fbpx
WP Woman | Questions and Answers | a chick who knows a bit about WordPress

Question

I've done all my plugin updates, but I'm still showing that there's one plugin that needs updating. When I go to Plugins, I don't see a notice on any of them showing they need to be updated. How can I find out why I'm getting the notification to update a plugin when I don't see a plugin that needs updating?

Answer

Add the following code to functions.php in your WordPress theme files.

				
					/**
 * Debug Pending Updates
 *
 * Debugging method that will show all pending plugin
 * and theme updates for admin level users when ?debug_updates is
 * added to a /wp-admin/ URL.
 * Created by Kevin Leary at https://www.kevinleary.net/
 */
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' );
				
			

Visit a page with ?debug_updates added to the URL.

For example: yourdomain.example/wp-admin/?debug_updates.

This will show you any theme(s) or plugin(s) causing the issue.

I know a lot about WordPress, but I don't know everything. I had to do a search for the answer to this question, and I found it on Stack Overflow.

All the credit for the solution goes to Boston-based Kevin Leary, who is also a WordPress Developer who shared the solution for free on Stack Overflow.

Thanks, Kevin!

In the case of the person asking the question, they allowed me access to their site, and it turns out that the update notification was for a plugin that had been discontinued by the developer and the functionality of the extension rolled into the base plugin.

I didn't see this until after I ran Kevin's code in functions.php. I removed the discontinued plugin and the notification went away.

Leave a Reply

Your email address will not be published. Required fields are marked *


Subcribe to my weekly newsletter
Get video tutorials created specifically for your needs for your WordPress project(s).
Join Walmart+ and enjoy benefits, like discounts on gas, rewards for buying certain products and a free subscription to Paramount+
Join Walmart+ and enjoy benefits, like discounts on gas, rewards for buying certain products and a free subscription to Paramount+
Social Media Manager: grow your reach!