fix: avif tracking + new generate-missing-siblings command (v0.2.1)
Two related fixes to the AVIF pipeline: Fix #1 — postmeta tracking Format_Generator::process_avif_job() now updates _h4b_img_optim's avif_status from 'queued' → 'done' (with byte size) or 'error' (with reason) after the cron job runs. Previously the postmeta said 'queued' forever even when AVIF files existed on disk. Fix #2 — root cause of missing AVIFs on rds.ink bulk run wp_schedule_single_event(time()+30, …) coalesces identical args at the same timestamp, so bulk-queueing hundreds of AVIF jobs in the same second silently dropped many. Added wp h4b-img generate-missing-siblings that walks attachment metadata, finds files missing .webp/.avif, and generates them SYNCHRONOUSLY (no queue, no coalescing). Only processes registered sizes by default; --include-orphans flag for disk-walk mode. Verified on prod rds.ink: 1,134 of 1,737 registered images >=20KB have AVIF, 603 are missing. Of 389 orphan files >=20KB missing AVIF, those aren't referenced from any post/postmeta — correctly excluded. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ require_once H4B_IMG_OPTIM_DIR . 'includes/class-cli.php';
|
||||
require_once H4B_IMG_OPTIM_DIR . 'includes/class-cli-bulk.php';
|
||||
require_once H4B_IMG_OPTIM_DIR . 'includes/class-cli-rescue.php';
|
||||
require_once H4B_IMG_OPTIM_DIR . 'includes/class-cli-migrate.php';
|
||||
require_once H4B_IMG_OPTIM_DIR . 'includes/class-cli-siblings.php';
|
||||
require_once H4B_IMG_OPTIM_DIR . 'includes/class-picture-tag.php';
|
||||
|
||||
final class Plugin {
|
||||
|
||||
Reference in New Issue
Block a user