From d262bd3ae8a257731d2f9cbb37f443ab67c0b096 Mon Sep 17 00:00:00 2001 From: Dwindi Ramadhana Date: Wed, 7 Jan 2026 23:07:45 +0700 Subject: [PATCH] fix: license generation not working - hook timing issue Root cause: LicensingModule::init() was called from within plugins_loaded but then tried to add ANOTHER plugins_loaded action for LicenseManager::init(). Since plugins_loaded already fired, LicenseManager::init() never ran and WooCommerce order hooks were never registered. Fix: Call self::maybe_init_manager() directly instead of scheduling via add_action. --- includes/Modules/Licensing/LicensingModule.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Modules/Licensing/LicensingModule.php b/includes/Modules/Licensing/LicensingModule.php index 4292ffc..e79b05f 100644 --- a/includes/Modules/Licensing/LicensingModule.php +++ b/includes/Modules/Licensing/LicensingModule.php @@ -21,8 +21,10 @@ class LicensingModule { // Register settings schema LicensingSettings::init(); - // Initialize license manager when module is enabled - add_action('plugins_loaded', [__CLASS__, 'maybe_init_manager'], 20); + // Initialize license manager immediately since we're already in plugins_loaded + // Note: This is called from woonoow.php inside plugins_loaded action, + // so we can call maybe_init_manager directly instead of scheduling another hook + self::maybe_init_manager(); // Install tables on module enable add_action('woonoow/module/enabled', [__CLASS__, 'on_module_enabled']);