Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider returning instead of exiting when WC/PHP reqs are not met #238

Open
xristos3490 opened this issue Sep 27, 2022 · 1 comment
Open

Comments

@xristos3490
Copy link

xristos3490 commented Sep 27, 2022

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-L168

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.

e.g.,

> wp plugin activate taxjar-simplified-taxes-for-woocommerce --skip-plugins --skip-themes

<strong>Please activate WooCommerce before activating TaxJar.</strong>% 

Expected solution

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.

@dallendalton
Copy link
Contributor

@xristos3490 Thanks for submitting this! We are looking into it and will post updates in this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants