Make WordPress Core


Ignore:
Timestamp:
10/15/2020 01:58:28 AM (4 years ago)
Author:
TimothyBlynJacobs
Message:

Site Health, REST API: Move async tests to REST API endpoints.

This provides more flexibility when writing tests and benefits from running in a front-end context which is necessary for some tests like checking that updates are supported. Additionally, this provides a more robust interface for developers who want to integrate with Site Health tests.

Because the wp/v2 endpoint is reserved for modeling core entities, site health is registered in its own wp-site-health/v1 namespace.

The existing ajax actions have been maintained for backward compatibility.

Props Clorith, chrisvanpatten, afragen, pokhriyal, TimothyBlynJacobs.
Fixes #48105.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r49109 r49154  
    133133            '/wp/v2/plugins/(?P<plugin>[^.\/]+(?:\/[^.\/]+)?)',
    134134            '/wp/v2/block-directory/search',
     135            '/wp-site-health/v1',
     136            '/wp-site-health/v1/tests/background-updates',
     137            '/wp-site-health/v1/tests/loopback-requests',
     138            '/wp-site-health/v1/tests/dotorg-communication',
     139            '/wp-site-health/v1/directory-sizes',
    135140        );
    136141
     
    142147            '/' === $route ||
    143148            preg_match( '#^/oembed/1\.0(/.+)?$#', $route ) ||
    144             preg_match( '#^/wp/v2(/.+)?$#', $route )
     149            preg_match( '#^/wp/v2(/.+)?$#', $route ) ||
     150            preg_match( '#^/wp-site-health/v1(/.+)?$#', $route )
    145151        );
    146152    }
Note: See TracChangeset for help on using the changeset viewer.