84% debug-bar-for-sophi

Code Review | Debug Bar for Sophi

WordPress plugin Debug Bar for Sophi scored84%from 54 tests.

About plugin

  • Plugin page: debug-bar-for-sophi
  • Plugin version: 0.3.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: May 10, 2022
  • Latest release: Jul 7, 2022
  • Number of updates: 4
  • Update frequency: every 15.3 days
  • Top authors: 10up (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /800 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼4.56ms] Passed 4 tests

A check of server-side resources used by Debug Bar for Sophi
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1242.89 ▲4.51
Dashboard /wp-admin3.41 ▲0.1148.01 ▼2.77
Posts /wp-admin/edit.php3.53 ▲0.1746.24 ▼5.35
Add New Post /wp-admin/post-new.php5.99 ▲0.1189.56 ▼14.62
Media Library /wp-admin/upload.php3.34 ▲0.1141.74 ▲7.84

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Debug Bar for Sophi
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4214.36 ▲0.001.64 ▲0.0344.02 ▲4.61
Dashboard /wp-admin2,209 ▲355.62 ▲0.1194.73 ▲10.0242.49 ▼0.78
Posts /wp-admin/edit.php2,115 ▲152.01 ▼0.0036.11 ▼2.3832.32 ▼4.67
Add New Post /wp-admin/post-new.php1,536 ▲1123.59 ▼0.05669.98 ▲12.9952.30 ▼1.65
Media Library /wp-admin/upload.php1,414 ▲144.17 ▼0.0193.93 ▼13.9845.76 ▼8.01

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Debug_Bar_Panel' not found in wp-content/plugins/debug-bar-for-sophi/includes/class-sophi-debug-bar-panel.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'SophiDebugBar\\Item' not found in wp-content/plugins/debug-bar-for-sophi/includes/classes/Event.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SophiDebugBar\\Item' not found in wp-content/plugins/debug-bar-for-sophi/includes/classes/Request.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/debug-bar-for-sophi/sophi-debug-bar.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: debug bar, sophi

debug-bar-for-sophi/sophi-debug-bar.php 92% from 13 tests

The main file in "Debug Bar for Sophi" v. 0.3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("debug-bar-for-sophi.php" instead of "sophi-debug-bar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,260 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP203479051,253
JSON1005
CSS1001
JavaScript1001

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.37
Average class complexity15.33
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods81
▷ Static methods2024.69%
▷ Public methods7997.53%
▷ Protected methods00.00%
▷ Private methods22.47%
Functions25
▷ Named functions2392.00%
▷ Anonymous functions28.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin