Make WordPress Core

Ticket #44118: fix-update_plugins-transient.patch

File fix-update_plugins-transient.patch, 1.1 KB (added by siliconforks, 7 years ago)

proposed fix

  • src/wp-includes/update.php

     
    268268                $current = new stdClass;
    269269        }
    270270
    271         $new_option               = new stdClass;
    272         $new_option->last_checked = time();
    273 
    274271        $doing_cron = wp_doing_cron();
    275272
    276273        // Check for update on a different schedule, depending on the page.
     
    298295        if ( $time_not_changed && ! $extra_stats ) {
    299296                $plugin_changed = false;
    300297                foreach ( $plugins as $file => $p ) {
    301                         $new_option->checked[ $file ] = $p['Version'];
    302 
    303298                        if ( ! isset( $current->checked[ $file ] ) || strval( $current->checked[ $file ] ) !== strval( $p['Version'] ) ) {
    304299                                $plugin_changed = true;
    305300                        }
     
    383378                return;
    384379        }
    385380
     381        $new_option               = new stdClass;
     382        $new_option->last_checked = time();
     383        foreach ( $plugins as $file => $p ) {
     384                $new_option->checked[ $file ] = $p['Version'];
     385        }
     386
    386387        $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
    387388        foreach ( $response['plugins'] as &$plugin ) {
    388389                $plugin = (object) $plugin;