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

Don't include WooCommerce config if plugin not active #27

Open
tyrann0us opened this issue May 23, 2019 · 1 comment
Open

Don't include WooCommerce config if plugin not active #27

tyrann0us opened this issue May 23, 2019 · 1 comment

Comments

@tyrann0us
Copy link
Contributor

The WooCommerce config file contains 50 keys (https://github.com/deliciousbrains/wp-migrate-db-anonymization/blob/5508a6c782b9efc8118562b5606b64bc3cec7d50/config/woocommerce.php). If WooCommerce is not active, each field is checked against these 50 keys in vain. With larger databases this will have a negative effect on the already poor migration performance.

My suggestion: Check whether WooCommerce is active at all before the config file is included.

@WillBrubaker
Copy link

If WooCommerce is not active, that is not an indication that WooCommerce customer data does not exist in the database. Perhaps the reason that it is deactivated is because everything else is too to try an get around the poor migration performance that you speak of. I wonder if a better check would be for the woocommerce_version option whether it exists or not e.g. https://github.com/woocommerce/woocommerce/blob/3.0.0/includes/class-wc-install.php#L225

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