WordPress integration options
When integrating your WordPress plugin with WunderUpdates, you can configure the update class with a number of options. These options mainly control how the plugin looks and behaves on the WordPress plugins screen.
Example of a plugin row with a license key popup and update channel selection both enabled:
Required options
The following options are required, the update class will throw an error on initialization if you omit any of these.
Key | Description |
---|---|
plugin_name | Human readable plugin name |
slug | Slug, or subfolder of your plugin, must be unique |
version | Current plugin version |
full_path | Full path of your plugin file, usually __FILE__ |
account_key | The account name/key as provided via the API |
License options
These options controls plugin licensing.
Key | Default | Description |
---|---|---|
licensed | false | Should the plugin send a license key when checking for update? |
license_popup | false | Enable the license key popup on the WordPress plugins screen? |
license_option_key | Name of WordPress option where the license key is stored. | |
license_popup_strings | [] | Array for providing your own strings for the license key popup. |
licensed
If the plugin is licensed on the WunderUpdates platform this needs to be set to true
, otherwise the plugin will not send the license key when checking for updates.
license_popup
If your plugin doesn't have a settings page or if it's not suitable to add a license key field to it, you can enable the license key popup. This will show a popup on the WordPress plugins screen where the user can enter the license key and get it validated against the WunderUpdates API. If enabled, there will be an extra link Enter license
on the plugin row in the WordPress plugins screen, see the image above.
license_option_key
The name of the WordPress option where the license key is stored after the popup has been used. If you leave this empty the license key will stored in the WordPress options table with the key wunderupdates_license_{slug}
.
license_popup_strings
When the license key popup is enabled you can provide your own strings for the popup using this array. The array can contain the following keys:
Key | Description |
---|---|
title | Popup title. |
description | Short description before the input field |
validation_success | Validation success message. |
validation_fail | Validation failure message. |
Update channel options
These options controls the plugin update channel.
Key | Default | Description |
---|---|---|
channel_popup | Enable the chanel key popup on the WordPress plugins screen. | |
channel_option_key | Name of WordPress option where the channel type is stored. | |
channel_popup_strings | [] | Array for providing your own string for the channels popup. |
channel | stable | Which channel to use. |
channel_popup
Just as with the license key popup, you can enable a channel popup. This will show a popup on the WordPress plugins screen where the user can select the update channel. If enabled, there will be an extra link with the current chaannel on the name plugin row, by clicking this link the user can select a different channel.
channel_option_key
The name of the WordPress option where the update channel is stored after the popup has been used. If you leave this empty the license key will stored in the WordPress options table with the key wunderupdates_channel_{slug}
.
channel_popup_strings
When the channel popup is enabled you can provide your own string for the popup title via this array:
Key | Description |
---|---|
title | Popup title. |
channel
If you don't want the users to be able to select the channel via the popup or your own settings page, but you still want to override the default stable
, you can set this option to the channel you want to use. Valid values are stable
, rc
, beta
and alpha
. If you leave this empty the default channel will be stable
.
Note that for any other channel than stable
, the channel name will be visible on the plugin row, but the user will not be able to change it unless you enable the channel popup.