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
[x] Bug fix (non-breaking change which fixes an issue).
Checklists
Feature validation
[x] I validated all the Acceptance Criteria. If possible, provide sreenshots or videos.
[x] I triggered all changed lines of code at least once without new errors/warnings/notices.
Code style
[x] I wrote self-explanatory code about what it does.
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
todelete_file()
if it's actually a path.Type of change
Checklists
Feature validation
Code style