diff --git src/wp-admin/includes/class-wp-site-health.php src/wp-admin/includes/class-wp-site-health.php
index 01f97959c5..a1e8bdfa4e 100644
|
|
class WP_Site_Health { |
51 | 51 | */ |
52 | 52 | public function enqueue_scripts() { |
53 | 53 | $screen = get_current_screen(); |
54 | | if ( 'site-health' !== $screen->id ) { |
| 54 | if ( 'site-health' !== $screen->id && 'site-health-network' !== $screen->id ) { |
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
… |
… |
class WP_Site_Health { |
80 | 80 | $health_check_js_variables['site_status']['issues'] = $issue_counts; |
81 | 81 | } |
82 | 82 | |
83 | | if ( 'site-health' === $screen->id && ! isset( $_GET['tab'] ) ) { |
| 83 | if ( ( 'site-health' === $screen->id || 'site-health-network' === $screen->id ) |
| 84 | && ! isset( $_GET['tab'] ) ) { |
84 | 85 | $tests = WP_Site_Health::get_tests(); |
85 | 86 | |
86 | 87 | // Don't run https test on localhost |
diff --git src/wp-admin/menu.php src/wp-admin/menu.php
index 96c4c2a9c4..24b08e6633 100644
|
|
$menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', |
263 | 263 | $submenu['tools.php'][5] = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' ); |
264 | 264 | $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' ); |
265 | 265 | $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' ); |
266 | | $submenu['tools.php'][20] = array( __( 'Site Health' ), 'view_site_health_checks', 'site-health.php' ); |
| 266 | // Hide Site Health in individual sites. |
| 267 | if ( ! is_multisite() ) { |
| 268 | $submenu['tools.php'][20] = array( __( 'Site Health' ), 'view_site_health_checks', 'site-health.php' ); |
| 269 | } |
267 | 270 | $submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' ); |
268 | 271 | $submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' ); |
269 | 272 | if ( is_multisite() && ! is_main_site() ) { |
diff --git src/wp-admin/network/menu.php src/wp-admin/network/menu.php
index dbd77fd763..3c60304aa6 100644
|
|
$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'manage_network_ |
62 | 62 | $submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' ); |
63 | 63 | $submenu['plugins.php'][15] = array( __( 'Plugin Editor' ), 'edit_plugins', 'plugin-editor.php' ); |
64 | 64 | |
| 65 | $menu[24] = array( __( 'Tools' ), 'view_site_health_checks', 'site-health.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' ); |
| 66 | $submenu['site-health.php'][5] = array( __( 'Site Health' ), 'view_site_health_checks', 'site-health.php' ); |
| 67 | |
65 | 68 | $menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); |
66 | 69 | if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) { |
67 | 70 | $submenu['settings.php'][5] = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' ); |
68 | 71 | $submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' ); |
69 | 72 | } |
| 73 | |
70 | 74 | unset( $update_data ); |
71 | 75 | |
72 | 76 | $menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' ); |
diff --git src/wp-admin/network/site-health.php src/wp-admin/network/site-health.php
new file mode 100644
index 0000000000..ad0ecbfe4a
-
|
+
|
|
| 1 | <?php |
| 2 | /** |
| 3 | * Network Site Health administration panel. |
| 4 | * |
| 5 | * @package WordPress |
| 6 | * @subpackage Multisite |
| 7 | * @since 5.3.0 |
| 8 | */ |
| 9 | |
| 10 | /** Load WordPress Administration Bootstrap */ |
| 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
| 12 | |
| 13 | require( ABSPATH . 'wp-admin/site-health.php' ); |
diff --git src/wp-admin/site-health-info.php src/wp-admin/site-health-info.php
index 4a23f15251..75f764a67a 100644
|
|
require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
46 | 46 | </div> |
47 | 47 | |
48 | 48 | <nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> |
49 | | <a href="<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>" class="health-check-tab"> |
| 49 | <a href="<?php echo esc_url( network_admin_url( 'site-health.php' ) ); ?>" class="health-check-tab"> |
50 | 50 | <?php |
51 | 51 | /* translators: tab heading for Site Health Status page */ |
52 | 52 | _ex( 'Status', 'Site Health' ); |
53 | 53 | ?> |
54 | 54 | </a> |
55 | 55 | |
56 | | <a href="<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab active" aria-current="true"> |
| 56 | <a href="<?php echo esc_url( network_admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab active" aria-current="true"> |
57 | 57 | <?php |
58 | 58 | /* translators: tab heading for Site Health Info page */ |
59 | 59 | _ex( 'Info', 'Site Health' ); |
diff --git src/wp-admin/site-health.php src/wp-admin/site-health.php
index 5f19ebee0d..431b70cb3e 100644
|
|
require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
51 | 51 | </div> |
52 | 52 | |
53 | 53 | <nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> |
54 | | <a href="<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>" class="health-check-tab active" aria-current="true"> |
| 54 | <a href="<?php echo esc_url( network_admin_url( 'site-health.php' ) ); ?>" class="health-check-tab active" aria-current="true"> |
55 | 55 | <?php |
56 | 56 | /* translators: tab heading for Site Health Status page */ |
57 | 57 | _ex( 'Status', 'Site Health' ); |
58 | 58 | ?> |
59 | 59 | </a> |
60 | 60 | |
61 | | <a href="<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab"> |
| 61 | <a href="<?php echo esc_url( network_admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab"> |
62 | 62 | <?php |
63 | 63 | /* translators: tab heading for Site Health Info page */ |
64 | 64 | _ex( 'Info', 'Site Health' ); |
diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php
index d444da4a51..15df297e3f 100644
|
|
function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { |
543 | 543 | ); |
544 | 544 | } |
545 | 545 | |
| 546 | if ( current_user_can( 'view_site_health_checks' ) ) { |
| 547 | $wp_admin_bar->add_menu( |
| 548 | array( |
| 549 | 'parent' => 'network-admin', |
| 550 | 'id' => 'network-admin-to', |
| 551 | 'title' => __( 'Tools' ), |
| 552 | 'href' => network_admin_url( 'site-health.php' ), |
| 553 | ) |
| 554 | ); |
| 555 | } |
| 556 | |
546 | 557 | if ( current_user_can( 'manage_network_options' ) ) { |
547 | 558 | $wp_admin_bar->add_menu( |
548 | 559 | array( |
… |
… |
function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { |
553 | 564 | ) |
554 | 565 | ); |
555 | 566 | } |
| 567 | |
556 | 568 | } |
557 | 569 | |
558 | 570 | // Add site links |