Skip to content
Sign in
LC Smart Media Redirect & Cleaner icon

LC Smart Media Redirect & Cleaner

High-performance image size redirect engine, orphan scanner, prune tool, thumbnail regeneration, and image size manager for WordPress.

Not scanned yet WordPress plugin

Install in

No install steps yet

Follow the steps on the source page.

LC Smart Media Redirect & Cleaner keeps your Media Library lean without ever breaking a front-end
image. It intelligently redirects missing/mismatched thumbnail-size requests to the closest
available size instead of letting them 404 or silently regenerate on every request, scans for
orphaned metadata and unused files, and gives you a safe, reviewable prune tool.

Features:

  • Adaptive CPU Load Throttling & Background Engine — Real-time server CPU load monitoring (get_server_cpu_load()) with dynamic batch pacing, cooling backoffs, and safe execution.
  • Smart Core Web Vitals (LCP) Booster & Hero Preload Engine — Automatically detects hero images, strips loading="lazy", injects fetchpriority="high" and decoding="async", and outputs high-priority <link rel="preload"> in <head>.
  • Master Original Image Dimension Cap & Auto-Downscaler — Resizes oversized raw master camera/iPhone uploads in place (e.g. capped at 2560px or 2048px) to eliminate hosting bloat.
  • Native WP-CLI Command Suite — Comprehensive terminal management via wp smrc stats, wp smrc regen, wp smrc prune, and wp smrc redirect.
  • Interactive Visual Quality & Savings Comparison Modal — Apple-style split comparison slider with real-time file size & % savings calculations.
  • Smart Size Redirect — serves the closest matching registered image size instead of a
    broken or oversized fallback.
  • Metadata Orphan Scanner — manual, batched scan for attachment metadata pointing at files
    that no longer exist.
  • Prune Tool — review orphaned files before removing them; nothing is deleted blindly.
  • Future Generation Manager & custom image size management.
  • Background thumbnail regeneration via WP-Cron, batched to avoid timeouts.
  • App-like dashboard with single-site storage stats, export/import configuration.
  • Staging-to-Live Production Preset Sync — export complete configurations (core dimensions, size selections, Smart Size Redirect rules, and Pro engines) for seamless local-to-live migration.

Need automated (no-click) background maintenance, AVIF/WebP multi-format delivery, auto-compression, or
multisite/CDN-aware storage analysis? See LC Smart Media Redirect & Cleaner Pro, the licensed
add-on.

This plugin is the direct successor to “Batch Image Cleaner” (v1.9.28 and earlier); Standard
free features and stored settings remain fully compatible.

