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 '
' . $notice_text . '
' . $notice_text . '
' . __( 'Documentation on Auto-updates' ) . '
'; +} + +$help_sidebar_rollback = ''; + +if ( current_user_can( 'update_themes' ) || current_user_can( 'update_plugins' ) ) { + $rollback_help = '' . __( 'This feature will create a temporary backup of a plugin or theme before it is upgraded. This backup is used to restore the plugin or theme back to its previous state if there is an error during the update process.' ) . '
'; + + $rollback_help .= '' . __( 'On systems with fewer resources, this may lead to server timeouts or resource limits being reached. If you encounter an issue during the update process, please create a support forum topic and reference Rollback in the issue title.' ) . '
'; + + get_current_screen()->add_help_tab( + array( + 'id' => 'rollback-plugins-themes', + 'title' => __( 'Restore Plugin or Theme' ), + 'content' => $rollback_help, + ) + ); + + $help_sidebar_rollback = '' . __( 'Common Errors' ) . '
'; } get_current_screen()->set_help_sidebar( '' . __( 'For more information:' ) . '
' . - '' . __( 'Documentation on Updating WordPress' ) . '
' . + '' . __( 'Documentation on Updating WordPress' ) . '
' . $help_sidebar_autoupdates . - '' . __( 'Support' ) . '
' + '' . __( 'Support forums' ) . '
' . + $help_sidebar_rollback ); if ( 'upgrade-core' === $action ) { - // Force a update check when requested. + // Force an update check when requested. $force_check = ! empty( $_GET['force-check'] ); wp_version_check( array(), $force_check ); @@ -1027,17 +1065,31 @@ ?>'; if ( 'themes' === $upgrade_error ) { - _e( 'Please select one or more themes to update.' ); + $theme_updates = get_theme_updates(); + if ( ! empty( $theme_updates ) ) { + wp_admin_notice( + __( 'Please select one or more themes to update.' ), + array( + 'additional_classes' => array( 'error' ), + ) + ); + } } else { - _e( 'Please select one or more plugins to update.' ); + $plugin_updates = get_plugin_updates(); + if ( ! empty( $plugin_updates ) ) { + wp_admin_notice( + __( 'Please select one or more plugins to update.' ), + array( + 'additional_classes' => array( 'error' ), + ) + ); + } } - echo '
'; - /* translators: 1: Date, 2: Time. */ - printf( __( 'Last checked on %1$s at %2$s.' ), date_i18n( __( 'F j, Y' ), $last_update_check ), date_i18n( __( 'g:i a T' ), $last_update_check ) ); + + printf( + /* translators: 1: Date, 2: Time. */ + __( 'Last checked on %1$s at %2$s.' ), + /* translators: Last update date format. See https://www.php.net/manual/datetime.format.php */ + date_i18n( __( 'F j, Y' ), $last_update_check ), + /* translators: Last update time format. See https://www.php.net/manual/datetime.format.php */ + date_i18n( __( 'g:i a T' ), $last_update_check ) + ); echo ' ' . __( 'Check again.' ) . ''; echo '
';