diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/dashboard.php --- a/wp/wp-admin/includes/dashboard.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/includes/dashboard.php Fri Sep 05 18:40:08 2025 +0200 @@ -20,17 +20,18 @@ function wp_dashboard_setup() { global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks; - $wp_dashboard_control_callbacks = array(); - $screen = get_current_screen(); + $screen = get_current_screen(); /* Register Widgets and Controls */ + $wp_dashboard_control_callbacks = array(); - $response = wp_check_browser_version(); + // Browser version + $check_browser = wp_check_browser_version(); - if ( $response && $response['upgrade'] ) { + if ( $check_browser && $check_browser['upgrade'] ) { add_filter( 'postbox_classes_dashboard_dashboard_browser_nag', 'dashboard_browser_nag_class' ); - if ( $response['insecure'] ) { + if ( $check_browser['insecure'] ) { wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'You are using an insecure browser!' ), 'wp_dashboard_browser_nag' ); } else { wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'Your browser is out of date!' ), 'wp_dashboard_browser_nag' ); @@ -38,14 +39,19 @@ } // PHP Version. - $response = wp_check_php_version(); + $check_php = wp_check_php_version(); + + if ( $check_php && current_user_can( 'update_php' ) ) { + // If "not acceptable" the widget will be shown. + if ( isset( $check_php['is_acceptable'] ) && ! $check_php['is_acceptable'] ) { + add_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' ); - if ( $response && isset( $response['is_acceptable'] ) && ! $response['is_acceptable'] - && current_user_can( 'update_php' ) - ) { - add_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' ); - - wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Recommended' ), 'wp_dashboard_php_nag' ); + if ( $check_php['is_lower_than_future_minimum'] ) { + wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Required' ), 'wp_dashboard_php_nag' ); + } else { + wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Recommended' ), 'wp_dashboard_php_nag' ); + } + } } // Site Health. @@ -278,7 +284,6 @@ " method="get">

- + 'submit_users' ) ); ?>

@@ -494,7 +504,12 @@

- + 'submit_sites' ) ); ?>

@@ -516,7 +531,7 @@ } /** - * The Quick Draft widget display and creation of drafts. + * Displays the Quick Draft widget. * * @since 3.8.0 * @@ -558,9 +573,16 @@ - -
- + array( 'error' ), + ) + ); + } + ?>
{{ event.title }} + <# if ( event.type ) { + const titleCaseEventType = event.type.replace( + /\w\S*/g, + function ( type ) { return type.charAt(0).toUpperCase() + type.substr(1).toLowerCase(); } + ); + #> + {{ 'wordcamp' === event.type ? 'WordCamp' : titleCaseEventType }} + + <# } #> {{ event.location.location }}
@@ -1532,7 +1572,11 @@ * * @param string $link The widget's secondary link URL. */ - 'link' => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ), + 'link' => apply_filters( + 'dashboard_secondary_link', + /* translators: Link to the Planet website of the locale. */ + __( 'https://planet.wordpress.org/' ) + ), /** * Filters the secondary feed URL for the 'WordPress Events and News' dashboard widget. @@ -1541,7 +1585,11 @@ * * @param string $url The widget's secondary feed URL. */ - 'url' => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ), + 'url' => apply_filters( + 'dashboard_secondary_feed', + /* translators: Link to the Planet feed of the locale. */ + __( 'https://planet.wordpress.org/feed/' ) + ), /** * Filters the secondary link title for the 'WordPress Events and News' dashboard widget. @@ -1628,9 +1676,10 @@ number_format_i18n( $quota ) ); printf( - '%2$s (%3$s)', + '%2$s (%3$s)', esc_url( admin_url( 'upload.php' ) ), $text, + /* translators: Hidden accessibility text. */ __( 'Manage Uploads' ) ); ?> @@ -1643,9 +1692,10 @@ $percentused ); printf( - '%2$s (%3$s)', + '%2$s (%3$s)', esc_url( admin_url( 'upload.php' ) ), $text, + /* translators: Hidden accessibility text. */ __( 'Manage Uploads' ) ); ?> @@ -1729,7 +1779,7 @@ * * @param string $notice The notice content. * @param array|false $response An array containing web browser information, or - * false on failure. See `wp_check_browser_version()`. + * false on failure. See wp_check_browser_version(). */ echo apply_filters( 'browse-happy-notice', $notice, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } @@ -1825,39 +1875,58 @@ } if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) { - $msg = sprintf( + // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates. + + if ( $response['is_lower_than_future_minimum'] ) { + $message = sprintf( + /* translators: %s: The server PHP version. */ + __( 'Your site is running on an outdated version of PHP (%s), which does not receive security updates and soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.' ), + PHP_VERSION + ); + } else { + $message = sprintf( + /* translators: %s: The server PHP version. */ + __( 'Your site is running on an outdated version of PHP (%s), which does not receive security updates. It should be updated.' ), + PHP_VERSION + ); + } + } elseif ( $response['is_lower_than_future_minimum'] ) { + $message = sprintf( /* translators: %s: The server PHP version. */ - __( 'Your site is running an insecure version of PHP (%s), which should be updated.' ), + __( 'Your site is running on an outdated version of PHP (%s), which soon will not be supported by WordPress. Ensure that PHP is updated on your server as soon as possible. Otherwise you will not be able to upgrade WordPress.' ), PHP_VERSION ); } else { - $msg = sprintf( + $message = sprintf( /* translators: %s: The server PHP version. */ - __( 'Your site is running an outdated version of PHP (%s), which should be updated.' ), + __( 'Your site is running on an outdated version of PHP (%s), which should be updated.' ), PHP_VERSION ); } ?> -

+

-

+

+

%2$s %3$s', + '%2$s %3$s', esc_url( wp_get_update_php_url() ), __( 'Learn more about updating PHP' ), - /* translators: Accessibility text. */ + /* translators: Hidden accessibility text. */ __( '(opens in a new tab)' ) ); ?> @@ -1879,8 +1948,14 @@ function dashboard_php_nag_class( $classes ) { $response = wp_check_php_version(); - if ( $response && isset( $response['is_secure'] ) && ! $response['is_secure'] ) { - $classes[] = 'php-insecure'; + if ( ! $response ) { + return $classes; + } + + if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) { + $classes[] = 'php-no-security-updates'; + } elseif ( $response['is_lower_than_future_minimum'] ) { + $classes[] = 'php-version-lower-than-future-minimum'; } return $classes; @@ -1913,7 +1988,7 @@

-
- +

@@ -2011,7 +2088,10 @@

-
+

@@ -2019,7 +2099,10 @@
-
+

@@ -2035,16 +2118,19 @@
-
+

- +

- +