[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-admin/ -> site-health.php (source)

   1  <?php
   2  /**
   3   * Tools Administration Screen.
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   */
   8  
   9  if ( isset( $_GET['tab'] ) && 'debug' === $_GET['tab'] ) {
  10      require_once( dirname( __FILE__ ) . '/site-health-info.php' );
  11      return;
  12  }
  13  
  14  /** WordPress Administration Bootstrap */
  15  require_once( dirname( __FILE__ ) . '/admin.php' );
  16  
  17  $title = __( 'Site Health Status' );
  18  
  19  if ( ! current_user_can( 'view_site_health_checks' ) ) {
  20      wp_die( __( 'Sorry, you are not allowed to access site health information.' ), '', 403 );
  21  }
  22  
  23  wp_enqueue_style( 'site-health' );
  24  wp_enqueue_script( 'site-health' );
  25  
  26  if ( ! class_exists( 'WP_Site_Health' ) ) {
  27      require_once ( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
  28  }
  29  
  30  $health_check_site_status = new WP_Site_Health();
  31  
  32  // Start by checking if this is a special request checking for the existence of certain filters.
  33  $health_check_site_status->check_wp_version_check_exists();
  34  
  35  require_once ( ABSPATH . 'wp-admin/admin-header.php' );
  36  ?>
  37  <div class="health-check-header">
  38      <div class="health-check-title-section">
  39          <h1>
  40              <?php _e( 'Site Health' ); ?>
  41          </h1>
  42      </div>
  43  
  44      <div class="health-check-title-section site-health-progress-wrapper loading hide-if-no-js">
  45          <div class="site-health-progress">
  46              <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">
  47                  <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
  48                  <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
  49              </svg>
  50          </div>
  51          <div class="site-health-progress-label">
  52              <?php _e( 'Results are still loading&hellip;' ); ?>
  53          </div>
  54      </div>
  55  
  56      <nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
  57          <a href="<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>" class="health-check-tab active" aria-current="true">
  58              <?php
  59              /* translators: Tab heading for Site Health Status page. */
  60              _ex( 'Status', 'Site Health' );
  61              ?>
  62          </a>
  63  
  64          <a href="<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab">
  65              <?php
  66              /* translators: Tab heading for Site Health Info page. */
  67              _ex( 'Info', 'Site Health' );
  68              ?>
  69          </a>
  70      </nav>
  71  </div>
  72  
  73  <hr class="wp-header-end">
  74  
  75  <div class="notice notice-error hide-if-js">
  76      <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
  77  </div>
  78  
  79  <div class="health-check-body hide-if-no-js">
  80      <div class="site-status-all-clear hide">
  81          <p class="icon">
  82              <span class="dashicons dashicons-yes"></span>
  83          </p>
  84  
  85          <p class="encouragement">
  86              <?php _e( 'Great job!' ); ?>
  87          </p>
  88  
  89          <p>
  90              <?php _e( 'Everything is running smoothly here.' ); ?>
  91          </p>
  92      </div>
  93  
  94      <div class="site-status-has-issues">
  95          <h2>
  96              <?php _e( 'Site Health Status' ); ?>
  97          </h2>
  98  
  99          <p><?php _e( 'The site health check shows critical information about your WordPress configuration and items that require your attention.' ); ?></p>
 100  
 101          <div class="site-health-issues-wrapper" id="health-check-issues-critical">
 102              <h3 class="site-health-issue-count-title">
 103                  <?php
 104                      /* translators: %s: Number of critical issues found. */
 105                      printf( _n( '%s critical issue', '%s critical issues', 0 ), '<span class="issue-count">0</span>' );
 106                  ?>
 107              </h3>
 108  
 109              <div id="health-check-site-status-critical" class="health-check-accordion issues"></div>
 110          </div>
 111  
 112          <div class="site-health-issues-wrapper" id="health-check-issues-recommended">
 113              <h3 class="site-health-issue-count-title">
 114                  <?php
 115                      /* translators: %s: Number of recommended improvements. */
 116                      printf( _n( '%s recommended improvement', '%s recommended improvements', 0 ), '<span class="issue-count">0</span>' );
 117                  ?>
 118              </h3>
 119  
 120              <div id="health-check-site-status-recommended" class="health-check-accordion issues"></div>
 121          </div>
 122      </div>
 123  
 124      <div class="site-health-view-more">
 125          <button type="button" class="button site-health-view-passed" aria-expanded="false" aria-controls="health-check-issues-good">
 126              <?php _e( 'Passed tests' ); ?>
 127              <span class="icon"></span>
 128          </button>
 129      </div>
 130  
 131      <div class="site-health-issues-wrapper hidden" id="health-check-issues-good">
 132          <h3 class="site-health-issue-count-title">
 133              <?php
 134                  /* translators: %s: Number of items with no issues. */
 135                  printf( _n( '%s item with no issues detected', '%s items with no issues detected', 0 ), '<span class="issue-count">0</span>' );
 136              ?>
 137          </h3>
 138  
 139          <div id="health-check-site-status-good" class="health-check-accordion issues"></div>
 140      </div>
 141  </div>
 142  
 143  <script id="tmpl-health-check-issue" type="text/template">
 144      <h4 class="health-check-accordion-heading">
 145          <button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-{{ data.test }}" type="button">
 146              <span class="title">{{ data.label }}</span>
 147              <span class="badge {{ data.badge.color }}">{{ data.badge.label }}</span>
 148              <span class="icon"></span>
 149          </button>
 150      </h4>
 151      <div id="health-check-accordion-block-{{ data.test }}" class="health-check-accordion-panel" hidden="hidden">
 152          {{{ data.description }}}
 153          <div class="actions">
 154              <p class="button-container">{{{ data.actions }}}</p>
 155          </div>
 156      </div>
 157  </script>
 158  
 159  <?php
 160  include ( ABSPATH . 'wp-admin/admin-footer.php' );


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7