Make WordPress Core

Ticket #52642: 52642.diff

File 52642.diff, 1.9 KB (added by SergeyBiryukov, 4 years ago)
  • src/wp-admin/includes/class-wp-site-health.php

     
    23102310                                        'label' => __( 'HTTP Requests' ),
    23112311                                        'test'  => 'http_requests',
    23122312                                ),
     2313                                'rest_availability'         => array(
     2314                                        'label'     => __( 'REST API availability' ),
     2315                                        'test'      => 'rest_availability',
     2316                                        'skip_cron' => true,
     2317                                ),
    23132318                                'debug_enabled'             => array(
    23142319                                        'label' => __( 'Debugging enabled' ),
    23152320                                        'test'  => 'is_in_debug_mode',
     
    23522357                );
    23532358
    23542359                // Conditionally include Authorization header test if the site isn't protected by Basic Auth.
    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' ) ),
    23722366                                'skip_cron' => true,
    23732367                        );
    23742368                }