Main Docs Page: f(x) Updater Docs
Here’s step by step instruction to configure your group updates using f(x) Updater plugin.
So this “GROUP” feature is useful only if you have (for example) a theme shop with several themes and/or several plugins.
So, basically, with this feature, you can create a single dedicated plugin to update all your themes and plugins. And you no longer need to include the updater.php class in all your themes and plugins (and future themes and plugins).
All you need is to create a group updater plugin and ask your client to install this plugin to get updates. So, It’s not really needed if you only have one theme or one plugin.
1. Add plugin and theme update repository
Add it in a group. It’s a taxonomy, so it’s similar with adding category or tag to a post.
You can also edit the group if needed from “f(x) Updater > Groups” Screen, just like you edit a taxonomy term:
All you need from this data is the group “SLUG”. Which we will use in the next step.
2. Include the updater class in your updater plugin
Of course, you will need to create a dedicated updater plugin. And in this plugin, you will need to include the updater class.
You can use the updater class included in the f(x) Updater plugin:
VERY IMPORTANT: Make sure you change the class name with your own updater plugin prefix.
Include it in your updater plugin. example code:
/* Include plugin updater. */ require_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/updater.php' );
and configure the config array as needed:
$this->config = array( 'server' => 'http://your-website/', 'type' => 'group', 'id' => 'my-theme-shop', 'api' => '1.0.0', // leave it as is 'post' => array(), // leave it as is );
This is your website home url where you install f(x) Updater. This is the server where the plugin will pull the update data.
Updater type, change the value to “plugin” for single plugin updater, “theme” for single theme updater, and “group” for multi item updates (within the group). In this case we use it for group updates.
This is the group slug as you have configured in Group Edit Screen (in step 1)
Current f(x) Updater api version. currently leave it as “1.0.0”. This is to make it easier for future development, in case we change method in the future.
Data you add here will send via $_POST to your server when checking for updates. useful if you want to extend this plugin and use update restriction/license key, etc
3. That’s it !
- Install your updater plugin (with the updater.php included and configured) in other sites/client sites.
- Include your themes and plugins in this group.
- Install your themes/plugins to other website/client/customer websites.
- If you add new features to your plugin/theme or fix a bug. Create new version.
- Update your f(x) Updater Theme and Plugin repository entry
- Don’t forget to save/update.
- Visit/log-in your other/client site where you install the updater plugin and other theme/plugin in the same group.
- Navigate to “Dashboard > Updates” to check new updates.
- Update your plugin/theme.
Note: WordPress check updates once in 12 hours. If you don’t see the updates click “Check Again” button and keep track on the “Last Checked” time stamp on the “Dashboard > Updates” Screen.