get_test_background_updates example



    /** * Checks if background updates work as expected. * * @since 5.6.0 * * @return array */
    public function test_background_updates() {
        $this->load_admin_textdomain();
        return $this->site_health->get_test_background_updates();
    }

    /** * Checks that the site can reach the WordPress.org API. * * @since 5.6.0 * * @return array */
    public function test_dotorg_communication() {
        $this->load_admin_textdomain();
        
check_ajax_referer( 'health-check-site-status' );

    if ( ! current_user_can( 'view_site_health_checks' ) ) {
        wp_send_json_error();
    }

    if ( ! class_exists( 'WP_Site_Health' ) ) {
        require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
    }

    $site_health = WP_Site_Health::get_instance();
    wp_send_json_success( $site_health->get_test_background_updates() );
}

/** * Handles site health checks on loopback requests via AJAX. * * @since 5.2.0 * @deprecated 5.6.0 Use WP_REST_Site_Health_Controller::test_loopback_requests() * @see WP_REST_Site_Health_Controller::test_loopback_requests() */
function wp_ajax_health_check_loopback_requests() {
    _doing_it_wrong(
        
Home | Imprint | This part of the site doesn't use cookies.