Skip to content

v1.7.3 - Fix scan inconsistency

Choose a tag to compare

@mtallo22 mtallo22 released this 20 Apr 20:10
· 10 commits to main since this release

Bug Fix

Scan count inconsistency resolved — consecutive scans were returning different counts (e.g. 26 one run, 52 the next).

Root cause

The server-side hozio_scan_acc_ transient used to accumulate results across batches had a race condition on Redis/Memcached hosts: batch 0 would call set_transient([], ...) then immediately get_transient(), which returned the stale array from the previous scan due to object-cache write propagation delay. Batch 0 started with 26 old items, added 26 new ones = 52 total on the second run.

Fix

Eliminated the server-side accumulator entirely. PHP now returns only the current batch's results (batch_unused). The JavaScript client accumulates all batches, sorts by file size, and renders on completion — no cross-request state, no transient races possible.

Files changed

  • includes/class-unused-detector.php — removed hozio_scan_acc_ transient from scan_batch() and clear_scan_data()
  • admin/views/backups.php — JS accumulates results client-side
  • hozio-image-optimizer.php — version bump to 1.7.3