Skip to content

Commit

Permalink
:feat: Fixed undefined array key for image without webp version
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Mar 18, 2024
1 parent 855858d commit 96717a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/Optimization/Data/AbstractData.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ public function get_optimized_size( $human_format = true, $decimals = 2, $use_ne
if ( $use_nextgen ) {
/**Checking for success status before size, some cases the response is false
* because the image is already compressed, or we have a connection timed out
*/
$size = $data['sizes'][ $nextgen_webp_size_name ]['success'] ?
* */
$size = ! empty( $data['sizes'][ $nextgen_webp_size_name ] ) && $data['sizes'][ $nextgen_webp_size_name ]['success'] ?
(int) $data['sizes'][ $nextgen_webp_size_name ]['optimized_size'] : 0;
if ( ! empty( $data['sizes'][ $nextgen_avif_size_name ]['optimized_size'] ) &&
$data['sizes'][ $nextgen_avif_size_name ] ) {
Expand Down

0 comments on commit 96717a1

Please sign in to comment.