diff --git src/wp-admin/includes/class-wp-site-health.php src/wp-admin/includes/class-wp-site-health.php
index 85420f4b8d..aeafa85e6b 100644
|
|
class WP_Site_Health { |
87 | 87 | unset( $tests['direct']['https_status'] ); |
88 | 88 | } |
89 | 89 | foreach ( $tests['direct'] as $test ) { |
90 | | $test_function = sprintf( |
91 | | 'get_test_%s', |
92 | | $test['test'] |
93 | | ); |
| 90 | if ( is_string( $test['test'] ) ) { |
| 91 | $test_function = sprintf( |
| 92 | 'get_test_%s', |
| 93 | $test['test'] |
| 94 | ); |
94 | 95 | |
95 | | if ( method_exists( $this, $test_function ) && is_callable( array( $this, $test_function ) ) ) { |
96 | | $health_check_js_variables['site_status']['direct'][] = call_user_func( array( $this, $test_function ) ); |
97 | | } else { |
| 96 | if ( method_exists( $this, $test_function ) && is_callable( array( $this, $test_function ) ) ) { |
| 97 | $health_check_js_variables['site_status']['direct'][] = call_user_func( array( $this, $test_function ) ); |
| 98 | continue; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | if ( is_callable( $test['test'] ) ) { |
98 | 103 | $health_check_js_variables['site_status']['direct'][] = call_user_func( $test['test'] ); |
99 | 104 | } |
100 | 105 | } |
101 | 106 | |
102 | 107 | foreach ( $tests['async'] as $test ) { |
103 | | $health_check_js_variables['site_status']['async'][] = array( |
104 | | 'test' => $test['test'], |
105 | | 'completed' => false, |
106 | | ); |
| 108 | if ( is_string( $test['test'] ) ) { |
| 109 | $health_check_js_variables['site_status']['async'][] = array( |
| 110 | 'test' => $test['test'], |
| 111 | 'completed' => false, |
| 112 | ); |
| 113 | } |
107 | 114 | } |
108 | 115 | } |
109 | 116 | |
… |
… |
class WP_Site_Health { |
1783 | 1790 | * to avoid any collisions between tests. |
1784 | 1791 | * |
1785 | 1792 | * @type string $label A friendly label for your test to identify it by. |
1786 | | * @type string $test The ajax action to be called to perform the tests. |
| 1793 | * @type mixed $test A callable to perform a direct test. A string ajax action to be called to perform an async test. |
1787 | 1794 | * } |
1788 | 1795 | * } |
1789 | 1796 | */ |