Upgrade/Install: Prevent an unnecessary plugin update check when the plugin update data is up to date.
This ensures the `checked` property is always populated with the latest plugin data before determining whether to perform an update check. Previously this was only populated when the data was already identified as being stale, which could result in a subsequent unnecessary update check when viewing the Plugins screen. Props siliconforks, bookdude13, pbiron, francina, Cybr, snehapatil02, johnbillion Fixes #44118, #61055 Built from https://develop.svn.wordpress.org/trunk@59926 git-svn-id: http://core.svn.wordpress.org/trunk@59268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -337,12 +337,6 @@ function wp_update_plugins( $extra_stats = array() ) {
|
||||
$current = new stdClass();
|
||||
}
|
||||
|
||||
$updates = new stdClass();
|
||||
$updates->last_checked = time();
|
||||
$updates->response = array();
|
||||
$updates->translations = array();
|
||||
$updates->no_update = array();
|
||||
|
||||
$doing_cron = wp_doing_cron();
|
||||
|
||||
// Check for update on a different schedule, depending on the page.
|
||||
@@ -371,8 +365,6 @@ function wp_update_plugins( $extra_stats = array() ) {
|
||||
$plugin_changed = false;
|
||||
|
||||
foreach ( $plugins as $file => $p ) {
|
||||
$updates->checked[ $file ] = $p['Version'];
|
||||
|
||||
if ( ! isset( $current->checked[ $file ] ) || (string) $current->checked[ $file ] !== (string) $p['Version'] ) {
|
||||
$plugin_changed = true;
|
||||
}
|
||||
@@ -461,6 +453,15 @@ function wp_update_plugins( $extra_stats = array() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$updates = new stdClass();
|
||||
$updates->last_checked = time();
|
||||
$updates->response = array();
|
||||
$updates->translations = array();
|
||||
$updates->no_update = array();
|
||||
foreach ( $plugins as $file => $p ) {
|
||||
$updates->checked[ $file ] = $p['Version'];
|
||||
}
|
||||
|
||||
$response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
|
||||
|
||||
if ( $response && is_array( $response ) ) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59925';
|
||||
$wp_version = '6.8-alpha-59926';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user