68% redis-cache

Code Review | Redis Object Cache

WordPress plugin Redis Object Cache scored68%from 54 tests.

About plugin

  • Plugin page: redis-cache
  • Plugin version: 2.5.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Nov 14, 2014
  • Latest release: Nov 16, 2023
  • Number of updates: 223
  • Update frequency: every 14.8 days
  • Top authors: tillkruess (100%)

Code review

54 tests

User reviews

146 reviews

Install metrics

100,000+ active /8,232,035 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.58ms] Passed 4 tests

Analyzing server-side resources used by Redis Object Cache
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.80 ▼3.37
Dashboard /wp-admin3.36 ▲0.0646.20 ▼4.46
Posts /wp-admin/edit.php3.41 ▲0.0549.28 ▲6.08
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.09 ▼3.50
Media Library /wp-admin/upload.php3.28 ▲0.0531.89 ▼2.98
Redis /wp-admin/options-general.php?page=redis-cache3.4235.56

Server storage [IO: ▲1.46MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 402 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Redis Object Cache
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,056 ▲29414.73 ▲0.611.60 ▼0.2440.97 ▼3.89
Dashboard /wp-admin2,439 ▲2626.38 ▲0.85135.13 ▲31.8047.22 ▲3.26
Posts /wp-admin/edit.php2,132 ▲321.97 ▼0.0539.71 ▲2.9835.24 ▼0.95
Add New Post /wp-admin/post-new.php1,548 ▲2223.28 ▲0.20598.39 ▼147.4945.60 ▼10.23
Media Library /wp-admin/upload.php1,432 ▲324.25 ▲0.02103.70 ▼5.0543.62 ▼4.03
Redis /wp-admin/options-general.php?page=redis-cache1,0682.8346.0727.85

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php+108
    stream_socket_client(): unable to connect to tcp://127.0.0.1:6379 (Connection refused)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=redis-cache
    • > Warning in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php+108
    stream_socket_client(): unable to connect to tcp://127.0.0.1:6379 (Connection refused)

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 295× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Command/Redis/MSET.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Command/Redis/OBJECT_.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Pipeline\\Pipeline' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Pipeline/ConnectionErrorProof.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Command/Redis/SADD.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Command/Redis/LPUSHX.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Command/Redis/AbstractCommand/BZPOPBase.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Command/Redis/LMPOP.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Command/Redis/DECRBY.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Connection\\Replication\\ReplicationInterface' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/Replication/MasterSlaveReplication.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\ClientInterface' not found in wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: relay, phpredis, redis, caching performance, cache...

redis-cache/redis-cache.php Passed 13 tests

This is the main PHP file of "Redis Object Cache" version 2.5.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
132 characters long description:
A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin18,428 lines of code in 398 files:
LanguageFilesBlank linesComment linesLines of code
PHP3824,77112,35616,574
Markdown330201,059
JavaScript26415423
CSS1370159
Dockerfile63012107
JSON20075
YAML16026
Bourne Shell15165

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity6.42
▷ Minimum class complexity1.00
▷ Maximum class complexity347.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces42
Interfaces32
Traits27
Classes313
▷ Abstract classes134.15%
▷ Concrete classes30095.85%
▷ Final classes10.33%
Methods1,311
▷ Static methods443.36%
▷ Public methods1,07381.85%
▷ Protected methods19614.95%
▷ Private methods423.20%
Functions48
▷ Named functions2143.75%
▷ Anonymous functions2756.25%
Constants60
▷ Global constants2135.00%
▷ Class constants3965.00%
▷ Public constants3076.92%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin