| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * WP Site Health debugging functions. |
| 4 | 4 | * |
| 5 | + * @deprecated 15.9 Site Health integration is now handled by the connection package. | |
| 5 | 6 | * @package automattic/jetpack |
| 6 | 7 | */ |
| 7 | 8 | |
| 8 | 9 | /** |
| @@ -8,21 +9,26 @@ | ||
| 8 | 9 | /** |
| 9 | 10 | * Test runner for Core's Site Health module. |
| 10 | 11 | * |
| 11 | 12 | * @since 7.3.0 |
| 13 | + * @deprecated 15.9 Use Automattic\Jetpack\Connection\Site_Health instead. | |
| 12 | 14 | */ |
| 13 | 15 | function jetpack_debugger_ajax_local_testing_suite() { |
| 16 | + _deprecated_function( __FUNCTION__, 'jetpack-15.9' ); | |
| 14 | 17 | check_ajax_referer( 'health-check-site-status' ); |
| 15 | 18 | if ( ! current_user_can( 'jetpack_manage_modules' ) ) { |
| 16 | - wp_send_json_error(); | |
| 19 | + // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- It takes null, but its phpdoc only says int. | |
| 20 | + wp_send_json_error( null, null, JSON_UNESCAPED_SLASHES ); | |
| 17 | 21 | } |
| 18 | - $tests = new Jetpack_Cxn_Tests(); | |
| 19 | - wp_send_json_success( $tests->output_results_for_core_async_site_health() ); | |
| 22 | + $tests = new Automattic\Jetpack\Connection\Connection_Health_Tests(); | |
| 23 | + // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- It takes null, but its phpdoc only says int. | |
| 24 | + wp_send_json_success( $tests->output_results_for_core_async_site_health(), null, JSON_UNESCAPED_SLASHES ); | |
| 20 | 25 | } |
| 21 | 26 | /** |
| 22 | 27 | * Adds the Jetpack Local Testing Suite to the Core Site Health system. |
| 23 | 28 | * |
| 24 | 29 | * @since 7.3.0 |
| 30 | + * @deprecated 15.9 Use Automattic\Jetpack\Connection\Site_Health instead. | |
| 25 | 31 | * |
| 26 | 32 | * @param array $core_tests Array of tests from Core's Site Health. |
| 27 | 33 | * |
| 28 | 34 | * @return array $core_tests Array of tests for Core's Site Health. |
| @@ -27,9 +33,10 @@ | ||
| 27 | 33 | * |
| 28 | 34 | * @return array $core_tests Array of tests for Core's Site Health. |
| 29 | 35 | */ |
| 30 | 36 | function jetpack_debugger_site_status_tests( $core_tests ) { |
| 31 | - $cxn_tests = new Jetpack_Cxn_Tests(); | |
| 37 | + _deprecated_function( __FUNCTION__, 'jetpack-15.9' ); | |
| 38 | + $cxn_tests = new Automattic\Jetpack\Connection\Connection_Health_Tests(); | |
| 32 | 39 | $tests = $cxn_tests->list_tests( 'direct' ); |
| 33 | 40 | foreach ( $tests as $test ) { |
| 34 | 41 | |
| 35 | 42 | $core_tests['direct'][ $test['name'] ] = array( |
| @@ -36,10 +43,10 @@ | ||
| 36 | 43 | 'label' => __( 'Jetpack: ', 'jetpack' ) . $test['name'], |
| 37 | 44 | /** |
| 38 | 45 | * Callable for Core's Site Health system to execute. |
| 39 | 46 | * |
| 40 | - * @param array $test A Jetpack Testing Suite test array. | |
| 41 | - * @param Jetpack_Cxn_Tests $cxn_tests An instance of the Jetpack Test Suite. | |
| 47 | + * @var array $test A Jetpack Testing Suite test array. | |
| 48 | + * @var Automattic\Jetpack\Connection\Connection_Health_Tests $cxn_tests An instance of the connection test suite. | |
| 42 | 49 | * |
| 43 | 50 | * @return array { |
| 44 | 51 | * A results array to match the format expected by WordPress Core. |
| 45 | 52 | * |