Edit File by line
/home/zeestwma/ceyloniy.../wp-conte.../plugins/litespee.../lib
File: object-cache.php
<?php
[0] Fix | Delete
// phpcs:ignoreFile
[1] Fix | Delete
[2] Fix | Delete
/**
[3] Fix | Delete
* Plugin Name: LiteSpeed Cache - Object Cache (Drop-in)
[4] Fix | Delete
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
[5] Fix | Delete
* Description: High-performance page caching and site optimization from LiteSpeed.
[6] Fix | Delete
* Author: LiteSpeed Technologies
[7] Fix | Delete
* Author URI: https://www.litespeedtech.com
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
defined( 'WPINC' ) || exit;
[11] Fix | Delete
/**
[12] Fix | Delete
* LiteSpeed Object Cache
[13] Fix | Delete
*
[14] Fix | Delete
* @since 1.8
[15] Fix | Delete
*/
[16] Fix | Delete
[17] Fix | Delete
! defined( 'LSCWP_OBJECT_CACHE' ) && define( 'LSCWP_OBJECT_CACHE', true );
[18] Fix | Delete
[19] Fix | Delete
// Initialize const `LSCWP_DIR` and locate LSCWP plugin folder
[20] Fix | Delete
$lscwp_dir = ( defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins' ) . '/litespeed-cache/';
[21] Fix | Delete
[22] Fix | Delete
// Use plugin as higher priority than MU plugin
[23] Fix | Delete
if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) {
[24] Fix | Delete
// Check if is mu plugin or not
[25] Fix | Delete
$lscwp_dir = ( defined( 'WPMU_PLUGIN_DIR' ) ? WPMU_PLUGIN_DIR : WP_CONTENT_DIR . '/mu-plugins' ) . '/litespeed-cache/';
[26] Fix | Delete
if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) {
[27] Fix | Delete
$lscwp_dir = '';
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
$data_file = WP_CONTENT_DIR . '/.litespeed_conf.dat';
[32] Fix | Delete
$lib_file = $lscwp_dir . 'src/object.lib.php';
[33] Fix | Delete
[34] Fix | Delete
// Can't find LSCWP location, terminate object cache process
[35] Fix | Delete
if ( ! $lscwp_dir || ! file_exists( $data_file ) || ( ! file_exists( $lib_file ) ) ) {
[36] Fix | Delete
if ( ! is_admin() ) { // Bypass object cache for frontend
[37] Fix | Delete
require_once ABSPATH . WPINC . '/cache.php';
[38] Fix | Delete
} else {
[39] Fix | Delete
$err = 'Can NOT find LSCWP path for object cache initialization in ' . __FILE__;
[40] Fix | Delete
error_log( $err );
[41] Fix | Delete
add_action(
[42] Fix | Delete
is_network_admin() ? 'network_admin_notices' : 'admin_notices',
[43] Fix | Delete
function () use ( &$err ) {
[44] Fix | Delete
echo $err;
[45] Fix | Delete
}
[46] Fix | Delete
);
[47] Fix | Delete
}
[48] Fix | Delete
} elseif ( ! LSCWP_OBJECT_CACHE ) {
[49] Fix | Delete
// Disable cache
[50] Fix | Delete
wp_using_ext_object_cache( false );
[51] Fix | Delete
}
[52] Fix | Delete
// Init object cache & LSCWP
[53] Fix | Delete
elseif ( file_exists( $lib_file ) ) {
[54] Fix | Delete
require_once $lib_file;
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function