Software Licensing - Plugin 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 'theme_slug' => 'theme-slug', // Theme slug 'version' => '1.0.0', // 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.0', // 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 '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: 2.3.9
Important: All three of these version numbers must match.
2. 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.
3. Why isn't it working on my multisite setup?
The custom updater only works when the plugin is active.
If you have activated a plugin on a single sub site, only that site can check for updates, the network admin cannot.
That means in order to get updates to show up, you must:
- Activate plugin on sub site
- Activate license key on sub site
- Visit Plugins page on sub site (or just trigger the update check somehow)
- This caches the available plugin updates in a network-wide transient
- Now you can visit Network → Plugins and see the update
4. 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/.
5. 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.