wp/wp-admin/site-health.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
--- a/wp/wp-admin/site-health.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/site-health.php	Fri Sep 05 18:40:08 2025 +0200
@@ -9,7 +9,7 @@
 /** WordPress Administration Bootstrap */
 require_once __DIR__ . '/admin.php';
 
-wp_reset_vars( array( 'action' ) );
+$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
 
 $tabs = array(
 	/* translators: Tab heading for Site Health Status page. */
@@ -19,7 +19,7 @@
 );
 
 /**
- * An associative array of extra tabs for the Site Health navigation bar.
+ * Filters the extra tabs for the Site Health navigation bar.
  *
  * Add a custom page to the Site Health screen, based on a tab slug and label.
  * The label you provide will also be used as part of the site title.
@@ -87,7 +87,7 @@
 
 get_current_screen()->set_help_sidebar(
 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
-	'<p>' . __( '<a href="https://wordpress.org/support/article/site-health-screen/">Documentation on Site Health tool</a>' ) . '</p>'
+	'<p>' . __( '<a href="https://wordpress.org/documentation/article/site-health-screen/">Documentation on Site Health tool</a>' ) . '</p>'
 );
 
 // Start by checking if this is a special request checking for the existence of certain filters.
@@ -105,20 +105,30 @@
 	<?php
 	if ( isset( $_GET['https_updated'] ) ) {
 		if ( $_GET['https_updated'] ) {
-			?>
-			<div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Site URLs switched to HTTPS.' ); ?></p></div>
-			<?php
+			wp_admin_notice(
+				__( 'Site URLs switched to HTTPS.' ),
+				array(
+					'type'        => 'success',
+					'id'          => 'message',
+					'dismissible' => true,
+				)
+			);
 		} else {
-			?>
-			<div id="message" class="notice notice-error is-dismissible"><p><?php _e( 'Site URLs could not be switched to HTTPS.' ); ?></p></div>
-			<?php
+			wp_admin_notice(
+				__( 'Site URLs could not be switched to HTTPS.' ),
+				array(
+					'type'        => 'error',
+					'id'          => 'message',
+					'dismissible' => true,
+				)
+			);
 		}
 	}
 	?>
 
 	<div class="health-check-title-section site-health-progress-wrapper loading hide-if-no-js">
 		<div class="site-health-progress">
-			<svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
+			<svg aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
 				<circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
 				<circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
 			</svg>
@@ -160,7 +170,12 @@
 		<?php if ( count( $tabs ) > 4 ) : ?>
 			<button type="button" class="health-check-tab health-check-offscreen-nav-wrapper" aria-haspopup="true">
 				<span class="dashicons dashicons-ellipsis"></span>
-				<span class="screen-reader-text"><?php _e( 'Toggle extra menu items' ); ?></span>
+				<span class="screen-reader-text">
+					<?php
+					/* translators: Hidden accessibility text. */
+					_e( 'Toggle extra menu items' );
+					?>
+				</span>
 
 				<div class="health-check-offscreen-nav">
 					<?php
@@ -193,7 +208,7 @@
 <?php
 if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) {
 	/**
-	 * Output content of a custom Site Health tab.
+	 * Fires when outputting the content of a custom Site Health tab.
 	 *
 	 * This action fires right after the Site Health header, and users are still subject to
 	 * the capability checks for the Site Health page to view any custom tabs and their contents.
@@ -207,12 +222,15 @@
 	require_once ABSPATH . 'wp-admin/admin-footer.php';
 	return;
 } else {
+	wp_admin_notice(
+		__( 'The Site Health check requires JavaScript.' ),
+		array(
+			'type'               => 'error',
+			'additional_classes' => array( 'hide-if-js' ),
+		)
+	);
 	?>
 
-<div class="notice notice-error hide-if-js">
-	<p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
-</div>
-
 <div class="health-check-body health-check-status-tab hide-if-no-js">
 	<div class="site-status-all-clear hide">
 		<p class="icon">
@@ -233,9 +251,9 @@
 			<?php _e( 'Site Health Status' ); ?>
 		</h2>
 
-		<p><?php _e( 'The site health check shows critical information about your WordPress configuration and items that require your attention.' ); ?></p>
+		<p><?php _e( 'The site health check shows information about your WordPress configuration and items that may need your attention.' ); ?></p>
 
-		<div class="site-health-issues-wrapper" id="health-check-issues-critical">
+		<div class="site-health-issues-wrapper hidden" id="health-check-issues-critical">
 			<h3 class="site-health-issue-count-title">
 				<?php
 					/* translators: %s: Number of critical issues found. */
@@ -243,10 +261,12 @@
 				?>
 			</h3>
 
+			<p><?php _e( 'Critical issues are items that may have a high impact on your sites performance or security, and resolving these issues should be prioritized.' ); ?></p>
+
 			<div id="health-check-site-status-critical" class="health-check-accordion issues"></div>
 		</div>
 
-		<div class="site-health-issues-wrapper" id="health-check-issues-recommended">
+		<div class="site-health-issues-wrapper hidden" id="health-check-issues-recommended">
 			<h3 class="site-health-issue-count-title">
 				<?php
 					/* translators: %s: Number of recommended improvements. */
@@ -254,6 +274,8 @@
 				?>
 			</h3>
 
+			<p><?php _e( 'Recommended items are considered beneficial to your site, although not as important to prioritize as a critical issue, they may include improvements to things such as; Performance, user experience, and more.' ); ?></p>
+
 			<div id="health-check-site-status-recommended" class="health-check-accordion issues"></div>
 		</div>
 	</div>