Edit File by line
/home/barbar84/www/wp-admin
File: site-health-info.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
/** WordPress Administration Bootstrap */
[8] Fix | Delete
require_once __DIR__ . '/admin.php';
[9] Fix | Delete
[10] Fix | Delete
$title = __( 'Site Health Info' );
[11] Fix | Delete
[12] Fix | Delete
if ( ! current_user_can( 'view_site_health_checks' ) ) {
[13] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to access the debug data.' ), '', 403 );
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
wp_enqueue_style( 'site-health' );
[17] Fix | Delete
wp_enqueue_script( 'site-health' );
[18] Fix | Delete
[19] Fix | Delete
if ( ! class_exists( 'WP_Debug_Data' ) ) {
[20] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php';
[21] Fix | Delete
}
[22] Fix | Delete
if ( ! class_exists( 'WP_Site_Health' ) ) {
[23] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
$health_check_site_status = WP_Site_Health::get_instance();
[27] Fix | Delete
[28] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[29] Fix | Delete
?>
[30] Fix | Delete
<div class="health-check-header">
[31] Fix | Delete
<div class="health-check-title-section">
[32] Fix | Delete
<h1>
[33] Fix | Delete
<?php _e( 'Site Health' ); ?>
[34] Fix | Delete
</h1>
[35] Fix | Delete
</div>
[36] Fix | Delete
[37] Fix | Delete
<div class="health-check-title-section site-health-progress-wrapper loading hide-if-no-js">
[38] Fix | Delete
<div class="site-health-progress">
[39] 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">
[40] Fix | Delete
<circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
[41] Fix | Delete
<circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
[42] Fix | Delete
</svg>
[43] Fix | Delete
</div>
[44] Fix | Delete
<div class="site-health-progress-label">
[45] Fix | Delete
<?php _e( 'Results are still loading&hellip;' ); ?>
[46] Fix | Delete
</div>
[47] Fix | Delete
</div>
[48] Fix | Delete
[49] Fix | Delete
<nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
[50] Fix | Delete
<a href="<?php echo esc_url( admin_url( 'site-health.php' ) ); ?>" class="health-check-tab">
[51] Fix | Delete
<?php
[52] Fix | Delete
/* translators: Tab heading for Site Health Status page. */
[53] Fix | Delete
_ex( 'Status', 'Site Health' );
[54] Fix | Delete
?>
[55] Fix | Delete
</a>
[56] Fix | Delete
[57] Fix | Delete
<a href="<?php echo esc_url( admin_url( 'site-health.php?tab=debug' ) ); ?>" class="health-check-tab active" aria-current="true">
[58] Fix | Delete
<?php
[59] Fix | Delete
/* translators: Tab heading for Site Health Info page. */
[60] Fix | Delete
_ex( 'Info', 'Site Health' );
[61] Fix | Delete
?>
[62] Fix | Delete
</a>
[63] Fix | Delete
</nav>
[64] Fix | Delete
</div>
[65] Fix | Delete
[66] Fix | Delete
<hr class="wp-header-end">
[67] Fix | Delete
[68] Fix | Delete
<div class="notice notice-error hide-if-js">
[69] Fix | Delete
<p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
[70] Fix | Delete
</div>
[71] Fix | Delete
[72] Fix | Delete
<div class="health-check-body health-check-debug-tab hide-if-no-js">
[73] Fix | Delete
<?php
[74] Fix | Delete
[75] Fix | Delete
WP_Debug_Data::check_for_updates();
[76] Fix | Delete
[77] Fix | Delete
$info = WP_Debug_Data::debug_data();
[78] Fix | Delete
[79] Fix | Delete
?>
[80] Fix | Delete
[81] Fix | Delete
<h2>
[82] Fix | Delete
<?php _e( 'Site Health Info' ); ?>
[83] Fix | Delete
</h2>
[84] Fix | Delete
[85] Fix | Delete
<p>
[86] Fix | Delete
<?php
[87] Fix | Delete
/* translators: %s: URL to Site Health Status page. */
[88] Fix | Delete
printf( __( 'This page can show you every detail about the configuration of your WordPress website. For any improvements that could be made, see the <a href="%s">Site Health Status</a> page.' ), esc_url( admin_url( 'site-health.php' ) ) );
[89] Fix | Delete
?>
[90] Fix | Delete
</p>
[91] Fix | Delete
<p>
[92] Fix | Delete
<?php _e( 'If you want to export a handy list of all the information on this page, you can use the button below to copy it to the clipboard. You can then paste it in a text file and save it to your device, or paste it in an email exchange with a support engineer or theme/plugin developer for example.' ); ?>
[93] Fix | Delete
</p>
[94] Fix | Delete
[95] Fix | Delete
<div class="site-health-copy-buttons">
[96] Fix | Delete
<div class="copy-button-wrapper">
[97] Fix | Delete
<button type="button" class="button copy-button" data-clipboard-text="<?php echo esc_attr( WP_Debug_Data::format( $info, 'debug' ) ); ?>">
[98] Fix | Delete
<?php _e( 'Copy site info to clipboard' ); ?>
[99] Fix | Delete
</button>
[100] Fix | Delete
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
[101] Fix | Delete
</div>
[102] Fix | Delete
</div>
[103] Fix | Delete
[104] Fix | Delete
<div id="health-check-debug" class="health-check-accordion">
[105] Fix | Delete
[106] Fix | Delete
<?php
[107] Fix | Delete
[108] Fix | Delete
$sizes_fields = array( 'uploads_size', 'themes_size', 'plugins_size', 'wordpress_size', 'database_size', 'total_size' );
[109] Fix | Delete
[110] Fix | Delete
foreach ( $info as $section => $details ) {
[111] Fix | Delete
if ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) {
[112] Fix | Delete
continue;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
?>
[116] Fix | Delete
<h3 class="health-check-accordion-heading">
[117] Fix | Delete
<button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" type="button">
[118] Fix | Delete
<span class="title">
[119] Fix | Delete
<?php echo esc_html( $details['label'] ); ?>
[120] Fix | Delete
<?php
[121] Fix | Delete
[122] Fix | Delete
if ( isset( $details['show_count'] ) && $details['show_count'] ) {
[123] Fix | Delete
printf( '(%d)', count( $details['fields'] ) );
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
?>
[127] Fix | Delete
</span>
[128] Fix | Delete
<?php
[129] Fix | Delete
[130] Fix | Delete
if ( 'wp-paths-sizes' === $section ) {
[131] Fix | Delete
?>
[132] Fix | Delete
<span class="health-check-wp-paths-sizes spinner"></span>
[133] Fix | Delete
<?php
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
?>
[137] Fix | Delete
<span class="icon"></span>
[138] Fix | Delete
</button>
[139] Fix | Delete
</h3>
[140] Fix | Delete
[141] Fix | Delete
<div id="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" class="health-check-accordion-panel" hidden="hidden">
[142] Fix | Delete
<?php
[143] Fix | Delete
[144] Fix | Delete
if ( isset( $details['description'] ) && ! empty( $details['description'] ) ) {
[145] Fix | Delete
printf( '<p>%s</p>', $details['description'] );
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
?>
[149] Fix | Delete
<table class="widefat striped health-check-table" role="presentation">
[150] Fix | Delete
<tbody>
[151] Fix | Delete
<?php
[152] Fix | Delete
[153] Fix | Delete
foreach ( $details['fields'] as $field_name => $field ) {
[154] Fix | Delete
if ( is_array( $field['value'] ) ) {
[155] Fix | Delete
$values = '<ul>';
[156] Fix | Delete
[157] Fix | Delete
foreach ( $field['value'] as $name => $value ) {
[158] Fix | Delete
$values .= sprintf( '<li>%s: %s</li>', esc_html( $name ), esc_html( $value ) );
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
$values .= '</ul>';
[162] Fix | Delete
} else {
[163] Fix | Delete
$values = esc_html( $field['value'] );
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
if ( in_array( $field_name, $sizes_fields, true ) ) {
[167] Fix | Delete
printf( '<tr><td>%s</td><td class="%s">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values );
[168] Fix | Delete
} else {
[169] Fix | Delete
printf( '<tr><td>%s</td><td>%s</td></tr>', esc_html( $field['label'] ), $values );
[170] Fix | Delete
}
[171] Fix | Delete
}
[172] Fix | Delete
[173] Fix | Delete
?>
[174] Fix | Delete
</tbody>
[175] Fix | Delete
</table>
[176] Fix | Delete
</div>
[177] Fix | Delete
<?php } ?>
[178] Fix | Delete
</div>
[179] Fix | Delete
</div>
[180] Fix | Delete
[181] Fix | Delete
<?php
[182] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[183] Fix | Delete
[184] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function