Skip to content

Commit

Permalink
Version 1.0.2
Browse files Browse the repository at this point in the history
= 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.
  • Loading branch information
KBurkholder committed Feb 17, 2024
1 parent 9637b57 commit d5a4e9f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
12 changes: 6 additions & 6 deletions Extensions/class.eacObjectCache.extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';


/**
Expand Down Expand Up @@ -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],
[
Expand All @@ -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();
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion eacObjectCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,7 +15,7 @@

defined( 'ABSPATH' ) || exit;

define('EAC_OBJECT_CACHE','1.0.1');
define('EAC_OBJECT_CACHE_VERSION','1.0.2');

/**
*
Expand Down Expand Up @@ -1726,7 +1726,7 @@ public function stats(): void
echo "<strong>Cache Hits:</strong> ".number_format($this->cache_stats['cache hits'],0)."<br />";
echo "<strong>Cache Misses:</strong> ".number_format($this->cache_stats['cache misses'])."<br />";
echo "<strong>Cache Ratio:</strong> ".
$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 "</p>\n";

echo "<p><strong>Cache Counts:</strong></p><ul>";
Expand Down Expand Up @@ -1833,7 +1833,7 @@ public function getStats($full=true): array

$stats = array();
$stats['id'] = array(
self::PLUGIN_NAME => EAC_OBJECT_CACHE,
self::PLUGIN_NAME => EAC_OBJECT_CACHE_VERSION,
'cache file' => ($this->db)
? '~/'.trailingslashit(basename($this->cache_folder)) . $this->cache_file
: 'memory-only',
Expand Down
3 changes: 2 additions & 1 deletion src/wp-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* @subpackage Cache
*/

defined( 'EAC_OBJECT_CACHE' ) || exit;
defined( 'ABSPATH' ) || exit;
defined( 'EAC_OBJECT_CACHE_VERSION' ) || exit;

/**
* Sets up Object Cache Global and assigns it.
Expand Down

0 comments on commit d5a4e9f

Please sign in to comment.