core_upgrade_preamble

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

WordPress Version: 6.4

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 */
function core_upgrade_preamble()
{
    $updates = get_core_updates();
    // Include an unmodified $wp_version.
    require ABSPATH . WPINC . '/version.php';
    $is_development_version = preg_match('/alpha|beta|RC/', $wp_version);
    if (isset($updates[0]->version) && version_compare($updates[0]->version, $wp_version, '>')) {
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
        $message = sprintf(
            /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */
            __('<strong>Important:</strong> Before updating, please <a href="%1$s">back up your database and files</a>. For help with updates, visit the <a href="%2$s">Updating WordPress</a> documentation page.'),
            __('https://wordpress.org/documentation/article/wordpress-backups/'),
            __('https://wordpress.org/documentation/article/updating-wordpress/')
        );
        wp_admin_notice($message, array('type' => 'warning', 'additional_classes' => array('inline')));
    } elseif ($is_development_version) {
        echo '<h2 class="response">' . __('You are using a development version of WordPress.') . '</h2>';
    } else {
        echo '<h2 class="response">' . __('You have the latest version of WordPress.') . '</h2>';
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || 'latest' !== $updates[0]->response)) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(
            /* translators: 1: URL to About screen, 2: WordPress version. */
            __('<a href="%1$s">Learn more about WordPress %2$s</a>.'),
            esc_url(self_admin_url('about.php')),
            $normalized_version
        ) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 6.2

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $required_php_version   The required PHP version string.
 * @global string $required_mysql_version The required MySQL version string.
 */
function core_upgrade_preamble()
{
    global $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    // Include an unmodified $wp_version.
    require ABSPATH . WPINC . '/version.php';
    $is_development_version = preg_match('/alpha|beta|RC/', $wp_version);
    if (isset($updates[0]->version) && version_compare($updates[0]->version, $wp_version, '>')) {
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
        echo '<div class="notice notice-warning inline"><p>';
        printf(
            /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */
            __('<strong>Important:</strong> Before updating, please <a href="%1$s">back up your database and files</a>. For help with updates, visit the <a href="%2$s">Updating WordPress</a> documentation page.'),
            __('https://wordpress.org/documentation/article/wordpress-backups/'),
            __('https://wordpress.org/documentation/article/updating-wordpress/')
        );
        echo '</p></div>';
    } elseif ($is_development_version) {
        echo '<h2 class="response">' . __('You are using a development version of WordPress.') . '</h2>';
    } else {
        echo '<h2 class="response">' . __('You have the latest version of WordPress.') . '</h2>';
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || 'latest' !== $updates[0]->response)) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(
            /* translators: 1: URL to About screen, 2: WordPress version. */
            __('<a href="%1$s">Learn more about WordPress %2$s</a>.'),
            esc_url(self_admin_url('about.php')),
            $normalized_version
        ) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 5.6

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $required_php_version   The required PHP version string.
 * @global string $required_mysql_version The required MySQL version string.
 */
function core_upgrade_preamble()
{
    global $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    // Include an unmodified $wp_version.
    require ABSPATH . WPINC . '/version.php';
    $is_development_version = preg_match('/alpha|beta|RC/', $wp_version);
    if (isset($updates[0]->version) && version_compare($updates[0]->version, $wp_version, '>')) {
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
        echo '<div class="notice notice-warning inline"><p>';
        printf(
            /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */
            __('<strong>Important:</strong> Before updating, please <a href="%1$s">back up your database and files</a>. For help with updates, visit the <a href="%2$s">Updating WordPress</a> documentation page.'),
            __('https://wordpress.org/support/article/wordpress-backups/'),
            __('https://wordpress.org/support/article/updating-wordpress/')
        );
        echo '</p></div>';
    } elseif ($is_development_version) {
        echo '<h2 class="response">' . __('You are using a development version of WordPress.') . '</h2>';
    } else {
        echo '<h2 class="response">' . __('You have the latest version of WordPress.') . '</h2>';
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || 'latest' !== $updates[0]->response)) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(
            /* translators: 1: URL to About screen, 2: WordPress version. */
            __('<a href="%1$s">Learn more about WordPress %2$s</a>.'),
            esc_url(self_admin_url('about.php')),
            $normalized_version
        ) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 5.5

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $required_php_version   The required PHP version string.
 * @global string $required_mysql_version The required MySQL version string.
 */
