Changeset 54043 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php
- Timestamp:
- 08/31/2022 10:44:04 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php
r50072 r54043 44 44 * 45 45 * @since 5.6.0 46 * @since 6.1.0 Adds page-cache async test. 46 47 * 47 48 * @see register_rest_route() … … 155 156 return $this->validate_request_permission( 'debug_enabled' ) && ! is_multisite(); 156 157 }, 158 ) 159 ); 160 161 register_rest_route( 162 $this->namespace, 163 sprintf( 164 '/%s/%s', 165 $this->rest_base, 166 'page-cache' 167 ), 168 array( 169 array( 170 'methods' => 'GET', 171 'callback' => array( $this, 'test_page_cache' ), 172 'permission_callback' => function () { 173 return $this->validate_request_permission( 'view_site_health_checks' ); 174 }, 175 ), 157 176 ) 158 177 ); … … 241 260 $this->load_admin_textdomain(); 242 261 return $this->site_health->get_test_authorization_header(); 262 } 263 264 /** 265 * Checks that full page cache is active. 266 * 267 * @since 6.1.0 268 * 269 * @return array The test result. 270 */ 271 public function test_page_cache() { 272 $this->load_admin_textdomain(); 273 return $this->site_health->get_test_page_cache(); 243 274 } 244 275
Note: See TracChangeset
for help on using the changeset viewer.