wp-media / imagify-plugin

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

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

Closed Tabrisrp closed 3 months ago

Tabrisrp commented 3 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