From 8d542fe50923037f6ec0f862e19b249bec3f2fdf Mon Sep 17 00:00:00 2001 From: COQUARD Cyrille Date: Fri, 10 Nov 2023 12:00:50 +0100 Subject: [PATCH] Fixed code standards --- classes/Optimization/Process/AbstractProcess.php | 10 +++++----- inc/functions/admin-ui.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/Optimization/Process/AbstractProcess.php b/classes/Optimization/Process/AbstractProcess.php index adce73630..bec0948df 100644 --- a/classes/Optimization/Process/AbstractProcess.php +++ b/classes/Optimization/Process/AbstractProcess.php @@ -1561,13 +1561,13 @@ public function is_full_webp() { return false; } - $keys = array_keys($sizes); - $non_webp_keys = array_values(array_filter($keys, function ($key) { - return strpos($key, static::WEBP_SUFFIX) === false; + $keys = array_keys( $sizes ); + $non_webp_keys = array_values(array_filter($keys, function ( $key ) { + return strpos( $key, static::WEBP_SUFFIX ) === false; })); - return array_reduce($non_webp_keys, function ($is_fully, $key) use ($sizes) { - return key_exists($key. self::WEBP_SUFFIX, $sizes) && $is_fully; + return array_reduce($non_webp_keys, function ( $is_fully, $key ) use ( $sizes ) { + return key_exists( $key . self::WEBP_SUFFIX, $sizes ) && $is_fully; }, true); } diff --git a/inc/functions/admin-ui.php b/inc/functions/admin-ui.php index 9d986dca7..372d3f5a0 100644 --- a/inc/functions/admin-ui.php +++ b/inc/functions/admin-ui.php @@ -96,7 +96,7 @@ function get_imagify_attachment_optimization_text( $process ) { if ( $media->is_image() ) { $has_webp = $process->has_webp() ? __( 'Yes', 'imagify' ) : __( 'No', 'imagify' ); - if( $process->has_webp() ) { + if ( $process->has_webp() ) { $has_webp = $process->is_full_webp() ? __( 'Yes', 'imagify' ) : __( 'Partially', 'imagify' ); } $output .= $output_before . '' . __( 'WebP generated:', 'imagify' ) . ' ' . esc_html( $has_webp ) . '' . $output_after;