PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
← All changes | classes/Bulk/CustomFolders.php +11 -1 2.3.1 → trunk View file →
@@ -185,10 +185,20 @@
185 185 WHERE
186 186 fi.mime_type IN ( $mime_types )
187 187 AND ( fi.status = 'success' OR fi.status = 'already_optimized' )
188 188 AND fi.data NOT LIKE %s
189 + AND fi.data NOT LIKE %s
189 190 ORDER BY fi.file_id DESC",
190 - '%' . $wpdb->esc_like( $nextgen_suffix . '";a:4:{s:7:"success";b:1;' ) . '%'
191 + '%' . $wpdb->esc_like( $nextgen_suffix . '";a:4:{s:7:"success";b:1;' ) . '%',
192 + /**
193 + * Second predicate: skip files the API permanently refused to convert (the next-gen file
194 + * would be heavier than the original, or the file is already compressed). Those are stored
195 + * as `<size><suffix>";a:3:{s:15:"permanent_error";b:1;s:7:"success";b:0;s:5:"error";…`.
196 + * Transient failures serialize as a 2-element array without the `permanent_error` key, so
197 + * they keep being retried. Matching serialized data with LIKE is fragile: the key order
198 + * written in Optimization\Data\CustomFolders must not change.
199 + */
200 + '%' . $wpdb->esc_like( $nextgen_suffix . '";a:3:{s:15:"permanent_error";b:1;' ) . '%'
191 201 )
192 202 );
193 203
194 204 $wpdb->flush();