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 @@