Skip to content

Instantly share code, notes, and snippets.

View lukecav's full-sized avatar
👻
Creature stole my twinkie!

Luke Cavanagh lukecav

👻
Creature stole my twinkie!
View GitHub Profile
@lukecav
lukecav / functions.php
Created October 28, 2026 23:29
Set the elementor/tracker/send_event cron event tracker to send every 7 days not daily
add_action('init', function () {
$hook = 'elementor/tracker/send_event';
// Register weekly schedule if unavailable.
add_filter('cron_schedules', function ($schedules) {
$schedules['weekly'] = [
'interval' => WEEK_IN_SECONDS,
'display' => 'Once Weekly',
];
return $schedules;
@lukecav
lukecav / Links
Last active October 28, 2026 21:00
Major security alert: PHP vulnerable to critical RCE - CVE-2026-109618 and CVE-2026-109619 (PHP2Shell)
@lukecav
lukecav / Links
Created September 23, 2026 23:05
How to use jev
@lukecav
lukecav / MySQL query
Created June 16, 2026 17:04
Keeps logs from the last 30 days and deletes anything with a log_date_gmt older than 30 days in the wp_actionscheduler_logs database table
Preview
SELECT COUNT(*)
FROM wp_actionscheduler_logs
WHERE log_date_gmt < NOW() - INTERVAL 30 DAY;
Actual
DELETE FROM wp_actionscheduler_logs
WHERE log_date_gmt < NOW() - INTERVAL 30 DAY;
@lukecav
lukecav / functions.php
Created May 26, 2026 17:19
Remove "Liquid Web Products" submenu from Settings in wp-admin
add_action( 'admin_menu', function () {
remove_submenu_page(
'options-general.php',
'lw-software-manager'
);
}, 999 );
@lukecav
lukecav / Links
Created May 14, 2026 22:21
NGINX Rift (CVE-2026-42945): Patched nginx available in testing
@lukecav
lukecav / functions.php
Last active May 14, 2026 20:13
Remove the Liquid Web software manager in wp-admin
add_action( 'admin_menu', 'hide_liquid_web_licensing_menu_item', 999 );
function hide_liquid_web_licensing_menu_item() {
remove_menu_page( 'lw-software-manager' );
}
@lukecav
lukecav / affiliates-query.sql
Created March 20, 2026 17:38
FluentAffiliate - SQL query to export affiliate data
SELECT
-- Affiliate info
a.id AS affiliate_id,
a.user_id AS affiliate_user_id,
a.status AS affiliate_status,
a.rate AS commission_rate,
a.rate_type,
a.total_earnings,
a.unpaid_earnings,
a.referrals AS total_referral_count,
@lukecav
lukecav / Command
Created March 11, 2026 22:06
Delete all specific prefix based cron events via WP-CLI
wp cron event list --fields=hook --format=csv \
| tail -n +2 \
| grep -E '^(stellarwp|nexcess)' \
| sort -u \
| while IFS= read -r hook; do
wp cron event delete "$hook"
done
@lukecav
lukecav / functions.php
Last active February 20, 2026 20:48
On the subscriptions list screen in wp-admin change the search order button to be search subscriptions in WooCommerce
add_filter( 'gettext', function( $translated, $text, $domain ) {
// Only target WooCommerce strings in admin
if ( ! is_admin() || $domain !== 'woocommerce' ) {
return $translated;
}
// Check we're on the subscriptions list screen
$screen = get_current_screen();
if ( $screen && $screen->id === 'woocommerce_page_wc-orders--shop_subscription' ) {