68% diagnostic-glance

Code Review | Diagnostic Glance

WordPress plugin Diagnostic Glance scored68%from 54 tests.

About plugin

  • Plugin page: diagnostic-glance
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 9, 2015
  • Latest release: Sep 1, 2023
  • Number of updates: 33
  • Update frequency: every 87.4 days
  • Top authors: Laughter On Water (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /2,272 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.94MB] [CPU: ▼57.85ms] Passed 4 tests

This is a short check of server-side resources used by Diagnostic Glance
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.425.15 ▼44.45
Dashboard /wp-admin2.06 ▼1.245.42 ▼48.52
Posts /wp-admin/edit.php2.07 ▼1.296.03 ▼42.71
Add New Post /wp-admin/post-new.php2.06 ▼3.826.34 ▼95.73
Media Library /wp-admin/upload.php2.07 ▼1.166.39 ▼33.64

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Diagnostic Glance
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲13114.28 ▼0.012.06 ▲0.0942.94 ▲0.23
Dashboard /wp-admin2,290 ▲1105.55 ▼0.1391.73 ▼11.1146.30 ▲3.96
Posts /wp-admin/edit.php2,104 ▲42.11 ▲0.1038.22 ▲2.0837.50 ▲1.88
Add New Post /wp-admin/post-new.php1,530 ▲423.42 ▲0.27652.48 ▼16.5848.70 ▼3.52
Media Library /wp-admin/upload.php1,404 ▲44.20 ▲0.1094.41 ▼17.8840.21 ▼3.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the low_diagnostic_glance_styles handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • dashboard_widget_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/diagnostic-glance/includes/widget-config.php
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/diagnostic-glance/includes/ldg-scripts.php:11
    • > PHP Notice
      Undefined variable: ldgoptions in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 40
    • > PHP Notice
      Undefined variable: ldgoptions in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 39
    • > PHP Notice
      Undefined variable: ldgoptions in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 44
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 44
    • > PHP Notice
      Undefined variable: ldgoptions in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 42
    • > PHP Warning
      Use of undefined constant LDG_PLUGIN_VERSION - assumed 'LDG_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 48
    • > PHP Warning
      Use of undefined constant LDG_PLUGIN_VERSION - assumed 'LDG_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 36
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 41
    • > PHP Notice
      Undefined variable: ldgoptions in wp-content/plugins/diagnostic-glance/includes/widget-config.php on line 45

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: diagnostics, forum help, glance, diagnostic, system

diagnostic-glance/diagnostic-glance.php 92% from 13 tests

Analyzing the main PHP file in "Diagnostic Glance" version 1.0
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected615 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP790151474
CSS1171468
SVG20238
JavaScript12035

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods675.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/LOW_background_logo.png9.26KB8.48KB▼ 8.41%
images/eye-open.png1.21KB1.08KB▼ 10.78%
images/eye-closed.png1.00KB0.91KB▼ 8.69%