Current Active Pipeline Status

  • Standard lifecycle (v1.9.33, audited August 8, 2026): ✅ Bootstrap order, migration, activation/deactivation, cron ownership, uninstall cleanup, and legacy URL handling were traced end to end. Three defects were fixed: query-string false-positive 410 responses, stale deactivation orphan-scan state, and retained dynamic prune sessions after uninstall.
  • Future-upload size generation & Image Size Manager (v1.9.56, audited August 19, 2026): ✅ smrc_get_registered_sizes() updated to read unfiltered registrations directly from Smrc_Core::get_image_sizes(). Custom registration, override ordering, disabled-size filtering, minimum-longest-side behavior, duplicate-size deduplication, and post-upload metadata were traced end to end. All 26 registered sizes (Core, Theme, WooCommerce, Custom) reliably render on the Image Sizes grid regardless of active upload generation state.
  • Dashboard configuration controls (v1.9.35, audited August 8, 2026): ✅ Rendered controls, action bindings, nonces/capabilities, option persistence, import/export, and completion feedback were traced end to end. Two UI defects were fixed: numeric settings now acknowledge or safely roll back failures, and the unused scan-subfolder selector was removed.
  • Manual thumbnail regeneration (v1.9.36, audited August 8, 2026): ✅ Selected-size persistence, reset/resume/run loop, locks, attachment processing, file/metadata writes, errors, stop, and recovery controls were traced end to end. Two defects were fixed: Stop no longer releases the lock during an active batch, and the live error total includes every batch error.
  • Background thumbnail regeneration (v1.9.37, audited August 8, 2026): ✅ AJAX start/status/cancel, cron scheduling, run state, locks, batch processing, completion, stale recovery, and UI feedback were traced end to end. Four concurrency/recovery defects were fixed: duplicate starts and callbacks are blocked, cancellation cannot be overwritten by an in-flight batch, and malformed running state recovers safely.
  • Background orphan scanner (v1.9.38, audited August 8, 2026): ✅ Start/status/cancel/clear AJAX, WP-Cron scheduling, persistent offsets/results, filesystem and metadata phases, result caps, cancellation, stale recovery, and UI polling were traced end to end. Four concurrency/recovery defects were fixed: duplicate starts and cron callbacks are blocked, cancellation cannot be overwritten by in-flight work, malformed state recovers to idle, and structured UI failures are handled correctly.
  • Cleanup and prune execution (v1.9.39, audited August 8, 2026): ✅ Analysis safety set, prune preparation, transient ownership, batched deletion, per-file path handling, orphan metadata/file deletion, and client completion feedback were traced end to end. Two safety defects were fixed: every batch revalidates its reviewed filesystem scope, and the UI only confirms deletion after a successful server response.
  • Rebrand compatibility (v1.9.40, audited August 8, 2026): ✅ Standard bootstrap, class/function identity, shared cron hooks/state, Pro dependency contract, and exported UI metadata were traced end to end. Runtime and exported metadata now use the Smart Media name; retained bic_* keys are data compatibility identifiers, not executable class/function names.
  • Active runtime boundary (v1.9.41, audited August 8, 2026): ✅ Configuration import validation now accepts only Smart Media exports. The retired Batch Image Cleaner is not used as a runtime or import dependency; retained bic_* values remain stored-data compatibility only.
  • Deletion and regeneration safety (v1.9.42, audited August 8, 2026): ✅ Folder deletion, thumbnail-size deletion, metadata-derived file paths, foreground size selection, and lifecycle cleanup were rechecked. Four defects were fixed: unsafe deletion inputs are rejected, failed deletes retain metadata, folder traversal refuses symlinks/out-of-scope entries, and regeneration processes only active image sizes.
  • Third-pass deletion revalidation and state hardening (v1.9.44, audited August 8, 2026): ✅ Orphan deletion (metadata + files), regeneration lock lifecycle, prune lock recovery, custom-size deletion, size-override read paths, configuration import validation, and uninstall coverage of lock options and dynamic scan-accumulator transients.
  • Smart Size Redirect (Standard, v1.9.55, audited August 18, 2026): ✅ Dynamic canonical discovery, aspect-ratio/crop-mode compatibility scoring, manual destination overrides, auto-match reset, and frontend image_downsize/srcset behavior were traced end to end.
  • Fourth-pass deep audit (Standard + Pro, audited August 10, 2026): ✅ Thumbnail Regeneration, Future Generation & Custom Sizes, Storage Overview & Config Backup, Pro License Engine, Pro WebP Pipeline, Pro Auto-Compression Pipeline, Pro Automated Maintenance, and Pro Multisite & CDN Storage Analysis were thoroughly reviewed end to end. Validated correctness, state transitions, fail-closed safety checks, and edge-cases. Found no regressions or new bugs. The fixes applied in previous passes successfully resolved all prior defects in these pipelines.

Written by Joobi from the project's own listing. See the source page

cleanupimagesmediaredirectthumbnails
30 Nov 2026
Version 1.9.81 released. Not scanned yet.

