Closed Mai-Saad closed 8 months ago
If I may add more details about this,
The reason is because here within WordPress when an image is too big (dimensions) it gets resized and gets added -scaled
in the name.
However, in Imagify, we create a backup for the non -scaled
version while WordPress use the -scaled
in the database and therefore, use it as a main source for this image.
So when the function https://github.com/wp-media/imagify-plugin/blob/2d98bbc79c1b633311334d084b8de0674353e5e8/classes/Bulk/WP.php#L181 tries to get the medias without webp, it returns something like : https://github.com/wp-media/imagify-plugin/blob/2d98bbc79c1b633311334d084b8de0674353e5e8/classes/Bulk/WP.php#L220-L226
And as the image with -scaled
in the database does not have a backup file as we did a backup of the non--scaled
version. So it lands into the 'error' => 'no_backup'
section. Therefore, it is not counted nor optimized.
It may be fixed by https://github.com/wp-media/imagify-plugin/pull/811 tho as within this PR we add the generation of the -scaled
version of the backup.
This should be fixed by https://github.com/wp-media/imagify-plugin/pull/820
The following scenario fixed on 2.2.0.1: 1- activate imagify 2- upload small and large images => webP created 3- enable avif => generating is 0/2 on clean site
or
1- activate imagify 2- enable avif 3- upload small and large images => avif created 4- dsiable avif => generating 0/2 is displayed in settings
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug We arenot considering large images for missing webp/next gen count
To Reproduce Steps to reproduce the behavior:
Expected behavior number of images missing webP = number of images having generate webp link in media library page
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming