From 3517dc0b8b89842e20af6e6fb127436bd4aa52b3 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 6 Feb 2018 11:04:34 +0000 Subject: [PATCH] Updates: Partially revert [42584], as this branch of code should always be run after a core update check. This code branch is responsible for running all autoupdates, including plugins and themes - which should run regardless of if there's a core autoupdate available. This revert does not revert the `$timeout` changes, as these should still use cached data if it's available. Ideally this should be decoupled from the core update check to allow background updates to operate even when the core update check is disabled or running more often than twice daily. See #43103. Built from https://develop.svn.wordpress.org/trunk@42653 git-svn-id: http://core.svn.wordpress.org/trunk@42482 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/update.php | 16 +++------------- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/wp-includes/update.php b/wp-includes/update.php index 77f801f301..0f23e2a987 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -173,8 +173,7 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) { return; } - $offers = $body['offers']; - $has_auto_update = false; + $offers = $body['offers']; foreach ( $offers as &$offer ) { foreach ( $offer as $offer_key => $value ) { @@ -208,10 +207,6 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) { ), '' ) ); - - if ( 'autoupdate' == $offer->response ) { - $has_auto_update = true; - } } $updates = new stdClass(); @@ -234,13 +229,8 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) { } // Trigger background updates if running non-interactively, and we weren't called from the update handler. - if ( $doing_cron && $has_auto_update && ! doing_action( 'wp_maybe_auto_update' ) ) { - include_once( ABSPATH . '/wp-admin/includes/update.php' ); - - // Only trigger background updates if an acceptable autoupdate is on offer, avoids needless extra API calls. - if ( find_core_auto_update() ) { - do_action( 'wp_maybe_auto_update' ); - } + if ( $doing_cron && ! doing_action( 'wp_maybe_auto_update' ) ) { + do_action( 'wp_maybe_auto_update' ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 621e968fb7..033e9da65d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42652'; +$wp_version = '5.0-alpha-42653'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.