function core_upgrade_preamble()
{
    global $required_php_version, $required_mysql_version;
    $wp_version = get_bloginfo('version');
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' === $updates[0]->response) {
        echo '<h2>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h2>';
    }
    if (isset($updates[0]->version) && version_compare($updates[0]->version, $wp_version, '>')) {
        echo '<div class="notice notice-warning"><p>';
        printf(
            /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */
            __('<strong>Important:</strong> Before updating, please <a href="%1$s">back up your database and files</a>. For help with updates, visit the <a href="%2$s">Updating WordPress</a> documentation page.'),
            __('https://wordpress.org/support/article/wordpress-backups/'),
            __('https://wordpress.org/support/article/updating-wordpress/')
        );
        echo '</p></div>';
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
    }
    if (isset($updates[0]) && 'development' === $updates[0]->response) {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || 'latest' !== $updates[0]->response)) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(
            /* translators: 1: URL to About screen, 2: WordPress version. */
            __('<a href="%1$s">Learn more about WordPress %2$s</a>.'),
            esc_url(self_admin_url('about.php')),
            $normalized_version
        ) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 5.4

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $required_php_version   The required PHP version string.
 * @global string $required_mysql_version The required MySQL version string.
 */
function core_upgrade_preamble()
{
    global $required_php_version, $required_mysql_version;
    $wp_version = get_bloginfo('version');
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' === $updates[0]->response) {
        echo '<h2>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h2>';
    }
    if (isset($updates[0]->version) && version_compare($updates[0]->version, $wp_version, '>')) {
        echo '<div class="notice notice-warning"><p>';
        _e('<strong>Important:</strong> Before updating, please <a href="https://wordpress.org/support/article/wordpress-backups/">back up your database and files</a>. For help with updates, visit the <a href="https://wordpress.org/support/article/updating-wordpress/">Updating WordPress</a> documentation page.');
        echo '</p></div>';
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
    }
    if (isset($updates[0]) && 'development' === $updates[0]->response) {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || 'latest' !== $updates[0]->response)) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(
            /* translators: 1: URL to About screen, 2: WordPress version. */
            __('<a href="%1$s">Learn more about WordPress %2$s</a>.'),
            esc_url(self_admin_url('about.php')),
            $normalized_version
        ) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 5.3

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $required_php_version
 * @global string $required_mysql_version
 */
