Skip to content

Instantly share code, notes, and snippets.

View sebastianmoran-mainwp's full-sized avatar
🚀
Fast Lane Strategies: Turbocharging Your WordPress Website for Optimal Speed.

Sebastian Moran sebastianmoran-mainwp

🚀
Fast Lane Strategies: Turbocharging Your WordPress Website for Optimal Speed.
View GitHub Profile
@sebastianmoran-mainwp
sebastianmoran-mainwp / update.php
Created September 20, 2018 04:10 — forked from thisislawatts/update.php
Force database upgrade in Advanced Custom Fields
<?php
class acf_update {
/*
* __construct
*
* A good place to add actions / filters
*
* @type functionac
@sebastianmoran-mainwp
sebastianmoran-mainwp / Command
Created September 20, 2018 04:13
WP-CLI command to get the Advanced Custom Field version installed
wp option get acf_version
@sebastianmoran-mainwp
sebastianmoran-mainwp / DNS Prefetch domains
Created October 10, 2018 03:28
WP Rocket - Advanced Options Prefetch DNS requests
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@sebastianmoran-mainwp
sebastianmoran-mainwp / Export
Last active October 15, 2018 22:42
MainWP Site - WP Disable Settings
eyJ3cC1kaXNhYmxlIjp7ImRpc2FibGVfZ3JhdmF0YXJzIjowLCJkaXNhYmxlX2dyYXZhdGFyc19vbmx5X2NvbW1lbnRzIjowLCJkaXNhYmxlX3JlZmVycmFsX3NwYW0iOjAsInJlbW92ZV9qcXVlcnlfbWlncmF0ZSI6MCwiZG5zX3ByZWZldGNoIjoxLCJkbnNfcHJlZmV0Y2hfaG9zdF9saXN0Ijoid3d3Lmdvb2dsZS1hbmFseXRpY3MuY29tXHJcbmNkbi5pdWJlbmRhLmNvbVxyXG53d3cuZ29vZ2xlLmNvbVxyXG5mb250cy5nb29nbGVhcGlzLmNvbVxyXG53d3cuZ3N0YXRpYy5jb21cclxubWF4Y2RuLmJvb3RzdHJhcGNkbi5jb21cclxuanMtYWdlbnQubmV3cmVsaWMuY29tXHJcbmhpdHMtaS5pdWJlbmRhLmNvbVxyXG5iYW0ubnItZGF0YS5uZXQiLCJkaXNhYmxlX2Vtb2ppIjoxLCJkaXNhYmxlX2VtYmVkcyI6MSwicmVtb3ZlX3F1ZXJ5c3RyaW5ncyI6MCwibGF6eV9sb2FkX2dvb2dsZV9mb250cyI6MSwibGF6eV9sb2FkX2ZvbnRfYXdlc29tZSI6MSwicmVtb3ZlX3lvYXN0X2NvbW1lbnQiOjEsInJlbW92ZV95b2FzdF9icmVhZGNydW1ic19kdXBsaWNhdGVzIjoxLCJkZWZhdWx0X3Bpbmdfc3RhdHVzIjowLCJkaXNhYmxlX2FsbF9jb21tZW50cyI6MCwiZGlzYWJsZV9hdXRob3JfcGFnZXMiOjAsImRpc2FibGVfY29tbWVudHNfb25fY2VydGFpbl9wb3N0X3R5cGVzIjoxLCJkaXNhYmxlX2NvbW1lbnRzX29uX3Bvc3RfdHlwZXMiOnsicGFnZSI6IjEiLCJhdHRhY2htZW50IjoiMSIsInF1aWNrX3N0YXJ0IjoiMSIsImZhcXMiOiIxIiwiY2hhbmdlbG9nIjoi
@sebastianmoran-mainwp
sebastianmoran-mainwp / plugin-status.yml
Created October 23, 2018 17:30
WP-CLI - wp doctor plugin-status.yml example
plugin-mainwp-child-active:
check: Plugin_Status
options:
name: mainwp-child
status: active
plugin-classic-editor-active:
check: Plugin_Status
options:
name: classic-editor
status: active
@sebastianmoran-mainwp
sebastianmoran-mainwp / Commands
Last active October 26, 2018 15:21
Common and handy WP-CLI commands
wp plugin list
wp plugin deactivate --all
wp plugin install contact-form-7 --version=5.0.3 --force
wp theme active twentyseventeen
wp theme install astra --active
wp db export
wp db reset --yes
wp db import filename.sql
wp db size
wp db size --tables
@sebastianmoran-mainwp
sebastianmoran-mainwp / Commands
Last active November 1, 2018 03:43
WP-CLI wp profile handy commands
wp profile stage
wp profile stage bootstrap
wp profile stage --all
wp profile stage --all --spotlight
wp profile hook wp
wp profile hook --all
wp profile hook --all --spotlight
wp profile hook --all --spotlight --url=https://mainwp.com/presales-faq/
wp profile hook plugins_loaded --url=https://mainwp.com --fields=callback,time,location
wp profile hook --all --spotlight --skip-plugins=contact-form-7
@sebastianmoran-mainwp
sebastianmoran-mainwp / Commands
Last active November 21, 2018 04:34
WP-CLI cron events commands
wp cron test
wp cron event list
wp cron event delete delete_version_transients
wp option delete cron
@sebastianmoran-mainwp
sebastianmoran-mainwp / Command
Created January 29, 2019 04:29
Delete readme.html and wp-config-sample.php files from WordPress installs
rm -f readme.html wp-config-sample.php
@sebastianmoran-mainwp
sebastianmoran-mainwp / import-file.csv
Last active January 29, 2019 04:35
Redirection plugin - readme.html redirect
source target regex type code match hits title
/readme.html / 0 url 301 url 0