1.9.81 (November 27, 2026)

  • BUG FIX & DATA SAFETY — Config Import Clamp Fix, Settings Persistence & Cache Reset: Fixed ajax_import_config() clamping smrc_max_original_width to a minimum of 1200 (which silently re-enabled master image downscaling when importing presets where auto-downscale was disabled at 0), added explicit return; statements after error responses, and called Smrc_Core::reset_redirect_caches() plus Smrc_Core::reset_folder_scan() on import; updated Admin_Interface::handle_save_settings() to persist smrc_max_original_width, smrc_lcp_preload_enabled, and reset redirect caches on form save; and completed uninstall.php cleanup to remove smrc_bic_migrated plus .smrc_cache/ dotfiles (.htaccess) via DirectoryIterator so @rmdir() leaves zero directory residue.
  • WP-CLI & UI HARDENING — Full-Scope CLI Prune, Regen Progress Accuracy & Safe Import/Export Feedback: Fixed Smrc_CLI_Command::prune() scanning only the first 5,000 files instead of paginating the full uploads tree and synced smrc_bg_scan_results / stats caches after deletion; hardened Smrc_CLI_Command::regen() with --reset, registered size validation, batch-error continuation instead of premature aborts when $processed === 0, and stats invalidation; guarded Smrc_CLI_Command::redirect() against conflicting --enable/--disable flags and flushed redirect caches; preserved original "Download Preset" button labels, enforced 2 MB import file limit, escaped status notices via .text(), synced SMRC_DATA runtime scan/min-width values after settings updates, styled .smrc-setting-save-status, and prevented #smrc-import-file / slider horizontal overflow on mobile.

1.9.80 (November 27, 2026)

  • PERFORMANCE & DATA INTEGRITY — Regeneration Query Optimization, Vector SVG Skip & WebP/AVIF Companion Cleanup: Disabled SQL_CALC_FOUND_ROWS and term/meta cache preloading inside Smrc_Core::get_next_batch(); skipped image/svg+xml attachments inside Smrc_Core::process_image() so vector uploads never log bogus wp_get_image_editor() errors; cleaned up adjacent .webp/.avif companion variants via Smrc_Core::delete_adjacent_image_companions() when non-shared thumbnails are replaced or batch-nuked (delete_all_thumbnails_batch() and delete_thumbnail_size_files()); added keyset pagination ($last_id / $known_total) to delete_all_thumbnails_batch() and ajax_delete_all_thumbnails() to eliminate O(N^2) offset scans; and replaced full-table ORDER BY RAND() scans inside ajax_get_image_comparison() with indexed ID-range sampling plus both .webp/.avif and .jpg.webp/.jpg.avif detection.
  • BUG FIX & RESPONSIVE UI — Background Regen Guardrails, Adaptive CPU Pacing & Comparison Slider Polish: Rejected starting background regeneration when no registered image sizes are selected (smrc_bg_regen_start()), clamped background batch sizes (1..500), invalidated folder stats caches on foreground/background completion, and applied throttle_delay_ms CPU load pacing across both ajax_run_batch() and smrc_bg_regen_batch(); fixed resume bar width reading pixels instead of percentage (parseFloat(.smrc-progress-text)), escaped modal/banner HTML, synced live error log rows, restored #smrc-bg-regen-cancel icon markup after cancel requests, synced slider width on #smrc-cmp-img-after image load, prevented mobile touchmove scroll hijack during drag, and wrapped #smrc-comparison-modal banners/footers for <= 600px screens.

1.9.79 (November 27, 2026)

  • PERFORMANCE & DATA SAFETY — Single-Pass Prune Engine, WebP/AVIF Companion Protection & Keyset Cleanup: Consolidated smrc_prune_prepare() into a single RecursiveCallbackFilterIterator pass that prunes .smrc_cache, symlinks, hidden dot-directories, and optimizer backup folders before descent and evaluates orphan keep-dimension rules inline without double-scanning or buffering full path buckets; skipped smrc_build_wp_safe_set() when no matches exist and skipped .smrc_cache/transient state writes during dry-run previews (mode=dry); added smrc_is_path_in_wp_safe_set() to protect active WebP/AVIF companions alongside registered WP images/thumbnails; converted smrc_build_wp_safe_set() and Smrc_Core::delete_thumbnail_size_files() to keyset pagination while cleaning up adjacent WebP/AVIF companions and stale metadata on size deletion; and enabled Folder Analysis Delete All in Admin_Interface::handle_delete_thumbnail_size() for both registered and ghost/legacy thumbnail sizes.
  • BUG FIX & RESPONSIVE UI — Prune State Token Hardening, Cancellation & Mobile Breakdown UI: Sanitized prune session tokens uniformly via smrc_prune_sanitize_token(), stopped redundant large transient writes when .smrc_cache JSON state succeeds, reset folder stats cache when smrc_prune_delete_batch() finishes deletions, added missing return; statements across handle-prune.php / handle-delete.php, removed the unnecessary is_readable() block with clearstatcache() in smrc_delete_file_and_count(), defined missing .smrc-hidden CSS so #smrc_prune_cancel stays hidden when idle, honored mid-scan Cancel clicks before starting batch deletion, escaped dynamic JS error/progress HTML in prune notices, displayed skipped counts and synchronized Folder Analysis size lists after lazyLoadStats() via delegated .smrc-delete-thumbnail-size click handlers, and added mobile wrapping/scroll rules for prune tables and breakdown items.

