Skip to content

Instantly share code, notes, and snippets.

@wecreatedigital
wecreatedigital / gist:f52c2c8a897276d13a72c6bb2bdccb0e
Created May 23, 2021 13:15
SQL to export WooCommerce reviews
# 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'
@wecreatedigital
wecreatedigital / anonymise-wordpress-woocommerce.sql
Created May 4, 2020 11:13
A series of queries to anonymise WordPress/WooCommerce users and their orders
/**
* Author: Dean Appleton-Claydon
* Date: 02/05/2020
*
* A script to anonymise users and orders from a WordPress/WooCommerce website
* For use on development/staging/testing website, NOT suitable for production use!
*
* Read all queries in full to understand how the anonymisation process works.
* All WordPress/WooCommerce databases are different so extra care should be taken to ensure all personal data is anonymised.
*
@wecreatedigital
wecreatedigital / FishpigValetDriver.php
Created April 26, 2020 16:41
Magento 2, WordPress FishPig and Laravel Valet
<?php
/**
* Modified from: https://github.com/danielbachhuber/quickstart-minus-quickstart/blob/a0051a2298e7ec4e48dc1d9cc8c5ad644638e9dd/config/VipValetDriver.php
*/
class FishpigValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*