Skip to content

Instantly share code, notes, and snippets.

Avatar
🌃
Do. Or do not. There is no try.

Luke Cavanagh lukecav

🌃
Do. Or do not. There is no try.
View GitHub Profile
@lukecav
lukecav / Command
Created May 13, 2021
Rollback the Dark Mode plugin to the previous version from a WP-CLI command
View Command
wp plugin install dark-mode --version=3.3.1 --activate
@lukecav
lukecav / functions.php
Created May 10, 2021
Disable the block editor in widgets in WordPress 5.8
View functions.php
add_filter( 'wp_use_widgets_block_editor', '__return_false' );
@lukecav
lukecav / Links
Created May 10, 2021
Mailchimp for WooCommerce plugin API issues
View Links
@lukecav
lukecav / Commands
Created May 6, 2021
Find the PHP-FPM usage and PHP-FPM average
View Commands
ps -ylC php-fpm --sort:rss
ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"Mb") }'
@lukecav
lukecav / Commands
Last active May 6, 2021
Display PHP-FPM pool information
View Commands
sudo apt-get install -y libfcgi0ldbl
sudo -u www-data bash -c "export SCRIPT_NAME=/status; export SCRIPT_FILENAME=/status; export REQUEST_METHOD=GET; cgi-fcgi -bind -connect /var/run/php/php7.3-fpm.sock"
sudo -u www-data bash -c "export SCRIPT_NAME=/status; export SCRIPT_FILENAME=/status; export QUERY_STRING=full; export REQUEST_METHOD=GET; cgi-fcgi -bind -connect /var/run/php/php7.3-fpm.sock"
@lukecav
lukecav / Links
Created May 5, 2021
Gatsby and Netlify caching and scaling
View Links
@lukecav
lukecav / Commands
Created May 5, 2021
Check which TLS version a sites server is running
View Commands
openssl s_client -connect google.com:443 -tls1_2
openssl s_client -connect google.com:443 -tls1_3
@lukecav
lukecav / wp-config.php
Last active May 4, 2021
Object Cache Pro set MaxTTL
View wp-config.php
define('WP_REDIS_CONFIG', [
'maxttl' => 3600 * 12, // 12 hours
]);
@lukecav
lukecav / Option name
Created May 4, 2021
Facebook for WooCommerce product sync job transient name
View Option name
wc_facebook_background_product_sync_job_%
@lukecav
lukecav / Command
Created Apr 30, 2021
Trigger a site scan in iThemes Security Pro plugin using a WP-CLI command
View Command
wp itsec site-scanner scan