Software Licensing - Update notifications not showing
When using Software Licensing there are several things that can cause plugin updates to not show up.
1. Not having version numbers in sync.
There are three places you must increment your software when releasing a new version.
A. The Licensing meta box in your download page
B. In your Updater file. Themes have a file called theme-updater.php and plugins have some code right in the main plugin file.
Themes have something like this:
$config = array( 'remote_api_url' => 'https://easydigitaldownloads.com', // Site where EDD is hosted 'item_name' => 'Theme Name', // Name of theme 'item_id' => 123, // ID of download 'theme_slug' => 'theme-slug', // Theme slug 'version' => '1.4', // The current version of this theme 'author' => 'Easy Digital Downloads', // The author of this theme 'download_id' => '', // Optional, used for generating a license renewal link 'renew_url' => '' // Optional, allows for a custom license renewal link ),
Note the 'version' in there. It must match what you have in the Meta Box above.
Plugins have something like this:
$edd_updater = new EDD_SL_Plugin_Updater( EDD_SAMPLE_STORE_URL, __FILE__, array( 'version' => '1.4', // current version number 'license' => $license_key, // license key (used get_option above to retrieve from DB) 'item_name' => EDD_SAMPLE_ITEM_NAME, // name of this plugin 'item_id' => EDD_SAMPLE_ITEM_ID, // download ID on your site 'author' => 'Pippin Williamson' // author of this plugin ) );
Note the version number in that code as well.
C. The plugin header.
Just like every other plugin there's a version number in the header. Example:
<!--?php /** * Plugin Name: Easy Digital Downloads * Plugin URI: https://easydigitaldownloads.com * Description: Serve Digital Downloads Through WordPress * Author: Pippin Williamson * Author URI: https://pippinsplugins.com * Version: 1.4
Important: All three of these version numbers must match.
2. Download name mismatch and no item_id specified
In order for the license updater to receive updates from the correct download on your site, the item_name and item_id keys are included in the array demonstrated above. It is not necessary to include both. If both are present, the item_id value will be used and item_name will be disregarded.
If only item_name is used, it is critical that the value matches exactly the download's actual title. If the title is not an exact match, update notifications will not be shown. For this reason, we recommend using item_id instead.
3. Using a security plugin or htaccess rules that blocks the ?edd_action=get_version/activate_license requests
Some plugins and htaccess rules block get variables like the one above because they're commonly used by attackers. Look for these settings and make sure they're off.
4. Why isn't it working on my multisite setup?
The plugin needs to be activated either via the multisite network or via one of the individual sites. The custom updater only works when the plugin is activated; otherwise, the code cannot run.
The Network Admin will only see updates via the Network Admin Dashboard, if the plugin is Network Activated OR the plugin is activated on the Main site. Note, the main site is the WordPress site on the network labeled Main:
Note: The Network Admin will not see an update notice from the Network Admin Dashboard if the plugin is active on any of the other sites on the network. But the network admin can see and update the plugin via the site's plugin list where the plugin is activated.
Only Network Administrators will see the update notice, as that is the only user level which can update plugins on multisite.
That means in order to get updates to appear on the Network Admin Dashboard, without Network Activating the plugin, the following needs to happen:
- Activate plugin on the Main site
- Activate license key on the Main site
- Visit Plugins page on site (or Network Admin → Home → Updates). Note, although a site admin visiting the Plugins screen will trigger the check for an update, the notice will only appear to Network Admins.
- This caches the available plugin updates in a network-wide transient.
- As a Network Admin, you can visit Network → Plugins and see the update.
Why do some plugins show an update notification when they are not activated on any of the multisite sites?
Plugins on wp.org will show that an update is available without being activated.
5. Why does my plugin always show there's an update?
The updater class in your plugin had a bug before version 1.6. Update to 1.6 or higher and this issue will be resolved.
You may get the latest version of the the updater class from the sample plugin available in your purchase history at https://easydigitaldownloads.com/your-account/.
6. Incorrect __FILE__ parameter provided to updater class
If you are extending the updater class from a file other than the main plugin file, add a define('YOUR_PREFIX_PLUGIN_FILE', __FILE__ ); to the main plugin file, and then instead of calling __FILE__ as the second parameter of the new EDD_SL_Plugin_Updater class, call YOUR_PREFIX_PLUGIN_FILE there.