84% document-generator-for-openapi

Code Review | Document Generator for OpenAPI

WordPress plugin Document Generator for OpenAPI scored84%from 54 tests.

About plugin

  • Plugin page: document-generato...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2
  • WordPress version: 6.3.1
  • First release: Sep 21, 2021
  • Latest release: Jul 4, 2023
  • Number of updates: 5
  • Update frequency: every 130.2 days
  • Top authors: schneiderundschuetz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,968 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.35ms] Passed 4 tests

This is a short check of server-side resources used by Document Generator for OpenAPI
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0834.31 ▼9.22
Dashboard /wp-admin3.38 ▲0.0844.86 ▼4.94
Posts /wp-admin/edit.php3.50 ▲0.1448.45 ▲1.18
Add New Post /wp-admin/post-new.php5.97 ▲0.0891.16 ▼3.43
Media Library /wp-admin/upload.php3.31 ▲0.0735.14 ▲0.20

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Document Generator for OpenAPI
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.211.85 ▼0.0543.57 ▼6.44
Dashboard /wp-admin2,206 ▲184.83 ▼0.05107.14 ▼7.5541.96 ▼5.24
Posts /wp-admin/edit.php2,089 ▼02.05 ▼0.1039.88 ▲2.3737.08 ▼1.48
Add New Post /wp-admin/post-new.php1,534 ▼023.30 ▲0.15675.55 ▲9.0856.69 ▲3.21
Media Library /wp-admin/upload.php1,382 ▼64.19 ▼0.1697.60 ▼11.4642.72 ▼2.75

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'OpenAPIGenerator\\GeneratorBase' not found in wp-content/plugins/document-generator-for-openapi/inc/class-generator-3_1_0.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === document-generator-for-openapi === )
You can look at the official readme.txt

document-generator-for-openapi/document-generator-for-openapi.php Passed 13 tests

The entry point to "Document Generator for OpenAPI" version 1.1.0 is a PHP file that has certain tags in its header comment area
64 characters long description:
OpenAPI (fka. Swagger) Document Generator for WordPress 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 detected495 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP814380467
Markdown28028

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2787.10%
▷ Protected methods13.23%
▷ Private methods39.68%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin