File: /var/www/html/wp-content/mu-plugins/block_external_fix.php
<?php
/**
* Block slow external Elementor requests instantly
*/
if (!defined('ABSPATH')) return;
add_filter('pre_http_request', function($preempt, $args, $url) {
static $blocked = [
'migrations.elementor.com',
'connect.elementor.com',
'analytics.elementor.com',
];
foreach ($blocked as $host) {
if (strpos($url, $host) !== false) {
error_log("[BLOCKED] $url");
// Return WP_Error to instantly fail the request
return new WP_Error('blocked', 'Blocked by performance filter: ' . $host);
}
}
return $preempt;
}, 1, 3);