??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/rosestpetronal.nl/wp-content/plugins/litespeed-cache/src/import.preset.cls.php
⬅ Kembali
<?php
// phpcs:ignoreFile
/**
* The preset class.
*
* @since 5.3.0
*/
namespace LiteSpeed;
defined('WPINC') || exit();
class Preset extends Import {
protected $_summary;
const MAX_BACKUPS = 10;
const TYPE_APPLY = 'apply';
const TYPE_RESTORE = 'restore';
const STANDARD_DIR = LSCWP_DIR . 'data/preset';
const BACKUP_DIR = LITESPEED_STATIC_DIR . '/auto-backup';
/**
* Returns sorted backup names
*
* @since 5.3.0
* @access public
*/
public static function get_backups() {
self::init_filesystem();
global $wp_filesystem;
$backups = array_map(
function ( $path ) {
return self::basename($path['name']);
},
$wp_filesystem->dirlist(self::BACKUP_DIR) ?: array()
);
rsort($backups);
return $backups;
}
/**
* Removes extra backup files
*
* @since 5.3.0
* @access public
*/
public static function prune_backups() {
$backups = self::get_backups();
global $wp_filesystem;
foreach (array_slice($backups, self::MAX_BACKUPS) as $backup) {
$path = self::get_backup($backup);
$wp_filesystem->delete($path);
Debug2::debug('[Preset] Deleted old backup from ' . $backup);
}
}
/**
* Returns a settings file's extensionless basename given its filesystem path
*
* @since 5.3.0
* @access public
*/
public static function basename( $path ) {
return basename($path, '.data');
}
/**
* Returns a standard preset's path given its extensionless basename
*
* @since 5.3.0
* @access public
*/
public static function get_standard( $name ) {
return path_join(self::STANDARD_DIR, $name . '.data');
}
/**
* Returns a backup's path given its extensionless basename
*
* @since 5.3.0
* @access public
*/
public static function get_backup( $name ) {
return path_join(self::BACKUP_DIR, $name . '.data');
}
/**
* Initializes the global $wp_filesystem object and clears stat cache
*
* @since 5.3.0
*/
static function init_filesystem() {
require_once ABSPATH . '/wp-admin/includes/file.php';
\WP_Filesystem();
clearstatcache();
}
/**
* Init
*
* @since 5.3.0
*/
public function __construct() {
Debug2::debug('[Preset] Init');
$this->_summary = self::get_summary();
}
/**
* Applies a standard preset's settings given its extensionless basename
*
* @since 5.3.0
* @access public
*/
public function apply( $preset ) {
$this->make_backup($preset);
$path = self::get_standard($preset);
$result = $this->import_file($path) ? $preset : 'error';
$this->log($result);
}
/**
* Restores settings from the backup file with the given timestamp, then deletes the file
*
* @since 5.3.0
* @access public
*/
public function restore( $timestamp ) {
$backups = array();
foreach (self::get_backups() as $backup) {
if (preg_match('/^backup-' . $timestamp . '(-|$)/', $backup) === 1) {
$backups[] = $backup;
}
}
if (empty($backups)) {
$this->log('error');
return;
}
$backup = $backups[0];
$path = self::get_backup($backup);
if (!$this->import_file($path)) {
$this->log('error');
return;
}
self::init_filesystem();
global $wp_filesystem;
$wp_filesystem->delete($path);
Debug2::debug('[Preset] Deleted most recent backup from ' . $backup);
$this->log('backup');
}
/**
* Saves current settings as a backup file, then prunes extra backup files
*
* @since 5.3.0
* @access public
*/
public function make_backup( $preset ) {
$backup = 'backup-' . time() . '-before-' . $preset;
$data = $this->export(true);
$path = self::get_backup($backup);
File::save($path, $data, true);
Debug2::debug('[Preset] Backup saved to ' . $backup);
self::prune_backups();
}
/**
* Tries to import from a given settings file
*
* @since 5.3.0
*/
function import_file( $path ) {
$debug = function ( $result, $name ) {
$action = $result ? 'Applied' : 'Failed to apply';
Debug2::debug('[Preset] ' . $action . ' settings from ' . $name);
return $result;
};
$name = self::basename($path);
$contents = file_get_contents($path);
if (false === $contents) {
Debug2::debug('[Preset] ❌ Failed to get file contents');
return $debug(false, $name);
}
$parsed = array();
try {
// Check if the data is v4+
if (strpos($contents, '["_version",') === 0) {
$contents = explode("\n", $contents);
foreach ($contents as $line) {
$line = trim($line);
if (empty($line)) {
continue;
}
list($key, $value) = \json_decode($line, true);
$parsed[$key] = $value;
}
} else {
$parsed = \json_decode(base64_decode($contents), true);
}
} catch (\Exception $ex) {
Debug2::debug('[Preset] ❌ Failed to parse serialized data');
return $debug(false, $name);
}
if (empty($parsed)) {
Debug2::debug('[Preset] ❌ Nothing to apply');
return $debug(false, $name);
}
$this->cls('Conf')->update_confs($parsed);
return $debug(true, $name);
}
/**
* Updates the log
*
* @since 5.3.0
*/
function log( $preset ) {
$this->_summary['preset'] = $preset;
$this->_summary['preset_timestamp'] = time();
self::save_summary();
}
/**
* Handles all request actions from main cls
*
* @since 5.3.0
* @access public
*/
public function handler() {
$type = Router::verify_type();
switch ($type) {
case self::TYPE_APPLY:
$this->apply(!empty($_GET['preset']) ? $_GET['preset'] : false);
break;
case self::TYPE_RESTORE:
$this->restore(!empty($_GET['timestamp']) ? $_GET['timestamp'] : false);
break;
default:
break;
}
Admin::redirect();
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
📁 cdn
dir
—
2026-06-22 10:09
📁 data_structure
dir
—
2026-06-22 10:09
🐘 activation.cls.php
php
17.3 KB
2026-04-01 20:54
🐘 admin-display.cls.php
php
48.5 KB
2026-04-01 20:54
🐘 admin-settings.cls.php
php
11.1 KB
2026-04-01 20:54
🐘 admin.cls.php
php
6.1 KB
2026-04-01 20:54
🐘 api.cls.php
php
10.4 KB
2026-04-01 20:54
🐘 avatar.cls.php
php
8.7 KB
2026-04-01 20:54
🐘 base.cls.php
php
37.7 KB
2026-04-01 20:54
🐘 cdn.cls.php
php
15.9 KB
2026-04-01 20:54
🐘 cloud-auth-callback.trait.php
php
10.4 KB
2026-04-01 20:54
🐘 cloud-auth-ip.trait.php
php
4.3 KB
2026-04-01 20:54
🐘 cloud-auth.trait.php
php
9.4 KB
2026-04-01 20:54
🐘 cloud-misc.trait.php
php
10.3 KB
2026-04-01 20:54
🐘 cloud-node.trait.php
php
5.9 KB
2026-04-01 20:54
🐘 cloud-request.trait.php
php
19.7 KB
2026-04-01 20:54
🐘 cloud.cls.php
php
7.3 KB
2026-04-01 20:54
🐘 conf.cls.php
php
19.5 KB
2026-04-01 20:54
🐘 control.cls.php
php
24.3 KB
2026-04-01 20:54
🐘 core.cls.php
php
21 KB
2026-04-01 20:54
🐘 crawler-map.cls.php
php
19.4 KB
2026-04-01 20:54
🐘 crawler.cls.php
php
44.7 KB
2026-04-01 20:54
🐘 css.cls.php
php
17.8 KB
2026-04-01 20:54
🐘 data.cls.php
php
22.2 KB
2026-04-01 20:54
🐘 data.upgrade.func.php
php
5.7 KB
2026-04-01 20:54
🐘 db-optm.cls.php
php
15.3 KB
2026-04-01 20:54
🐘 debug2.cls.php
php
18.4 KB
2026-04-01 20:54
🐘 doc.cls.php
php
5.4 KB
2026-04-01 20:54
🐘 error.cls.php
php
7.4 KB
2026-04-01 20:54
🐘 esi.cls.php
php
27.2 KB
2026-04-01 20:54
🐘 file.cls.php
php
10.6 KB
2026-04-01 20:54
🐘 guest.cls.php
php
2.8 KB
2026-04-01 20:54
🐘 gui.cls.php
php
36.6 KB
2026-04-01 20:54
🐘 health.cls.php
php
2.8 KB
2026-04-01 20:54
🐘 htaccess.cls.php
php
29.8 KB
2026-04-01 20:54
🐘 img-optm-manage.trait.php
php
30.8 KB
2026-04-01 20:54
🐘 img-optm-pull.trait.php
php
22.1 KB
2026-04-01 20:54
🐘 img-optm-send.trait.php
php
21.9 KB
2026-04-01 20:54
🐘 img-optm.cls.php
php
5.3 KB
2026-04-01 20:54
🐘 import.cls.php
php
4.3 KB
2026-04-01 20:54
🐘 import.preset.cls.php
php
5.5 KB
2026-04-01 20:54
🐘 lang.cls.php
php
17 KB
2026-04-01 20:54
🐘 localization.cls.php
php
4 KB
2026-04-01 20:54
🐘 media.cls.php
php
44.1 KB
2026-04-01 20:54
🐘 metabox.cls.php
php
5.3 KB
2026-04-01 20:54
🐘 object-cache-wp.cls.php
php
18.8 KB
2026-04-01 20:54
🐘 object-cache.cls.php
php
20.9 KB
2026-04-01 20:54
🐘 object.lib.php
php
14.2 KB
2026-04-01 20:54
🐘 optimize.cls.php
php
38.6 KB
2026-04-01 20:54
🐘 optimizer.cls.php
php
10.5 KB
2026-04-01 20:54
🐘 placeholder.cls.php
php
17.9 KB
2026-04-01 20:54
🐘 purge.cls.php
php
34.4 KB
2026-04-01 20:54
🐘 report.cls.php
php
6.1 KB
2026-04-01 20:54
🐘 rest.cls.php
php
9.1 KB
2026-04-01 20:54
🐘 root.cls.php
php
14.3 KB
2026-04-01 20:54
🐘 router.cls.php
php
20.8 KB
2026-04-01 20:54
🐘 str.cls.php
php
3.1 KB
2026-04-01 20:54
🐘 tag.cls.php
php
9.3 KB
2026-04-01 20:54
🐘 task.cls.php
php
7 KB
2026-04-01 20:54
🐘 tool.cls.php
php
4.2 KB
2026-04-01 20:54
🐘 ucss.cls.php
php
16.3 KB
2026-04-01 20:54
🐘 utility.cls.php
php
26 KB
2026-04-01 20:54
🐘 vary.cls.php
php
21.3 KB
2026-04-01 20:54
🐘 vpi.cls.php
php
9.4 KB
2026-04-01 20:54