79% diskhero

Code Review | DiskHero

WordPress plugin DiskHero scored79%from 54 tests.

About plugin

  • Plugin page: diskhero
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Aug 4, 2022
  • Latest release: Aug 4, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: kaushik07 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /244 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼13.04ms] Passed 4 tests

Analyzing server-side resources used by DiskHero
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.78 ▼4.90
Dashboard /wp-admin3.34 ▼0.0147.67 ▼29.29
Posts /wp-admin/edit.php3.39 ▲0.0348.59 ▼2.84
Add New Post /wp-admin/post-new.php5.93 ▲0.0591.85 ▼15.12
Media Library /wp-admin/upload.php3.26 ▲0.0353.70 ▲19.34

Server storage [IO: ▲0.09MB] [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: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

DiskHero: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.25 ▼1.251.75 ▼0.1741.20 ▼0.89
Dashboard /wp-admin2,224 ▲365.84 ▼0.0298.80 ▼6.8979.93 ▲39.30
Posts /wp-admin/edit.php2,107 ▲212.06 ▲0.0435.43 ▼2.9033.55 ▲0.97
Add New Post /wp-admin/post-new.php1,533 ▲1422.67 ▼0.36747.98 ▲117.7350.05 ▲0.99
Media Library /wp-admin/upload.php1,397 ▲94.13 ▼0.07109.55 ▲3.3577.89 ▲32.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/diskhero/admin/stats-page.php
    • > /wp-content/plugins/diskhero/includes/functions.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/diskhero/diskhero.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: disk analysis, storage analysis, disk statistics, disk usage, disk stats

diskhero/diskhero.php Passed 13 tests

The primary PHP file in "DiskHero" version 1.0 is used by WordPress to initiate all plugin functionality
25 characters long description:
Simple disk stats plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin658 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript265233288
PHP34926188
CSS1310180
SVG2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wporbit.png12.04KB6.41KB▼ 46.78%
images/logo.png25.23KB9.10KB▼ 63.93%
images/favicon.png20.57KB7.83KB▼ 61.91%