afragen / git-updater

This WP plugin will update GitHub, Bitbucket, GitLab, and Gitea hosted plugins and themes
https://git-updater.com
MIT License
3.17k stars 462 forks source link

Theme not showing in WP updates. #132

Closed cupofnestor closed 9 years ago

cupofnestor commented 9 years ago

I've re-read the readme, and added a branch (master) and version to my style.css.

I've created two theme directories, in one I've placed the above style.css, and in the second I've placed the style.css from the test theme

I then deactivate, and reactivate gitHub-updater, click "check again" on the wp-updates page, and still do not see either theme in the update panel. I'm still missing something.

cupofnestor commented 9 years ago

I think I've got it working, I had to clone the entire repo and remove the version from the style.css header. At which point, wp updated my theme. I think tagging releases is what is confusing to me, if I remove version from my header, will github-updater always update to the latest tag on master? Can github-updater ignore tags and simply update to my latest commits on master?

afragen commented 9 years ago

Per the README, if your branch is master and you are tagging releases the update will come from the most recent tag. You do not have to tag releases but you must increment the version number.

Many get into trouble by starting to tag releases and then stopping. If you delete all your tags then this issue won't occur.

BTW, I usually test by just decreasing the version number locally and not tagging new releases.

afragen commented 9 years ago

The version number in the tagged release must match be the same. Your 0.0.1 tag has a version 0.0.0

cupofnestor commented 9 years ago

Okay, I'm setting up a new test repo that will not use releases. When you say

you must increment the version number. You mean the version in the style.css header, correct? So if the (header) version is ahead on the repo, github-updater will prompt the update.

cupofnestor commented 9 years ago

Gotcha, this seems to be working with my new child test theme. So simple, I don't know what my problem was. Perhaps you could add a note about the effects of the Version to the README, this was a little unclear. Thank you for your help, great script, perhaps I will make a tutorial for other morons like myself.

afragen commented 9 years ago

@cupofnestor how's this, https://github.com/afragen/github-updater#versions

michaelalhilly commented 9 years ago

I think I'm having a problem with this too. I followed the steps. I have a private bb repo with version set to 1.0 and a tag that simply contains 1.0. Yet the theme doesn't appear in the settings so I can't enter a pass.

/* Theme Name: Prime Theme URI: http://villagecity.org Description: Multi-purpose theme. Author: Villagecity Author URI: http://villagecity.org Version: 0.9 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: villagecity Tags: agency, business, ajax, portfolio, blog, shop, multi-purpose, clean, elegant, white, photography, modern, fullscreen, stylish, design, e-commerce, woocommerce Bitbucket Theme URI: https://michaelalhilly@bitbucket.org/michaelalhilly/prime-wp-theme Bitbucket Branch: master

CSS changes can be made in files in the /css/ folder. This is a placeholder file required by WordPress, so do not delete it. */

michaelalhilly commented 9 years ago

Sorry the above style.css header is from my local install.

afragen commented 9 years ago

@michaelalhilly I'm sorry this is because my primary test environment is a multisite installation. I've just pushed v3.1.1. Let me know if it solves this for you.

BTW, you don't need your username in the Bitbucket Theme URI

michaelalhilly commented 9 years ago

@afragen Thanks for the quick response. Unfortunately, it's still not working. I removed my username from the URI. I've toggled the theme and forced check for updates but still nothing. By chance is this meant to be used with a repo that contains just the theme.zip? My current repo contains the uncompressed theme files which I'm using for development.

afragen commented 9 years ago

It is meant to be used with your development repo, so uncompressed files. I'll have to take a closer look when I get back from work.

Is is now a private repo? Are you on a single site install or multisite.

michaelalhilly commented 9 years ago

No worries. My repo is private and I'm using a single install. Let me know if there's any more info I can provide you. I'm also not seeing any errors although I am running my install locally with debug enabled.

afragen commented 9 years ago

@michaelalhilly for me to fully test I would need the password. When I get to it I'll only be able to tell that the Settings page option is available and that a 401 error occurs when trying to check the Bitbucket API. But at should be enough to tell if it's working.

Have you filled in the password in the Settings page?

michaelalhilly commented 9 years ago

@afragen I'm unable to set the password as the settings page displays "No private repositories are installed."

michaelalhilly commented 9 years ago

I've given you access to the repo.

afragen commented 9 years ago

Have you updated to GitHub Updater v3.1.1?

afragen commented 9 years ago

@michaelalhilly you are missing the header. You need to add Bitbucket Theme URI: https://bitbucket.org/michaelalhilly/prime-wp-theme to the style.css and to the tag.

michaelalhilly commented 9 years ago

@afragen Ahh. Okay I'll give it a shot and get back to you. Yes I'm using 3.1.1. Thanks.

michaelalhilly commented 9 years ago

@afragen Okay. The tag version now matches the style.css header tag in the repo. I've lowered the style.css header version tag on my local install to 1.0.0. Still nothing. Are you saying I have to add the entire line "Bitbucket Theme URI: https://bitbucket.org/michaelalhilly/prime-wp-theme" as a tag? If so, I tried and received an error stating it is an invalid tag.

afragen commented 9 years ago

The Bitbucket Theme URI must be present in your local theme. It must be present in your remote theme and it must be present in the tagged release.

The tag should just be the version number.

michaelalhilly commented 9 years ago

I'm assuming tag release refers to the Bitbucket repo? Currently I am only running the theme locally. So I'm a little confused as to the importance of the remote theme. Does this plugin not work on local installs?

afragen commented 9 years ago

It works on local installs, but even local installs must receive updates from somewhere.

I assume your developing in your local install and as such you will never receive an update notification. I would encourage you not to test updating against your local development version as it could, and likely will, be replaced with the remote version and you will lose changes. You should create a second local install to test with and make sure the theme in that install isn't being working on.

Yes, the tag refers to the tagged release in Bitbucket.

Does that all make sense?

michaelalhilly commented 9 years ago

@afragen It does. Thank you for your patience. Also thanks for the advice. Although my files are saved to a separate directory I just realized you're correct and my ide is set to save external changes automatically and therefore I would have ended up overriding everything once the update downloaded. Thanks!!!! I'm going to setup a separate install and try again but it does sound like I now have everything setup correctly.

afragen commented 9 years ago

Let me know if you get it working after set up. Also, I tend to test by just decreasing the local version number.

I found out you should try to test updating on you updating plugin the hard way. :wink:

michaelalhilly commented 9 years ago

:) I got it working! Thanks! This is awesome!!!

Not sure why this didn't work on my dev install.

It may be worth adding to the docs that the name of the repo needs to be exactly the same as the theme file or else it will download as a separate theme instead of updating.

This is a great plugin but unfortunately I can't use this with my clients as I don't want to store my pass on their install. Do you plan to continue development on this project? If so, deployment keys for bitbucket would be a great feature. I assume you're already planning to do this as I see you have included support for github access tokens.

Yes! I really appreciate the heartache you saved me.

afragen commented 9 years ago

Can you keep me an admin on the repo. Then let me test to see if I can use my password and update. If that works we can deescalate my privileges and find the point where I have read-only privs. If that works then all you would need to do is add you clients to the repo as read-only or some other privilege.

Bitbucket doesn't have deploy keys like GitHub. Bitbucket requires a log on to the site for oAuth. Way too difficult.

michaelalhilly commented 9 years ago

Yes. I see your point. That would be a short-term fix. I would then have to create bitbucket user for each of them. I can live with that for now. I'll keep you on until you've completed.

michaelalhilly commented 9 years ago

Btw, I found the issue on my dev install. It seems the WooThemes Helper plugin prevents github-updater from working. Makes sense since WooThemes is also a theme/plugin updater.

cupofnestor commented 9 years ago

hoo, my issue threads keep getting away from me. I used github-updater for a little while with success, but then my changes stopped showing up, even when the local version < remote version. I gave up on github-updater for the moment, since I need to be in active development on this theme. Is this script not meant for "development" use, pushing changes every few minutes or so?

afragen commented 9 years ago

Sorry about that @cupofnestor

This plugin isn't meant to push changes more frequently than every 12 hours. However, all you have to do is use the Check Again button then refresh the update page and you will see the most recent changes. If you are pushing a private repo you won't have issues with hitting GutHub's API too many times per hour. Bitbucket doesn't seem to have a limitation.

afragen commented 9 years ago

@michaelalhilly you've changed the repo name but not the header in the style.css. The new repo seems to be https://bitbucket.org/michaelalhilly/villagecity-prime

I fixed this in the repo but I cannot figure out how to make a tag from the web page.

michaelalhilly commented 9 years ago

Hmm.. I must've changed by accident. I'll add the tag using sourcetree. I'm assuming you want to increment to 1.1.4?

michaelalhilly commented 9 years ago

@afragen Woah... Sorry had a little trouble figuring out how to tag your commit and merge your updates with mine. It should be okay now.

afragen commented 9 years ago

@michaelalhilly sorry didn't mean to mess too much. A couple of things. I can see an update using my user/pass, so I think I'm going to see about just having users enter their own user/pass and not worry about the actual repo password.

What do you think of that idea? Then you could just add any client as a user on the repo. We just need to figure out the minimum privs needed.

afragen commented 9 years ago

@michaelalhilly can you set my privileges on your repo to read-only? I'm going to push to develop so you can see the changes but so far I can authenticate with my user/pass. I need to ensure that I can still do this with read-only privs.

If this works as I expect, you can set clients as read-only access in your Bitbucket private repos and never expose your own password.

afragen commented 9 years ago

@michaelalhilly I changed my privileges down to read and it works. Thanks for letting me test, you can remove me now.

michaelalhilly commented 9 years ago

@afragen Sorry for the late reply. That sounds great!

This will work for now on non-e-commerce sites. Unfortunately, the issue with the WooThemes Updater is tough to ignore since clients commonly request WooCommerce extensions. Should I create a separate issue for this?

Just curious if you have plans to implement deployment keys or if this is something I should look into?

Again great work!

afragen commented 9 years ago

@michaelalhilly it's easier to create a new issue for the WooThemes Updater. If you could send me a zip of this plugin I might be able to find the conflict.

As for deployment keys, that's something for Bitbucket would need to develop. It's not something that I can create or am I misunderstanding it. This might also be something for a new issue.

michaelalhilly commented 9 years ago

@afragen I'll create new issues for both and attach the relevant files there. Thanks!

afragen commented 9 years ago

@cupofnestor is there anything else I can help with here?

michaelalhilly commented 9 years ago

@afragen Nope. Everything is working for me now. Thanks!

moskeyombus commented 9 years ago

Maybe I've misread this thread, but Bitbucket does in fact support deployment keys. Log in, go to 'Settings', 'Deployment Keys' is a menu option on the left. Just discovered this WP plugin today, will dig a little deeper and see if I can get it to work.

afragen commented 9 years ago

@moskeyombus my understanding of Bitbucket Deployment Keys is that they are SSH keys.

A deployment key grants read-only access to a public or private repository. With a deployment key a user or a process can pull or clone a repository over SSH.

This plugin and any updating via the WP admin works over HTTP GET or curl not SSH. Because of that Bitbucket-style deployment keys won't work.

Currently all GHU needs is your personal Bitbucket login and you must have read access to the repo.

afragen commented 9 years ago

If anyone in this issue still has here let's bring it to a new separate issue. Thanks.