v1.0.32
What's new in v1.0.32
Fix — orphaned pending-ticket cleanup fallback. LFW's cancel/refund cleanup depends on the lty_ticket_ids_in_order order meta and never runs on trash/delete. When it misses, lty_ticket_pending posts survive, count as "placed" in LFW's stock recalculation on product save, and eventually drive the product to negative stock — WooCommerce then blocks add-to-cart while the progress bar still shows tickets available (incident 2026-07-02, product 112077: 12,942 orphans from three trashed bulk orders set stock to −4 at 17,058/30,000 sold and locked 11 instant-win prizes).
inc/order-ticket-cleanup-fallback.php— on order cancel/refund/fail/trash/delete (after LFW's own handlers), removes leftover pending tickets by theirlty_order_idmeta, resets locked instant-win logs, prunes both hold-ticket metas, and flushes LFW counter transients. No-op when LFW's cleanup worked.scripts/fix-orphaned-lottery-tickets.php— WP-CLI repair for existing orphans (dry-run by default;apply, optionalclear-holds) with stock recalculation.docs/ORDER-TICKET-CLEANUP.md— incident background and production runbook.