89% embed-swagger-ui

Code Review | Embed Swagger UI

WordPress plugin Embed Swagger UI scored89%from 54 tests.

About plugin

  • Plugin page: embed-swagger-ui
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 19, 2023
  • Latest release: Apr 19, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: spanrig (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /447 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.03MB] [CPU: ▼11.41ms] Passed 4 tests

A check of server-side resources used by Embed Swagger UI
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.32 ▲0.89
Dashboard /wp-admin3.34 ▼0.0047.86 ▼14.35
Posts /wp-admin/edit.php3.39 ▲0.0448.37 ▼6.23
Add New Post /wp-admin/post-new.php5.98 ▲0.0984.81 ▼25.09
Media Library /wp-admin/upload.php3.27 ▲0.0437.05 ▲0.03
All Swaggers /wp-admin/edit.php?post_type=swagger_ui3.3136.77
Add new /wp-admin/post-new.php?post_type=swagger_ui3.3245.54

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Embed Swagger UI
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13618.28 ▲3.90393.83 ▲392.1843.20 ▲2.33
Dashboard /wp-admin2,234 ▲605.51 ▼0.1589.47 ▼7.4780.31 ▲38.14
Posts /wp-admin/edit.php2,139 ▲391.97 ▼0.0635.48 ▼3.5235.43 ▼3.14
Add New Post /wp-admin/post-new.php1,570 ▲4418.33 ▼4.83720.55 ▲23.8152.23 ▼20.31
Media Library /wp-admin/upload.php1,445 ▲484.24 ▲0.0399.98 ▼2.2366.44 ▲17.25
All Swaggers /wp-admin/edit.php?post_type=swagger_ui1,1111.9128.6931.83
Add new /wp-admin/post-new.php?post_type=swagger_ui1,6923.5662.4785.74

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

embed-swagger-ui/wp-swagger-ui.php 85% from 13 tests

The main PHP script in "Embed Swagger UI" version 1.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("embed-swagger-ui.php" instead of "wp-swagger-ui.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected316 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP6107370308
JavaScript5095
CSS1111
SVG1001
XML1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.25
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods23
▷ Static methods14.35%
▷ Public methods2086.96%
▷ Protected methods00.00%
▷ Private methods313.04%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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 were not PNG files found in your plugin