The plug in is using a bad query that almost took our site down.
We run $order->get_coupon_codes() on the orders we have so that we can use the coupon info for other things. But in calling this instance method it seems the WC Smart Coupons plugin runs some other thing that seemingly cause problems in the DB:
SELECT * FROM wp_posts WHERE FIND_IN_SET (ID, (SELECT option_value FROM wp_options WHERE option_name = ‘sc_display_custom_credit_6896_1’)) > 0 GROUP BY ID ORDER BY post_date DESC
That takes forever and runs through N every time, could be replaced with
SELECT distinct * FROM wp_posts WHERE id in (SELECT option_value FROM wp_options WHERE option_name = ‘sc_display_custom_credit_6896_1’) ORDER BY post_date DESC
Which takes 0sec to complete
Open
Last updated: March 21, 2024
0 comments
Log in to comment on this feature request.