SOAP Session and Scripts

/** ==================================================================== * Snippet 2: Session and Script Management (UPDATED & SECURE) * * This version removes the insecure credential passing and adds a * secure nonce for logged-in user actions. * ==================================================================== */ if ( ! function_exists( ‘gb_start_session_if_needed’ )…Continue reading

SOAP Logic and Handlers

/** ==================================================================== * Snippet 1: SOAP Logic and Data Handling (WITH CACHING) * ==================================================================== */ require_once( ABSPATH . ‘youraccount/OnlineSoapClient.php’ ); // — Constants for Rate Limiting — define(‘GB_LOGIN_ATTEMPTS_LIMIT’, 5); define(‘GB_LOGIN_LOCKOUT_PERIOD’, 5 * MINUTE_IN_SECONDS); // — Helper function to get the…Continue reading

Email Verification Endpoint

/** * ==================================================================== * Snippet: Handle Email Verification Endpoint * ==================================================================== * This snippet creates a virtual page at /verify-email/ to handle * email verification without needing to create a page in the WP admin. */ // 1. Register a…Continue reading

Secure Bill Breakdown Page Access

/** * ==================================================================== * Snippet: Secure Bill Breakdown Page Access (with Encryption & Editor Bypass) * ==================================================================== * This runs before the /bill-breakdown page loads to decrypt and * verify the user has permission. It now includes a bypass for…Continue reading

Disable Thumbnail Image Sizes (copy)

add_filter( ‘intermediate_image_sizes_advanced’, function( $sizes ) { // Disable specific thumbnail sizes, uncomment the ones you want to disable. // unset( $sizes[‘thumbnail’] ); // 150px x 150px // unset( $sizes[‘medium’] ); // 300px x 300px // unset( $sizes[‘medium_large’] ); // 768px…Continue reading

Generate Branded WP Maintenance Page

function rd_client_write_maintenance_dropin() { if (!function_exists(‘rd_client_get_brand_tokens’) || !function_exists(‘rd_client_brand_css_vars_from_tokens’)) { return new WP_Error(‘rd_tokens_missing’, ‘Brand token helpers are not loaded.’); } $tokens = rd_client_get_brand_tokens(); $vars_css = rd_client_brand_css_vars_from_tokens($tokens); // Favicon: token override, else Site Icon $favicon = ”; if (!empty($tokens[‘favicon_url’])) { $favicon = $tokens[‘favicon_url’];…Continue reading

Style Custom WP Error Page

if ( ! defined(‘RD_WP_DIE_BRANDER’) ) { return; } add_filter(‘rd_wp_die_head_css’, function ($css) { // Load tokens and convert to CSS variables $tokens = rd_client_get_brand_tokens(); $vars = ‘:root{‘.rd_client_brand_css_vars_from_tokens($tokens).’}’; $css .= $vars .Continue reading

Assign WP Error Page HTML Class and Change Title

if ( ! defined(‘RD_WP_DIE_BRANDER’) ) { define(‘RD_WP_DIE_BRANDER’, true); } add_action(‘plugins_loaded’, function () { if ((function_exists(‘wp_doing_ajax’) && wp_doing_ajax()) || (function_exists(‘wp_is_json_request’) && wp_is_json_request()) || (defined(‘XMLRPC_REQUEST’) && XMLRPC_REQUEST)) { return; } add_filter(‘wp_die_handler’, function () { return ‘rd_wp_die_passthrough_handler’; }); }); function rd_wp_die_passthrough_handler( $message, $title…Continue reading

[DO NOT PUSH] Branding Tokens for WP Pages Customisation

add_filter(‘rd_client_brand_tokens’, function ($t) { return array_merge($t, [ // Colours ‘color_primary’ => ‘#231f20’, ‘color_accent’ => ‘#881721’, ‘color_bg’ => ‘#ffffff’, ‘color_bg_alt’ => ‘#881721’, ‘color_text’ => ‘#231f20’, ‘color_link’ => ‘#231f20’, ‘color_link_hover’ => ‘#881721’, // Fonts ‘font_family’ => ‘Roboto, system-ui, -apple-system, “Segoe UI”, Roboto,…Continue reading