Skip to content

Instantly share code, notes, and snippets.

View lukecav's full-sized avatar
Infinite data generation engine

Luke Cavanagh lukecav

Infinite data generation engine
View GitHub Profile
@lukecav
lukecav / Links
Created June 22, 2022 20:51
WordPress Toolkit for how to manage your site in Plesk
@lukecav
lukecav / Links
Created June 22, 2022 20:42
How to update the PHP version in cPanel for a domain
@lukecav
lukecav / functions.php
Created June 20, 2022 20:47
Disable default shipping method selected in WooCommerce
add_filter( 'woocommerce_shipping_chosen_method', '__return_false', 99);
@lukecav
lukecav / functions.php
Created June 17, 2022 16:30
Disable the Action Scheduler default queue runner
function asdds_disable_default_runner() {
if ( class_exists( 'ActionScheduler' ) ) {
remove_action( 'action_scheduler_run_queue', array( ActionScheduler::runner(), 'run' ) );
}
}
// ActionScheduler_QueueRunner::init() is attached to 'init' with priority 1, so we need to run after that
add_action( 'init', 'asdds_disable_default_runner', 10 );
@lukecav
lukecav / Commands
Last active June 16, 2022 20:49
Disable and enable the 2FA module in iThemes Security Pro
wp itsec modules disable two-factor
wp itsec modules enable two-factor
@lukecav
lukecav / Link
Created June 15, 2022 19:03
WordPress Toolkit CLI
@lukecav
lukecav / Commands
Created June 15, 2022 19:02
Commands to run for updating WordPress Toolkit
systemctl status wp-toolkit-scheduled-tasks
su wp-toolkit --shell=/bin/bash -c '/usr/bin/sw-engine -d auto_prepend_file=/usr/local/cpanel/3rdparty/wp-toolkit/scripts/scheduled-task-prepend-file.php /usr/local/cpanel/3rdparty/wp-toolkit/plib/scripts/instances-auto-update.php'
@lukecav
lukecav / Commands
Created June 15, 2022 17:57
Check CentOS version from command line
hostnamectl
rpm --eval '%{centos_ver}'
@lukecav
lukecav / functions.php
Created June 13, 2022 18:08
Disable persistent cart in WooCommerce
add_filter( ‘woocommerce_persistent_cart_enabled’, ‘__return_false’ );
@lukecav
lukecav / functions.php
Created June 13, 2022 16:19
Set cache lift span in WP-Optimize to 30 minutes
add_filter('wpo_option_key_page_cache_length', 'my_prefix_page_cache_length');
function my_prefix_page_cache_length() {
return 60 * 30;
}