Support for Woocommerce customers
-
I was able to filter woocommerce customers from getting deleted and i have modified your query to the following
$sql = "SELECT $select FROM ${pre}users AS u ". "LEFT OUTER JOIN ${pre}comments AS c ON u.ID = c.user_id ". "LEFT OUTER JOIN ${pre}posts AS p ON u.ID = p.post_author ". "LEFT OUTER JOIN ${pre}links AS l ON u.ID = l.link_owner ". "WHERE c.user_id IS NULL ". "AND p.post_author IS NULL AND l.link_owner IS NULL ". "AND u.ID NOT IN (SELECT DISTINCT(meta_value) from ${pre}postmeta WHERE meta_key = '_customer_user') ". $this->getUserWhitelistSQL()." ". "AND u.user_registered < DATE_ADD(NOW(), INTERVAL -$daysGrace DAY) ". "GROUP BY u.ID${limit};";
Above query works fine but as i have thousands of users in my users table your plugin get crashed. Can you help me how we can optimize this?
If we can fix this then your plugin can add this feature to filter woocommerce customers. Because woocommerce stores order data in postmeta table and customer id is stored in the meta_value where meta_key = ‘_customer_user’
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Support for Woocommerce customers’ is closed to new replies.