X7ROOT File Manager
Current Path:
/usr/src/litespeed-wp-plugin/7.7/litespeed-cache/src
usr
/
src
/
litespeed-wp-plugin
/
7.7
/
litespeed-cache
/
src
/
📁
..
📄
activation.cls.php
(17.34 KB)
📄
admin-display.cls.php
(48.47 KB)
📄
admin-settings.cls.php
(11.12 KB)
📄
admin.cls.php
(5.04 KB)
📄
api.cls.php
(10.36 KB)
📄
avatar.cls.php
(8.65 KB)
📄
base.cls.php
(34.46 KB)
📁
cdn
📄
cdn.cls.php
(15.92 KB)
📄
cloud.cls.php
(65.91 KB)
📄
conf.cls.php
(19.53 KB)
📄
control.cls.php
(24.35 KB)
📄
core.cls.php
(20.97 KB)
📄
crawler-map.cls.php
(19.41 KB)
📄
crawler.cls.php
(44.74 KB)
📄
css.cls.php
(17.69 KB)
📄
data.cls.php
(22.21 KB)
📄
data.upgrade.func.php
(5.72 KB)
📁
data_structure
📄
db-optm.cls.php
(15.35 KB)
📄
debug2.cls.php
(17.05 KB)
📄
doc.cls.php
(5.45 KB)
📄
error.cls.php
(7.35 KB)
📄
esi.cls.php
(27.18 KB)
📄
file.cls.php
(10.57 KB)
📄
guest.cls.php
(2.75 KB)
📄
gui.cls.php
(36.57 KB)
📄
health.cls.php
(2.83 KB)
📄
htaccess.cls.php
(24 KB)
📄
img-optm.cls.php
(65.13 KB)
📄
import.cls.php
(4.29 KB)
📄
import.preset.cls.php
(5.5 KB)
📄
lang.cls.php
(17.11 KB)
📄
localization.cls.php
(3.44 KB)
📄
media.cls.php
(40.27 KB)
📄
metabox.cls.php
(5.29 KB)
📄
object-cache-wp.cls.php
(24.62 KB)
📄
object-cache.cls.php
(20.26 KB)
📄
object.lib.php
(13.31 KB)
📄
optimize.cls.php
(38.84 KB)
📄
optimizer.cls.php
(9.41 KB)
📄
placeholder.cls.php
(17.96 KB)
📄
purge.cls.php
(34.41 KB)
📄
report.cls.php
(6.12 KB)
📄
rest.cls.php
(9.08 KB)
📄
root.cls.php
(14.61 KB)
📄
router.cls.php
(20.66 KB)
📄
str.cls.php
(3.08 KB)
📄
tag.cls.php
(9.26 KB)
📄
task.cls.php
(7.05 KB)
📄
tool.cls.php
(4.17 KB)
📄
ucss.cls.php
(16.27 KB)
📄
utility.cls.php
(24.38 KB)
📄
vary.cls.php
(21.33 KB)
📄
vpi.cls.php
(9.38 KB)
Editing: guest.cls.php
<?php /** * Guest mode management class. * * Handles syncing of Guest Mode IP and UA lists from QUIC.cloud. * * @package LiteSpeed * @since 7.7 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Guest * * Extends Cloud class to provide Guest Mode related functionality. */ class Guest extends Cloud { const LOG_TAG = '👤'; const TYPE_SYNC = 'sync'; /** * Cron handler for daily Guest Mode sync. * * @since 7.7 * @return void */ public static function cron() { self::debug( 'Cron: starting daily sync' ); self::cls()->sync_lists(); } /** * Sync Guest Mode IP and UA lists. * * Fetches the latest IP and UA lists from QUIC.cloud API and saves them locally. * * @since 7.7 * @return array{success: bool, message: string} */ public function sync_lists() { self::debug( 'Starting Guest Mode lists sync' ); $cloud_dir = LITESPEED_STATIC_DIR . '/cloud'; $results = [ 'ips' => false, 'uas' => false, ]; foreach ( [ 'ips', 'uas' ] as $type ) { $data = $this->_fetch_api( $this->_cloud_server_wp . '/gm_' . $type ); if ( $data && File::save( $cloud_dir . '/gm_' . $type . '.txt', $data, true ) ) { self::debug( 'Guest Mode ' . $type . ' synced' ); $results[ $type ] = true; } } $success = $results['ips'] && $results['uas']; $message = $success ? __( 'Guest Mode lists synced successfully.', 'litespeed-cache' ) : __( 'Failed to sync Guest Mode lists.', 'litespeed-cache' ); return [ 'success' => $success, 'message' => $message, ]; } /** * Fetch data from API. * * @since 7.7 * @param string $url API URL. * @return string|false Data on success, false on failure. */ private function _fetch_api( $url ) { self::debug( 'Fetching: ' . $url ); $response = wp_remote_get( $url, [ 'timeout' => 15, ] ); if ( is_wp_error( $response ) ) { self::debug( 'Fetch error: ' . $response->get_error_message() ); return false; } $code = wp_remote_retrieve_response_code( $response ); if ( 200 !== $code ) { self::debug( 'Fetch failed with code: ' . $code ); return false; } $body = wp_remote_retrieve_body( $response ); if ( empty( $body ) ) { self::debug( 'Empty response body' ); return false; } return $body; } /** * Handle all request actions from main class. * * @since 7.7 * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_SYNC: $result = $this->sync_lists(); if ( Router::is_ajax() ) { wp_send_json( $result ); } if ( $result['success'] ) { Admin_Display::success( $result['message'] ); } else { Admin_Display::error( $result['message'] ); } break; default: break; } Admin::redirect(); } }
Upload File
Create Folder