Skip to content

Lightweight class to integrate for standalone plugin/theme updates.

License

Notifications You must be signed in to change notification settings

Nalci/git-updater-lite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Updater Lite

A simple standalone library to enable automatic updates to your git hosted WordPress plugins or themes.

Description

This library was designed to be added to your git hosted plugin or theme to enable standalone updates.

You must have a publicly reachable site that will be used for dynamically retrieving the update API data.

  • Git Updater is required on a site where all of the release versions of your plugins and themes are installed.
  • All of your plugins/themes must be integrated with Git Updater.
  • You must be using Git Updater v12.9.0 or better.

Git Updater is capable of returning a REST endpoint containing the plugins_api() or themes_api() data for your plugin/theme. You will pass this endpoint during the integration.

The REST endpoint format is as follows.

  • plugins - https://my-site.com/wp-json/git-updater/v1/update-api/?slug=my-plugin
  • themes - https://my-site.com/wp-json/git-updater/v1/update-api/?slug=my-theme

Installation

Add via composer. composer require afragen/git-updater-lite:^1

Add the following to your plugin or theme. Where <update server URI> is the domain to the update server, eg https://git-updater.com.

require_once __DIR__ . '/vendor/afragen/git-updater-lite/Lite.php';
add_filter( 'gul_update_server', function () {
    return '<update server URI>';
});
( new \Fragen\Git_Updater\Lite( __FILE__ ) )->run();

An example integrated plugin is here, https://github.com/afragen/test-plugin-gu-lite

FWIW, I test by decreasing the version number locally to see an update.

About

Lightweight class to integrate for standalone plugin/theme updates.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%