Security: Remove unnecessary `DISABLE_WP_CRON` check in plugin and theme automatic updates.

Fixes #50436.

Props johnbillion, audrasjb, bookdude13, pbiron, arpitgshah.



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


git-svn-id: http://core.svn.wordpress.org/trunk@47916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2020-06-23 22:24:09 +00:00
parent 840d1c796b
commit 8dad73a5b6
2 changed files with 21 additions and 25 deletions

View File

@ -984,30 +984,26 @@ function wp_get_auto_update_message() {
// Check if event exists.
if ( false === $next_update_time ) {
return __( 'There may be a problem with WP-Cron. Automatic update not scheduled.' );
}
// See if cron is disabled
$cron_disabled = defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON;
if ( $cron_disabled ) {
return __( 'WP-Cron is disabled. Automatic updates not available.' );
}
$time_to_next_update = human_time_diff( intval( $next_update_time ) );
// See if cron is overdue.
$overdue = ( time() - $next_update_time ) > 0;
if ( $overdue ) {
return sprintf(
/* translators: Duration that WP-Cron has been overdue. */
__( 'There may be a problem with WP-Cron. Automatic update overdue by %s.' ),
$time_to_next_update
);
$message = __( 'Auto-update update not scheduled. There may be a problem with WP-Cron.' );
} else {
return sprintf(
/* translators: Time until the next update. */
__( 'Auto-update scheduled in %s.' ),
$time_to_next_update
);
$time_to_next_update = human_time_diff( intval( $next_update_time ) );
// See if cron is overdue.
$overdue = ( time() - $next_update_time ) > 0;
if ( $overdue ) {
$message = sprintf(
/* translators: Duration that WP-Cron has been overdue. */
__( 'Auto-update update overdue by %s. There may be a problem with WP-Cron.' ),
$time_to_next_update
);
} else {
$message = sprintf(
/* translators: Time until the next update. */
__( 'Auto-update update scheduled in %s.' ),
$time_to_next_update
);
}
}
return $message;
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-48146';
$wp_version = '5.5-alpha-48147';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.