Skip to content

Instantly share code, notes, and snippets.

😆
He who laughs most, learns best.

Luke Cavanagh lukecav

View GitHub Profile
@lukecav
lukecav / wp-config.php
Created May 24, 2018
Delete WooCommerce data after uninstalling on a site
View wp-config.php
define( 'WC_REMOVE_ALL_DATA', true);
@lukecav
lukecav / Commands
Last active May 24, 2018
WP-CLI commands to deactive, uninstall and remove the option value set by WooCommerce Custom Orders Table plugin
View Commands
wp plugin deactivate woocommerce-custom-orders-table
wp plugin uninstall woocommerce-custom-orders-table
wp option delete wc_orders_table_version
@lukecav
lukecav / Command
Last active May 24, 2018
WP Migrate DB Pro WP-CLI command to export the site db and exclude products and orders from a WooCommerce site
View Command
wp migratedb export site-db.sql.gz --exclude-post-types=product,shop_order --skip-replace-guids --gzip-file
@lukecav
lukecav / Command
Last active May 24, 2018
Export a site DB but exclude users, orders and payment db tables from WooCommerce using WP-CLI
View Command
wp db export --exclude_tables=wp_woocommerce_orders,wp_woocommerce_order_items,wp_woocommerce_order_itemmeta,wp_woocommerce_payment_tokens,wp_woocommerce_payment_tokenmeta,wp_users,wp_usermeta
@lukecav
lukecav / Commands
Last active Jun 13, 2018
Export orders and products from WooCommerce using WP-CLI
View Commands
wp export --dir=/wp-content/backup/ --post_type=shop_order --start_date=2018-05-03 --end_date=2018-05-24
wp export --dir=/wp-content/backup/ --post_type=product --start_date=2018-05-03 --end_date=2018-05-24
wp import demosite.wordpress.2018-05-24.xml --path=/wp-content/backup/
@lukecav
lukecav / Custom DB tables
Created May 24, 2018
Cerber Security & Antispam plugin
View Custom DB tables
cerber_acl
cerber_blocks
cerber_countries
cerber_lab
cerber_lab_ip
cerber_lab_net
cerber_log
cerber_traffic
@lukecav
lukecav / Commands
Created May 22, 2018
Check memory usage in Linux
View Commands
free -m
free -g
vmstat -s
@lukecav
lukecav / wp-config.php
Created May 22, 2018
Automatic updates for all plugins and themes in WordPress
View wp-config.php
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
@lukecav
lukecav / functions.php
Created May 18, 2018
Update Zapier feed after entry is updated in GravityView
View functions.php
add_action( 'gravityview/edit_entry/after_update', array( $this, 'gform_after_update_entry_2', 'send_to_zapier_on_update', 10, 2 );
function send_to_zapier_on_update( $form, $entry_id ) {
$entry = GFAPI::get_entry( $entry_id );
GFZapier::send_form_data_to_zapier( $entry, $form );
}
@lukecav
lukecav / functions.php
Created May 18, 2018
Update Zapier feed after entry is updated in Gravity Forms
View functions.php
add_action( 'gform_after_update_entry_2', 'send_to_zapier_on_update', 10, 2 );
function send_to_zapier_on_update( $form, $entry_id ) {
$entry = GFAPI::get_entry( $entry_id );
GFZapier::send_form_data_to_zapier( $entry, $form );
}
You can’t perform that action at this time.