Background Updates: Remove the 7am/7pm background update check. This check was made redundant by [28129] as background updates are now run after a version check takes place.

See #27772, #35323.


git-svn-id: https://develop.svn.wordpress.org/trunk@36180 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2016-01-06 06:11:46 +00:00
parent cd6cc5c7db
commit ce4ef49b10
3 changed files with 19 additions and 16 deletions

View File

@@ -169,7 +169,7 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
}
}
// Trigger a background updates check if running non-interactively, and we weren't called from the update handler.
// Trigger background updates if running non-interactively, and we weren't called from the update handler.
if ( defined( 'DOING_CRON' ) && DOING_CRON && ! doing_action( 'wp_maybe_auto_update' ) ) {
do_action( 'wp_maybe_auto_update' );
}
@@ -647,20 +647,6 @@ function wp_schedule_update_checks() {
if ( ! wp_next_scheduled( 'wp_update_themes' ) && ! wp_installing() )
wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! wp_installing() ) {
// Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site.
$next = strtotime( 'today 7am' );
$now = time();
// Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now.
while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) {
$next += 12 * HOUR_IN_SECONDS;
}
$next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
// Add a random number of minutes, so we don't have all sites trying to update exactly on the hour
$next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS;
wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' );
}
}
/**