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 | inc/3rd-party/nextgen-gallery/classes/Bulk/NGG.php +11 -1 2.3.1 → trunk View file →
@@ -169,10 +169,20 @@
169 169 ON ( ngg.pid = data.pid )
170 170 WHERE
171 171 ( data.status = 'success' OR data.status = 'already_optimized' )
172 172 AND data.data NOT LIKE %s
173 + AND data.data NOT LIKE %s
173 174 ORDER BY ngg.pid DESC",
174 - '%' . $wpdb->esc_like( $suffix . '";a:4:{s:7:"success";b:1;' ) . '%'
175 + '%' . $wpdb->esc_like( $suffix . '";a:4:{s:7:"success";b:1;' ) . '%',
176 + /**
177 + * Second predicate: skip images the API permanently refused to convert (the next-gen file
178 + * would be heavier than the original, or the file is already compressed). Those are stored
179 + * as `<size><suffix>";a:3:{s:15:"permanent_error";b:1;s:7:"success";b:0;s:5:"error";…`.
180 + * Transient failures serialize as a 2-element array without the `permanent_error` key, so
181 + * they keep being retried. Matching serialized data with LIKE is fragile: the key order
182 + * written in Imagify\NGG\Optimization\Data\NGG must not change.
183 + */
184 + '%' . $wpdb->esc_like( $suffix . '";a:3:{s:15:"permanent_error";b:1;' ) . '%'
175 185 )
176 186 );
177 187
178 188 $wpdb->flush();