1.9.78 (November 27, 2026)

  • PERFORMANCE & FALSE-POSITIVE FIX — Bulk Orphan Scanner Lookup & WebP/AVIF/-scaled Protection: Replaced per-file N+1 wp_postmeta SQL lookups inside Smrc_Core::get_orphaned_files() (300–600 queries/batch -> 1 bulk query/batch) with Smrc_Core::get_registered_attachment_path_map() and Smrc_Core::is_known_attachment_or_companion(); pruned .smrc_cache, symlinks, and backup folders before directory recursion; scoped orphan file cache keys by subdirectory; and protected active WordPress -scaled unscaled masters (original_image) plus Pro .webp/.avif companions from false-positive orphan classification and deletion.
  • BUG FIX & SECURITY — Persistent Scan Result Sync, Batch Deletion & Styled Notifications: Updated ajax_delete_orphaned_metadata() and ajax_delete_orphaned_files() to purge deleted items from smrc_bg_scan_results (preventing deleted items from reappearing on reload) and reset stats caches; chunked large orphan deletions into 200-item AJAX batches in admin-script.js to avoid PHP max_input_vars truncation; escaped toast showNotification() text and added explicit .smrc-notification, .smrc-orphan-controls, and .smrc-orphan-list styling/scrolling with mobile modal containment; included piu counts in background scan banners; guarded #smrc-clear-bg-scan error states and .smrc-folder-toggle selectors; and added return; after wp_send_json_error() in handle-orphan-bg.php.

1.9.77 (November 27, 2026)

  • PERFORMANCE & ZERO-WRITE GET — WooCommerce On-the-Fly Thumbnail Regeneration Suppression: Added Smrc_Core::filter_woocommerce_sizes_to_resize() hooked onto woocommerce_image_sizes_to_resize so disabled or Smart-Size-Redirected WooCommerce image sizes never trigger synchronous disk creation or wp_postmeta writes during frontend visitor GET requests (23.55ms / 9 queries / 1 write reduced to 0.69ms / 4 queries / 0 writes).
  • BUG FIX & LCP — Upload Scaling Stat-Cache, Redirect Cache Invalidation & Self-Closing LCP Tags: Cleared PHP stat cache before reading resized filesize and ignored animated GIF/SVG files in Smrc_Core::scale_original_on_upload(); added get_queried_object_id() fallback in LCP preload/attribute hooks; preserved self-closing <img ... /> syntax in optimize_lcp_content_image(); and centralized Smrc_Core::reset_redirect_caches() across redirect/size mutations.
  • BUG FIX & RESPONSIVE UI — Atomic Inline Dimension Saves, Custom Size Cleanup & Mobile Tables: Replaced dual concurrent dimension POST requests (lost-update race condition) with atomic single-request ajax_save_size_override(), cleared stale smrc_size_overrides and pruned option references on custom size edits/deletions, synced UI cards/badges dynamically with escHtml(), wrapped Smart Size Redirect chips and Registered Sizes controls for mobile (<= 600px / <= 480px), and added horizontal scroll containment for #smrc-custom-sizes-table.

