Get_Posts() with numberposts set to -1
-
Hello,
Description of issue
In the method
ShareASale_WC_Tracker_Pixel::get_customer_status()
there is a call to get_posts() that has numberposts set to -1. On sites with over a million orders this is a very expensive query. Since this method is hooked intowoocommerce_thankyou
it can cause the WooCommerce Order Completed page to take 10+ seconds to render.Possible fixes
1. It would be helpful for sites that do not want run this expensive query to have a setting to turn it off.
2. Replace the expensive query with another method like adding a user meta of “total orders” that can be updates after an order is placed.
Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get_Posts() with numberposts set to -1’ is closed to new replies.