| @@ -7,9 +7,9 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | namespace ElasticPress\Command; |
| 10 | 10 | |
| 11 | -use \WP_CLI; | |
| 11 | +use WP_CLI; | |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | 14 | exit; // Exit if accessed directly. |
| 15 | 15 | } |
| @@ -61,9 +61,9 @@ | ||
| 61 | 61 | * @return float Time spent so far |
| 62 | 62 | */ |
| 63 | 63 | public static function timer_stop( $precision = 3 ) { |
| 64 | 64 | $diff = microtime( true ) - self::$time_start; |
| 65 | - return (float) number_format( (float) $diff, $precision ); | |
| 65 | + return (float) number_format( (float) $diff, $precision, '.', '' ); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Starts the timer. |
| @@ -157,23 +157,21 @@ | ||
| 157 | 157 | * so that the value from the local memory is discarded. |
| 158 | 158 | */ |
| 159 | 159 | $should_interrupt_sync = wp_cache_get( $transient, 'transient', true ); |
| 160 | 160 | } else { |
| 161 | - $options = $wpdb->options; | |
| 162 | - | |
| 161 | + // phpcs:disable WordPress.DB.DirectDatabaseQuery | |
| 163 | 162 | $should_interrupt_sync = $wpdb->get_var( |
| 164 | - // phpcs:disable | |
| 165 | 163 | $wpdb->prepare( |
| 166 | 164 | " |
| 167 | 165 | SELECT option_value |
| 168 | - FROM $options | |
| 166 | + FROM $wpdb->options | |
| 169 | 167 | WHERE option_name = %s |
| 170 | 168 | LIMIT 1 |
| 171 | 169 | ", |
| 172 | 170 | "_transient_{$transient}" |
| 173 | 171 | ) |
| 174 | - // phpcs:enable | |
| 175 | 172 | ); |
| 173 | + // phpcs:enable WordPress.DB.DirectDatabaseQuery | |
| 176 | 174 | } |
| 177 | 175 | |
| 178 | 176 | return $should_interrupt_sync ? (bool) $should_interrupt_sync : null; |
| 179 | 177 | } |