PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | webp/class-wpo-webp-task-manager.php +4 -14 4.6.1 → 4.7.0 View file →
@@ -139,9 +139,10 @@
139 139 }
140 140
141 141 $destination = WPO_WebP_Utils::get_destination_path($source);
142 142 if (file_exists($destination)) {
143 - $this->backfill_webp_conversion_meta($post->ID);
143 + // A way of backfilling already webp converted images
144 + update_post_meta($post->ID, WPO_Webp_Convert_Image_Task::WEBP_CONVERSION_META_KEY, true);
144 145 continue;
145 146 }
146 147
147 148 $filtered_post_ids[] = array(
@@ -156,19 +157,8 @@
156 157 return $filtered_post_ids;
157 158 }
158 159
159 160 /**
160 - * Backfill the webp conversion meta for attachments that already have
161 - * a WebP file present at the destination path.
162 - *
163 - * @param int $post_id The attachment post ID.
164 - * @return void
165 - */
166 - private function backfill_webp_conversion_meta($post_id): void {
167 - update_post_meta($post_id, '_wpo-webp-conversion-complete', true);
168 - }
169 -
170 - /**
171 161 * Meta query array for getting compressed images not yet converted to WebP
172 162 *
173 163 * @return array<int|string, array<int|string, array<string, string>|string>|string>
174 164 */
@@ -182,14 +172,14 @@
182 172 ),
183 173 array(
184 174 'relation' => 'OR',
185 175 array(
186 - 'key' => '_wpo-webp-conversion-complete',
176 + 'key' => WPO_Webp_Convert_Image_Task::WEBP_CONVERSION_META_KEY,
187 177 'compare' => 'NOT EXISTS',
188 178 'value' => '',
189 179 ),
190 180 array(
191 - 'key' => '_wpo-webp-conversion-complete',
181 + 'key' => WPO_Webp_Convert_Image_Task::WEBP_CONVERSION_META_KEY,
192 182 'compare' => '!=',
193 183 'value' => '1',
194 184 )
195 185 )