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/performance-fixes.php
<?php
// Performance fixes - removes Google Fonts and disables WC cart fragments

// 1. Remove Google Fonts (render-blocking external resource)
add_action('wp_print_styles', function() {
    global $wp_styles;
    if (!isset($wp_styles->registered)) return;
    foreach ($wp_styles->registered as $handle => $style) {
        if (!empty($style->src) && strpos($style->src, 'fonts.googleapis.com') !== false) {
            wp_deregister_style($handle);
            wp_dequeue_style($handle);
        }
    }
}, 100);

// 2. Disable WC cart fragments on non-cart pages (heavy blocking AJAX)
add_action('wp_enqueue_scripts', function() {
    $is_cart = function_exists('is_cart') ? is_cart() : false;
    $is_checkout = function_exists('is_checkout') ? is_checkout() : false;
    if (!$is_cart && !$is_checkout) {
        wp_dequeue_script('wc-cart-fragments');
        wp_deregister_script('wc-cart-fragments');
    }
}, 99);

// 3. Disable emoji scripts
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');