woocommerce / wc-smooth-generator

Smooth product, customer and order generation for WooCommerce
315 stars 49 forks source link

disable WC emails on CLI customer, order generation #58

Closed rrennick closed 3 years ago

rrennick commented 3 years ago

This PR unhooks the WooCommerce customer and order emails when generating objects via the WP CLI command. The performance improvement in my dev environment on 1000 orders was ~15%.

Closes #13

Testing

1- Run wp wc generate orders 1- Run wp wc generate customers

zhongruige commented 3 years ago

When running this, I found that emails were still sent out. This was the flow I followed:

rrennick commented 3 years ago

refresh the WP Mail log page at wp-admin/tools.php?page=wpml_plugin_log and note the number increments

@zhongruige In my environment, I don't have any emails logged in trunk or this branch. Which emails did you see logged?

zhongruige commented 3 years ago

@rrennick I was seeing the following emails come in:

Screen Shot 2021-08-03 at 10 59 15

The only difference I can think of is I was testing this using a hosted environment where the the emailer is set up and emails are sent, while, for example, I know in some local environments emails aren't actually sent out. So maybe that could be the difference?

rrennick commented 3 years ago

@zhongruige Thanks for the review. I've updated the PR to unhook all the transactional emails.