Recently I ran into an annoying situation while working on the WP Creator’s Club site. WordPress was insisting there was an update available, however, when I visited the Updates page, there were no updates showing.
Here is a screenshot of what I mean:
In the above image you can clearly see WordPress is indicating there is an available update for something on the website, yet my updates page says everything is up to date.
How to find the update
While Googling this problem I came across an awesome PHP snippet you can drop into your functions.php file that will tell you which plugin or theme is generating this update message.
Here is the PHP snippet:
/**
* Debug Pending Updates
*
* Crude debugging method that will spit out all pending plugin
* and theme updates for admin level users when ?debug_updates is
* added to a /wp-admin/ URL.
*/
function debug_pending_updates() {
// Rough safety nets
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) return;
if ( ! isset( $_GET['debug_updates'] ) ) return;
$output = "";
// Check plugins
$plugin_updates = get_site_transient( 'update_plugins' );
if ( $plugin_updates && ! empty( $plugin_updates->response ) ) {
foreach ( $plugin_updates->response as $plugin => $details ) {
$output .= "<p><strong>Plugin</strong> <u>$plugin</u> is reporting an available update.</p>";
}
}
// Check themes
wp_update_themes();
$theme_updates = get_site_transient( 'update_themes' );
if ( $theme_updates && ! empty( $theme_updates->response ) ) {
foreach ( $theme_updates->response as $theme => $details ) {
$output .= "<p><strong>Theme</strong> <u>$theme</u> is reporting an available update.</p>";
}
}
if ( empty( $output ) ) $output = "No pending updates found in the database.";
wp_die( $output );
}
add_action( 'init', 'debug_pending_updates' );
How to use this code
Once you add this code block to your functions.php file and save, navigate your site’s admin dashboard and then append ?debug_updates to the end of your URL.
For example: https://example.com/wp-admin/?debug_updates
The site will then load a page showing all of the items on your site that are indicating they have an update available, even if they aren’t showing on your updates page.
It looks like this:
Ah ha! Even though this plugin update isn’t showing on my updates page, I took a look at the official page for the EDD Amazon S3 plugin and saw there WAS an update available for the plugin.
I downloaded the update and then uploaded it via FTP and the issue went away.
Wrapping Up
Once you’ve installed the updates you can remove that code block from your functions.php and save it in a file for the next time you encounter one of these phantom updates on your WordPress site.
If you have a more efficient way of solving this problem or if you’ve used this and it worked, let me know about it in the comments!
As always, happy creating!