2355 | | if ( function_exists( 'wp_is_site_protected_by_basic_auth' ) ) { |
2356 | | if ( ! wp_is_site_protected_by_basic_auth() ) { |
2357 | | $tests['async']['authorization_header'] = array( |
2358 | | 'label' => __( 'Authorization header' ), |
2359 | | 'test' => rest_url( 'wp-site-health/v1/tests/authorization-header' ), |
2360 | | 'has_rest' => true, |
2361 | | 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:pwd' ) ), |
2362 | | 'skip_cron' => true, |
2363 | | ); |
2364 | | } |
2365 | | } |
2366 | | |
2367 | | // Conditionally include REST rules if the function for it exists. |
2368 | | if ( function_exists( 'rest_url' ) ) { |
2369 | | $tests['direct']['rest_availability'] = array( |
2370 | | 'label' => __( 'REST API availability' ), |
2371 | | 'test' => 'rest_availability', |
| 2360 | if ( ! wp_is_site_protected_by_basic_auth() ) { |
| 2361 | $tests['async']['authorization_header'] = array( |
| 2362 | 'label' => __( 'Authorization header' ), |
| 2363 | 'test' => rest_url( 'wp-site-health/v1/tests/authorization-header' ), |
| 2364 | 'has_rest' => true, |
| 2365 | 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:pwd' ) ), |