1.9.76 (November 27, 2026)

  • BUG FIX & RESPONSIVE UI — Cold Overview Auto-Refresh, Formatter & Responsive Shell: Fixed formatStorageSize(0) returning "0 MB" instead of '0 B' (which prevented lazyLoadStats() from firing on cold transients), added KB and non-finite guards, marked cold states with data-stats-cold="1", removed the unmatched stray CSS brace in admin-style.css, preserved horizontal top-nav labels on <= 960px viewports even when auto-collapsed, synced #smrc-side-toggle aria-expanded, tightened mobile padding at <= 480px, and pointed Quick Setup Step 2 directly to #smart-size-redirect-tab.
  • PERFORMANCE & DATA INTEGRITY — Stats & Analysis Pipeline Optimization: Eliminated duplicate smrc_list_upload_subpaths() scanning on dashboard render, pruned .smrc_cache/symlinks/backup directories from Smrc_Core::get_video_statistics(), checked accumulator expiry before querying in Smrc_Core::scan_stats_batch() while running the COUNT(*) query once on offset === 0, excluded image/svg+xml from non-SVG metadata/size tallies in smrc_media_analysis(), unified ajax_refresh_stats() authorization, and removed shadowed/incomplete escHtml in admin-script.js.

1.9.75 (November 25, 2026)

  • PERFORMANCE & ZERO-WRITE GET — Dashboard GET Query Elimination: Added explicit $persist = false mode to Smrc_Core::get_processing_stats() so loading admin.php?page=smrc-dashboard performs 0 option write queries while batch mutations (ajax_run_batch) still persist counters.
  • BUG FIX — Global Dashboard Nonce Integrity & Thumbnail/Folder Deletion: Rendered #smrc_nonce globally in dashboard.php (eliminating duplicate IDs in the Quick Setup step form and fixing silent nonce failure when clicking “Delete All” on thumbnail sizes or folders after Quick Setup completes).
  • BUG FIX — Visual Comparison Slider Modal Overlay & Safe Titles: Added complete fixed-overlay, backdrop, header, close button, and responsive mobile styles for #smrc-comparison-modal in admin-style.css, plus decoded plain-text modal titles and structured error extraction in admin-script.js.
  • BUG FIX — Background Regen Stale-Lock Reclamation: Added smrc_regen_acquire_processing_lock(300) to automatically reclaim orphaned smrc_regeneration_processing_lock locks older than 5 minutes after fatal worker timeouts in both smrc_bg_regen_batch() and ajax_run_batch().
  • BUG FIX & SECURITY — Orphan Scanner Cache Exclusion & Folder Prefix Containment: Excluded .smrc_cache/, symlinks, and optimizer backup directories from Smrc_Core::get_orphaned_files(); protected WP -scaled original_image backups inside smrc_build_wp_safe_set(); escaped $wpdb->esc_like() trailing-slash paths in cleanup_database_references(); gated orphan_summary output behind discover_orphans; escaped dynamic JS HTML strings in orphan lists and confirmation modals; guarded # anchor smooth-scroll clicks against jQuery selector syntax errors; and prevented stale sidebar .is-active highlights across Pro tabs.
  • PHP 8.5 & RESPONSIVE UI — Cast wp_parse_url() paths to (string) in render_lcp_preload_tag() and strip_srcset_originals(), escaped suggestion HTML names in smrc_media_analysis(), and added responsive < 1080px / < 840px / < 600px / < 480px rules for Quick Setup steps, comparison slider modal, and metrics grid.

1.9.74 (November 1, 2026)

  • PERFORMANCE & LATENCY OPTIMIZATION — Smart Size Redirect Target Memoization: Added in-memory request-scoped static memoization to Smrc_Core::get_canonical_target_sizes() and Smrc_Core::find_best_redirect_target(). Reduces redundant option table lookups and aspect-ratio scoring calculations to 0.001ms across high-density image galleries and archive pages.
  • ARCHITECTURE — Administrative & AJAX Hook Decoupling: Gated over 25 administrative AJAX action hook registrations (wp_ajax_smrc_*) behind is_admin() || DOING_AJAX, eliminating unnecessary hook table bloat and memory consumption during public visitor GET requests.

