HEX
Server: Apache/2.4.66 (Debian)
System: Linux 3e214bd180d4 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/mu-plugins/00_mailchimp_override.php
<?php
/**
 * Override Liquid_MailChimp class to prevent frontend API calls
 * The newsletter widget calls get_mailchimp_lists() in register_controls()
 * which makes a curl request to Mailchimp API, taking 10+ seconds on frontend
 */

// This file must load BEFORE hub-core loads the real class
// Define the class early to prevent hub-core from overriding it with the real one
// (class_exists check in mailchimp.php will prevent redefinition)

if (!class_exists('Liquid_MailChimp')) {
    class Liquid_MailChimp {
        
        public function __construct($api_key, $api_endpoint = null) {
            // No-op - prevent real Mailchimp initialization
        }
        
        public function get($method, $args = [], $timeout = 10) {
            // On frontend, return empty result instantly (no API call)
            if (!is_admin() && !wp_doing_ajax()) {
                return [];
            }
            // In admin, we could make the real call, but for now return empty
            return [];
        }
        
        public function post($method, $args = [], $timeout = 10) {
            return [];
        }
        
        public function getLastError() {
            return false;
        }
        
        public function getLastResponse() {
            return ['body' => ''];
        }
        
        public function getLastRequest() {
            return [];
        }
    }
}