Requirement for Woocommerce in Must Use plugins
-
Hello there,
I wish to use your plugin with a WP install where I put Woocommerce in mu-plugins. Unfortunately yout plugin refuses to work if it does not detect woocommerce activated as regular plugin.I managed to trick your verification located in WPO_WCPDF::is_woocommerce_activated() by hooking like this :
- enable a flag in a ‘muplugins_loaded’ hook
- check flag is ON in a ‘option_active_plugins’ hook and if so push ‘woocommerce/woocommerce.php’ to plugins array (coming from in active_plugins)
- disable flag in a ‘plugins_loaded’ hook fired lately (ex: 99)
This is working but that would be nice that your plugin could check if WC does not exists in WPMU_PLUGIN_DIR
If someone’s wonder why to use a flag: if you don’t, when WP core do_action( ‘option_active_plugins’ ) for its own purposes, it gets your woocommerce push to the unserialized active_plugins option and this may cause you some trouble (at least an updated option with as many [‘woocommerce/woocommerce.php’] as plugins you enabled/disabled and a persistent notice in dashboard complaining about woocommerce not found among plugins).
- The topic ‘Requirement for Woocommerce in Must Use plugins’ is closed to new replies.