79% rest-api-toolbox

Code Review | REST API Toolbox

WordPress plugin REST API Toolbox scored79%from 54 tests.

About plugin

  • Plugin page: rest-api-toolbox
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.7
  • WordPress version: 6.3.1
  • First release: Apr 16, 2016
  • Latest release: Mar 25, 2021
  • Number of updates: 19
  • Update frequency: every 95.0 days
  • Top authors: GunGeekATX (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /28,912 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.23MB] [CPU: ▼1.62ms] Passed 4 tests

An overview of server-side resources used by REST API Toolbox
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1835.61 ▼6.47
Dashboard /wp-admin3.59 ▲0.2948.41 ▲1.02
Posts /wp-admin/edit.php3.64 ▲0.2847.11 ▼2.61
Add New Post /wp-admin/post-new.php6.11 ▲0.2289.20 ▲2.78
Media Library /wp-admin/upload.php3.45 ▲0.2237.74 ▲1.57
REST API Toolbox /wp-admin/options-general.php?page=rest-api-toolbox-settings3.4231.95

Server storage [IO: ▲0.06MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for REST API Toolbox
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.37 ▲0.111.87 ▼0.0441.50 ▼1.83
Dashboard /wp-admin2,202 ▲285.59 ▲0.0284.20 ▼23.0741.77 ▼6.04
Posts /wp-admin/edit.php2,104 ▲71.98 ▼0.0035.15 ▼2.3031.60 ▼7.50
Add New Post /wp-admin/post-new.php1,543 ▲1518.19 ▼4.53605.14 ▼16.8381.13 ▲30.17
Media Library /wp-admin/upload.php1,401 ▼24.17 ▲0.0297.14 ▼4.4241.39 ▼0.12
REST API Toolbox /wp-admin/options-general.php?page=rest-api-toolbox-settings8222.0023.8528.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 15× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/rest-api-toolbox/includes/settings/class-rest-api-toolbox-settings-general.php
    • > /wp-content/plugins/rest-api-toolbox/admin/partials/admin-help.php
    • > /wp-content/plugins/rest-api-toolbox/includes/class-rest-api-toolbox-settings.php
    • > /wp-content/plugins/rest-api-toolbox/includes/settings/class-rest-api-toolbox-settings-help.php
    • > /wp-content/plugins/rest-api-toolbox/includes/class-rest-api-toolbox-prefix.php
    • > /wp-content/plugins/rest-api-toolbox/includes/class-rest-api-toolbox-admin.php
    • > /wp-content/plugins/rest-api-toolbox/includes/class-rest-api-toolbox-base.php
    • > /wp-content/plugins/rest-api-toolbox/includes/settings/class-rest-api-toolbox-settings-core.php
    • > /wp-content/plugins/rest-api-toolbox/includes/settings/class-rest-api-toolbox-settings.php
    • > /wp-content/plugins/rest-api-toolbox/includes/settings/class-rest-api-toolbox-settings-ssl.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(REST_API_TOOLBOX_ROOTincludes/wp-cli/class-rest-api-toolbox-base-command.php): failed to open stream: No such file or directory in wp-content/plugins/rest-api-toolbox/includes/wp-cli/setup.php on line 11
    • > PHP Warning
      Use of undefined constant REST_API_TOOLBOX_ROOT - assumed 'REST_API_TOOLBOX_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/rest-api-toolbox/includes/wp-cli/setup.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'REST_API_Toolbox_Base_Command' not found in wp-content/plugins/rest-api-toolbox/includes/wp-cli/class-rest-api-toolbox-rest-api-command.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/rest-api-toolbox/includes/wp-cli/class-rest-api-toolbox-base-command.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/rest-api-toolbox/rest-api-toolbox.php:19
    • > PHP Fatal error
      require_once(): Failed opening required 'REST_API_TOOLBOX_ROOTincludes/wp-cli/class-rest-api-toolbox-base-command.php' (include_path='.:/usr/share/php') in wp-content/plugins/rest-api-toolbox/includes/wp-cli/setup.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'REST_API_Toolbox_Base_Command' not found in wp-content/plugins/rest-api-toolbox/includes/wp-cli/class-rest-api-toolbox-ssl-command.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: json api, rest api, wp rest api, rest

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

This is the main PHP file of "REST API Toolbox" version 1.4.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
47 characters long description:
Allows easy tweaks of several REST API settings

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,195 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP204842251,195

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.59
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods106
▷ Static methods6965.09%
▷ Public methods9892.45%
▷ Protected methods00.00%
▷ Private methods87.55%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin