89% rest-api-docs

Code Review | REST API Docs

WordPress plugin REST API Docs scored89%from 54 tests.

About plugin

  • Plugin page: rest-api-docs
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 28, 2018
  • Latest release: Mar 28, 2018
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: Takahashi_Fumiki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /769 total downloads

Benchmarks

Plugin footprint 83% 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.00MB] [CPU: ▼7.09ms] Passed 4 tests

Analyzing server-side resources used by REST API Docs
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.27 ▼1.95
Dashboard /wp-admin3.31 ▲0.0143.27 ▼4.46
Posts /wp-admin/edit.php3.36 ▲0.0144.86 ▼5.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.72 ▼16.89
Media Library /wp-admin/upload.php3.23 ▲0.0034.86 ▲0.79
REST API /wp-admin/tools.php?page=rest-api-doc3.2030.78

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for REST API Docs
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.58 ▲0.162.00 ▲0.5645.25 ▲5.64
Dashboard /wp-admin2,193 ▲165.63 ▲0.0589.57 ▲3.1037.59 ▼4.58
Posts /wp-admin/edit.php2,107 ▲71.95 ▼0.0338.96 ▲1.7734.58 ▼1.10
Add New Post /wp-admin/post-new.php1,531 ▲323.34 ▲0.10653.57 ▼0.7367.95 ▲1.82
Media Library /wp-admin/upload.php1,401 ▲14.13 ▼0.09111.22 ▲7.5247.67 ▲0.57
REST API /wp-admin/tools.php?page=rest-api-doc8322.4443.5428.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, 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 Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: rest

rest-api-docs/rest-api-doc.php 85% from 13 tests

Analyzing the main PHP file in "REST API Docs" version 0.2.0
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("rest-api-docs.php" instead of "rest-api-doc.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 detected662 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
Vuejs Component3233192
Sass3200163
JSON20075
JavaScript481767
PHP2104560
PO File1191953
Markdown121040
XML14211
CSS1111

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected