94% debug-tool

Code Review | Debug Tool

WordPress plugin Debug Tool scored 94% from 54 tests.

About plugin

  • Plugin page: debug-tool
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 5.8.1
  • First release: Feb 23, 2017
  • Latest release: Jul 10, 2018
  • Number of updates: 26
  • Update frequency: every 19.3 days
  • Top authors: eugenbobrowski (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,172 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.88MB] [CPU: ▼128.18ms] Passed 4 tests

An overview of server-side resources used by Debug Tool
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.9841.82 ▲19.56
Dashboard /wp-admin4.10 ▲1.0451.48 ▲8.58
Posts /wp-admin/edit.php4.12 ▲1.0160.46 ▲14.24
Add New Post /wp-admin/post-new.php6.01 ▲0.57106.81 ▼541.62
Media Library /wp-admin/upload.php3.96 ▲0.9638.41 ▲6.09

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Debug Tool
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /55,441 ▲51,84518.56 ▲3.0021.11 ▲10.8681.49 ▲34.34
Dashboard /wp-admin24,604 ▲21,6736.49 ▲0.35222.51 ▲93.19136.16 ▲28.35
Posts /wp-admin/edit.php24,322 ▲21,5833.10 ▲0.27105.18 ▲40.67119.46 ▲31.48
Add New Post /wp-admin/post-new.php15,385 ▲13,50922.57 ▲3.36274.71 ▼120.09133.03 ▲26.09
Media Library /wp-admin/upload.php23,131 ▲21,3215.22 ▲0.10169.28 ▲23.57138.20 ▲19.10

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/debug-tool/tools/image-puller.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/debug-tool/tools/queries.php:97
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/debug-tool/tools/items-on-page.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/debug-tool/tools/cron-jobs.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/debug-tool/tools/wp-cache.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/debug-tool/tools/errors.php:153
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/debug-tool/tools/phpinfo.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/debug-tool/tools/actions.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/debug-tool/tools/page-stat.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/debug-tool/debug-tool.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Page with debug bar), #2 (Error modal), #3 (Queries modal), #4 (Howto open and close bar)
The official readme.txt might help

debug-tool/debug-tool.php Passed 13 tests

This is the main PHP file of "Debug Tool" version 2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
68 characters long description:
Show helpful debug bar at front and admin side. Tool for developers.

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
Good job! No executable or dangerous file extensions detected1,461 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP1122270925
LESS1361473
JavaScript218062
CSS1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.40
▷ Minimum class complexity2.00
▷ Maximum class complexity25.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods51
▷ Static methods1019.61%
▷ Public methods3976.47%
▷ Protected methods00.00%
▷ Private methods1223.53%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.22MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png72.61KB24.12KB▼ 66.78%
css/images/debug-bug-icon.png1.50KB1.25KB▼ 16.55%
css/images/settings.png0.90KB0.58KB▼ 35.64%
screenshot-1.png55.07KB20.88KB▼ 62.09%
screenshot-3.png97.47KB31.82KB▼ 67.35%