diff --git a/Extensions/class.eacObjectCache.extension.php b/Extensions/class.eacObjectCache.extension.php index 0ba8837..296ac27 100755 --- a/Extensions/class.eacObjectCache.extension.php +++ b/Extensions/class.eacObjectCache.extension.php @@ -19,7 +19,7 @@ class object_cache_extension extends \EarthAsylumConsulting\abstract_extension /** * @var string extension version */ - const VERSION = '23.1210.1'; + const VERSION = '24.0217.1'; /** @@ -120,7 +120,7 @@ public function admin_options_settings(): void if ($this->checkForInstall('admin') === true && $this->checkForInstall('source') === true) { - $default = $this->varPost('_btnCacheInstall') ?: ((defined('EAC_OBJECT_CACHE')) ? 'Install' : 'Uninstall'); + $default = $this->varPost('_btnCacheInstall') ?: ((defined('EAC_OBJECT_CACHE_VERSION')) ? 'Install' : 'Uninstall'); $default = ($default=='Install') ? 'Uninstall' : 'Install'; $this->registerExtensionOptions( [$this->registerAs,$this->registerTab], [ @@ -136,7 +136,7 @@ public function admin_options_settings(): void ); } - if (defined('EAC_OBJECT_CACHE')) + if (defined('EAC_OBJECT_CACHE_VERSION')) { global $wp_object_cache; $stats = $wp_object_cache->getStats(); @@ -481,7 +481,7 @@ public function initialize() { if ( ! parent::initialize() ) return; // disabled - if (defined('EAC_OBJECT_CACHE')) + if (defined('EAC_OBJECT_CACHE_VERSION')) { global $wp_object_cache; $wp_object_cache->display_stats = $this->get_option('object_cache_stats'); @@ -546,7 +546,7 @@ public function checkForInstall($check='all') // check 3rd-party object cache if ($check == 'all' || $check == 'existing') { - if (file_exists(WP_CONTENT_DIR.'/object-cache.php') && !defined('EAC_OBJECT_CACHE')) + if (file_exists(WP_CONTENT_DIR.'/object-cache.php') && !defined('EAC_OBJECT_CACHE_VERSION')) { $plugin_data = get_plugin_data( WP_CONTENT_DIR.'/object-cache.php', true ); if ( ! $plugin_data['Title'] ) $plugin_data['Title'] = '3rd Party Object Cache'; @@ -648,7 +648,7 @@ public function install_object_cache($action) */ public function adminVersionUpdate($curVersion,$newVersion) { - if (defined('EAC_OBJECT_CACHE')) + if (defined('EAC_OBJECT_CACHE_VERSION')) { $this->install_object_cache('update'); } diff --git a/eacObjectCache.php b/eacObjectCache.php index e2f5c0c..a87ad46 100755 --- a/eacObjectCache.php +++ b/eacObjectCache.php @@ -14,7 +14,7 @@ * @wordpress-plugin * Plugin Name: {eac}ObjectCache * Description: {eac}Doojigger Object Cache - SQLite powered WP_Object_Cache Drop-in - * Version: 1.0.1 + * Version: 1.0.2 * Requires at least: 5.5.0 * Tested up to: 6.4 * Requires PHP: 7.4 diff --git a/readme.md b/readme.md index 0620eca..e5af6df 100644 --- a/readme.md +++ b/readme.md @@ -7,8 +7,8 @@ Plugin URI: https://eacdoojigger.earthasylum.com/eacobjectcache/ Author: [EarthAsylum Consulting](https://www.earthasylum.com) -Stable tag: 1.0.1 -Last Updated: 24-Jan-2024 +Stable tag: 1.0.2 +Last Updated: 17-Feb-2024 Requires at least: 5.5.0 Tested up to: 6.4 Requires PHP: 7.4 diff --git a/readme.txt b/readme.txt index 72013e2..e46ca8e 100644 --- a/readme.txt +++ b/readme.txt @@ -1,8 +1,8 @@ === {eac}ObjectCache - SQLite powered WP_Object_Cache Drop-in. === Plugin URI: https://eacdoojigger.earthasylum.com/eacobjectcache/ Author: [EarthAsylum Consulting](https://www.earthasylum.com) -Stable tag: 1.0.1 -Last Updated: 24-Jan-2024 +Stable tag: 1.0.2 +Last Updated: 17-Feb-2024 Requires at least: 5.5.0 Tested up to: 6.4 Requires PHP: 7.4 @@ -404,6 +404,13 @@ You should receive a copy of the GNU General Public License along with this prog == Changelog == += Version 1.0.2 - February 17, 2024 = + ++ Minor updates as per WordPress review team. ++ Changed EAC_OBJECT_CACHE to EAC_OBJECT_CACHE_VERSION. ++ Added ABSPATH check in wp-cache.php. ++ Escape output of calculated cache ratio. + = Version 1.0.1 - January 24, 2024 = + Improved sanitization and output escaping. diff --git a/src/object-cache.php b/src/object-cache.php index 485b462..44eaccf 100644 --- a/src/object-cache.php +++ b/src/object-cache.php @@ -4,7 +4,7 @@ * * Plugin Name: {eac}ObjectCache * Description: {eac}Doojigger Object Cache - SQLite powered WP_Object_Cache Drop-in - * Version: 1.0.1 + * Version: 1.0.2 * Requires at least: 5.5.0 * Tested up to: 6.4 * Requires PHP: 7.4 @@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit; -define('EAC_OBJECT_CACHE','1.0.1'); +define('EAC_OBJECT_CACHE_VERSION','1.0.2'); /** * @@ -1726,7 +1726,7 @@ public function stats(): void echo "Cache Hits: ".number_format($this->cache_stats['cache hits'],0)."
"; echo "Cache Misses: ".number_format($this->cache_stats['cache misses'])."
"; echo "Cache Ratio: ". - $this->cache_hit_ratio($this->cache_stats['cache hits'],$this->cache_stats['cache misses']); + esc_attr( $this->cache_hit_ratio($this->cache_stats['cache hits'],$this->cache_stats['cache misses']) ); echo "

\n"; echo "

Cache Counts: