afragen / git-updater

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

Integrate this plugin directly in my custom theme #29

Closed multiformeingegno closed 10 years ago

multiformeingegno commented 10 years ago

Is it possible to integrate this directly in my custom theme so I could ship my theme with automatic updates built-in? :-)

afragen commented 10 years ago

All you have to do to make this work in your theme is to add the appropriate header(s).

While is is possible to strip out pieces of this project to directly place into another project it really wasn't designed that way. The simplest solution is to point to this project within your theme's README and have your users download and install this plugin. If your users are already downloading your theme, asking them to download this plugin so that the theme they just downloaded stays up to date seems like a reasonable request.

The benefits are less bloat to your theme and a "current" version of the updater code from this plugin. If you want to see how to phrase the readme, see https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate and change it slightly so that the header is GitHub Theme URI: https://github.com/<owner>/<repo>

grappler commented 10 years ago

You could get users to install this as a plugin using this piece of code http://tgmpluginactivation.com/.

multiformeingegno commented 10 years ago

Thanks! For my users these 2 methods will work. :)But for example for custom themes I made for myself, is it possible to insert the code in the theme itself? I tried putting both on GitHub and in my local installation the includes folder in my theme for and the include statements in my functions.php, then I disabled the plugin. The problem is that I keep being notified of one version and even if I upgrade I'm only notified about that version, regardless new tags being created on the branch..

Maybe functions.php isn't the right place to add the include statements?

On Wed, Dec 25, 2013 at 9:15 AM, Ulrich Pogson notifications@github.com wrote:

You could get users to install this as a plugin using this piece of code http://tgmpluginactivation.com/.

Reply to this email directly or view it on GitHub: https://github.com/afragen/github-updater/issues/29#issuecomment-31194459

afragen commented 10 years ago

If the custom themes are in a private repo, you should be able to create an access token in GitHib and add the GutHub Access Token: header to the theme. Hopefully this should allow for updates from a private repo.

afragen commented 10 years ago

The problem with trying to put this code directly into your project is that it's designed to search all GitHub plugins and themes for updates. You also risk conflict if the plugin is also installed.