90% wp-rest-api-cache

Code Review | WP REST API Cache

WordPress plugin WP REST API Cache scored90%from 54 tests.

About plugin

  • Plugin page: wp-rest-api-cache
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9.4
  • WordPress version: 6.3.1
  • First release: May 24, 2016
  • Latest release: Mar 3, 2018
  • Number of updates: 10
  • Update frequency: every 64.8 days
  • Top authors: airesvsg (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

500+ active /16,282 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.01ms] Passed 4 tests

Server-side resources used by WP REST API Cache
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0345.02 ▼2.23
Dashboard /wp-admin3.34 ▲0.0351.30 ▼2.04
Posts /wp-admin/edit.php3.39 ▲0.0353.27 ▲4.43
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.79 ▼8.21
Media Library /wp-admin/upload.php3.26 ▲0.0342.67 ▲6.76
WP REST API Cache /wp-admin/options-general.php?page=rest-cache3.2334.36

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP REST API Cache
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲4714.34 ▼0.021.60 ▼0.2041.63 ▼2.81
Dashboard /wp-admin2,208 ▲315.62 ▼0.0687.43 ▼14.0339.46 ▼2.09
Posts /wp-admin/edit.php2,110 ▲101.95 ▲0.0139.12 ▲3.5734.41 ▼4.36
Add New Post /wp-admin/post-new.php1,532 ▲623.39 ▲0.08683.34 ▲9.8350.74 ▼4.42
Media Library /wp-admin/upload.php1,410 ▲104.24 ▲0.03108.82 ▲6.9047.14 ▲4.17
WP REST API Cache /wp-admin/options-general.php?page=rest-cache8622.0024.2927.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: wp, wordpress, rest, wp-api, cache...

wp-rest-api-cache/class-wp-rest-cache.php 92% from 13 tests

Analyzing the main PHP file in "WP REST API Cache" version 1.2.0
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-rest-api-cache.php" instead of "class-wp-rest-cache.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected238 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3469176
Markdown115062

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.50
▷ Minimum class complexity7.00
▷ Maximum class complexity14.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods13100.00%
▷ Public methods861.54%
▷ Protected methods00.00%
▷ Private methods538.46%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin