author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
9 | 1 |
<?php |
2 |
/** |
|
3 |
* Tools Administration Screen. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
18 | 9 |
if ( ! defined( 'ABSPATH' ) ) { |
10 |
die(); |
|
9 | 11 |
} |
12 |
||
13 |
if ( ! class_exists( 'WP_Debug_Data' ) ) { |
|
16 | 14 |
require_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php'; |
9 | 15 |
} |
16 |
if ( ! class_exists( 'WP_Site_Health' ) ) { |
|
16 | 17 |
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; |
9 | 18 |
} |
19 |
||
16 | 20 |
$health_check_site_status = WP_Site_Health::get_instance(); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
21 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
22 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
23 |
__( 'The Site Health check requires JavaScript.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
24 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
25 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
26 |
'additional_classes' => array( 'hide-if-js' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
27 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
28 |
); |
9 | 29 |
?> |
30 |
||
31 |
<div class="health-check-body health-check-debug-tab hide-if-no-js"> |
|
32 |
<?php |
|
33 |
||
34 |
WP_Debug_Data::check_for_updates(); |
|
35 |
||
36 |
$info = WP_Debug_Data::debug_data(); |
|
37 |
||
38 |
?> |
|
39 |
||
40 |
<h2> |
|
41 |
<?php _e( 'Site Health Info' ); ?> |
|
42 |
</h2> |
|
43 |
||
44 |
<p> |
|
16 | 45 |
<?php |
46 |
/* translators: %s: URL to Site Health Status page. */ |
|
47 |
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' ) ) ); |
|
48 |
?> |
|
9 | 49 |
</p> |
50 |
<p> |
|
16 | 51 |
<?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.' ); ?> |
9 | 52 |
</p> |
53 |
||
54 |
<div class="site-health-copy-buttons"> |
|
55 |
<div class="copy-button-wrapper"> |
|
56 |
<button type="button" class="button copy-button" data-clipboard-text="<?php echo esc_attr( WP_Debug_Data::format( $info, 'debug' ) ); ?>"> |
|
57 |
<?php _e( 'Copy site info to clipboard' ); ?> |
|
58 |
</button> |
|
16 | 59 |
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> |
9 | 60 |
</div> |
61 |
</div> |
|
62 |
||
63 |
<div id="health-check-debug" class="health-check-accordion"> |
|
64 |
||
65 |
<?php |
|
66 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
67 |
$sizes_fields = array( 'uploads_size', 'themes_size', 'plugins_size', 'fonts_size', 'wordpress_size', 'database_size', 'total_size' ); |
9 | 68 |
|
69 |
foreach ( $info as $section => $details ) { |
|
70 |
if ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) { |
|
71 |
continue; |
|
72 |
} |
|
73 |
||
74 |
?> |
|
75 |
<h3 class="health-check-accordion-heading"> |
|
76 |
<button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" type="button"> |
|
77 |
<span class="title"> |
|
78 |
<?php echo esc_html( $details['label'] ); ?> |
|
79 |
<?php |
|
80 |
||
81 |
if ( isset( $details['show_count'] ) && $details['show_count'] ) { |
|
19 | 82 |
printf( |
83 |
'(%s)', |
|
84 |
number_format_i18n( count( $details['fields'] ) ) |
|
85 |
); |
|
9 | 86 |
} |
87 |
||
88 |
?> |
|
89 |
</span> |
|
90 |
<?php |
|
91 |
||
92 |
if ( 'wp-paths-sizes' === $section ) { |
|
93 |
?> |
|
94 |
<span class="health-check-wp-paths-sizes spinner"></span> |
|
95 |
<?php |
|
96 |
} |
|
97 |
||
98 |
?> |
|
99 |
<span class="icon"></span> |
|
100 |
</button> |
|
101 |
</h3> |
|
102 |
||
103 |
<div id="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" class="health-check-accordion-panel" hidden="hidden"> |
|
104 |
<?php |
|
105 |
||
106 |
if ( isset( $details['description'] ) && ! empty( $details['description'] ) ) { |
|
107 |
printf( '<p>%s</p>', $details['description'] ); |
|
108 |
} |
|
109 |
||
110 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
111 |
<table class="widefat striped health-check-table"> |
9 | 112 |
<tbody> |
113 |
<?php |
|
114 |
||
115 |
foreach ( $details['fields'] as $field_name => $field ) { |
|
116 |
if ( is_array( $field['value'] ) ) { |
|
117 |
$values = '<ul>'; |
|
118 |
||
119 |
foreach ( $field['value'] as $name => $value ) { |
|
120 |
$values .= sprintf( '<li>%s: %s</li>', esc_html( $name ), esc_html( $value ) ); |
|
121 |
} |
|
122 |
||
123 |
$values .= '</ul>'; |
|
124 |
} else { |
|
125 |
$values = esc_html( $field['value'] ); |
|
126 |
} |
|
127 |
||
128 |
if ( in_array( $field_name, $sizes_fields, true ) ) { |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
129 |
printf( '<tr><th scope="row">%s</th><td class="%s">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values ); |
9 | 130 |
} else { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
131 |
printf( '<tr><th scope="row">%s</th><td>%s</td></tr>', esc_html( $field['label'] ), $values ); |
9 | 132 |
} |
133 |
} |
|
134 |
||
135 |
?> |
|
136 |
</tbody> |
|
137 |
</table> |
|
138 |
</div> |
|
139 |
<?php } ?> |
|
140 |
</div> |
|
141 |
</div> |