1.9.73 (October 29, 2026)

  • PERFORMANCE & SERVER OPTIMIZATION — Eliminating Frontend Table Scans & On-Boot Migrations: Resolved MariaDB CPU bottlenecks by gating legacy postmeta migrations behind a persistent execution flag (smrc_bic_migrated), ensuring table updates never repeat after initial migration.
  • ARCHITECTURE — Admin-Scoped Upgrade Execution: Moved maybe_upgrade() out of frontend plugins_loaded so that schema and version upgrade routines execute exclusively during administrative console requests (admin_init) and plugin activation, eliminating redundant write queries and table locks on public visitor page loads.

1.9.72 (October 19, 2026)

  • PERFORMANCE — Memory usage optimizations during high-concurrency image redirect handling and enhanced transient cache cleanup.

1.9.71 (September 2, 2026)

  • CACHE LIFECYCLE AUTO-PRUNE — Implemented automated purging of stale .smrc_cache/ review state files (smrc_prune_purge_stale_cache_files()) older than 12 hours upon new review generation, preventing filesystem accumulation from abandoned scans.
  • ZERO-RESIDUE UNINSTALL COMPLETION — Enhanced uninstall.php to clean all lingering cache files and safely remove the .smrc_cache/ uploads directory upon plugin deletion.

1.9.70 (September 1, 2026)

  • RESEARCH CITATION ALIGNMENT — Updated administrative console Research Journal citation to link directly to the newly published dedicated academic manuscript: “Dynamic Media Dimension Mapping and Filesystem Inode Pruning in High-Concurrency CMS Ecosystems” (Light & Composition University Academic Journal, Vol. 14, Issue 2, Pages 33–64).

1.9.67 (August 29, 2026)

  • PERFORMANCE & RELIABILITY — High-Capacity File-Backed Prune State Engine: Upgraded prune list state storage from heavy database transients to fast, protected filesystem caching (.smrc_cache/) with transient fallback, eliminating MySQL packet exhaustion and timeout bottlenecks when processing 40,000+ files.
  • ENHANCEMENT — Batch Deletion Lock Auto-Reclaim & 500-Item Chunks: Released locks synchronously before JSON transmission, reduced stale lock threshold to 30s with auto-reclaim, boosted deletion batch size to 500 items, and added automatic 409-lock contention retries in admin JavaScript.
  • OPTIMIZATION — Lean Prepare Payload: Trimmed orphan_summary preview arrays to avoid large JSON transfers during orphan discovery.

1.9.66 (August 26, 2026)

  • REBRANDING & URL SYNC — Updated Plugin URI to https://www.lightandcomposition.com/dev/lc-smart-media-redirect-cleaner/ across plugin headers, Dev Lab catalog, and metadata mappings.

1.9.65 (August 26, 2026)

  • REVIEW COMPLIANCE — Directory slug alignment to lc-smart-media-redirect-cleaner, full text domain unification, unslashed and sanitized nonce verification, and template late-escaping audit.

1.9.64 (August 25, 2026)

  • AUDIT — 17-Pipeline Deep End-to-End Audit: Full code and security verification across all 17 pipelines including SSR routing, orphan cleanup, lock lifecycle, master downscaler, and LCP booster.
  • COMPLIANCE — Zero-Residue Lifecycle Cleanup: Added missing options (smrc_max_original_width, smrc_lcp_preload_enabled) to uninstall.php and activate() / maybe_upgrade() defaults.
  • HARDENING — Form Action & Superglobal Sanitization: Added strict sanitize_key() and wp_unslash() sanitization across admin form actions and AJAX request parameters.
  • TEST SUITE — Verified 100% test pass rate across 225 automated unit tests with 765 assertions.

1.9.63 (August 25, 2026)

  • REFACTOR — WordPress.org Directory Rebranding: Renamed plugin to LC Smart Media Redirect & Cleaner (slug: smart-media-redirect-cleaner) to ensure distinctiveness and eliminate generic/trademark collisions.
  • SECURITY — JSON Import Deep Sanitization: Added recursive sanitize_json_payload() sanitiz
27 Aug 2026Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)