function core_upgrade_preamble()
{
    global $required_php_version, $required_mysql_version;
    $wp_version = get_bloginfo('version');
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h2>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h2>';
    }
    if (isset($updates[0]->version) && version_compare($updates[0]->version, $wp_version, '>')) {
        echo '<div class="notice notice-warning"><p>';
        _e('<strong>Important:</strong> Before updating, please <a href="https://wordpress.org/support/article/wordpress-backups/">back up your database and files</a>. For help with updates, visit the <a href="https://wordpress.org/support/article/updating-wordpress/">Updating WordPress</a> documentation page.');
        echo '</p></div>';
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(
            /* translators: 1: URL to About screen, 2: WordPress version. */
            __('<a href="%1$s">Learn more about WordPress %2$s</a>.'),
            esc_url(self_admin_url('about.php')),
            $normalized_version
        ) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 5.1

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $required_php_version
 * @global string $required_mysql_version
 */
function core_upgrade_preamble()
{
    global $required_php_version, $required_mysql_version;
    $wp_version = get_bloginfo('version');
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h2>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h2>';
    } else {
        echo '<div class="notice notice-warning"><p>';
        _e('<strong>Important:</strong> Before updating, please <a href="https://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="https://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%1$s">Learn more about WordPress %2$s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 4.7

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $required_php_version
 * @global string $required_mysql_version
 */
function core_upgrade_preamble()
{
    global $required_php_version, $required_mysql_version;
    $wp_version = get_bloginfo('version');
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h2>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h2>';
    } else {
        echo '<div class="notice notice-warning"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="https://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="https://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 4.4

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $wp_version
 * @global string $required_php_version
 * @global string $required_mysql_version
 */
function core_upgrade_preamble()
{
    global $wp_version, $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h2>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h2>';
    } else {
        echo '<div class="notice notice-warning"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="https://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="https://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h2 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h2>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 4.3

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @global string $wp_version
 * @global string $required_php_version
 * @global string $required_mysql_version
 */
function core_upgrade_preamble()
{
    global $wp_version, $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h3>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h3>';
    } else {
        echo '<div class="notice notice-warning"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="https://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="https://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h3 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h3>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 4.2

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @return null
 */
function core_upgrade_preamble()
{
    global $wp_version, $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h3>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h3>';
    } else {
        echo '<div class="updated inline"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="https://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="https://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h3 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h3>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 4.0

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @return null
 */
function core_upgrade_preamble()
{
    global $wp_version, $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h3>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h3>';
    } else {
        echo '<div class="updated inline"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h3 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h3>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p>';
            echo '<strong>' . __('BETA TESTERS:') . '</strong> ' . __('This site is set up to install updates of future beta versions automatically.');
            echo '</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 3.9

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7.0
 *
 * @return null
 */
function core_upgrade_preamble()
{
    global $wp_version, $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h3>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h3>';
    } else {
        echo '<div class="updated inline"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h3 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h3>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p><strong>BETA TESTERS:</strong> This site is set up to install updates of future beta versions automatically.</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    $alternate = true;
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 7.1

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7
 *
 * @return null
 */
function core_upgrade_preamble()
{
    global $wp_version, $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h3>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports(array('ssl'))) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h3>';
    } else {
        echo '<div class="updated inline"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h3 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h3>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p><strong>BETA TESTERS:</strong> This site is set up to install updates of future beta versions automatically.</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    $alternate = true;
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}

WordPress Version: 3.7

/**
 * Display upgrade WordPress for downloading latest or upgrading automatically form.
 *
 * @since 2.7
 *
 * @return null
 */
function core_upgrade_preamble()
{
    global $wp_version, $required_php_version, $required_mysql_version;
    $updates = get_core_updates();
    if (!isset($updates[0]->response) || 'latest' == $updates[0]->response) {
        echo '<h3>';
        _e('You have the latest version of WordPress.');
        if (wp_http_supports('ssl')) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            $upgrader = new WP_Automatic_Updater();
            $future_minor_update = (object) array('current' => $wp_version . '.1.next.minor', 'version' => $wp_version . '.1.next.minor', 'php_version' => $required_php_version, 'mysql_version' => $required_mysql_version);
            $should_auto_update = $upgrader->should_update('core', $future_minor_update, ABSPATH);
            if ($should_auto_update) {
                echo ' ' . __('Future security updates will be applied automatically.');
            }
        }
        echo '</h3>';
    } else {
        echo '<div class="updated inline"><p>';
        _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
        echo '</p></div>';
        echo '<h3 class="response">';
        _e('An updated version of WordPress is available.');
        echo '</h3>';
    }
    if (isset($updates[0]) && $updates[0]->response == 'development') {
        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        $upgrader = new WP_Automatic_Updater();
        if (wp_http_supports('ssl') && $upgrader->should_update('core', $updates[0], ABSPATH)) {
            echo '<div class="updated inline"><p><strong>BETA TESTERS:</strong> This site is set up to install updates of future beta versions automatically.</p></div>';
        }
    }
    echo '<ul class="core-updates">';
    $alternate = true;
    foreach ((array) $updates as $update) {
        echo '<li>';
        list_core_update($update);
        echo '</li>';
    }
    echo '</ul>';
    // Don't show the maintenance mode notice when we are only showing a single re-install option.
    if ($updates && (count($updates) > 1 || $updates[0]->response != 'latest')) {
        echo '<p>' . __('While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.') . '</p>';
    } elseif (!$updates) {
        list($normalized_version) = explode('-', $wp_version);
        echo '<p>' . sprintf(__('<a href="%s">Learn more about WordPress %s</a>.'), esc_url(self_admin_url('about.php')), $normalized_version) . '</p>';
    }
    dismissed_updates();
}