Skip to content

Instantly share code, notes, and snippets.

View lukecav's full-sized avatar
🪨
Words of encouragement

Luke Cavanagh lukecav

🪨
Words of encouragement
View GitHub Profile
@lukecav
lukecav / functions.php
Created May 12, 2026 16:24
Remove the Liquid Web software manager in wp-admin
add_action( 'admin_menu', function () {
remove_menu_page( 'lw-software-manager' );
}, 999 );
@lukecav
lukecav / Query
Last active May 8, 2026 18:25
MySQL script to get all WooCommerce orders including metadata
select
p.ID as order_id,
p.post_date,
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email,
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name,
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name,
max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1,
max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2,
max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city,
max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state,
@lukecav
lukecav / AGENTS.MD
Created September 15, 2025 21:07
AGENTS.MD — Codex Playbook for Building a WordPress Plugin

AGENTS.md — Codex Playbook for Building a WordPress Plugin

A precise, no-nonsense blueprint for orchestrating autonomous and semi-autonomous coding agents to plan, scaffold, implement, test, and ship a production‑grade WordPress plugin.


0) Purpose & Scope

This document defines the agents, tools, workflows, constraints, and acceptance criteria for using an agentic coding system ("Codex") to create and maintain a WordPress plugin. It is optimized for real, shippable code, not demos.

@lukecav
lukecav / Prompt examples
Last active April 15, 2026 12:23
Stable Diffusion XL Prompt examples
Cinematic images
detailed textures, sharp focus, ultra-high pixel detail, intricate, realistic, movie scene, cinematic, high-quality, full colors, incredibly detailed, 4k, 8k, 16k, hyper-realistic, RAW photo, masterpiece, ultra-detailed, professionally color graded, professional photography
cinematic, cinematic lighting, 8K raw photo, best quality, masterpiece, ultra high res, realistic, photography, digital painting, vibrant, intricate details, high-definition, detailed, sharp focus, 8k uhd
Lens Types
Wide-angle lens
Telephoto lens
@lukecav
lukecav / Commands
Created August 27, 2018 13:54
Delete unattached images using WP-CLI
wp post delete $(wp post list --post_type='attachment' --format=ids --post_parent=0)
wp post delete $(wp post list --post_type='attachment' \
--format=ids --post_parent=0 --post_mime_type='image/jpeg')
wp post delete $(wp post list --post_type='attachment' \
--format=ids --post_parent=0 --post_mime_type='image/png')
@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 / gist:4224fbb2a57383e3cc511f136697ef58
Last active March 16, 2026 13:35
gravity-forms-list-field-datepicker-plugin.php
<?php
/*
Plugin Name: Date Picker in List Fields for Gravity Forms
Description: Gives the option of adding a date picker to a list field column
Version: 1.6.2
Author: Adrian Gordon
Author URI: http://www.itsupportguides.com
License: GPL2
Text Domain: gravity-forms-list-field-date-picker
@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 / export-active-subscriptions.sql
Created February 19, 2026 17:54
HPOS-compatible SQL query to export active subscriptions in WooCommerce including start date, next payment date and last order date
SELECT
o.id AS subscription_id,
o.status AS subscription_status,
o.date_created_gmt AS date_created,
a.first_name,
a.last_name,
a.email,
o.total_amount,
o.currency,
last_order.meta_value AS last_order_date_created,
@lukecav
lukecav / Command
Last active February 20, 2026 20:55
Update Advanced Custom Field plugin using WP-CLI
wp plugin install --force https://www.advancedcustomfields.com/latest/