I want to create an custom plugin for woocommerce features so it is a dependent plugin so i need trigger an error that it requires woocommerce plugin and the plugin should not be activated if woocommerce plugin is not activated, please help

  • I expect there are plenty of existing plugins that do this that you can copy? I'd add an admin_init hook that checks if one of the WooCommerce classes exists - I'm not sure which to recommend - and if not add an admin_notices hook to output some warning HTML.
    – Rup
    Commented Apr 3, 2020 at 13:33
  • 2
    Does this answer your question? How to make a plugin require another plugin?
    – BenB
    Commented Apr 3, 2020 at 15:01


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.