| @@ -47,8 +47,12 @@ | ||
| 47 | 47 | // Registered unconditionally so orphaned files are removed even if conversion |
| 48 | 48 | // has since been disabled in settings. |
| 49 | 49 | add_action('delete_attachment', ['Metasync_Image_Converter', 'cleanup_on_delete']); |
| 50 | 50 | |
| 51 | +// Drop cached media-library stats when an attachment is deleted so the | |
| 52 | +// admin stats card never counts removed images. | |
| 53 | +add_action('delete_attachment', ['Metasync_Media_Batch_Optimizer', 'flush_stats_cache']); | |
| 54 | + | |
| 51 | 55 | // Invalidate cached image dimensions when an attachment is deleted or its |
| 52 | 56 | // metadata is (re)generated, so stale width/height are never injected after an |
| 53 | 57 | // image is removed, replaced under the same filename, or its thumbnails are |
| 54 | 58 | // regenerated to new sizes. Registered unconditionally so the cache cannot |
| @@ -116,8 +120,9 @@ | ||
| 116 | 120 | 'revertFailed' => __('Revert failed.', 'metasync'), |
| 117 | 121 | 'revertDisabled' => __('Original image unavailable — revert is disabled', 'metasync'), |
| 118 | 122 | 'startBatch' => __('Start optimizing all unoptimized images?', 'metasync'), |
| 119 | 123 | 'batchFailed' => __('Failed to start batch optimization.', 'metasync'), |
| 124 | + 'batchStalled' => __('Batch optimization stopped after repeated errors. Please reload the page and try again.', 'metasync'), | |
| 120 | 125 | 'batchComplete' => __('Batch optimization complete!', 'metasync'), |
| 121 | 126 | 'imagesProcessed' => __('images processed', 'metasync'), |
| 122 | 127 | 'failed' => __('failed', 'metasync'), |
| 123 | 128 | 'optimizingOf' => __('Optimizing', 'metasync'), |