IMTIAZ EPU
Plugin Update

How To Debug WordPress Pending Plugin Update?

WORDPRESS SHOWS A PENDING PLUGIN UPDATE WHEN ALL PLUGINS ARE UNTIL DATE.

Do you've a WordPress site that claims to have a Plugin update or Theme update when all plugin is up to date?

The debugging code, contributed by Kevin Leary, among this article might show that specific update or Theme is creating the update accessible, detect among your WordPress installation.

To find out that plugin or theme is creating the unfinished update notification in your WordPress installation, add the following code to your functions.php file of the currently active theme or child theme.

Once saved in your function file, add to ?debug_updates your WordPress backend after /wp admin/.

Example: http://yourwebsite.com/wp admin/? .debug_upgrades

 /**
 * 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 .= "

Plugin $plugin 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 .= "

Theme $theme 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' );

It has helped you discover that plugin or theme is generating the unfinished update notice on your WordPress website

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Privacy Policy
error: Content is protected !!