Skip to content

Instantly share code, notes, and snippets.

View bhubbard's full-sized avatar
:octocat:
Hello

Brandon Hubbard bhubbard

:octocat:
Hello
View GitHub Profile

Disabling the Elementor Element Cache (introduced as a performance experiment) for specific pages is crucial when dealing with dynamic plugins like BuddyBoss, where content changes based on the user's login status or activity.

Since Elementor does not currently provide a single "on/off" toggle via a public hook for the entire page's Element Cache, the most reliable way to achieve this programmatically is by hooking into the Elementor CSS and cache rendering logic.

Method 1: The Recommended BuddyBoss/URL Snippet This code checks if the current URL contains BuddyBoss keywords (like members, groups, activity) or if it's a specific page ID, and then tells Elementor to bypass caching for those instances.

Add this to your child theme's functions.php or a functional plugin (like Code Snippets):

Method 2: Disabling Cache for Logged-In Users

<?php
/**
* Plugin Name: WP-CLI Custom Mail Command
* Description: Adds a native `wp mail` command to test and debug wp_mail() deliverability.
* Version: 1.0
*/
// Exit if WP-CLI is not running
if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
return;
@bhubbard
bhubbard / sz_ajax_logger.php
Created January 21, 2026 14:55 — forked from sabrina-zeidan/sz_ajax_logger.php
Save all AJAX queries performed to track AJAX performance [WordPress]
add_action('shutdown','sz_log_all_ajax_queries');
function sz_log_all_ajax_queries() {
global $wpdb;
if ( empty($wpdb->queries) ) {
return;
}
$timestamp = date('Y-m-d H:i:s');
You are an expert in WordPress design and the Ollie theme's color system. Your task is to help me define a new color palette for an Ollie-based WordPress site. I will provide you with details about the brand, target audience, and desired aesthetic. You will then propose a complete 11-slot color palette, adhering strictly to Ollie's color system guidelines.
**Ollie Color System Overview:**
* **11 Color Slots:** Each color has a specific purpose.
* **Brand Colors (4 slots):**
* `Brand` (primary) and `Brand Alt` (secondary brand color) are for main brand elements like buttons and CTAs.
* `Brand Accent` (for `Brand`) and `Brand Alt Accent` (for `Brand Alt`) are complementary accent colors, designed to work as text colors on their respective main brand colors (or vice-versa for backgrounds). They ensure good readability and contrast.
* **Neutral Colors (7 slots):** For foundational UI elements like backgrounds, text, and borders.
* `Base`: Default page background (typically light).
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/wp-admin/plugins.php",
"steps": [
{
"step": "login",
"username": "admin",
"password": "password"
},
{
<?php
/**
* Plugin Name: Bloomerang Data Exporter
* Description: Exports data from the Bloomerang API and saves it as JSON files in the uploads directory.
* Version: 1.0.0
* Author: Gemini
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: bloomerang-data-exporter
*/
<?php
// phpcs:disable WordPress.WP.AlternativeFunctions.curl_curl_init, WordPress.WP.AlternativeFunctions.curl_curl_exec, WordPress.WP.AlternativeFunctions.curl_curl_setopt, WordPress.WP.AlternativeFunctions.curl_curl_close, WordPress.WP.AlternativeFunctions.curl_curl_error
/**
* Cloudflare KV Object Cache
*
* Drop-in replacement for the WordPress Object Cache.
*
* File: object-cache.php
* Directory: /wp-content/
#!/bin/bash
# A WP-CLI script to install performance and image-related plugins,
# and then regenerate all media library thumbnails.
# --- Configuration ---
# Exit immediately if a command exits with a non-zero status.
set -e
# --- Script Start ---
#!/bin/bash
# A WP-CLI script to install, run, and uninstall the WP-Sweep plugin.
# This automates the process of cleaning the WordPress database.
# --- Configuration ---
# Exit immediately if a command exits with a non-zero status.
set -e
# --- Script Start ---
@bhubbard
bhubbard / Uconnect_mp4.json
Created February 9, 2025 04:50
UConnect Presets for Handbrake
{
"PresetList": [
{
"AlignAVStart": false,
"AudioCopyMask": [
"copy:aac"
],
"AudioEncoderFallback": "av_aac",
"AudioLanguageList": [
"eng"