| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * WP Site Health functionality temporarily stored in this file until all of Jetpack is PHP 5.3+ |
| 4 | 4 | * |
| 5 | - * @package automattic/jetpack | |
| 5 | + * @package Jetpack. | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | use Automattic\Jetpack\Sync\Modules; |
| 9 | 9 | /** |
| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | * @type string $action HTML to a link to resolve issue. |
| 52 | 52 | * @type string $test Unique test identifier. |
| 53 | 53 | * } |
| 54 | 54 | */ |
| 55 | - 'test' => function () use ( $test, $cxn_tests ) { | |
| 55 | + 'test' => function() use ( $test, $cxn_tests ) { | |
| 56 | 56 | $results = $cxn_tests->run_test( $test['name'] ); |
| 57 | 57 | if ( is_wp_error( $results ) ) { |
| 58 | 58 | return; |
| 59 | 59 | } |
| @@ -123,20 +123,20 @@ | ||
| 123 | 123 | * |
| 124 | 124 | * @param string $hook The current admin page hook. |
| 125 | 125 | */ |
| 126 | 126 | function jetpack_debugger_enqueue_site_health_scripts( $hook ) { |
| 127 | - if ( 'site-health.php' === $hook ) { | |
| 128 | - $full_sync_module = Modules::get_module( 'full-sync' ); | |
| 129 | - $progress_percent = $full_sync_module ? $full_sync_module->get_sync_progress_percentage() : false; | |
| 127 | + $full_sync_module = Modules::get_module( 'full-sync' ); | |
| 128 | + $progress_percent = $full_sync_module ? $full_sync_module->get_sync_progress_percentage() : false; | |
| 130 | 129 | |
| 131 | - $ajax_nonce = wp_create_nonce( 'jetpack-site-health' ); | |
| 130 | + $ajax_nonce = wp_create_nonce( 'jetpack-site-health' ); | |
| 132 | 131 | |
| 132 | + if ( 'site-health.php' === $hook ) { | |
| 133 | 133 | $wp_scripts = wp_scripts(); |
| 134 | 134 | wp_enqueue_script( 'jquery-ui-progressbar' ); |
| 135 | 135 | wp_enqueue_script( |
| 136 | 136 | 'jetpack_debug_site_health_script', |
| 137 | 137 | plugins_url( 'jetpack-debugger-site-health.js', __FILE__ ), |
| 138 | - array( 'jquery', 'jquery-ui-progressbar' ), | |
| 138 | + array( 'jquery-ui-progressbar' ), | |
| 139 | 139 | JETPACK__VERSION, |
| 140 | 140 | false |
| 141 | 141 | ); |
| 142 | 142 | wp_enqueue_style( |
| @@ -176,9 +176,9 @@ | ||
| 176 | 176 | if ( ! $progress_percent ) { |
| 177 | 177 | echo 'done'; |
| 178 | 178 | wp_die(); |
| 179 | 179 | } |
| 180 | - echo (int) $progress_percent; | |
| 180 | + echo intval( $progress_percent ); | |
| 181 | 181 | wp_die(); |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |