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?
to your account
This was bought up in conversation with @pmgarman.
Issue is every time a coupon is used, a meta value is stored in _used_by. Coupons used hundreds of thousands of times cause issue on load.
We should look into a better way of storing this data.
The text was updated successfully, but these errors were encountered:
I posted in my dev blog a bit of background on how this can cripple a site in an edge case.
Sorry, something went wrong.
IMO use different table for that.
That's my opinion as well
Having this stored as meta on the coupon also makes it difficult to track down what coupons a given user has used. Let me look into the schema and see what I can come up with.
Okay, first swing at this completed:
When calling validate_user_usage_limit() -- we really don't need all the data for all usages, so I simplified the check in e6b7d5c
I also optimized some calls we're using in populate() with 6ef4cf0
Pull request generated as #8940
Merge pull request #8940 from woothemes/issues/8482
Tidy up how we're dealing with coupon postmeta around `_used_by` which can get big.
Successfully merging a pull request may close this issue.