73% rest-api-cache

Code Review | Rest API Cache

WordPress plugin Rest API Cache scored73%from 54 tests.

About plugin

  • Plugin page: rest-api-cache
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9.3
  • WordPress version: 6.3.1
  • First release: Feb 6, 2018
  • Latest release: Jun 20, 2019
  • Number of updates: 3
  • Update frequency: every 168.0 days
  • Top authors: vsourz1td (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,937 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by Rest API Cache
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.31 ▼1.19
Dashboard /wp-admin3.33 ▲0.0345.50 ▼8.08
Posts /wp-admin/edit.php3.39 ▲0.0345.27 ▼0.52
Add New Post /wp-admin/post-new.php5.95 ▲0.0686.01 ▼2.07
Media Library /wp-admin/upload.php3.26 ▲0.0333.82 ▼0.88
Rest API Cache /wp-admin/admin.php?page=rest_api_cache_setting3.2832.21
Exclude API Cache /wp-admin/admin.php?page=rest_api_exclude3.2832.16

Server storage [IO: ▲0.34MB] [DB: ▲0.33MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
rest_cache_time
rest_cache_datetime
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Rest API Cache
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲20613.58 ▼0.718.45 ▲6.6543.79 ▼3.21
Dashboard /wp-admin2,250 ▲595.80 ▼0.11105.98 ▼8.3238.52 ▼3.87
Posts /wp-admin/edit.php2,139 ▲472.02 ▲0.0139.00 ▲4.5433.85 ▲0.70
Add New Post /wp-admin/post-new.php1,574 ▲6023.28 ▲5.74668.57 ▼10.2055.59 ▲3.97
Media Library /wp-admin/upload.php1,435 ▲444.22 ▼0.1092.83 ▼0.9040.81 ▼0.07
Rest API Cache /wp-admin/admin.php?page=rest_api_cache_setting8901.6824.8129.80
Exclude API Cache /wp-admin/admin.php?page=rest_api_exclude8261.8424.3026.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • rest_cache_time
    • rest_cache_datetime
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=rest_api_exclude
    • > Notice in wp-content/plugins/rest-api-cache/admin/partials/rest-api-cache-admin-display.php+39
    Trying to get property 'routes' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rest_api_exclude
    • > Warning in wp-content/plugins/rest-api-cache/admin/partials/rest-api-cache-admin-display.php+52
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=rest_api_exclude
    • > Notice in wp-content/plugins/rest-api-cache/admin/partials/rest-api-cache-admin-display.php+52
    Undefined variable: endpointstitle
    • > GET request to /wp-admin/admin.php?page=rest_api_exclude
    • > Warning in wp-content/plugins/rest-api-cache/admin/partials/rest-api-cache-admin-display.php+63
    array_multisort(): Argument #1 is expected to be an array or a sort flag

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/rest-api-cache/public/partials/rest-api-cache-public-display.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/rest-api-cache/admin/partials/rest-api-cache-setting-display.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/rest-api-cache/admin/partials/rest-api-cache-admin-display.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

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

"Rest API Cache" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
63 characters long description:
Boost your application speed by caching the WordPress REST API.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,243 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript73474031,425
PHP13194555542
CSS63120276

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity4.71
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods412.90%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin