Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkruss authored Jan 23, 2025
1 parent 2631760 commit c913c4d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions includes/class-predis.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ protected function build_cluster_connection_array() {
$cluster = array_values( WP_REDIS_CLUSTER );

foreach ( $cluster as $key => $server ) {
// phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
$components = parse_url( $server );

if ( ! empty( $components['scheme'] ) ) {
Expand Down
44 changes: 22 additions & 22 deletions includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -2501,30 +2501,29 @@ public function decr( $key, $offset = 1, $group = 'default' ) {
* Used by the Debug bar plugin
*
* @return void
*
* phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
*/
public function stats() {
?>
<p>
<strong>Redis Status:</strong>
<?php echo $this->redis_status() ? 'Connected' : 'Not connected'; ?>
<br />
<strong>Redis Client:</strong>
<?php echo $this->diagnostics['client'] ?: 'Unknown'; ?>
<br />
<strong>Cache Hits:</strong>
<?php echo (int) $this->cache_hits; ?>
<br />
<strong>Cache Misses:</strong>
<?php echo (int) $this->cache_misses; ?>
<br />
<strong>Cache Size:</strong>
<?php echo number_format_i18n( strlen( serialize( $this->cache ) ) / 1024, 2 ); ?> KB
</p>
<?php
}
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
?>
<p>
<strong>Redis Status:</strong>
<?php echo $this->redis_status() ? 'Connected' : 'Not connected'; ?>
<br />
<strong>Redis Client:</strong>
<?php echo $this->diagnostics['client'] ?: 'Unknown'; ?>
<br />
<strong>Cache Hits:</strong>
<?php echo (int) $this->cache_hits; ?>
<br />
<strong>Cache Misses:</strong>
<?php echo (int) $this->cache_misses; ?>
<br />
<strong>Cache Size:</strong>
<?php echo number_format_i18n( strlen( serialize( $this->cache ) ) / 1024, 2 ); ?> KB
</p>
<?php
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
}

/**
* Returns various information about the object cache.
Expand Down Expand Up @@ -3035,6 +3034,7 @@ protected function build_cluster_connection_array() {
$cluster = array_values( WP_REDIS_CLUSTER );

foreach ( $cluster as $key => $server ) {
// phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
$components = parse_url( $server );

if ( ! empty( $components['scheme'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: tillkruess
Donate link: https://github.com/sponsors/tillkruss
Tags: redis, object cache, caching, performance, relay
Requires at least: 4.6
Tested up to: 6.6
Tested up to: 6.7
Requires PHP: 7.2
Stable tag: 2.5.4
License: GPLv3
Expand Down

0 comments on commit c913c4d

Please sign in to comment.