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.