Skip to content

Instantly share code, notes, and snippets.

Warren Holmes warrendholmes

Block or report user

Report or block warrendholmes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mojo-ping
"email": "string",
"first_name": "string",
"last_name": "string",
"order_id": "string",
"is_production": "string",
"action": "ACTION",
"products": [
View gist:cfcf399faf638a77c75f
<link rel="stylesheet" type="text/css" href="//">
<body class="page page-id-18553 page-parent page-template page-template-template-my-account page-template-template-my-account-php woocommerce-account woocommerce-page chrome feature-3">
<script src="//"></script>
Appcues.identify('52175', {
email: '',
name: 'wdh',
View gist:3247acb399183c016745
DATE_FORMAT( date_created, '%Y-%m' ),
COUNT( * ) AS 'Licenses Created',
SUM( IF( DATE_FORMAT( date_created, '%Y-%m-%d' ) < '2013-08-01', IF( DATE_ADD( date_created, INTERVAL 2 YEAR ) > support_expiry_date, 0, 1 ), IF( DATE_ADD( date_created, INTERVAL 1 YEAR ) > support_expiry_date, 0, 1 ) ) ) as 'Licenses Renewed'
FROM license
WHERE lifetime <> 1
and product_id not in (18596,18606,18608,18656,18825,56536,56542,56546,56551,56552,56553,56556,56557,56558,56559,56560,56561,56562,56563,56564,120726,120727,120728,120730,120733,120736,120741,120744,120745,120746,120748,120749,120750,120752,120753,120754,120755,120759,124451,131599,135051,138175,142278,143158,168744,170213,176537,185343,190246,190248,196635,197567,201497,202412,204152,213827,222996,225393,226188,234845,238816,239962,244762,290592,291779,312408,312508,435830,435833,435834,474603,475304,489666,491331,493046,497916,502349,524956,536332,543228,565154)
GROUP BY DATE_FORMAT( date_created, '%Y-%m' )
ORDER BY DATE_FORMAT( date_created, '%Y
View gist:ea10faab9481c72c8b8b
<!-- Begin Inspectlet Embed Code -->
<script type="text/javascript" id="inspectletjs">
window.__insp = window.__insp || [];
__insp.push(['wid', 797319850]);
(function() {
function __ldinsp(){var insp = document.createElement('script'); insp.type = 'text/javascript'; insp.async = true; = "inspsync"; insp.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(insp, x); }
if (window.attachEvent){
window.attachEvent('onload', __ldinsp);
window.addEventListener('load', __ldinsp, false);
View gist:e792706fcc01d8451529
//Get cohort report on WC buyers
SELECT DATE_FORMAT(, '%Y-%m' ) as 'Year/Month', count( as 'Total orders', count( DISTINCT ) as 'Number of users', SUM( oi.line_item_total ) as 'Gross Revenue'
FROM order_item as oi
LEFT JOIN `order` as o on oi.order_id =
left join customer as c on o.customer_id =
LEFT JOIN product as p on = oi.product_id
LEFT JOIN product_product_cat_rel AS rel on rel.product_id =
WHERE DATE_FORMAT(c.date_registered, '%Y-%m') = '2014-01'
AND oi.line_item_total > 0
AND DATE_FORMAT(, '%Y') > 2013
View gist:d6e57529dcf64d87c8c8
All revenue data by month / year
SELECT sum(oi.line_item_total), date_format(, '%m-%Y' ) FROM `order_item` as oi join `order` as o on = oi.order_id group by date_format(, '%m-%Y' ) order by asc
All revenue data by month / year and product
SELECT sum(oi.line_item_total), date_format(, '%m-%Y' ), oi.product_id FROM `order_item` as oi join `order` as o on = oi.order_id group by date_format(, '%m-%Y' ), oi.product_id order by asc
All recurring revenue data by month / year and product
SELECT sum(oi.line_item_total), date_format(, '%m-%Y' ), oi.product_id FROM `order_item` as oi join `order` as o on = oi.order_id where oi.recurring = 1 group by date_format(, '%m-%Y' ), oi.product_id order by asc
Customers added
View bundleana.php
$order_data_normalized = array();
$starter_bundle = array('27147','18618','18718','18686');
$row = 1;
if (($handle = fopen("/Users/warrenholmes/Sites/phpinfo/wp_woocommerce_downloadable_product_permissions.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
View alef1
$args = array(
‘posts_per_page’ => 1,
‘post_type’ => ‘product’,
‘post_status’ => array( ‘publish’, ‘trash’, ‘draft’, ‘pending’ ),
‘meta_query’ => array(
‘key’ => ‘_spin_id’,
‘value’ => (string) trim($p->SpinId),
) )
View Flexslider Options
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade", //String: Select your animation type, "fade" or "slide"
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false, //{NEW} Boolean: Reverse the animation direction
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
startAt: 0, //Integer: The slide that the slider should start on. Array nota
You can’t perform that action at this time.