10% disk-space-pie-chart

Code Review | Disk Space Pie Chart

WordPress plugin Disk Space Pie Chart scored10%from 54 tests.

About plugin

  • Plugin page: disk-space-pie-chart
  • Plugin version: 0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.8
  • WordPress version: 6.3.1
  • First release: Jan 2, 2011
  • Latest release: Dec 13, 2013
  • Number of updates: 41
  • Update frequency: every 28.5 days
  • Top authors: versluis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /4,090 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
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/disk-space-pie-chart/guruspace.php+345
    Function create_function() is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼53.70ms] Passed 4 tests

Analyzing server-side resources used by Disk Space Pie Chart
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.95 ▼1.28
Dashboard /wp-admin2.05 ▼1.305.56 ▼56.54
Posts /wp-admin/edit.php2.05 ▼1.314.98 ▼43.23
Add New Post /wp-admin/post-new.php2.05 ▼3.845.27 ▼87.29
Media Library /wp-admin/upload.php2.05 ▼1.185.52 ▼27.74
Disk Space Pie /wp-admin/index.php?page=guruspace-admin2.055.31

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
guru_unit
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for Disk Space Pie Chart
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲12213.26 ▼1.325.11 ▲3.4633.68 ▼5.45
Dashboard /wp-admin2,277 ▲894.85 ▼1.01103.03 ▼14.9745.51 ▲3.00
Posts /wp-admin/edit.php2,072 ▼172.05 ▲0.0435.66 ▼1.5232.94 ▼0.29
Add New Post /wp-admin/post-new.php1,537 ▲2323.36 ▲5.71677.04 ▼2.6656.64 ▼10.86
Media Library /wp-admin/upload.php1,395 ▲134.13 ▼0.0293.25 ▼1.0245.94 ▲0.18
Disk Space Pie /wp-admin/index.php?page=guruspace-admin7791.147.1224.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/disk-space-pie-chart/guruspace.php+345
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded
    • guru_unit
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/index.php?page=guruspace-admin
    • > Deprecated in wp-content/plugins/disk-space-pie-chart/guruspace.php+345
    Function create_function() is deprecated
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=guruspace-admin
    • > Notice in wp-content/plugins/disk-space-pie-chart/guruspace.php+201
    A non well formed numeric value encountered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=guruspace-admin
    • > Warning in wp-content/plugins/disk-space-pie-chart/guruspace.php+187
    Division by zero
    • > GET request to /wp-admin/index.php?page=guruspace-admin
    • > Error in wp-content/plugins/disk-space-pie-chart/guruspace.php+152
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/disk-space-pie-chart/guruspace.php:152
    Stack trace:
    #0 wp-content/plugins/disk-space-pie-chart/guruspace.php(204): db_size()
    #1 wp-includes/class-wp-hook.php(310): guruspace()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/index.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/disk-space-pie-chart/includes/piechart.php
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110
    • > PHP Notice
      Undefined variable: xtra_height in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 48
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 99
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110
    • > PHP Warning
      imagefilledarc() expects parameter 7 to be int, float given in wp-content/plugins/disk-space-pie-chart/includes/piechart.php on line 110

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues 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:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === disk-space-pie-chart === )
Please take inspiration from this readme.txt

disk-space-pie-chart/guruspace.php 92% from 13 tests

The main PHP file in "Disk Space Pie Chart" ver. 0.6 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("disk-space-pie-chart.php" instead of "guruspace.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin319 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP211571319

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.33
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/guru-header-2013.png33.72KB13.19KB▼ 60.90%