10% kdisk

Code Review | KDisk

WordPress plugin KDisk scored10%from 54 tests.

About plugin

  • Plugin page: kdisk
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2021
  • Latest release: Oct 26, 2022
  • Number of updates: 45
  • Update frequency: every 9.7 days
  • Top authors: kdiskplugin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,461 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Error in wp-content/plugins/kdisk/mydisk/class-kdisk-mydisk.php+52
    Uncaught Error: Class 'KDisk_Base' not found in wp-content/plugins/kdisk/mydisk/class-kdisk-mydisk.php:52
    Stack trace:
    #0 wp-content/plugins/kdisk/templates/tem-mydisk.php(64): KDisk_MyDisk->initialize()
    #1 wp-content/plugins/kdisk/kdisk.php(181): include('/var/www/wordpr...')
    #2 wp-content/plugins/kdisk/kdisk.php(75): kdisk_upgrate_function()
    #3 wp-includes/class-wp-hook.php(310): kdisk_plugin_activation()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.95ms] Passed 4 tests

This is a short check of server-side resources used by KDisk
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.26 ▼1.41
Dashboard /wp-admin3.31 ▲0.0049.68 ▼3.53
Posts /wp-admin/edit.php3.36 ▲0.0049.48 ▼4.19
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.77 ▼0.64
Media Library /wp-admin/upload.php3.23 ▲0.0036.49 ▼2.68

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 59 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for KDisk
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.56 ▲0.192.11 ▲0.3048.20 ▲2.40
Dashboard /wp-admin2,195 ▲155.66 ▲0.0185.38 ▼6.7240.49 ▼6.71
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0239.81 ▼0.8237.64 ▲0.18
Add New Post /wp-admin/post-new.php1,526 ▼1917.67 ▼5.49636.55 ▲9.1353.49 ▲8.37
Media Library /wp-admin/upload.php1,400 ▼04.19 ▲0.01103.40 ▼0.6548.16 ▲2.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/kdisk/uninstall.php+27
    Trying to access array offset on value of type null
  • The plugin did not uninstall correctly, leaving 59 files (1.26MB) in the plugin directory
    • (new file) mydisk/class-kdisk-in-command.php
    • (new file) lang/kdisk-ru_RU.mo
    • (new file) mydisk/class-kdisk-mydisk.php
    • (new file) kdisk.php
    • (new file) lang/kdisk-ru_RU.po
    • (new file) index.php
    • (new file) css/style-admin.css
    • (new file) mydisk/css/kv-elements.css
    • (new file) mydisk/css/mydisk.css
    • (new file) include/class-kdisk-wp.php
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • recovery_mode_email_last_sent

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/kdisk/mydisk/include/class-kdisk-make-info-file.php
    • > /wp-content/plugins/kdisk/mydisk/class-kdisk-mydisk.php
    • > /wp-content/plugins/kdisk/templates/tem-mydisk.php
    • > /wp-content/plugins/kdisk/mydisk/include/class-kdisk-basemy.php
    • > /wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php
    • > /wp-content/plugins/kdisk/mydisk/include/class-kdisk-tasks.php
    • > /wp-content/plugins/kdisk/mydisk/include/class-kdisk-base.php
    • > /wp-content/plugins/kdisk/mydisk/include/class-kdisk-ffmpeg.php
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: ranges in wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php on line 138
    • > PHP Warning
      fwrite() expects parameter 1 to be resource, bool given in wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php on line 203
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/kdisk/kdisk.php:34
    • > PHP Warning
      fopen(wp-content/temporary/14-10-23dwn.log): failed to open stream: No such file or directory in /var/www/wordpress/wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php on line 199
    • > PHP Fatal error
      Uncaught Error: Class 'KDisk_WP' not found in wp-content/plugins/kdisk/templates/tem-mydisk.php:18
    • > PHP Warning
      fclose() expects parameter 1 to be resource, bool given in wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php on line 204
    • > PHP Notice
      Undefined index: User-Agent in wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php on line 133
    • > PHP Warning
      fwrite() expects parameter 1 to be resource, bool given in wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php on line 202
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/kdisk/mydisk/include/class-kdisk-stat.php on line 167

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Пример папки с файлами), #2 (Процесс конвертации видео файла используя ffmpeg), #3 (Properties file)
You can take inspiration from this readme.txt

kdisk/kdisk.php Passed 13 tests

This is the main PHP file of "KDisk" version 1.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
111 characters long description:
Плагин загрузка, хранение, скачивание файлов пользователями

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 plugin7,415 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP209665204,644
JavaScript6232671,722
CSS310311844
PO File190108205

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.30
Average class complexity44.33
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods104
▷ Static methods2423.08%
▷ Public methods10399.04%
▷ Protected methods00.00%
▷ Private methods10.96%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
24 PNG files occupy 0.97MB with 0.63MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
mydisk/imgs/kvrecovert.png28.93KB6.59KB▼ 77.24%
mydisk/imgs/kvtrasht.png36.41KB9.48KB▼ 73.97%
screenshot-2.png122.37KB36.32KB▼ 70.32%
mydisk/imgs/folder.png26.04KB3.72KB▼ 85.71%
mydisk/imgs/kvmenu.png1.74KB1.44KB▼ 17.06%