diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/update-core.php --- a/wp/wp-admin/update-core.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/update-core.php Fri Sep 05 18:40:08 2025 +0200 @@ -42,7 +42,7 @@ if ( 'en_US' === $update->locale && 'en_US' === get_locale() ) { $version_string = $update->current; - } elseif ( 'en_US' === $update->locale && $update->packages->partial && $wp_version == $update->partial_version ) { + } elseif ( 'en_US' === $update->locale && $update->packages->partial && $wp_version === $update->partial_version ) { $updates = get_core_updates(); if ( $updates && 1 === count( $updates ) ) { // If the only available update is a partial builds, it doesn't need a language-specific version string. @@ -59,7 +59,7 @@ $message = ''; $form_action = 'update-core.php?action=do-core-upgrade'; - $php_version = phpversion(); + $php_version = PHP_VERSION; $mysql_version = $wpdb->db_version(); $show_buttons = true; @@ -91,7 +91,7 @@ $version_url = sprintf( /* translators: %s: WordPress version. */ - esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ), + esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $update->current ) ); @@ -179,19 +179,18 @@ } echo '

'; - if ( 'en_US' !== $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package != $update->locale ) ) { + if ( 'en_US' !== $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package !== $update->locale ) ) { echo '

' . __( 'This localized version contains both the translation and various other localization fixes.' ) . '

'; - } elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) { + } elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() && ( ! $update->packages->partial && $wp_version === $update->partial_version ) ) { // Partial builds don't need language-specific warnings. echo '

' . sprintf( /* translators: %s: WordPress version. */ - __( 'You are about to install WordPress %s in English (US). There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ), + __( 'You are about to install WordPress %s in English (US). There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ), 'development' !== $update->response ? $update->current : '' ) . '

'; } echo ''; - } /** @@ -242,13 +241,8 @@ * 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. @@ -261,14 +255,19 @@ _e( 'An updated version of WordPress is available.' ); echo ''; - echo '

'; - printf( + $message = sprintf( /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */ __( 'Important: Before updating, please back up your database and files. For help with updates, visit the Updating WordPress documentation page.' ), - __( 'https://wordpress.org/support/article/wordpress-backups/' ), - __( 'https://wordpress.org/support/article/updating-wordpress/' ) + __( 'https://developer.wordpress.org/advanced-administration/security/backup/' ), + __( 'https://wordpress.org/documentation/article/updating-wordpress/' ) ); - echo '

'; + wp_admin_notice( + $message, + array( + 'type' => 'warning', + 'additional_classes' => array( 'inline' ), + ) + ); } elseif ( $is_development_version ) { echo '

' . __( 'You are using a development version of WordPress.' ) . '

'; } else { @@ -308,10 +307,22 @@ if ( isset( $_GET['core-major-auto-updates-saved'] ) ) { if ( 'enabled' === $_GET['core-major-auto-updates-saved'] ) { $notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' ); - echo '

' . $notice_text . '

'; + wp_admin_notice( + $notice_text, + array( + 'type' => 'success', + 'dismissible' => true, + ) + ); } elseif ( 'disabled' === $_GET['core-major-auto-updates-saved'] ) { $notice_text = __( 'WordPress will only receive automatic security and maintenance releases from now on.' ); - echo '

' . $notice_text . '

'; + wp_admin_notice( + $notice_text, + array( + 'type' => 'success', + 'dismissible' => true, + ) + ); } } @@ -402,7 +413,7 @@ _e( 'This site is automatically kept up to date with each new version of WordPress.' ); if ( $can_set_update_option ) { - echo '
'; + echo '
'; printf( '%s', wp_nonce_url( add_query_arg( 'value', 'disable', $action_url ), 'core-major-auto-updates-nonce' ), @@ -413,7 +424,7 @@ _e( 'This site is automatically kept up to date with maintenance and security releases of WordPress only.' ); if ( $can_set_update_option ) { - echo '
'; + echo '
'; printf( '%s', wp_nonce_url( add_query_arg( 'value', 'enable', $action_url ), 'core-major-auto-updates-nonce' ), @@ -535,7 +546,7 @@ $compatible_php = is_php_version_compatible( $requires_php ); if ( ! $compatible_php && current_user_can( 'update_php' ) ) { - $compat .= '
' . __( 'This update does not work with your version of PHP.' ) . ' '; + $compat .= '
' . __( 'This update does not work with your version of PHP.' ) . ' '; $compat .= sprintf( /* translators: %s: URL to Update PHP page. */ __( 'Learn more about updating PHP.' ), @@ -572,11 +583,13 @@ -