Make WordPress Core


Ignore:
Timestamp:
02/01/2020 12:37:14 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Site Health: Rename WP_Site_Health::initialize() introduced in [47063] to ::get_instance(), for clarity and consistency with other core classes.

Use WP_Site_Health::get_instance() where it's needed, instead of creating multiple instances of the class.

Props afercia, xkon, Clorith, SergeyBiryukov.
See #47606.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r47122 r47149  
    51235123    }
    51245124
    5125     $site_health = new WP_Site_Health();
     5125    $site_health = WP_Site_Health::get_instance();
    51265126    wp_send_json_success( $site_health->get_test_dotorg_communication() );
    51275127}
     
    51435143    }
    51445144
    5145     $site_health = new WP_Site_Health();
     5145    $site_health = WP_Site_Health::get_instance();
    51465146    wp_send_json_success( $site_health->get_test_is_in_debug_mode() );
    51475147}
     
    51635163    }
    51645164
    5165     $site_health = new WP_Site_Health();
     5165    $site_health = WP_Site_Health::get_instance();
    51665166    wp_send_json_success( $site_health->get_test_background_updates() );
    51675167}
     
    51845184    }
    51855185
    5186     $site_health = new WP_Site_Health();
     5186    $site_health = WP_Site_Health::get_instance();
    51875187    wp_send_json_success( $site_health->get_test_loopback_requests() );
    51885188}
Note: See TracChangeset for help on using the changeset viewer.