82% consolari-debug-logger

Code Review | Consolari Debug Logger

WordPress plugin Consolari Debug Logger scored 82% from 54 tests.

About plugin

  • Plugin page: consolari-debug-l...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.1
  • WordPress version: 5.8.1
  • First release: Feb 3, 2015
  • Latest release: Feb 3, 2015
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: Peter_Indexed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 569 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼141.38ms] Passed 4 tests

A check of server-side resources used by Consolari Debug Logger
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0234.49 ▲0.80
Dashboard /wp-admin3.13 ▲0.0847.13 ▲6.25
Posts /wp-admin/edit.php3.23 ▲0.1345.26 ▲0.65
Add New Post /wp-admin/post-new.php5.50 ▲0.0691.96 ▼565.57
Media Library /wp-admin/upload.php3.05 ▲0.0533.14 ▼1.38
Consolari Debug Logger /wp-admin/options-general.php?page=consolari_plugin_options3.0028.66

Server storage [IO: ▲0.36MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • You have illegally modified 1 file (1.28KB) outside of "wp-content/plugins/consolari-debug-logger/" and "wp-content/uploads/"
    • (new file) wp-content/db.php
Filesystem: 68 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Consolari Debug Logger
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8816.19 ▲0.668.71 ▲0.3144.63 ▼3.31
Dashboard /wp-admin2,997 ▲665.90 ▼0.14132.32 ▼10.15109.56 ▲2.01
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0065.17 ▼0.2788.90 ▼7.89
Add New Post /wp-admin/post-new.php1,675 ▲518.80 ▼0.55355.17 ▼23.00110.44 ▼1.20
Media Library /wp-admin/upload.php1,812 ▲55.04 ▲0.02152.95 ▲10.99117.59 ▼2.77
Consolari Debug Logger /wp-admin/options-general.php?page=consolari_plugin_options1,0592.1057.0585.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=consolari_plugin_options
    • > Notice in wp-content/plugins/consolari-debug-logger/src/admin_menu.php+44
    Trying to access array offset on value of type bool

SRP 0% from 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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/consolari-debug-logger/consolari-logger.php
  • 31× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Cannot use 'String' as class name as it is reserved in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/src/Consolari/Entries/String.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/tests/Entries/TableTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Consolari\\Transport\\AbstractTransport' not found in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/src/Consolari/Transport/BrowserEcho.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/consolari-debug-logger/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Consolari\\Entries\\AbstractEntry' not found in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/src/Consolari/Entries/Email.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/tests/Entries/ChartTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Consolari\\Entries\\AbstractEntry' not found in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/src/Consolari/Entries/Table.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Consolari\\Transport\\AbstractTransport' not found in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/src/Consolari/Transport/Curl.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/consolari-debug-logger/src/admin_menu.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/consolari-debug-logger/vendor/consolari/php-logger/tests/Entries/EmailTest.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (View the _SERVER environment.), #2 (Quickly get an overview of the execution time and memory consumption.), #3 (Get a formatted SQL query along with the result set.), #4 (For easy debugging of the SQL query view the code context of where it was executed.)
The official readme.txt might help

consolari-debug-logger/consolari-logger.php 92% from 13 tests

The main file in "Consolari Debug Logger" v. 0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("consolari-debug-logger.php" instead of "consolari-logger.php")

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
Everything looks great! No dangerous files found in this plugin2,125 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP525568491,940
JSON300135
Markdown316042
YAML1008

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.76
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces7
Interfaces4
Traits2
Classes40
▷ Abstract classes410.00%
▷ Concrete classes3690.00%
▷ Final classes00.00%
Methods193
▷ Static methods168.29%
▷ Public methods19098.45%
▷ Protected methods00.00%
▷ Private methods31.55%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants14.17%
▷ Class constants2395.83%
▷ Public constants23100.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
4 PNG files occupy 0.27MB with 0.19MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png107.98KB32.77KB▼ 69.66%
assets/screenshot-3.png38.79KB11.27KB▼ 70.96%
assets/screenshot-2.png59.32KB18.85KB▼ 68.22%
assets/screenshot-4.png67.49KB18.47KB▼ 72.64%