Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Added test if request is a REST API request so that cart is not loaded. #21090
Code inspired by WC_REST_Authentication::is_request_to_rest_api, but included also legacy API .
Changes proposed in this Pull Request:
Closes #20937 .
How to test the changes in this Pull Request:
@@ Coverage Diff @@ ## master #21090 +/- ## ========================================= Coverage ? 38.53% Complexity ? 13319 ========================================= Files ? 349 Lines ? 50325 Branches ? 0 ========================================= Hits ? 19390 Misses ? 30935 Partials ? 0
referenced this pull request
Aug 20, 2018
This will make plugins like this stop work: https://github.com/seb86/cart-rest-api-for-woocommerce
Good points, @claudiosanches, thanks for your review. It's true to that REST cart plugin would stop working, but on the other hand, I thought our stance is that REST api doesn't and won't support cart and should be stateless, so it kind of conflicts with each other. The fact that we run suboptimally and load the cart anyway should not be something others should rely on, I think.