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.
This commit is contained in:
@@ -21,8 +21,10 @@ class LicensingModule {
|
|||||||
// Register settings schema
|
// Register settings schema
|
||||||
LicensingSettings::init();
|
LicensingSettings::init();
|
||||||
|
|
||||||
// Initialize license manager when module is enabled
|
// Initialize license manager immediately since we're already in plugins_loaded
|
||||||
add_action('plugins_loaded', [__CLASS__, 'maybe_init_manager'], 20);
|
// 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
|
// Install tables on module enable
|
||||||
add_action('woonoow/module/enabled', [__CLASS__, 'on_module_enabled']);
|
add_action('woonoow/module/enabled', [__CLASS__, 'on_module_enabled']);
|
||||||
|
|||||||
Reference in New Issue
Block a user