Releases: ivanusto/disable-all-thumbnails
Release list
Release v1.3.0
WordPress 7.1 Compatibility & Settings Screen Fixes
Disabled sizes came back on WordPress 7.1
Two code paths ask wp_get_missing_image_subsizes() what still needs generating and skip the intermediate_image_sizes_advanced filter entirely:
- the long-standing post-upload recovery pass in
wp_update_image_subsizes(), and - 7.1's client-side media processing, where the browser reads the missing list from the REST create response, generates those sizes locally and sideloads them back.
A size switched off in this plugin was regenerated anyway. That list is now filtered too, so a disabled size stays disabled in both paths. Protected site icon sizes are excluded from the disabled set, so a stale setting saved by an older version can never reach it.
The bulk delete could remove companion originals
WordPress 7.1 stores companion files beside the main image: original_image (the pre-scale upload), source_image (for example the HEIC a JPEG was derived from), and animated_video / animated_video_poster (what an animated GIF is converted to). 7.1 can also register one physical file under several size names, so a size entry may point straight at one of these — and deleting it left the attachment referencing a file that no longer exists.
Those files are now protected. The size entry is still removed from the metadata; the shared file stays on disk.
The dimensions column was blank for two built-in sizes
The settings screen showed no dimensions at all for 1536x1536 and 2048x2048. WordPress registers those two with add_image_size() on plugins_loaded and never creates the *_size_w / *_size_h options the screen was reading.
Dimensions now come from wp_get_registered_image_subsizes(). Those two are also the only built-in sizes remove_image_size() can drop from the registry — which is exactly what disabling them here does — so the fixed dimensions core names them after are kept as a fallback. Without it, a disabled size would lose its dimensions again, or disappear from the list entirely and become impossible to re-enable.
Smaller display fixes
- An unconstrained axis now reads
autoinstead of0px, so Medium Large shows as 768px × auto. That size is 768px wide at whatever height preserves the aspect ratio. - The multiplication sign renders correctly. The
×entity was being passed throughesc_html(), so the column was literally showing the text×.
Verification
Verified against WordPress 7.1 with 31 checks covering the missing-subsizes filter, the protected-size exclusion, both the registered and the disabled-and-unregistered dimension paths, and the legacy false values an older version could have stored. Plugin Check reports no errors.
Full Changelog: v1.2.0...v1.3.0
Release v1.2.0
Fixed
"Delete All Thumbnails" destroyed the site icon.
The bulk delete walked every image attachment, deleted every file listed in its
metadata, and then assigned $metadata['sizes'] = array(). That included
site_icon-32, site_icon-180, site_icon-192 and site_icon-270 — the sub-sizes
WordPress generates for the site icon and references from wp_site_icon() on every
page load.
A single run broke the favicon, the Apple touch icon and the Windows tile
site-wide, and regenerating thumbnails could not undo it, because the metadata
naming those sizes had been blanked too.
The attachment currently set as the site icon is now skipped entirely. Attachments
that were the site icon at some point in the past are deliberately still processed:
nothing references them any more, so their files should be reclaimable. This is why
the check reads the site_icon option rather than the _wp_attachment_context meta,
which would immortalise every icon the site has ever used.
Sizes are now deleted one at a time instead of blanking the whole sizes array,
and metadata is only written back when something was actually removed — so an
attachment with nothing to delete is no longer rewritten.
The settings screen offered the site_icon-* sub-sizes as toggleable.
Switching one off removed it from intermediate_image_sizes_advanced, which broke the
favicon for every site icon set afterwards. They are functional icons rather than
content thumbnails, so they are no longer listed, no longer removable through the
generation filters, and stale entries saved by earlier versions are ignored.
Both readme.txt files declared Apache-2.0 while LICENSE, the plugin header and
README.md all declared GPL-2.0. Plugin Check flags this as a license_mismatch
error.
Added
Two filters, for sites that need to protect more than the site icon:
// Protect an additional size from being disabled or deleted.
add_filter( 'disable_all_thumbnails_is_protected_size', function ( $protected, $size ) {
return $protected || 'my-functional-size' === $size;
}, 10, 2 );
// Leave an entire attachment alone during the bulk delete.
add_filter( 'disable_all_thumbnails_skip_attachment', function ( $skip, $attachment_id ) {
return $skip || get_post_meta( $attachment_id, 'keep_thumbnails', true );
}, 10, 2 );Upgrade notes
If you already ran "Delete All Thumbnails" on a previous version, your site icon
sub-sizes are gone and cannot be regenerated from the blanked metadata. Set the site
icon again from Settings → General to rebuild them.
v1.1.1
v1.1.1: Removed persistent updates to core media options (thumbnail_size_w/h). Disabling built-in sizes is now handled entirely at runtime via the intermediate_image_sizes_advanced filter, so WordPress media settings are no longer altered after the feature is disabled. / 移除對核心媒體選項的持久性寫入,內建尺寸停用改由執行期濾鏡處理,停用功能後不再影響 WordPress 媒體設定。