wp-media / imagify-plugin

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

Fix data for optimized medias without next-gen versions #820

Closed Tabrisrp closed 3 months ago

Tabrisrp commented 3 months ago

Description

This PR updates the code related to storing and using the data for optimized medias without next-gen versions (depending on option selected, either WebP or AVIF).

Technical documentation

The logic remains the same, but makes use of the new method to get the list of optimized medias without next-gen.

It also removes no longer used methods that were only accounting for WebP.

Type of change

Checklists

Feature validation

Code style

Mai-Saad commented 3 months ago

@Tabrisrp Thanks for the PR. Is there any snippet we can use to control / overwrite next-gen status of image(s) so we can easily validate possible scenarios here?

Tabrisrp commented 3 months ago

I added a method to automatically clear the counter transient when enabling/disabling convert_to_avif

Mai-Saad commented 3 months ago

@Tabrisrp Thanks for the PR.

  1. avif is disabled
  2. upload some images (webP is created)
  3. enable webP using filter
  4. enable avif

note: without step 3, it will work fine