wp-media / imagify-plugin

Speed up your website with lighter images without losing quality.
https://imagify.io
73 stars 27 forks source link

Fixes #815 Skip image deletion if returned path value is false #819

Closed remyperona closed 9 months ago

remyperona commented 9 months ago

Description

Skip next-gen image deletion if main image is already WebP/AVIF, as no conversion happened.

Fixes #815

Technical documentation

Since the method returning the path for next-gen returns false if the image is already webp/avif, we can use that to bail-out early and only send the $path to delete_file() if it's actually a path.

Type of change

Checklists

Feature validation

Code style