False alarm WordPress update notification.

Have you ever experience that your WordPress site notify you that there was an update needed, but when you visit the update pages, there was nothing in there?.

I do, YES, and it was pretty frustrating because i don’t like it. I am afraid if the site wasn’t updated, it will cause some effect to the website performance performance.

Doing reinstall all the site, but the problem still exists, searching everywhere, and finally i found the solution. Just do small modification to the theme function, add the following code:


/**
* 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 .= "<strong>Plugin</strong> <u>$plugin</u> is reporting an available update.

";
}
}

// 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 .= "<strong>Theme</strong> <u>$theme</u> is reporting an available update.

";
}
}

if ( empty( $output ) ) $output = "No pending updates found in the database.";

wp_die( $output );
}
add_action( 'init', 'debug_pending_updates' );

Once you updated the function, then open your website with additional query:

//yourwebsite.com/wp-admin/?debug_updates

There, you will found which plugin, theme, etc that need to update.
hope this help you guys.

Original post created in Stackoverflow.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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