7 */ |
7 */ |
8 |
8 |
9 /** WordPress Administration Bootstrap */ |
9 /** WordPress Administration Bootstrap */ |
10 require_once __DIR__ . '/admin.php'; |
10 require_once __DIR__ . '/admin.php'; |
11 |
11 |
12 wp_reset_vars( array( 'action' ) ); |
12 $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; |
13 |
13 |
14 $tabs = array( |
14 $tabs = array( |
15 /* translators: Tab heading for Site Health Status page. */ |
15 /* translators: Tab heading for Site Health Status page. */ |
16 '' => _x( 'Status', 'Site Health' ), |
16 '' => _x( 'Status', 'Site Health' ), |
17 /* translators: Tab heading for Site Health Info page. */ |
17 /* translators: Tab heading for Site Health Info page. */ |
18 'debug' => _x( 'Info', 'Site Health' ), |
18 'debug' => _x( 'Info', 'Site Health' ), |
19 ); |
19 ); |
20 |
20 |
21 /** |
21 /** |
22 * An associative array of extra tabs for the Site Health navigation bar. |
22 * Filters the extra tabs for the Site Health navigation bar. |
23 * |
23 * |
24 * Add a custom page to the Site Health screen, based on a tab slug and label. |
24 * Add a custom page to the Site Health screen, based on a tab slug and label. |
25 * The label you provide will also be used as part of the site title. |
25 * The label you provide will also be used as part of the site title. |
26 * |
26 * |
27 * @since 5.8.0 |
27 * @since 5.8.0 |
85 ) |
85 ) |
86 ); |
86 ); |
87 |
87 |
88 get_current_screen()->set_help_sidebar( |
88 get_current_screen()->set_help_sidebar( |
89 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
89 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
90 '<p>' . __( '<a href="https://wordpress.org/support/article/site-health-screen/">Documentation on Site Health tool</a>' ) . '</p>' |
90 '<p>' . __( '<a href="https://wordpress.org/documentation/article/site-health-screen/">Documentation on Site Health tool</a>' ) . '</p>' |
91 ); |
91 ); |
92 |
92 |
93 // Start by checking if this is a special request checking for the existence of certain filters. |
93 // Start by checking if this is a special request checking for the existence of certain filters. |
94 $health_check_site_status->check_wp_version_check_exists(); |
94 $health_check_site_status->check_wp_version_check_exists(); |
95 |
95 |
103 </div> |
103 </div> |
104 |
104 |
105 <?php |
105 <?php |
106 if ( isset( $_GET['https_updated'] ) ) { |
106 if ( isset( $_GET['https_updated'] ) ) { |
107 if ( $_GET['https_updated'] ) { |
107 if ( $_GET['https_updated'] ) { |
108 ?> |
108 wp_admin_notice( |
109 <div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Site URLs switched to HTTPS.' ); ?></p></div> |
109 __( 'Site URLs switched to HTTPS.' ), |
110 <?php |
110 array( |
|
111 'type' => 'success', |
|
112 'id' => 'message', |
|
113 'dismissible' => true, |
|
114 ) |
|
115 ); |
111 } else { |
116 } else { |
112 ?> |
117 wp_admin_notice( |
113 <div id="message" class="notice notice-error is-dismissible"><p><?php _e( 'Site URLs could not be switched to HTTPS.' ); ?></p></div> |
118 __( 'Site URLs could not be switched to HTTPS.' ), |
114 <?php |
119 array( |
|
120 'type' => 'error', |
|
121 'id' => 'message', |
|
122 'dismissible' => true, |
|
123 ) |
|
124 ); |
115 } |
125 } |
116 } |
126 } |
117 ?> |
127 ?> |
118 |
128 |
119 <div class="health-check-title-section site-health-progress-wrapper loading hide-if-no-js"> |
129 <div class="health-check-title-section site-health-progress-wrapper loading hide-if-no-js"> |
120 <div class="site-health-progress"> |
130 <div class="site-health-progress"> |
121 <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"> |
131 <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"> |
122 <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> |
132 <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> |
123 <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> |
133 <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> |
124 </svg> |
134 </svg> |
125 </div> |
135 </div> |
126 <div class="site-health-progress-label"> |
136 <div class="site-health-progress-label"> |
158 ?> |
168 ?> |
159 |
169 |
160 <?php if ( count( $tabs ) > 4 ) : ?> |
170 <?php if ( count( $tabs ) > 4 ) : ?> |
161 <button type="button" class="health-check-tab health-check-offscreen-nav-wrapper" aria-haspopup="true"> |
171 <button type="button" class="health-check-tab health-check-offscreen-nav-wrapper" aria-haspopup="true"> |
162 <span class="dashicons dashicons-ellipsis"></span> |
172 <span class="dashicons dashicons-ellipsis"></span> |
163 <span class="screen-reader-text"><?php _e( 'Toggle extra menu items' ); ?></span> |
173 <span class="screen-reader-text"> |
|
174 <?php |
|
175 /* translators: Hidden accessibility text. */ |
|
176 _e( 'Toggle extra menu items' ); |
|
177 ?> |
|
178 </span> |
164 |
179 |
165 <div class="health-check-offscreen-nav"> |
180 <div class="health-check-offscreen-nav"> |
166 <?php |
181 <?php |
167 // Remove the first few entries from the array as being already output. |
182 // Remove the first few entries from the array as being already output. |
168 $tabs_slice = array_slice( $tabs, 3 ); |
183 $tabs_slice = array_slice( $tabs, 3 ); |
191 <hr class="wp-header-end"> |
206 <hr class="wp-header-end"> |
192 |
207 |
193 <?php |
208 <?php |
194 if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) { |
209 if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) { |
195 /** |
210 /** |
196 * Output content of a custom Site Health tab. |
211 * Fires when outputting the content of a custom Site Health tab. |
197 * |
212 * |
198 * This action fires right after the Site Health header, and users are still subject to |
213 * This action fires right after the Site Health header, and users are still subject to |
199 * the capability checks for the Site Health page to view any custom tabs and their contents. |
214 * the capability checks for the Site Health page to view any custom tabs and their contents. |
200 * |
215 * |
201 * @since 5.8.0 |
216 * @since 5.8.0 |
205 do_action( 'site_health_tab_content', $_GET['tab'] ); |
220 do_action( 'site_health_tab_content', $_GET['tab'] ); |
206 |
221 |
207 require_once ABSPATH . 'wp-admin/admin-footer.php'; |
222 require_once ABSPATH . 'wp-admin/admin-footer.php'; |
208 return; |
223 return; |
209 } else { |
224 } else { |
|
225 wp_admin_notice( |
|
226 __( 'The Site Health check requires JavaScript.' ), |
|
227 array( |
|
228 'type' => 'error', |
|
229 'additional_classes' => array( 'hide-if-js' ), |
|
230 ) |
|
231 ); |
210 ?> |
232 ?> |
211 |
|
212 <div class="notice notice-error hide-if-js"> |
|
213 <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p> |
|
214 </div> |
|
215 |
233 |
216 <div class="health-check-body health-check-status-tab hide-if-no-js"> |
234 <div class="health-check-body health-check-status-tab hide-if-no-js"> |
217 <div class="site-status-all-clear hide"> |
235 <div class="site-status-all-clear hide"> |
218 <p class="icon"> |
236 <p class="icon"> |
219 <span class="dashicons dashicons-smiley" aria-hidden="true"></span> |
237 <span class="dashicons dashicons-smiley" aria-hidden="true"></span> |
231 <div class="site-status-has-issues"> |
249 <div class="site-status-has-issues"> |
232 <h2> |
250 <h2> |
233 <?php _e( 'Site Health Status' ); ?> |
251 <?php _e( 'Site Health Status' ); ?> |
234 </h2> |
252 </h2> |
235 |
253 |
236 <p><?php _e( 'The site health check shows critical information about your WordPress configuration and items that require your attention.' ); ?></p> |
254 <p><?php _e( 'The site health check shows information about your WordPress configuration and items that may need your attention.' ); ?></p> |
237 |
255 |
238 <div class="site-health-issues-wrapper" id="health-check-issues-critical"> |
256 <div class="site-health-issues-wrapper hidden" id="health-check-issues-critical"> |
239 <h3 class="site-health-issue-count-title"> |
257 <h3 class="site-health-issue-count-title"> |
240 <?php |
258 <?php |
241 /* translators: %s: Number of critical issues found. */ |
259 /* translators: %s: Number of critical issues found. */ |
242 printf( _n( '%s critical issue', '%s critical issues', 0 ), '<span class="issue-count">0</span>' ); |
260 printf( _n( '%s critical issue', '%s critical issues', 0 ), '<span class="issue-count">0</span>' ); |
243 ?> |
261 ?> |
244 </h3> |
262 </h3> |
245 |
263 |
|
264 <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> |
|
265 |
246 <div id="health-check-site-status-critical" class="health-check-accordion issues"></div> |
266 <div id="health-check-site-status-critical" class="health-check-accordion issues"></div> |
247 </div> |
267 </div> |
248 |
268 |
249 <div class="site-health-issues-wrapper" id="health-check-issues-recommended"> |
269 <div class="site-health-issues-wrapper hidden" id="health-check-issues-recommended"> |
250 <h3 class="site-health-issue-count-title"> |
270 <h3 class="site-health-issue-count-title"> |
251 <?php |
271 <?php |
252 /* translators: %s: Number of recommended improvements. */ |
272 /* translators: %s: Number of recommended improvements. */ |
253 printf( _n( '%s recommended improvement', '%s recommended improvements', 0 ), '<span class="issue-count">0</span>' ); |
273 printf( _n( '%s recommended improvement', '%s recommended improvements', 0 ), '<span class="issue-count">0</span>' ); |
254 ?> |
274 ?> |
255 </h3> |
275 </h3> |
|
276 |
|
277 <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> |
256 |
278 |
257 <div id="health-check-site-status-recommended" class="health-check-accordion issues"></div> |
279 <div id="health-check-site-status-recommended" class="health-check-accordion issues"></div> |
258 </div> |
280 </div> |
259 </div> |
281 </div> |
260 |
282 |