72% wsm-downloader

Code Review | WSM Downloader

WordPress plugin WSM Downloader scored 72% from 54 tests.

About plugin

  • Plugin page: wsm-downloader
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5
  • WordPress version: 5.8.1
  • First release: Dec 26, 2019
  • Latest release: Nov 11, 2020
  • Number of updates: 9
  • Update frequency: every 35.8 days
  • Top authors: sjhoo (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active / 3,137 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.56MB] [CPU: ▼145.62ms] Passed 4 tests

Server-side resources used by WSM Downloader
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.32 ▲0.6036.44 ▲16.70
Dashboard /wp-admin3.59 ▲0.5446.34 ▲1.08
Posts /wp-admin/edit.php3.67 ▲0.5642.74 ▼1.07
Add New Post /wp-admin/post-new.php6.18 ▲0.7477.12 ▼577.84
Media Library /wp-admin/upload.php3.55 ▲0.5530.32 ▼4.63
WSM Downloader /wp-admin/options-general.php?page=wsm_downloader3.7035.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 82 new files
Database: no new tables, 1 new option
New WordPress options
wsmds_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WSM Downloader
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.96 ▲0.7210.44 ▲2.4547.06 ▼2.16
Dashboard /wp-admin2,975 ▲415.84 ▼0.13134.26 ▼13.38116.79 ▲4.31
Posts /wp-admin/edit.php2,753 ▲142.94 ▲0.2567.87 ▲1.6986.95 ▼8.23
Add New Post /wp-admin/post-new.php1,519 ▼9618.39 ▼2.86353.09 ▲66.89108.37 ▲0.62
Media Library /wp-admin/upload.php1,851 ▲415.16 ▲0.17149.18 ▼14.12116.40 ▼6.45
WSM Downloader /wp-admin/options-general.php?page=wsm_downloader11,52313.01562.01192.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • wsmds_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php
    • > /wp-content/plugins/wsm-downloader/assets/css/frontend/themes/darkred.css.php
    • > /wp-content/plugins/wsm-downloader/assets/css/frontend/themes/lightred.css.php
    • > /wp-content/plugins/wsm-downloader/assets/css/frontend/style-fixed.css.php
    • > /wp-content/plugins/wsm-downloader/assets/css/frontend/themes/lightblue.css.php
    • > /wp-content/plugins/wsm-downloader/assets/css/frontend/themes/darkblue.css.php
  • 525× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: wsmds_admin_options in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 223
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 258
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 229
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 58
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 254
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 125
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 103
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 21
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wsm-downloader/assets/css/frontend/themes/custom_template.php on line 169

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wsm_downloader
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wsm_downloader
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wsm_downloader
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.defaultString is deprecated since version 5.5.0! Use wp.i18n instead.
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wsm_downloader
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=5.8.1+1:283
    wpColorPickerL10n.defaultAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can look at the official readme.txt

wsm-downloader/wsm_downloader.php 92% from 13 tests

This is the main PHP file of "WSM Downloader" version 1.4.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wsm-downloader.php" instead of "wsm_downloader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin20,542 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript91,3101,20410,204
CSS98841326,263
PHP201,1362064,072
JSON3003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity14.25
▷ Minimum class complexity6.00
▷ Maximum class complexity27.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions2388.46%
▷ Anonymous functions311.54%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
36 PNG files occupy 0.35MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/admin/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%
assets/img/twitter.png0.48KB0.46KB▼ 3.69%
(invalid) assets/img/liveleak.png1.12KB0.00KB▼ 100.00%
assets/css/admin/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
assets/img/darkblue.png26.26KB9.72KB▼ 63.00%