Documentation

Welcome to the WP Updates documentation. You should find enough information on this page to get you going with WP Updates, however if you do run into any issues you can submit a ticket on our

Quick Start Video

Here is a quick video showing how simple it is to get set up and running with WP Updates in under 5 mins.

Integrating with your WordPress theme

Integrating WP Updates with your WordPress theme couldn't be simpler. First of all you need to create a theme in WP Updates. You will then be presented with a file to download. Note that this file is unqiue to your theme. Pop this file in the root folder of your WordPress theme.

Secondly you will need to add 2 lines of code to your theme's functions.php file. You simply need to copy and paste the code that is generated for this theme. It will look something like:

require_once('wp-updates-theme.php');
new WPUpdatesThemeUpdater_123( 'http://wp-updates.com/api/2/theme', basename(get_template_directory()) );

The two params for the WPUpdatesThemeUpdater class are as follows:

  • $api_url - The API URL is where your theme will check for updates. The number in the URL corresponds to the API version.
  • $theme_slug - The "slug" of your theme as used by WordPress. This is usually the name of the folder of your theme. If don't use the WPUpdatesThemeUpdater class in your theme's functions.php file you may have to manually set this (rather than use basename(get_template_directory())).

Thats it! Your theme is ready to go. Tell your users they'll have to manually update their theme for the last time :)

Integrating with your WordPress plugin

Integrating WP Updates with your WordPress plugin couldn't be simpler. First of all you need to create a plugin in WP Updates. You will then be presented with a file to download. Note that this file is unqiue to your plugin. Pop this file in the root folder of your WordPress plugin.

Secondly you will need to add 2 lines of code to your plugin's main file. You simply need to copy and paste the code that is generated for this theme. It will look something like:

require_once('wp-updates-plugin.php');
new WPUpdatesPluginUpdater_123( 'http://wp-updates.com/api/2/plugin', plugin_basename(__FILE__) );

The two params for the WPUpdatesPluginUpdater class are as follows:

  • $api_url - The API URL is where your plugin will check for updates. The number in the URL corresponds to the API version.
  • $plugin_path - The "slug" of your plugin as used by WordPress. This is usually the name of the folder of your plugin. If don't use the WPUpdatesPluginUpdater class in your plugin's main file you may have to manually set this (rather than use plugin_basename(__FILE__)).

Thats it! Your plugin is ready to go. Tell your users they'll have to manually update their plugin for the last time :)

Sellwire License Integration

If you use Sellwire to sell your themes and plugins you can now integrate WP Updates with the licensing functionality. This means that you can now limit updates to plugins and themes with valid licenses from Sellwire.

To make your plugin work with Sellwire licensing you need to make one change to your code by passing in a license key as an optional third parameter. You are responsible for obtaining and storing the license key for each theme/plugin.

new WPUpdatesPluginUpdater_123( 'http://wp-updates.com/api/2/plugin', plugin_basename(__FILE__), $license_key );

Debugging issues

Both the WPUpdatesThemeUpdater class and the WPUpdatesPluginUpdater class have some commented out code in their contructor which can be used for debugging issues. Simply un-comment the relevant lines to debug the updater.

WPUpdatesThemeUpdater
// This is for testing only!
//set_site_transient('update_themes', null);

Uncommenting the set_site_transient() line will force WordPress to check for theme updates on every request.

WPUpdatesPluginUpdater
// This is for testing only!
//set_site_transient( 'update_plugins', null );

// Show which variables are being requested when query plugin API
//add_filter( 'plugins_api_result', array(&$this, 'debug_result'), 10, 3 );

Uncommenting the set_site_transient() line will force WordPress to check for plugin updates on every request. Uncommenting the add_filter() line will print out the details of the response from the WP Updates API when it checks for updates.