Skip to content

Commit

Permalink
v6.3-b2: * **Object** Added brief parseable header comments to the dr…
Browse files Browse the repository at this point in the history
…op-in file. (OllieJones)
  • Loading branch information
Hai Zheng committed Jun 24, 2024
1 parent 92aff8c commit d25f695
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
42 changes: 25 additions & 17 deletions lib/object-cache.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
<?php
defined( 'WPINC' ) || exit;

/**
* Plugin Name: LiteSpeed Cache - Object Cache (Drop-in)
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
* Description: High-performance page caching and site optimization from LiteSpeed.
* Version: 6.3
* Author: LiteSpeed Technologies
* Author URI: https://www.litespeedtech.com
*/

defined('WPINC') || exit;
/**
* LiteSpeed Object Cache
*
* @since 1.8
*/

! defined( 'LSCWP_OBJECT_CACHE' ) && define( 'LSCWP_OBJECT_CACHE', true );
!defined('LSCWP_OBJECT_CACHE') && define('LSCWP_OBJECT_CACHE', true);

// Initialize const `LSCWP_DIR` and locate LSCWP plugin foder
$lscwp_dir = ( defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins' ) . '/litespeed-cache/';
$lscwp_dir = (defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins') . '/litespeed-cache/';
// Use plugin as higher priority than MU plugin
if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) {
if (!file_exists($lscwp_dir . 'litespeed-cache.php')) {
// Check if is mu plugin or not
$lscwp_dir = ( defined( 'WPMU_PLUGIN_DIR' ) ? WPMU_PLUGIN_DIR : WP_CONTENT_DIR . '/mu-plugins' ) . '/litespeed-cache/';
if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) {
$lscwp_dir = (defined('WPMU_PLUGIN_DIR') ? WPMU_PLUGIN_DIR : WP_CONTENT_DIR . '/mu-plugins') . '/litespeed-cache/';
if (!file_exists($lscwp_dir . 'litespeed-cache.php')) {
$lscwp_dir = '';
}
}
Expand All @@ -23,24 +33,22 @@
$lib_file = $lscwp_dir . 'src/object.lib.php';

// Can't find LSCWP location, terminate object cache process
if ( ! $lscwp_dir || ! file_exists( $data_file ) || ( ! file_exists( $lib_file ) ) ) {
if ( ! is_admin() ) { // Bypass object cache for frontend
if (!$lscwp_dir || !file_exists($data_file) || (!file_exists($lib_file))) {
if (!is_admin()) { // Bypass object cache for frontend
require_once ABSPATH . WPINC . '/cache.php';
}
else {
} else {
$err = 'Can NOT find LSCWP path for object cache initialization in ' . __FILE__;
error_log( $err );
add_action( is_network_admin() ? 'network_admin_notices' : 'admin_notices', function() use ( &$err ) {
error_log($err);
add_action(is_network_admin() ? 'network_admin_notices' : 'admin_notices', function () use (&$err) {
echo $err;
} );
});
}
}
else {
if ( ! LSCWP_OBJECT_CACHE ) { // Disable cache
} else {
if (!LSCWP_OBJECT_CACHE) { // Disable cache
wp_using_ext_object_cache(false);
}
// Init object cache & LSCWP
else if ( file_exists( $lib_file ) ) {
else if (file_exists($lib_file)) {
require_once $lib_file;
}
}
4 changes: 2 additions & 2 deletions litespeed-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: LiteSpeed Cache
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
* Description: High-performance page caching and site optimization from LiteSpeed
* Version: 6.3-b1
* Version: 6.3-b2
* Author: LiteSpeed Technologies
* Author URI: https://www.litespeedtech.com
* License: GPLv3
Expand Down Expand Up @@ -34,7 +34,7 @@
return;
}

!defined('LSCWP_V') && define('LSCWP_V', '6.3-b1');
!defined('LSCWP_V') && define('LSCWP_V', '6.3-b2');

!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
!defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
* **Page Optimize** Updated Instant Click library to version 5.2.0.
* **Page Optimize** Flatsome theme random string excludes. (PR#415)
* **Page Optimize** Exclude Cloudflare turnstile from JS optimizations. (Tobolo)
* **Page Optimize** Fixes Cloudflare Turnstile issues. (Contributolo PR#671/672)
* **Object** More debug log for objectr cache status. (PR#669)
* **Object** Added brief parseable header comments to the drop-in file. (OllieJones)

= 6.2.0.1 - Apr 25 2024 =
* 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525)
Expand Down

0 comments on commit d25f695

Please sign in to comment.