66% display-sql-stats

Code Review | Display SQL Stats

WordPress plugin Display SQL Stats scored66%from 54 tests.

About plugin

  • Plugin page: display-sql-stats
  • Plugin version: 0.9.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.7.4
  • WordPress version: 6.3.1
  • First release: Apr 16, 2013
  • Latest release: May 15, 2017
  • Number of updates: 44
  • Update frequency: every 33.9 days
  • Top authors: 1manfactory (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /4,611 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
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.95ms] Passed 4 tests

A check of server-side resources used by Display SQL Stats
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0537.84 ▼5.66
Dashboard /wp-admin3.41 ▲0.0648.71 ▼5.81
Posts /wp-admin/edit.php3.52 ▲0.1250.47 ▼2.93
Add New Post /wp-admin/post-new.php5.99 ▲0.0686.98 ▼5.40
Media Library /wp-admin/upload.php3.33 ▲0.0637.81 ▲2.83
Display SQL Stats /wp-admin/options-general.php?page=dss_display-stats3.3436.62

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Display SQL Stats
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5615.34 ▲1.102.19 ▲0.2140.04 ▼3.75
Dashboard /wp-admin2,222 ▲426.70 ▲1.04112.43 ▲25.3339.57 ▼2.81
Posts /wp-admin/edit.php2,130 ▲333.83 ▲1.8354.88 ▲18.6037.94 ▼3.72
Add New Post /wp-admin/post-new.php6,316 ▲4,79025.12 ▲1.95972.36 ▲289.9438.22 ▼35.66
Media Library /wp-admin/upload.php1,427 ▲306.35 ▲2.04107.62 ▲1.6145.06 ▲1.39
Display SQL Stats /wp-admin/options-general.php?page=dss_display-stats1,0553.2939.0325.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dss_display-stats
    • > Warning in wp-content/plugins/display-sql-stats/display-stats-admin.php+92
    count(): Parameter must be an array or an object that implements Countable
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dss_display-stats
    • > Notice in wp-content/plugins/display-sql-stats/display-stats-admin.php+120
    Trying to access array offset on value of type bool
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dss_display-stats
    • > Warning in wp-content/plugins/display-sql-stats/display-stats-admin.php+165
    in_array() expects parameter 2 to be array, bool given

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/display-sql-stats/display-stats-header.php
    • > /wp-content/plugins/display-sql-stats/whatsup.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/display-sql-stats/display-stats-getdata.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dss_set_lang_file() in wp-content/plugins/display-sql-stats/display-stats-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/display-sql-stats/display-stats.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dss_set_lang_file() in wp-content/plugins/display-sql-stats/display-stats-chart.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=dss_display-stats
    • > Console-api (warning) in unknown
    https://www.google.com/jsapi 140:47 " Attempting to load version '1' of Google Charts, but the previously loaded '1.0' will be used instead."

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: There are too many tags (18 tag instead of maximum 10)
Please take inspiration from this readme.txt

display-sql-stats/display-stats.php 92% from 13 tests

This is the main PHP file of "Display SQL Stats" version 0.9.5.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("display-sql-stats.php" instead of "display-stats.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin586 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8127120522
PO File1232864

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/plus-icon.png0.87KB0.84KB▼ 3.15%
img/minus-icon.png0.84KB0.79KB▼ 5.58%