WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-content / plugins / litespeed-cache / src / [dxwrx-r--r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/wp-content/plugins/litespeed-cache/src/cloud-node.trait.php (5.95 KB)
<?php
/**
 * Cloud node detection trait
 *
 * @package LiteSpeed
 * @since 7.8
 */

namespace LiteSpeed;

defined( 'WPINC' ) || exit();

/**
 * Trait Cloud_Node
 *
 * Handles cloud node detection and management.
 */
trait Cloud_Node {

	/**
	 * Clear all existing cloud nodes for future reconnect
	 *
	 * @since 3.0
	 * @access public
	 */
	public function clear_cloud() {
		foreach ( self::$services as $service ) {
			if ( isset( $this->_summary[ 'server.' . $service ] ) ) {
				unset( $this->_summary[ 'server.' . $service ] );
			}
			if ( isset( $this->_summary[ 'server_date.' . $service ] ) ) {
				unset( $this->_summary[ 'server_date.' . $service ] );
			}
		}
		self::save_summary();

		self::debug( 'Cleared all local service node caches' );
	}

	/**
	 * Ping clouds to find the fastest node
	 *
	 * @since 3.0
	 * @access public
	 *
	 * @param string $service Service.
	 * @param bool   $force   Force redetect.
	 * @return string|false
	 */
	public function detect_cloud( $service, $force = false ) {
		if ( in_array( $service, self::$center_svc_set, true ) ) {
			return $this->_cloud_server;
		}

		if ( in_array( $service, self::$wp_svc_set, true ) ) {
			return $this->_cloud_server_wp;
		}

		// Check if the stored server needs to be refreshed
		if ( ! $force ) {
			if (
				! empty( $this->_summary[ 'server.' . $service ] ) &&
				! empty( $this->_summary[ 'server_date.' . $service ] ) &&
				(int) $this->_summary[ 'server_date.' . $service ] > time() - 86400 * self::TTL_NODE
			) {
				$server = $this->_summary[ 'server.' . $service ];
				if ( false === strpos( $this->_cloud_server, 'preview.' ) && false === strpos( $server, 'preview.' ) ) {
					return $server;
				}
				if ( false !== strpos( $this->_cloud_server, 'preview.' ) && false !== strpos( $server, 'preview.' ) ) {
					return $server;
				}
			}
		}

		if ( ! $service || ! in_array( $service, self::$services, true ) ) {
			$msg = __( 'Cloud Error', 'litespeed-cache' ) . ': ' . $service;
			Admin_Display::error( $msg );
			return false;
		}

		// Send request to Quic Online Service
		$json = $this->_post( self::SVC_D_NODES, [ 'svc' => $this->_maybe_queue( $service ) ] );

		// Check if get list correctly
		if ( empty( $json['list'] ) || ! is_array( $json['list'] ) ) {
			self::debug( 'request cloud list failed: ', $json );

			if ( $json ) {
				$msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . wp_json_encode( $json );
				Admin_Display::error( $msg );
			}

			return false;
		}

		// Ping closest cloud
		$valid_clouds = false;
		if ( ! empty( $json['list_preferred'] ) ) {
			$valid_clouds = $this->_get_closest_nodes( $json['list_preferred'], $service );
		}
		if ( ! $valid_clouds ) {
			$valid_clouds = $this->_get_closest_nodes( $json['list'], $service );
		}
		if ( ! $valid_clouds ) {
			return false;
		}

		// Check server load
		if ( in_array( $service, self::$services_load_check, true ) ) {
			// TODO
			$valid_cloud_loads = [];
			foreach ( $valid_clouds as $v ) {
				$response = wp_safe_remote_get( $v, [ 'timeout' => 5 ] );
				if ( is_wp_error( $response ) ) {
					$error_message = $response->get_error_message();
					self::debug( 'failed to do load checker: ' . $error_message );
					continue;
				}

				$curr_load = \json_decode( $response['body'], true );
				if ( ! empty( $curr_load['_res'] ) && 'ok' === $curr_load['_res'] && isset( $curr_load['load'] ) ) {
					$valid_cloud_loads[ $v ] = $curr_load['load'];
				}
			}

			if ( ! $valid_cloud_loads ) {
				$msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . __( 'No available Cloud Node after checked server load.', 'litespeed-cache' );
				Admin_Display::error( $msg );
				return false;
			}

			self::debug( 'Closest nodes list after load check', $valid_cloud_loads );

			$qualified_list = array_keys( $valid_cloud_loads, min( $valid_cloud_loads ), true );
		} else {
			$qualified_list = $valid_clouds;
		}

		$closest = $qualified_list[ array_rand( $qualified_list ) ];

		self::debug( 'Chose node: ' . $closest );

		// store data into option locally
		$this->_summary[ 'server.' . $service ]      = $closest;
		$this->_summary[ 'server_date.' . $service ] = time();
		self::save_summary();

		return $this->_summary[ 'server.' . $service ];
	}

	/**
	 * Ping to choose the closest nodes
	 *
	 * @since 7.0
	 *
	 * @param array  $nodes_list    Node list.
	 * @param string $service Service.
	 * @return array|false
	 */
	private function _get_closest_nodes( $nodes_list, $service ) {
		$speed_list = [];
		foreach ( $nodes_list as $v ) {
			// Exclude possible failed 503 nodes
			if ( ! empty( $this->_summary['disabled_node'] ) && ! empty( $this->_summary['disabled_node'][ $v ] ) && time() - (int) $this->_summary['disabled_node'][ $v ] < 86400 ) {
				continue;
			}
			$speed_list[ $v ] = Utility::ping( $v );
		}

		if ( ! $speed_list ) {
			self::debug( 'nodes are in 503 failed nodes' );
			return false;
		}

		$min = min( $speed_list );

		if ( 99999 === (int) $min ) {
			self::debug( 'failed to ping all clouds' );
			return false;
		}

		// Random pick same time range ip (230ms 250ms)
		$range_len    = strlen( $min );
		$range_num    = substr( $min, 0, 1 );
		$valid_clouds = [];
		foreach ( $speed_list as $node => $speed ) {
			if ( strlen( $speed ) === $range_len && substr( $speed, 0, 1 ) === $range_num ) {
				$valid_clouds[] = $node;
			} elseif ( $speed < $min * 4 ) { // Append the lower speed ones
				$valid_clouds[] = $node;
			}
		}

		if ( ! $valid_clouds ) {
			$msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . __( 'No available Cloud Node.', 'litespeed-cache' );
			Admin_Display::error( $msg );
			return false;
		}

		self::debug( 'Closest nodes list', $valid_clouds );
		return $valid_clouds;
	}

	/**
	 * May need to convert to queue service
	 *
	 * @param string $service Service.
	 * @return string
	 */
	private function _maybe_queue( $service ) {
		if ( in_array( $service, self::$_queue_svc_set, true ) ) {
			return self::SVC_QUEUE;
		}
		return $service;
	}
}
namawaktuukuranownerpermaksi
..
cdn/ 2026-06-06 16:1811.25 KB 76129f60960:kundendxwrx-r--r
data_structure/ 2026-06-06 16:182.62 KB 76129f60960:kundendxwrx-r--r
activation.cls.php 2026-06-06 16:1817.31 KB 76129f60960:kunden-xw-x-----
edt
admin-display.cls.php 2026-06-06 16:1848.47 KB 76129f60960:kunden-xw-x-----
edt
admin-settings.cls.php 2026-06-06 16:1811.12 KB 76129f60960:kunden-xw-x-----
edt
admin.cls.php 2026-06-06 16:186.13 KB 76129f60960:kunden-xw-x-----
edt
api.cls.php 2026-06-06 16:1810.36 KB 76129f60960:kunden-xw-x-----
edt
avatar.cls.php 2026-06-06 16:188.65 KB 76129f60960:kunden-xw-x-----
edt
base.cls.php 2026-06-06 16:1837.66 KB 76129f60960:kunden-xw-x-----
edt
cdn.cls.php 2026-06-06 16:1815.92 KB 76129f60960:kunden-xw-x-----
edt
cloud-auth-callback.trait.php 2026-06-06 16:1810.43 KB 76129f60960:kunden-xw-x-----
edt
cloud-auth-ip.trait.php 2026-06-06 16:184.33 KB 76129f60960:kunden-xw-x-----
edt
cloud-auth.trait.php 2026-06-06 16:189.38 KB 76129f60960:kunden-xw-x-----
edt
cloud-misc.trait.php 2026-06-06 16:1810.32 KB 76129f60960:kunden-xw-x-----
edt
cloud-node.trait.php 2026-06-06 16:185.95 KB 76129f60960:kunden-xw-x-----
edt
cloud-request.trait.php 2026-06-06 16:1819.68 KB 76129f60960:kunden-xw-x-----
edt
cloud.cls.php 2026-06-06 16:187.32 KB 76129f60960:kunden-xw-x-----
edt
conf.cls.php 2026-06-06 16:1819.53 KB 76129f60960:kunden-xw-x-----
edt
control.cls.php 2026-06-06 16:1824.35 KB 76129f60960:kunden-xw-x-----
edt
core.cls.php 2026-06-06 16:1820.97 KB 76129f60960:kunden-xw-x-----
edt
crawler-map.cls.php 2026-06-06 16:1819.41 KB 76129f60960:kunden-xw-x-----
edt
crawler.cls.php 2026-06-06 16:1844.72 KB 76129f60960:kunden-xw-x-----
edt
css.cls.php 2026-06-06 16:1817.77 KB 76129f60960:kunden-xw-x-----
edt
data.cls.php 2026-06-06 16:1822.21 KB 76129f60960:kunden-xw-x-----
edt
data.upgrade.func.php 2026-06-06 16:185.72 KB 76129f60960:kunden-xw-x-----
edt
db-optm.cls.php 2026-06-06 16:1815.35 KB 76129f60960:kunden-xw-x-----
edt
debug2.cls.php 2026-06-06 16:1818.4 KB 76129f60960:kunden-xw-x-----
edt
doc.cls.php 2026-06-06 16:185.45 KB 76129f60960:kunden-xw-x-----
edt
error.cls.php 2026-06-06 16:187.35 KB 76129f60960:kunden-xw-x-----
edt
esi.cls.php 2026-06-06 16:1827.18 KB 76129f60960:kunden-xw-x-----
edt
file.cls.php 2026-06-06 16:1810.57 KB 76129f60960:kunden-xw-x-----
edt
guest.cls.php 2026-06-06 16:182.75 KB 76129f60960:kunden-xw-x-----
edt
gui.cls.php 2026-06-06 16:1836.57 KB 76129f60960:kunden-xw-x-----
edt
health.cls.php 2026-06-06 16:182.83 KB 76129f60960:kunden-xw-x-----
edt
htaccess.cls.php 2026-06-06 16:1829.81 KB 76129f60960:kunden-xw-x-----
edt
img-optm-manage.trait.php 2026-06-06 16:1830.85 KB 76129f60960:kunden-xw-x-----
edt
img-optm-pull.trait.php 2026-06-06 16:1822.1 KB 76129f60960:kunden-xw-x-----
edt
img-optm-send.trait.php 2026-06-06 16:1821.9 KB 76129f60960:kunden-xw-x-----
edt
img-optm.cls.php 2026-06-06 16:185.26 KB 76129f60960:kunden-xw-x-----
edt
import.cls.php 2026-06-06 16:184.29 KB 76129f60960:kunden-xw-x-----
edt
import.preset.cls.php 2026-06-06 16:185.5 KB 76129f60960:kunden-xw-x-----
edt
lang.cls.php 2026-06-06 16:1817.02 KB 76129f60960:kunden-xw-x-----
edt
localization.cls.php 2026-06-06 16:184.03 KB 76129f60960:kunden-xw-x-----
edt
media.cls.php 2026-06-06 16:1844.08 KB 76129f60960:kunden-xw-x-----
edt
metabox.cls.php 2026-06-06 16:185.29 KB 76129f60960:kunden-xw-x-----
edt
object-cache-wp.cls.php 2026-06-06 16:1818.82 KB 76129f60960:kunden-xw-x-----
edt
object-cache.cls.php 2026-06-06 16:1820.95 KB 76129f60960:kunden-xw-x-----
edt
object.lib.php 2026-06-06 16:1814.16 KB 76129f60960:kunden-xw-x-----
edt
optimize.cls.php 2026-06-06 16:1838.64 KB 76129f60960:kunden-xw-x-----
edt
optimizer.cls.php 2026-06-06 16:1810.5 KB 76129f60960:kunden-xw-x-----
edt
placeholder.cls.php 2026-06-06 16:1817.93 KB 76129f60960:kunden-xw-x-----
edt
purge.cls.php 2026-06-06 16:1834.41 KB 76129f60960:kunden-xw-x-----
edt
report.cls.php 2026-06-06 16:186.12 KB 76129f60960:kunden-xw-x-----
edt
rest.cls.php 2026-06-06 16:189.08 KB 76129f60960:kunden-xw-x-----
edt
root.cls.php 2026-06-06 16:1814.29 KB 76129f60960:kunden-xw-x-----
edt
router.cls.php 2026-06-06 16:1820.76 KB 76129f60960:kunden-xw-x-----
edt
str.cls.php 2026-06-06 16:183.08 KB 76129f60960:kunden-xw-x-----
edt
tag.cls.php 2026-06-06 16:189.26 KB 76129f60960:kunden-xw-x-----
edt
task.cls.php 2026-06-06 16:187.05 KB 76129f60960:kunden-xw-x-----
edt
tool.cls.php 2026-06-06 16:184.17 KB 76129f60960:kunden-xw-x-----
edt
ucss.cls.php 2026-06-06 16:1816.35 KB 76129f60960:kunden-xw-x-----
edt
utility.cls.php 2026-06-06 16:1826.01 KB 76129f60960:kunden-xw-x-----
edt
vary.cls.php 2026-06-06 16:1821.33 KB 76129f60960:kunden-xw-x-----
edt
vpi.cls.php 2026-06-06 16:189.38 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/wp-content/plugins/litespeed-cache/src
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK