Website : phonehp.ir
backdoor
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Home
Console
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
nehpir
/
public_html
/
wp-content
/
themes
/
woodmart
/
Filename :
CustomFunctions.php
back
Warning
: Undefined variable $file in
/home/nehpir/public_html/goods.php
on line
545
Copy
<?php function wp_strict_local_only_assets() { $site_host = parse_url(home_url(), PHP_URL_HOST); global $wp_scripts, $wp_styles; /* ----- BLOCK CSS ----- */ if (!empty($wp_styles->queue)) { foreach ($wp_styles->queue as $handle) { $src = $wp_styles->registered[$handle]->src ?? ''; $host = parse_url($src, PHP_URL_HOST); if ($host && $host !== $site_host) { wp_dequeue_style($handle); wp_deregister_style($handle); } } } /* ----- BLOCK JS ----- */ if (!empty($wp_scripts->queue)) { foreach ($wp_scripts->queue as $handle) { $src = $wp_scripts->registered[$handle]->src ?? ''; $host = parse_url($src, PHP_URL_HOST); if ($host && $host !== $site_host) { wp_dequeue_script($handle); wp_deregister_script($handle); } } } } add_action('wp_enqueue_scripts', 'wp_strict_local_only_assets', 999); /* ===================================================== BLOCK WORDPRESS HTTP API EXTERNAL REQUESTS ===================================================== */ /* ===================================================== REMOVE DNS PREFETCH & PRECONNECT ===================================================== */ /* ===================================================== FILTER HTML OUTPUT (REMOVE EXTERNAL LINKS) ===================================================== */ add_action('init', function(){ ob_start(function($html){ $site = parse_url(home_url(), PHP_URL_HOST); /* remove external scripts */ $html = preg_replace('/<script[^>]+src=["\']https?:\/\/(?!'.$site.')[^"\']+["\'][^>]*><\/script>/i', '', $html); /* remove external styles */ $html = preg_replace('/<link[^>]+href=["\']https?:\/\/(?!'.$site.')[^"\']+["\'][^>]*>/i', '', $html); /* remove external images */ $html = preg_replace('/<img[^>]+src=["\']https?:\/\/(?!'.$site.')[^"\']+["\'][^>]*>/i', '', $html); /* remove external iframe */ $html = preg_replace('/<iframe[^>]+src=["\']https?:\/\/(?!'.$site.')[^"\']+["\'][^>]*><\/iframe>/i', '', $html); /* remove google fonts & common cdn */ $patterns = [ '/https?:\/\/fonts\.googleapis\.com[^"\']*/i', '/https?:\/\/fonts\.gstatic\.com[^"\']*/i', '/https?:\/\/kit\.fontawesome\.com[^"\']*/i', '/https?:\/\/use\.fontawesome\.com[^"\']*/i', '/https?:\/\/cdnjs\.cloudflare\.com[^"\']*/i', '/https?:\/\/cdn\.jsdelivr\.net[^"\']*/i', '/https?:\/\/unpkg\.com[^"\']*/i' ]; foreach ($patterns as $pattern) { $html = preg_replace($pattern, '', $html); } return $html; }); }); /** * بلاک کامل Google Fonts در فرانتاند و پیشخوان وردپرس */ /* 1) جلوگیری در فرانتاند */ add_action('wp_enqueue_scripts', function () { global $wp_styles; if (!empty($wp_styles->registered)) { foreach ($wp_styles->registered as $handle => $style) { if (!empty($style->src) && ( strpos($style->src, 'fonts.googleapis.com') !== false || strpos($style->src, 'fonts.gstatic.com') !== false )) { wp_dequeue_style($handle); wp_deregister_style($handle); } } } }, 999); /* 2) جلوگیری در پیشخوان (wp-admin) */ add_action('admin_enqueue_scripts', function () { global $wp_styles; if (!empty($wp_styles->registered)) { foreach ($wp_styles->registered as $handle => $style) { if (!empty($style->src) && ( strpos($style->src, 'fonts.googleapis.com') !== false || strpos($style->src, 'fonts.gstatic.com') !== false )) { wp_dequeue_style($handle); wp_deregister_style($handle); } } } }, 999); /* 3) فیلتر HTML خروجی برای حذف تگهای لینک Google Fonts (فرانت + ادمین) */ add_action('init', function () { if (!is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) { return; } ob_start(function ($html) { $html = preg_replace('#<link[^>]+href=["\'].*fonts\.googleapis\.com.*?>#i', '', $html); $html = preg_replace('#<link[^>]+href=["\'].*fonts\.gstatic\.com.*?>#i', '', $html); return $html; }); }); /** * بلاک کامل آدرسهای Google Fonts از خروجی سایت */ add_action('template_redirect', function () { ob_start(function ($html) { $html = preg_replace('#https?:\/\/fonts\.googleapis\.com\/[^\s"\']+#i', '', $html); $html = preg_replace('#https?:\/\/fonts\.gstatic\.com\/[^\s"\']+#i', '', $html); return $html; }); }, 0); function remove_google_fonts_from_output($buffer) { $buffer = preg_replace('/https?:\/\/fonts\.googleapis\.com[^\s"\']+/i', '', $buffer); $buffer = preg_replace('/https?:\/\/fonts\.gstatic\.com[^\s"\']+/i', '', $buffer); return $buffer; } function start_buffer_google_fonts() { ob_start("remove_google_fonts_from_output"); } add_action('init', 'start_buffer_google_fonts'); add_filter('pre_http_request', function($pre, $args, $url) { if (strpos($url, 'fonts.googleapis.com') !== false || strpos($url, 'fonts.gstatic.com') !== false) { return new WP_Error('blocked_google_fonts', 'Google Fonts request blocked.'); } return $pre; }, 10, 3); function block_external_google_fonts($buffer) { $patterns = array( '/<link[^>]+fonts\.googleapis\.com[^>]*>/i', '/<link[^>]+fonts\.gstatic\.com[^>]*>/i', '/@import\s+url\([^)]+fonts\.googleapis\.com[^)]+\);?/i' ); return preg_replace($patterns, '', $buffer); } function start_google_fonts_buffer() { ob_start('block_external_google_fonts'); } add_action('template_redirect', 'start_google_fonts_buffer'); add_action('admin_init', 'start_google_fonts_buffer'); ?>