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