This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This script will delete all `on-hold` subscriptions and their orders and users. | |
* It will delete all subscriptions based on IP. | |
* | |
* wp eval-file delete-fraud-activity-by-ip.php 127.0.0.1 | |
* | |
* Dry run: | |
* wp eval-file delete-fraud-activity-by-ip 127.0.0.1 dry | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://deanandrews.uk/export-woocommerce-reviews-wordpress/ but enhanced to include the rating and filter out other comments. | |
``` | |
SELECT `post_title` AS 'Product', `comment_author` AS 'Customer Name', `comment_author_email` AS 'Customer Email', `comment_date`, `comment_content` AS 'Review', `wp_commentmeta`.`meta_value` AS 'Rating' | |
FROM `wp_comments` | |
INNER JOIN `wp_posts` ON `comment_post_ID`=`ID` | |
INNER JOIN `wp_commentmeta` ON `wp_commentmeta`.`comment_id`=`wp_comments`.`comment_ID` | |
WHERE `comment_author` != 'WooCommerce' | |
AND `wp_posts`.`post_type` = 'product' | |
AND `wp_posts`.`post_status` = 'publish' |
OlderNewer