Skip to content

Instantly share code, notes, and snippets.

@atif089
atif089 / Query
Created October 4, 2021 19:44 — forked from lukecav/Query
MySQL script to get all WooCommerce orders including metadata
select
p.ID as order_id,
p.post_date,
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email,
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name,
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name,
max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1,
max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2,
max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city,
max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state,
@atif089
atif089 / wordpress-ubuntu.sh
Last active January 21, 2020 23:50 — forked from bfocht/wordpress-ubuntu.sh
Install WordPress on ubuntu, PHP72 , apache, mysql, configure WordPress, wp-cli, phpUnit, WP Coding standards, letsencrypt
#!/bin/bash
#set the servername
SERVERNAME=
EMAIL=
mkdir /wpinstall
cd /wpinstall
#generate password for mysql