Project Zero

Push to GitHub

With the Plugin Update Checker, you can use GitHub as your release server. In functions.php, you will see the following code:

require_once STYLESHEETPATH . '/inc/functions/puc/plugin-update-checker.php';
$checkTheme = Puc_v4_Factory::buildUpdateChecker(
  $mytheme->get('ThemeURI'), // This can be any public repo on GitHub, or any file on your own server, defaults to the Theme URI value in style.css
  $mytheme->get('TextDomain'), // Uses the 'Text Domain' string as defined in style.css
// Enables releases via GitHub

To make it easier to call your repository, we have used the ‘Theme URI’ header in your style.css file to save your GitHub repo (in the format of{USER-NAME}/{REPO-NAME}/). We have also used the ‘Text Domain’ header to save your theme’s unique slug. This argument in the PHP array is optional, but it is recommended. In most cases, the slug should be the same as the name of your theme directory. By default, it uses the theme directory name as the slug. The PUC GitHub page says that, “if you intend on [using or enforcing] the slug in your own code – e.g. to filter updates or override update checker behaviour – it can be a good idea to set it explicitly.”

The script comes with the ability to select a different branch for your stable release branch. By default, it will select the main/master branch, but you can override this by adding this line after the function:


It also allows you to push out updates from private repositories. To do this, GitHub requires a personal access token, which you can generate in your account settings. Go to Settings > Developer Settings > Personal access tokens to generate a token. Once it has been generated, add this line after the function:


If you do not want to use GitHub, you can use your own server to push out updates. Instead of the code already in your functions.php file, you will need to use this code:

require 'path/to/plugin-update-checker/plugin-update-checker.php';
$checkTheme = Puc_v4_Factory::buildUpdateChecker(
  '', // The JSON file should contain the code below.
  __FILE__, //Full path to the main plugin file or functions.php.
  $mytheme->get('TextDomain'), // Uses the 'Text Domain' string as defined in style.css

On your server, at the URL you stated above, you should save a JSON file with the following information:

  "version": "2.0",
  "details_url": "",
  "download_url": ""

The information should refer to files on your server.

Just to note …

If you develop a theme for the WordPress Theme Directory, using any other release server will be against their terms of service. You will only be able to use Plugin Update Checker to release your own themes or to push out themes for development purposes.

Join the conversation

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.