Open xristos3490 opened 2 years ago
Currently, there is an exit() function when certain requirements are not met in the activation process. See https://github.com/taxjar/taxjar-woocommerce-plugin/blob/master/taxjar-woocommerce.php#L161-L168
exit()
This check results in errors when hosts manage the plugins using WP-CLI in conjunction with the --skip-plugins argument. Therefore, the plugin cannot be activated using wp-cli in isolation mode.
--skip-plugins
e.g.,
> wp plugin activate taxjar-simplified-taxes-for-woocommerce --skip-plugins --skip-themes <strong>Please activate WooCommerce before activating TaxJar.</strong>%
Consider bailing early with return calls instead of exiting. This part also seems relative: https://github.com/taxjar/taxjar-woocommerce-plugin/blob/master/taxjar-woocommerce.php#L27-L36 but i guess the register_activation_hook() runs independently. If so, TaxJar might need a small refactor to play well with the best practices.
return
exit
register_activation_hook()
@xristos3490 Thanks for submitting this! We are looking into it and will post updates in this thread.
Description
Currently, there is an
exit()
function when certain requirements are not met in the activation process. See https://github.com/taxjar/taxjar-woocommerce-plugin/blob/master/taxjar-woocommerce.php#L161-L168This check results in errors when hosts manage the plugins using WP-CLI in conjunction with the
--skip-plugins
argument. Therefore, the plugin cannot be activated using wp-cli in isolation mode.e.g.,
Expected solution
Consider bailing early with
return
calls instead ofexit
ing. This part also seems relative: https://github.com/taxjar/taxjar-woocommerce-plugin/blob/master/taxjar-woocommerce.php#L27-L36 but i guess theregister_activation_hook()
runs independently. If so, TaxJar might need a small refactor to play well with the best practices.