GRAYBYTE WORDPRESS FILE MANAGER2859

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/swamivivekananda.co.in/wp-content/plugins/airlift/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/swamivivekananda.co.in/wp-content/plugins/airlift//wp_cache.php
<?php
if (!defined('ABSPATH')) exit;
if (!class_exists('ALWPCache')) :
class ALWPCache {
	public static $so_cache_path =  WP_CONTENT_DIR . '/cache/airlift';
	public static $cache_path =  WP_CONTENT_DIR . '/cache';

	private static function getConfigFilePath() {
		if (ALWPFileSystem::getInstance()->isWritable(ABSPATH . 'wp-config.php') === true) {
			return ABSPATH . 'wp-config.php';
		}
		if ((ALWPFileSystem::getInstance()->exists(dirname(ABSPATH) . '/wp-config.php')) === true 
				&& (ALWPFileSystem::getInstance()->exists(dirname(ABSPATH) . '/wp-settings.php')) === false) {
			return dirname(ABSPATH) . '/wp-config.php';
		}
		return false;
	}

	public static function enableCache($info) {
		$resp = array();
		$resp['wp_config_updated'] = self::updateWpConfig('true', $info);
		$resp['advanced_cache_updated'] = self::copyAdvancedCacheFile();
		return $resp;
	}

	public static function disableCache($info) {
		$resp = array();
		ALWPFileSystem::getInstance()->rmdir(self::$so_cache_path, true);
		$resp['wp_config_updated'] = self::updateWpConfig('false', $info);
		$resp['advanced_cache_updated'] = self::removeAdvancedCacheFileContent();
		return $resp;
	}

	public static function updateWpConfig($value, $info) {
		$config_file_path = self::getConfigFilePath();

		if (!$config_file_path) {
			return false;
		}

		$content = ALWPFileSystem::getInstance()->getContents($config_file_path);

		$is_cache_present = ALHelper::safePregMatch('/^\s*define\(\s*\'WP_CACHE\'\s*,\s*(?<value>[^\s\)]*)\s*\)/m', $content, $current_value);
		if (isset($current_value['value']) && !empty($current_value['value']) && $value === $current_value['value']) {
			return true;
		}
		$constant = "define('WP_CACHE', {$value} ); // Added by {$info->brandname}";
		if (!$is_cache_present) {
			$config_content = preg_replace("/(<\?php)/i", "<?php\r\n{$constant}\r\n", $content);
		} elseif ( isset($current_value['value']) && !empty($current_value['value']) && $current_value['value'] !== $value) {
			$config_content = preg_replace("/^\s*define\(\s*\'WP_CACHE\'\s*,\s*([^\s\)]*)\s*\).+/m", $constant, $content);
		}
		$chmod = ALWPFileSystem::getInstance()->getchmodOctal($config_file_path);
		if (ALWPFileSystem::getInstance()->putContents($config_file_path, $config_content, $chmod) === true) {
			return true;
		}
		return false;
	}

	public static function copyAdvancedCacheFile() {
		$contents = ALWPFileSystem::getInstance()->getContents(WP_CONTENT_DIR . '/plugins/airlift/buffer/advanced-cache.php');
		if (ALWPFileSystem::getInstance()->putContents(WP_CONTENT_DIR . "/advanced-cache.php", $contents) === true) {
			return true;
		}
		return false;
	}

	public static function removeAdvancedCacheFileContent() {
		if (ALWPFileSystem::getInstance()->exists(WP_CONTENT_DIR . "/advanced-cache.php") === false) {
			return true;
		}
		if (ALWPFileSystem::getInstance()->putContents(WP_CONTENT_DIR . "/advanced-cache.php", "") === true) {
			return true;
		}
		return false;
	}
}

endif;

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:26
giriqfky / giriqfky
0755
admin
--
July 10 2025 04:32:34
giriqfky / giriqfky
0755
buffer
--
July 10 2025 04:32:34
giriqfky / giriqfky
0755
callback
--
July 10 2025 04:32:34
giriqfky / giriqfky
0755
css
--
July 10 2025 04:32:34
giriqfky / giriqfky
0755
img
--
July 10 2025 04:32:34
giriqfky / giriqfky
0755
public_keys
--
July 10 2025 04:32:34
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:34
giriqfky / giriqfky
0644
account.php
7.211 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
airlift.php
8.698 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
helper.php
10.678 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
info.php
7.069 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
license.txt
19.463 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
readme.txt
3.055 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
recover.php
1.707 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_actions.php
2.738 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_admin.php
16.021 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_api.php
1.04 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_cache.php
2.909 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_db.php
6.104 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_dynsync.php
34.751 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_file_system.php
2.289 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_login_whitelabel.php
1.476 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_settings.php
2.062 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644
wp_site_info.php
2.319 KB
June 23 2025 07:12:33
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF