{"id":480,"date":"2012-10-17T14:00:50","date_gmt":"2012-10-17T12:00:50","guid":{"rendered":"https:\/\/wprealm.com\/?p=480"},"modified":"2017-11-22T19:23:22","modified_gmt":"2017-11-22T18:23:22","slug":"yes-you-can-plugin-auto-updates-from-github","status":"publish","type":"tutorial","link":"http:\/\/wprealm.local\/tutorial\/yes-you-can-plugin-auto-updates-from-github\/","title":{"rendered":"Yes, You Can: Plugin Auto-Updates From Github"},"content":{"rendered":"

One of the things I love about WordPress is the plugin architecture, as it allows users to contribute and extend WordPress without compromising the sanity and clarity of its core.<\/p>\n

Whenever I write a plugin I tend to submit it to the official plugin repo, where it can quickly be downloaded \u00a0and used by thousands of\u00a0savvy\u00a0users. I also often host my plugins on GitHub too; either because I’m still developing them and I’m not quite ready to release them to the world or simply because it might be a client-specific or commercial plugin.\u00a0In those cases I always feel shorthanded when I see other plugins receive new update notifications and the ones on GitHub have to be updated manually.<\/p>\n

However, with some recent code by Joachim Kudish<\/a>, pushing new releases of these plugins on GitHub has become a lot easier, as it allows me to seamlessly combine official plugins with commercial ones and to update them in one go.\u00a0Every time I decide to release a new version, I just need to tag the release and the plugin will get a “new release available” message on the user’s admin panel. I have tried it out and it’s fairly easy to setup.<\/p>\n

It’s available via a\u00a0class we must include in the plugin to support GitHub updates. Download it and put the updater.php (source<\/a>) into the plugin directory that you will want to auto update and make sure that the plugin includes the file:<\/p>\n

include_once('updater.php');<\/code><\/p>\n

The next step is to\u00a0initialize the class. You can do this by adding:<\/p>\n\n

\n
\n
\n
\n
\n \n
\n\n \n
\n\n