{"id":233313,"date":"2025-05-27T13:11:28","date_gmt":"2025-05-27T13:11:28","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/selective-thumbnail-regenerator\/"},"modified":"2026-08-03T10:05:04","modified_gmt":"2026-08-03T10:05:04","slug":"selective-thumbnail-regenerator","status":"publish","type":"plugin","link":"https:\/\/hsb.wordpress.org\/plugins\/selective-thumbnail-regenerator\/","author":14365162,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1.2","stable_tag":"1.1.2","tested":"7.0.2","requires":"5.5","requires_php":"7.0","requires_plugins":null,"header_name":"Selective Thumbnail Regenerator","header_author":"rberet","header_description":"Regenerate thumbnails for media files uploaded in specific months and years.","assets_banners_color":"3c7ddc","last_updated":"2026-08-03 10:05:04","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/rberet.com\/wp-plugins\/selective-thumbnail-regenerator","header_author_uri":"https:\/\/rberet.com","rating":0,"author_block_rating":0,"active_installs":30,"downloads":744,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.2":{"tag":"1.0.2","author":"rberet","date":"2025-05-27 13:19:58"},"1.0.3":{"tag":"1.0.3","author":"rberet","date":"2026-05-30 06:39:41"},"1.0.4":{"tag":"1.0.4","author":"rberet","date":"2026-05-30 06:39:41"},"1.1.2":{"tag":"1.1.2","author":"rberet","date":"2026-08-03 10:05:04"}},"upgrade_notice":{"1.1.2":"<p>Resolves prepared-query placeholder-count warnings from WordPress Plugin Check.<\/p>","1.1.1":"<p>WordPress Plugin Check compatibility update for prepared queries, nonce verification, and translator context.<\/p>","1.1.0":"<p>Adds reload recovery for unfinished jobs and paginated Smart Regeneration with change and output-size estimates.<\/p>","1.0.5":"<p>Reliability and data-safety update with stable server jobs, safe cleanup, accurate history, hardened admin output, and accessibility improvements.<\/p>","1.0.4":"<p>Major update: Critical AJAX bug fix, performance improvements, Month Status Calendar with persistent history, batch failure recovery, Failed Images Log, Dry Run Mode, configurable batch size and throttle delay, and a fully redesigned interface.<\/p>","1.0.3":"<p>New features: Thumbnail size selection, cancel button, batch processing, and summary report.<\/p>","1.0.2":"<p>Important security update: Added capability checks to AJAX handlers and removed unnecessary files.<\/p>","1.0.1":"<p>Fixed security issues, updated function prefixes to &#039;strgrtr&#039; for uniqueness, added ABSPATH protection, and updated compatibility to WordPress 6.8.<\/p>","1.0.0":"<p>Initial release<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3554395,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3554395,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-2172x724.png":{"filename":"banner-2172x724.png","revision":3554395,"resolution":"2172x724","location":"assets","locale":"","width":2172,"height":724},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3554395,"resolution":"772x250","location":"assets","locale":"","width":1500,"height":486}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.2","1.0.3","1.0.4","1.1.2"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[163,84,5995,242936,2956],"plugin_category":[50],"plugin_contributors":[242937],"plugin_business_model":[],"class_list":["post-233313","plugin","type-plugin","status-publish","hentry","plugin_tags-images","plugin_tags-media","plugin_tags-regenerate","plugin_tags-thumbnail-regenerator","plugin_tags-thumbnails","plugin_category-media","plugin_contributors-rberet","plugin_committers-rberet"],"banners":{"banner":"https:\/\/ps.w.org\/selective-thumbnail-regenerator\/assets\/banner-772x250.png?rev=3554395","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/selective-thumbnail-regenerator\/assets\/icon-128x128.png?rev=3554395","icon_2x":"https:\/\/ps.w.org\/selective-thumbnail-regenerator\/assets\/icon-256x256.png?rev=3554395","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>The Selective Thumbnail Regenerator plugin provides a powerful and user-friendly way to regenerate image thumbnails for WordPress media libraries. Unlike other thumbnail regeneration plugins that blindly process the entire library, this plugin gives you precise control: choose a specific year, month, and even a title keyword to target exactly the images you need.<\/p>\n\n<h4>Key Features<\/h4>\n\n<ul>\n<li><strong>Date &amp; Title Filters<\/strong> - Choose a specific year, month, or search by title to target only the images you need.<\/li>\n<li><strong>Month Status Calendar<\/strong> - Green months are verified full-month, all-size runs with no failures. Legacy records are retained in amber because their scope cannot be verified.<\/li>\n<li><strong>Regeneration History Tracking<\/strong> - Bounded job summaries store exact filters, selected sizes, counts, and completion status. A \"Reset History\" button clears all records when needed.<\/li>\n<li><strong>Thumbnail Size Selection<\/strong> - Choose specific registered thumbnail sizes to regenerate instead of all sizes.<\/li>\n<li><strong>Configurable Batch Size<\/strong> - Set how many images are processed per AJAX request (1-20).<\/li>\n<li><strong>Throttle Delay Control<\/strong> - Set a cooldown pause between batches (0-2000 ms) to reduce server load.<\/li>\n<li><strong>Dry Run Mode<\/strong> - Verify that matching sources exist, are readable, and can be opened without writing changes.<\/li>\n<li><strong>Stable Server Jobs<\/strong> - User-scoped transient jobs use a fixed upper attachment ID and ID cursor to avoid duplicate or endless offset processing.<\/li>\n<li><strong>Reload Recovery<\/strong> - Reopen the plugin page within 24 hours to resume an unfinished job from its last per-image checkpoint or cancel it safely.<\/li>\n<li><strong>Smart Regeneration<\/strong> - Paginated preflight analysis finds missing, dimensionally incorrect, and stale sizes, estimates output size, and regenerates only that subset.<\/li>\n<li><strong>Automatic Batch Failure Recovery<\/strong> - Progress is checkpointed before every image. Interrupted jobs retry one image at a time and continue safely.<\/li>\n<li><strong>Failed Images Log<\/strong> - Detailed table of all failed images including ID, title, and exact failure reason.<\/li>\n<li><strong>Safe Orphaned File Cleanup<\/strong> - Obsolete thumbnails are deleted only after replacement files and metadata are saved successfully.<\/li>\n<li><strong>Live Terminal Activity Log<\/strong> - Real-time monospace console with timestamped status messages.<\/li>\n<li><strong>Visual Completion Metrics<\/strong> - Five-card summary board: Processed, Successful, Failed, Skipped, Duration.<\/li>\n<li><strong>Cancel Support<\/strong> - Stop safely after the current server step and receive an accurate partial summary.<\/li>\n<li><strong>Performance Optimized<\/strong> - Direct indexed SQL query for year selector loading.<\/li>\n<\/ul>\n\n<h3>Usage<\/h3>\n\n<ol>\n<li>Navigate to Tools &gt; Selective Thumbnail Regenerator.<\/li>\n<li>Select a year from the dropdown. A Month Status Calendar will appear showing which months have already been regenerated.<\/li>\n<li>Optionally select a month - via the dropdown or by clicking a month badge on the calendar.<\/li>\n<li>Optionally enter a title keyword to filter images by name.<\/li>\n<li>Adjust batch size and throttle delay in the Performance Configuration card.<\/li>\n<li>Enable Dry Run Mode to preview results without making changes.<\/li>\n<li>Click \"Scan Matching Images\" to count matching images. Smart Regeneration performs a paginated preflight and estimates the required thumbnail work and output size.<\/li>\n<li>Click \"Start Regeneration\" to begin. Watch the live terminal log for real-time updates.<\/li>\n<li>Review the Job Completion Report and Failed Images Log after the process ends.<\/li>\n<\/ol>\n\n<h3>Troubleshooting<\/h3>\n\n<h4>\"No images found for the selected period\"<\/h4>\n\n<p>There are no image attachments uploaded during the selected year\/month. Try a different time period.<\/p>\n\n<h4>The process is slow<\/h4>\n\n<p>Reduce the throttle delay or increase the batch size if your server can handle more load. Alternatively, increase the delay and reduce batch size if you are getting timeouts.<\/p>\n\n<h4>A batch keeps failing<\/h4>\n\n<p>Enable Dry Run Mode first to verify image accessibility. If specific images crash the server, they will appear in the Failed Images Log after regeneration completes.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Download the plugin ZIP file.<\/li>\n<li>Log in to your WordPress admin panel.<\/li>\n<li>Go to Plugins &gt; Add New &gt; Upload Plugin.<\/li>\n<li>Upload the ZIP file and click \"Install Now\".<\/li>\n<li>Activate the plugin through the \"Plugins\" menu in WordPress.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"why%20would%20i%20need%20to%20regenerate%20thumbnails%3F\"><h3>Why would I need to regenerate thumbnails?<\/h3><\/dt>\n<dd><p>You might need to regenerate thumbnails if:\n* You've changed your theme and it uses different thumbnail sizes\n* You've modified thumbnail sizes in WordPress settings\n* You've installed a plugin that adds new thumbnail sizes\n* Your thumbnails are corrupted or missing<\/p><\/dd>\n<dt id=\"will%20this%20plugin%20delete%20my%20original%20images%3F\"><h3>Will this plugin delete my original images?<\/h3><\/dt>\n<dd><p>No. The plugin only regenerates thumbnail versions. Your original uploaded images are never touched.<\/p><\/dd>\n<dt id=\"what%20does%20%22orphaned%20file%20cleanup%22%20mean%3F\"><h3>What does \"orphaned file cleanup\" mean?<\/h3><\/dt>\n<dd><p>When thumbnail dimensions change, old thumbnail files can remain on disk. The plugin compares old and newly saved metadata, then deletes only files that are no longer referenced. Existing files remain intact if generation or metadata saving fails.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20an%20image%20file%20is%20missing%20from%20the%20server%3F\"><h3>What happens if an image file is missing from the server?<\/h3><\/dt>\n<dd><p>The plugin detects the missing file, marks it as failed in the log, and moves on. The entire regeneration process never stops because of a single missing file.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20a%20server%20error%20occurs%20mid-batch%3F\"><h3>What happens if a server error occurs mid-batch?<\/h3><\/dt>\n<dd><p>The plugin automatically enters single-retry mode: it re-processes each image in the failed batch individually. The image causing the crash is identified, logged in the Failed Images report, and skipped so the rest complete successfully.<\/p><\/dd>\n<dt id=\"how%20does%20dry%20run%20mode%20work%3F\"><h3>How does Dry Run Mode work?<\/h3><\/dt>\n<dd><p>When Dry Run is enabled, the plugin checks that every matching source exists, is readable, and can be opened by a WordPress image editor. It writes no thumbnail changes and never marks a calendar month complete.<\/p><\/dd>\n<dt id=\"what%20is%20the%20month%20status%20calendar%3F\"><h3>What is the Month Status Calendar?<\/h3><\/dt>\n<dd><p>It is a 4\u00d73 grid of month buttons beneath the date filter. A month turns green only after an unfiltered, all-size run finishes without failures or skips. Older records appear in amber because their scope was not recorded.<\/p><\/dd>\n<dt id=\"can%20i%20cancel%20the%20process%3F\"><h3>Can I cancel the process?<\/h3><\/dt>\n<dd><p>Yes. Click the \"Cancel Process\" button. The active server step completes safely, then the process stops and shows a partial summary.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20i%20close%20the%20browser%20during%20regeneration%3F\"><h3>What happens if I close the browser during regeneration?<\/h3><\/dt>\n<dd><p>The browser processing loop pauses. Reopen the plugin page within 24 hours and use \"Resume Job\" to continue from the last per-image checkpoint, or cancel the saved job. Completed work remains applied.<\/p><\/dd>\n<dt id=\"what%20does%20smart%20regeneration%20check%3F\"><h3>What does Smart Regeneration check?<\/h3><\/dt>\n<dd><p>For each matching source image, Smart Regeneration compares active WordPress image sizes with saved metadata and files. It selects sizes whose file is missing, whose saved dimensions differ from the currently registered dimensions, or whose file is older than the source image. The preflight estimate is approximate and represents expected generated output, not guaranteed net disk growth.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Compatibility: Pass prepared-query replacements as individual arguments so WordPress Plugin Check can validate all placeholders.<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Compatibility: Refactored attachment database reads into fixed prepared queries accepted by WordPress Plugin Check.<\/li>\n<li>Security: Switched AJAX nonce validation to the standard check_ajax_referer() flow and documented verified request reads.<\/li>\n<li>Internationalization: Added translator context for every localized string containing replacement placeholders.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Feature: Detect and resume unfinished user jobs after the plugin page is reopened.<\/li>\n<li>Feature: Added a safe saved-job cancellation path and refreshed active-job expiry on every checkpoint.<\/li>\n<li>Feature: Added paginated Smart Regeneration preflight for missing, dimensionally incorrect, and stale thumbnail sizes.<\/li>\n<li>Feature: Added affected-image, thumbnail-count, and estimated-output-size metrics before regeneration.<\/li>\n<li>Performance: Smart mode regenerates only the sizes identified by a fresh per-image analysis.<\/li>\n<li>Cleanup: Uninstall now removes active-job and Smart-scan transient records in addition to job history and locks.<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Reliability: Replaced full-library offset scans with user-scoped transient jobs, stable ID cursors, immutable upper ID bounds, and per-image checkpoints.<\/li>\n<li>Data Safety: Generate and save replacement metadata before deleting obsolete thumbnails; preserve existing references for failed sizes.<\/li>\n<li>History Accuracy: Added versioned job history and verified calendar rules. Legacy completion flags remain visible as unverified amber records.<\/li>\n<li>Security: Removed dynamic HTML insertion for attachment titles and server messages in the admin interface.<\/li>\n<li>Bug Fixes: Fixed 0 ms throttle, title-only search, misleading success summaries, dry-run source checks, and safe cancellation behavior.<\/li>\n<li>Accessibility: Added native month and collapse buttons, focus states, ARIA expansion\/selection states, a live progress status, and an activity log.<\/li>\n<li>Internationalization: Moved client-visible status and error text into localized WordPress strings.<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Critical Fix: Fixed fatal AJAX error by conditionally loading wp-admin\/includes\/image.php before calling wp_generate_attachment_metadata().<\/li>\n<li>Performance Fix: Replaced PHP loop-based year extraction with a single fast $wpdb SQL query.<\/li>\n<li>Bug Fix: Allow thumbnail generation for attachments with missing or corrupt database metadata (empty-array fallback instead of error).<\/li>\n<li>Cleanup: Implemented physical deletion of orphaned thumbnail files from disk before regeneration.<\/li>\n<li>Feature: Month Status Calendar - visual 4x3 grid showing regenerated months per year, persisted in the database with Reset History support.<\/li>\n<li>Feature: Regeneration History Tracking stored in wp_options, persists across sessions.<\/li>\n<li>Feature: Image title search filter for targeting images by name.<\/li>\n<li>Feature: Dry Run Mode - preview processing without writing to disk.<\/li>\n<li>Feature: Configurable Batch Size slider (1-20 images per request).<\/li>\n<li>Feature: Configurable Throttle Delay slider (0-2000 ms cooldown between batches).<\/li>\n<li>Feature: Automatic batch failure recovery - retries each image individually when a batch crashes, then continues.<\/li>\n<li>Feature: Failed Images Log - detailed table showing ID, title, and exact error for every failed image.<\/li>\n<li>Feature: Cache busting on \"Scan Matching Images\" to always return fresh counts.<\/li>\n<li>Redesign: Full UI overhaul - Inter font, card-based responsive layout, custom progress bar, live terminal console, metrics board.<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Feature: Thumbnail size selection - choose which specific sizes to regenerate<\/li>\n<li>Feature: Cancel button - stop the regeneration process at any time<\/li>\n<li>Feature: Batch processing - process multiple images per AJAX request for faster regeneration<\/li>\n<li>Feature: Summary report - view success\/failure counts and elapsed time after completion<\/li>\n<li>Improved: Updated FAQ with new feature documentation<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Security: Added capability checks to AJAX handlers for improved security<\/li>\n<li>Removed unnecessary plugin assets<\/li>\n<li>Removed empty languages folder and Domain Path header<\/li>\n<li>Code structure improvements<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Security: Added ABSPATH protection to prevent direct file access<\/li>\n<li>Compatibility: Updated \"Tested up to\" value to WordPress 6.8<\/li>\n<li>Code Standards: Changed all prefixes from 'str' to 'strgrtr' for uniqueness<\/li>\n<li>Updated main class name to STRGRTR_Thumbnail_Regenerator<\/li>\n<li>Fixed contributor username in readme<\/li>\n<li>Updated all JS\/CSS\/HTML elements to use consistent prefixes<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Regenerate thumbnails selectively by upload date and search filters with full history calendar, performance throttle, and fail-safe recovery.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/233313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=233313"}],"author":[{"embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/rberet"}],"wp:attachment":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=233313"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=233313"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=233313"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=233313"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=233313"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=233313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}