74% wp-rest-cache

Code Review | WP REST Cache

WordPress plugin WP REST Cache scored 74% from 54 tests.

About plugin

  • Plugin page: wp-rest-cache
  • Plugin version: 2023.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Jan 31, 2019
  • Latest release: Aug 29, 2023
  • Number of updates: 47
  • Update frequency: every 35.6 days
  • Top authors: acato (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

10,000+ active / 170,763 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▲1.31ms] Passed 4 tests

An overview of server-side resources used by WP REST Cache
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1143.79 ▲0.75
Dashboard /wp-admin3.40 ▲0.0950.59 ▲2.78
Posts /wp-admin/edit.php3.45 ▲0.0951.91 ▼1.91
Add New Post /wp-admin/post-new.php5.99 ▲0.10111.56 ▲15.17
Media Library /wp-admin/upload.php3.32 ▲0.0939.56 ▲3.60
WP REST Cache /wp-admin/options-general.php?page=wp-rest-cache3.3738.44

Server storage [IO: ▲0.19MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Illegal file modification found: 1 file (1.07KB) outside of "wp-content/plugins/wp-rest-cache/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/wp-rest-cache.php
Filesystem: 31 new files
Database: 2 new tables, 6 new options
New tables
wp_wrc_relations
wp_wrc_caches
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

WP REST Cache: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10113.26 ▼1.301.70 ▼0.1040.95 ▼2.13
Dashboard /wp-admin2,226 ▲355.83 ▲0.73108.79 ▲0.3944.94 ▼2.99
Posts /wp-admin/edit.php2,106 ▲172.03 ▲0.0139.59 ▲3.8135.76 ▼0.15
Add New Post /wp-admin/post-new.php1,538 ▲1023.13 ▼0.04589.14 ▲4.3458.69 ▲6.39
Media Library /wp-admin/upload.php1,402 ▲144.20 ▼0.05100.47 ▲3.4843.75 ▼1.76
WP REST Cache /wp-admin/options-general.php?page=wp-rest-cache1,0252.0621.6527.18

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
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_wrc_relations
    • wp_wrc_caches
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Terms_Controller' not found in wp-content/plugins/wp-rest-cache/includes/controller/class-term-controller.php:21
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-rest-cache/admin/includes/class-api-caches-table.php on line 15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-rest-cache/sources/wp-rest-cache.php on line 23
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wp-rest-cache/sources/wp-rest-cache.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Rest_Cache_Plugin\\Admin\\Includes\\API_Caches_Table' not found in wp-content/plugins/wp-rest-cache/admin/partials/sub-endpoint-api.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/wp-rest-cache/includes/cli/class-flush-command.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Attachments_Controller' not found in wp-content/plugins/wp-rest-cache/includes/controller/class-attachment-controller.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/wp-rest-cache/admin/includes/class-api-caches-table.php:26
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-rest-cache/sources/wp-rest-cache.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-rest-cache/admin/partials/sub-clear-cache.php:45

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: api, cache, rest cache, rest api cache, rest...

wp-rest-cache/wp-rest-cache.php Passed 13 tests

"WP REST Cache" version 2023.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
31 characters long description:
Adds caching to the WP REST API

Code Analysis Passed 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
No dangerous file extensions were detected3,310 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP264501,7322,164
CSS233501,146

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.24
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces7
Interfaces0
Traits1
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods124
▷ Static methods97.26%
▷ Public methods9677.42%
▷ Protected methods21.61%
▷ Private methods2620.97%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin