wp_get_auto_update_message

The timeline below displays how wordpress function wp_get_auto_update_message has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.6

/**
 * Determines the appropriate auto-update message to be displayed.
 *
 * @since 5.5.0
 *
 * @return string The update message to be shown.
 */
function wp_get_auto_update_message()
{
    $next_update_time = wp_next_scheduled('wp_version_check');
    // Check if the event exists.
    if (false === $next_update_time) {
        $message = __('Automatic update not scheduled. There may be a problem with WP-Cron.');
    } else {
        $time_to_next_update = human_time_diff((int) $next_update_time);
        // See if cron is overdue.
        $overdue = time() - $next_update_time > 0;
        if ($overdue) {
            $message = sprintf(
                /* translators: %s: Duration that WP-Cron has been overdue. */
                __('Automatic update overdue by %s. There may be a problem with WP-Cron.'),
                $time_to_next_update
            );
        } else {
            $message = sprintf(
                /* translators: %s: Time until the next update. */
                __('Automatic update scheduled in %s.'),
                $time_to_next_update
            );
        }
    }
    return $message;
}

WordPress Version: 5.5

/**
 * Determines the appropriate auto-update message to be displayed.
 *
 * @since 5.5.0
 *
 * @return string The update message to be shown.
 */
function wp_get_auto_update_message()
{
    $next_update_time = wp_next_scheduled('wp_version_check');
    // Check if the event exists.
    if (false === $next_update_time) {
        $message = __('Automatic update not scheduled. There may be a problem with WP-Cron.');
    } else {
        $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: %s: Duration that WP-Cron has been overdue. */
                __('Automatic update overdue by %s. There may be a problem with WP-Cron.'),
                $time_to_next_update
            );
        } else {
            $message = sprintf(
                /* translators: %s: Time until the next update. */
                __('Automatic update scheduled in %s.'),
                $time_to_next_update
            );
        }
    }
    return $message;
}