diff -r 34716fd837a4 -r be944660c56a wp/wp-admin/site-health.php --- a/wp/wp-admin/site-health.php Tue Dec 15 15:52:01 2020 +0100 +++ b/wp/wp-admin/site-health.php Wed Sep 21 18:19:35 2022 +0200 @@ -6,15 +6,43 @@ * @subpackage Administration */ -if ( isset( $_GET['tab'] ) && 'debug' === $_GET['tab'] ) { - require_once __DIR__ . '/site-health-info.php'; - return; -} - /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; -$title = __( 'Site Health Status' ); +wp_reset_vars( array( 'action' ) ); + +$tabs = array( + /* translators: Tab heading for Site Health Status page. */ + '' => _x( 'Status', 'Site Health' ), + /* translators: Tab heading for Site Health Info page. */ + 'debug' => _x( 'Info', 'Site Health' ), +); + +/** + * An associated array of 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. + * + * @since 5.8.0 + * + * @param array $tabs An associated array of tab slugs and their label. + */ +$tabs = apply_filters( 'site_health_navigation_tabs', $tabs ); + +$wrapper_classes = array( + 'health-check-tabs-wrapper', + 'hide-if-no-js', + 'tab-count-' . count( $tabs ), +); + +$current_tab = ( isset( $_GET['tab'] ) ? $_GET['tab'] : '' ); + +$title = sprintf( + // translators: %s: The currently displayed tab. + __( 'Site Health - %s' ), + ( isset( $tabs[ $current_tab ] ) ? esc_html( $tabs[ $current_tab ] ) : esc_html( reset( $tabs ) ) ) +); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_die( __( 'Sorry, you are not allowed to access site health information.' ), '', 403 ); @@ -27,6 +55,23 @@ require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } +if ( 'update_https' === $action ) { + check_admin_referer( 'wp_update_https' ); + + if ( ! current_user_can( 'update_https' ) ) { + wp_die( __( 'Sorry, you are not allowed to update this site to HTTPS.' ), 403 ); + } + + if ( ! wp_is_https_supported() ) { + wp_die( __( 'It looks like HTTPS is not supported for your website at this point.' ) ); + } + + $result = wp_update_urls_to_https(); + + wp_redirect( add_query_arg( 'https_updated', (int) $result, wp_get_referer() ) ); + exit; +} + $health_check_site_status = WP_Site_Health::get_instance(); // Start by checking if this is a special request checking for the existence of certain filters. @@ -41,6 +86,20 @@ + +

+ +

+ +
-