Skip to content

Commit

Permalink
Fixed code standards
Browse files Browse the repository at this point in the history
  • Loading branch information
CrochetFeve0251 committed Nov 10, 2023
1 parent 28bd518 commit 8d542fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions classes/Optimization/Process/AbstractProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion inc/functions/admin-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . '<span class="data">' . __( 'WebP generated:', 'imagify' ) . '</span> <strong class="big">' . esc_html( $has_webp ) . '</strong>' . $output_after;
Expand Down

0 comments on commit 8d542fe

Please sign in to comment.