This plugin will activate updates for every plugin with a Git or Bitbucket repository in its header:
/*
Plugin Name: Plugin Example
Plugin URI: https://github.com/brainstormmedia/git-plugin-updates
Git URI: https://github.com/brainstormmedia/git-plugin-updates
*/
Either Plugin URI
or Git URI
can be set to your repository address. You don't need both.
For private repos, you can use the URI format:
https://username:password@bitbucket.org/brainstormmedia/git-plugin-updates
Ideally, Git Plugin Updates runs as a stand-alone plugin. However, if you would like to bundle it as a package in your own plugins to make sure updates over Git are enabled by default, you may do so by moving git-plugin-updates
into your plugin directory, then activating updates with this code:
add_action( 'plugins_loaded', 'myplugin_git_updater' );
function myplugin_git_updater() {
if ( is_admin() && !class_exists( 'GPU_Controller' ) ) {
require_once dirname( __FILE__ ) . '/git-plugin-updates/git-plugin-updates.php';
add_action( 'plugins_loaded', 'GPU_Controller::get_instance', 20 );
}
}
This method allows your plugin to update over Git, and if Git Plugin Updates is installed as a plugin later, only the stand-alone-plugin copy will load.
Plugin URI
header by default to avoid conflicts with wordpress.org. Override with add_filter( 'gpu_use_plugin_uri_header' '__return_true' );
log
and __get
methods. Remove variable github and bitbucket hosts. Move constants into GPU_Controller
. Reorder pre-load checks in order of liklihood.Plugin URI
or Git URI
.URI
format https://username:password@repo_address
.This plugin is written and maintained by Paul Clark.
It was forked from WordPress Github Plugin Updater by Joachim Kudish.
It has been updated with methods from Github Updater by Andy Fragen and @GaryJones.