10% rhj4-diagnostics

Code Review | RHJ4 Diagnostics

WordPress plugin RHJ4 Diagnostics scored10%from 54 tests.

About plugin

  • Plugin page: rhj4-diagnostics
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: Sep 20, 2014
  • Latest release: Oct 9, 2014
  • Number of updates: 7
  • Update frequency: every 7.7 days
  • Top authors: rhj4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /657 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method RHJ4Diagnostics::activate() should not be called statically

Server metrics [RAM: ▼1.48MB] [CPU: ▼54.14ms] Passed 4 tests

Server-side resources used by RHJ4 Diagnostics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.52 ▼0.9411.09 ▼29.60
Dashboard /wp-admin2.54 ▼0.8111.61 ▼57.80
Posts /wp-admin/edit.php2.54 ▼0.8213.12 ▼40.65
Add New Post /wp-admin/post-new.php2.54 ▼3.3613.73 ▼88.52
Media Library /wp-admin/upload.php2.54 ▼0.7011.07 ▼21.72

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
rhj4_diagnostic_options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by RHJ4 Diagnostics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲14313.71 ▼0.899.46 ▲7.8244.49 ▼0.85
Dashboard /wp-admin2,207 ▲305.75 ▲0.2190.10 ▼4.3138.52 ▼4.79
Posts /wp-admin/edit.php2,112 ▲122.19 ▲0.2034.44 ▼1.8633.15 ▼5.65
Add New Post /wp-admin/post-new.php1,547 ▲2118.32 ▼4.77642.41 ▲13.2145.34 ▼5.77
Media Library /wp-admin/upload.php1,406 ▲34.28 ▲0.01101.97 ▲1.6942.72 ▼2.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method RHJ4Diagnostics::init() should not be called statically
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • rhj4_diagnostic_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rhj4-diagnostics/demo.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rhj4-diagnostics/rhj4_diagnostics.php:1440

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
These attributes need to be fixed: You can look at the official readme.txt

rhj4-diagnostics/rhj4_diagnostics.php 92% from 13 tests

The main file in "RHJ4 Diagnostics" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("rhj4-diagnostics.php" instead of "rhj4_diagnostics.php")

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
There were no executable files found in this plugin2,555 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52346611,205
PHP3222462989
HTML114338318
CSS110943

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity79.00
▷ Minimum class complexity3.00
▷ Maximum class complexity155.00
Average method complexity5.73
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods13.03%
▷ Public methods3193.94%
▷ Protected methods00.00%
▷ Private methods26.06%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.61MB with 0.42MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png322.62KB90.21KB▼ 72.04%
assets/screenshot-3.png76.71KB24.23KB▼ 68.41%
assets/screenshot-5.png204.45KB59.12KB▼ 71.08%
assets/screenshot-4.png23.51KB8.94KB▼ 61.96%