You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handler base classes — Extracted 5 abstract handler base classes to eliminate duplicated constructor, logger, and shared helper logic across 13 handler files:
push_entity() helper — Module_Helpers::push_entity(module, entity, setting_key, wp_id) consolidates the repeated guard + map + queue pattern into a single method. Now used by 24 hook callbacks across 19 trait files (was 6 across 3). Removed unused Queue_Manager imports from 10 traits
LMS_Module_Base abstract class — Converted LMS_Helpers trait to LMS_Module_Base abstract class extending Module_Base, aligning with Membership_Module_Base, Booking_Module_Base, etc. LearnDash and LifterLMS modules now extend this intermediate base class instead of using a trait
CLI match expressions — Converted queue() and module() subcommand dispatch from switch to PHP 8.0 match expressions in CLI
Handler tests — 9 handler test classes refactored to extend Module_Test_Case, removing ~100 lines of duplicated $wpdb stub initialization and global store resets. 8 new tests: 4 for push_entity(), 2 for Booking_Handler_Base, 2 for LMS_Module_Base
Queue stats consolidation — Sync_Queue_Repository::get_stats() merged 3 separate SQL queries (pending count, failed count, last completed timestamp) into a single GROUP BY status query. Cache invalidation moved from per-job update_status() to a single invalidate_stats_cache() call at end of batch processing in Sync_Engine, eliminating transient thrashing during large batches
Webhook dedup window — Webhook_Handler::DEDUP_WINDOW increased from 300 s (5 min) to 1800 s (30 min) to prevent duplicate processing of retried Odoo webhooks
i18n hardcoded labels — Wrapped remaining hardcoded UI strings with translation functions: log level labels in tab-logs.php, direction labels (WP → Odoo / Odoo → WP) in tab-queue.php, class-admin.php, and admin.js
Fixed
Batch creates JSON decode — Added json_last_error() validation in Sync_Engine::process_batch_creates() for individual job payloads (matching the existing check in single-job processing). Invalid JSON now correctly marks the job as Error_Type::Permanent instead of silently skipping
Remaining counter — Sync_Engine remaining jobs counter now subtracts both individually processed and batch-grouped job counts, preventing inflated "remaining" log entries
Tests
292 new unit tests — 15 new test files covering previously untested base classes, handlers, and modules:
CRMModuleTest (55 tests) — CRM_Module push/pull contacts and leads