Background Updates: Remove the 7am/7pm background update check.

This changeset is a more basic version of [36180], clearing the extra now redundant schedule.
As the functionality for this was introduced in 3.9, [28129] has been backported to 3.7/3.8, allowing the API TTL to be respected by those versions.

See #27772.
Fixes #35323.

Built from https://develop.svn.wordpress.org/trunk@36184


git-svn-id: http://core.svn.wordpress.org/branches/3.9@36151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2016-01-06 13:24:33 +00:00
parent 4686a8e4e7
commit 96ad697c96
1 changed files with 2 additions and 13 deletions

View File

@ -611,19 +611,8 @@ function wp_schedule_update_checks() {
if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') )
wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! defined( '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' );
}
if ( ( wp_next_scheduled( 'wp_maybe_auto_update' ) > ( time() + HOUR_IN_SECONDS ) ) && ! defined('WP_INSTALLING') )
wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
}
if ( ( ! is_main_site() && ! is_network_admin() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) )