Investigate Hidden WordPress Plugin and Theme Updates

By George Nicolaou

Sometimes the Updates screen and a plugin’s own notice disagree. This recording includes an administrator-only diagnostic that displays information from WordPress’s stored update checks.

Check the straightforward causes

Confirm that your account can update plugins and themes, check any required vendor licence connection, and compare the installed version with the vendor’s release notes. A cached check or a vendor connection failure is different from an unavailable update.

Treat the snippet as temporary debugging

The earlier PHP code below reads update information and prints it in the administration area. Review it in a staging environment, keep its capability checks and avoid exposing diagnostic data publicly. Remove temporary debugging once the problem is understood.

Do not force an incompatible update

Back up, read compatibility notes and test important pages and forms before updating the live site. A hidden notice does not prove that every newer release is safe for your particular theme and add-ons.

Related guides

/**
* Displays hidden plugin and theme updates on update-core screen.
*/
function debug_pending_updates() {

// Rough safety nets
if ( ! is_user_logged_in() || ! current_user_can( 'update_plugins' ) || ! current_user_can( 'update_themes' ) ) 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.";

echo "<h2>Pending updates</h2>" . $output;
}
add_action( 'core_upgrade_preamble', 'debug_pending_updates' );

0 Comments

Submit a Comment

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

We use essential cookies to run this website. With your permission, we also use Google Analytics and embedded YouTube videos. Choose Accept all, Reject optional, or Cookie details. Privacy and cookies.

Accept all Reject optional