From ac2f1bc1db6337b91a5edcb21c2472a262a5eb1f Mon Sep 17 00:00:00 2001 From: COQUARD Cyrille Date: Wed, 25 Oct 2023 10:58:11 +0200 Subject: [PATCH] Fixed phpcs --- classes/Optimization/Process/AbstractProcess.php | 4 ++-- inc/classes/class-imagify.php | 2 +- inc/functions/admin-ui.php | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/classes/Optimization/Process/AbstractProcess.php b/classes/Optimization/Process/AbstractProcess.php index 3ff8a0355..0aab78cce 100644 --- a/classes/Optimization/Process/AbstractProcess.php +++ b/classes/Optimization/Process/AbstractProcess.php @@ -1757,8 +1757,8 @@ public function update_size_optimization_data( $response, $size, $level ) { // Size data. $data['success'] = true; - if(property_exists($response, 'message')) { - $data['message'] = imagify_translate_api_message($response->message); + if ( property_exists( $response, 'message' ) ) { + $data['message'] = imagify_translate_api_message( $response->message ); } $data['original_size'] = $response->original_size; $data['optimized_size'] = $response->new_size; diff --git a/inc/classes/class-imagify.php b/inc/classes/class-imagify.php index 191669193..b7d7669dd 100644 --- a/inc/classes/class-imagify.php +++ b/inc/classes/class-imagify.php @@ -443,7 +443,7 @@ private function curl_http_call( $url, $args = [] ) { * @param string $url URL from the call. * @param array $args Arguments from the call. */ - $response = apply_filters('pre_imagify_request', null, $url, $args); + $response = apply_filters( 'pre_imagify_request', null, $url, $args ); if ( $response ) { return $response; diff --git a/inc/functions/admin-ui.php b/inc/functions/admin-ui.php index ed7ebf5dc..f729255d8 100644 --- a/inc/functions/admin-ui.php +++ b/inc/functions/admin-ui.php @@ -42,6 +42,7 @@ function get_imagify_attachment_optimization_text( $process ) { } $data = $process->get_data(); + $optimized_data = $data->get_optimization_data(); $attachment_id = $media->get_id(); $optimization_level = imagify_get_optimization_level_label( $data->get_optimization_level() ); @@ -49,8 +50,8 @@ function get_imagify_attachment_optimization_text( $process ) { $output .= $output_before . '' . __( 'New Filesize:', 'imagify' ) . ' ' . $data->get_optimized_size() . '' . $output_after; } - if ( key_exists('message', $data) ) { - $output .= $output_before . '' . $data['message'] . '' . $output_after; + if ( key_exists( 'message', $optimized_data ) ) { + $output .= $output_before . '' . __( 'Convert:', 'imagify' ) . ' ' . $optimized_data['message'] . '' . $output_after; } $chart = '';