@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function get_item( $request ) { |
238 | 238 | $tools = $this->get_tools(); |
239 | - if ( empty( $tools[ $request['id'] ] ) ) { |
|
239 | + if ( empty( $tools[$request['id']] ) ) { |
|
240 | 240 | return new \WP_Error( 'woocommerce_rest_system_status_tool_invalid_id', __( 'Invalid tool ID.', 'woocommerce' ), array( 'status' => 404 ) ); |
241 | 241 | } |
242 | - $tool = $tools[ $request['id'] ]; |
|
242 | + $tool = $tools[$request['id']]; |
|
243 | 243 | return rest_ensure_response( |
244 | 244 | $this->prepare_item_for_response( |
245 | 245 | array( |
@@ -261,11 +261,11 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function update_item( $request ) { |
263 | 263 | $tools = $this->get_tools(); |
264 | - if ( empty( $tools[ $request['id'] ] ) ) { |
|
264 | + if ( empty( $tools[$request['id']] ) ) { |
|
265 | 265 | return new \WP_Error( 'woocommerce_rest_system_status_tool_invalid_id', __( 'Invalid tool ID.', 'woocommerce' ), array( 'status' => 404 ) ); |
266 | 266 | } |
267 | 267 | |
268 | - $tool = $tools[ $request['id'] ]; |
|
268 | + $tool = $tools[$request['id']]; |
|
269 | 269 | $tool = array( |
270 | 270 | 'id' => $request['id'], |
271 | 271 | 'name' => $tool['name'], |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | $tools = $this->get_tools(); |
412 | 412 | |
413 | 413 | try { |
414 | - if ( ! isset( $tools[ $tool ] ) ) { |
|
414 | + if ( ! isset( $tools[$tool] ) ) { |
|
415 | 415 | throw new Exception( __( 'There was an error calling this tool. There is no callback present.', 'woocommerce' ) ); |
416 | 416 | } |
417 | 417 | |
418 | - $callback = isset( $tools[ $tool ]['callback'] ) ? $tools[ $tool ]['callback'] : array( $this, $tool ); |
|
418 | + $callback = isset( $tools[$tool]['callback'] ) ? $tools[$tool]['callback'] : array( $this, $tool ); |
|
419 | 419 | |
420 | 420 | if ( ! is_callable( $callback ) ) { |
421 | 421 | throw new Exception( __( 'There was an error calling this tool. Invalid callback.', 'woocommerce' ) ); |
@@ -572,7 +572,7 @@ |
||
572 | 572 | protected function clear_sessions() { |
573 | 573 | global $wpdb; |
574 | 574 | |
575 | - $wpdb->query( "TRUNCATE {$wpdb->prefix}woocommerce_sessions" ); |
|
575 | + $wpdb->query( "truncate {$wpdb->prefix}woocommerce_sessions" ); |
|
576 | 576 | $result = absint( $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key='_woocommerce_persistent_cart_" . get_current_blog_id() . "';" ) ); // WPCS: unprepared SQL ok. |
577 | 577 | wp_cache_flush(); |
578 | 578 | /* translators: %d: amount of sessions */ |