62% download-manager

Code Review | Download Manager

WordPress plugin Download Manager scored62%from 54 tests.

About plugin

  • Plugin page: download-manager
  • Plugin version: 3.2.83
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4
  • WordPress version: 6.3.1
  • First release: Feb 10, 2010
  • Latest release: Dec 1, 2023
  • Number of updates: 587
  • Update frequency: every 8.6 days
  • Top authors: codename065 (100%)

Code review

54 tests

User reviews

939 reviews

Install metrics

100,000+ active /8,114,303 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.41MB] [CPU: ▲18.96ms] 75% from 4 tests

Server-side resources used by Download Manager
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,998.38ms on /wp-admin/edit.php?post_type=wpdmpro&page=wpdm-addons)
PageMemory (MB)CPU Time (ms)
Home /6.89 ▲3.4359.82 ▲16.40
Dashboard /wp-admin6.77 ▲3.4779.30 ▲29.68
Posts /wp-admin/edit.php6.79 ▲3.4378.12 ▲27.42
Add New Post /wp-admin/post-new.php9.30 ▲3.41105.02 ▲8.94
Media Library /wp-admin/upload.php6.60 ▲3.3761.82 ▲23.06
Welcome /wp-admin/index.php?page=wpdm-welcome6.5756.93
Tags /wp-admin/edit-tags.php?taxonomy=wpdmtag&post_type=wpdmpro6.5859.49
Add-Ons /wp-admin/edit.php?post_type=wpdmpro&page=wpdm-addons7.371,998.38
Templates /wp-admin/edit.php?post_type=wpdmpro&page=templates6.6764.79
All Files /wp-admin/edit.php?post_type=wpdmpro6.7766.93
History /wp-admin/edit.php?post_type=wpdmpro&page=wpdm-stats6.7065.28
Settings /wp-admin/edit.php?post_type=wpdmpro&page=settings6.7265.43
Categories /wp-admin/edit-tags.php?taxonomy=wpdmcategory&post_type=wpdmpro6.5861.09
Add New /wp-admin/post-new.php?post_type=wpdmpro6.9378.31

Server storage [IO: ▲7.78MB] [DB: ▲0.02MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • Illegal file modification found: 2 files (0.00KB) outside of "wp-content/plugins/download-manager/" and "wp-content/uploads/"
    • (new file) wp-content/wpdm-assets/link-templates/.empty
    • (new file) wp-content/wpdm-assets/page-templates/.empty
Filesystem: 607 new files
Database: 7 new tables, 15 new options
New tables
wp_ahm_user_download_counts
wp_ahm_download_stats
wp_ahm_social_conns
wp_ahm_emails
wp_ahm_assets
wp_ahm_sessions
wp_ahm_asset_links
New WordPress options
widget_wpdm_topdownloads
widget_wpdm_search
widget_theysaidso_widget
widget_listpackages
__wpdm_enc_key
widget_wpdm_tags
widget_catpackages
widget_recent-comments
theysaidso_admin_options
widget_wpdm_newdownloads
...

Browser metrics Passed 4 tests

A check of browser resources used by Download Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,436 ▲68916.29 ▲2.029.85 ▲8.2731.15 ▼17.67
Dashboard /wp-admin2,708 ▲5347.32 ▲1.78134.98 ▲34.4750.76 ▼1.98
Posts /wp-admin/edit.php2,240 ▲1402.10 ▲0.1654.90 ▲13.5339.39 ▲3.67
Add New Post /wp-admin/post-new.php1,614 ▲8822.99 ▼0.18671.21 ▼15.4136.26 ▼24.09
Media Library /wp-admin/upload.php1,617 ▲2235.34 ▲1.18104.49 ▼1.4142.53 ▼1.50
Welcome /wp-admin/index.php?page=wpdm-welcome1,2401.9039.43131.28
Tags /wp-admin/edit-tags.php?taxonomy=wpdmtag&post_type=wpdmpro1,3832.3431.8432.17
Add-Ons /wp-admin/edit.php?post_type=wpdmpro&page=wpdm-addons6,8054.8275.71124.75
Templates /wp-admin/edit.php?post_type=wpdmpro&page=templates2,3284.1965.9366.20
All Files /wp-admin/edit.php?post_type=wpdmpro1,7964.1667.4236.72
History /wp-admin/edit.php?post_type=wpdmpro&page=wpdm-stats1,7954.4377.6453.86
Settings /wp-admin/edit.php?post_type=wpdmpro&page=settings2,4164.8489.3965.49
Categories /wp-admin/edit-tags.php?taxonomy=wpdmcategory&post_type=wpdmpro1,7992.3731.5032.05
Add New /wp-admin/post-new.php?post_type=wpdmpro6,37411.00270.07324.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 tables in the database
    • wp_ahm_social_conns
    • wp_ahm_emails
    • wp_ahm_download_stats
    • wp_ahm_sessions
    • wp_ahm_assets
    • wp_ahm_asset_links
    • wp_ahm_user_download_counts
  • This plugin does not fully uninstall, leaving 15 options in the database
    • widget_theysaidso_widget
    • widget_wpdm_topdownloads
    • widget_wpdm_tags
    • widget_recent-posts
    • widget_packageinfo
    • widget_wpdm_newdownloads
    • widget_wpdm_categories
    • widget_recent-comments
    • widget_wpdm_search
    • __wpdm_enc_key
    • ...

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 | 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
  • 57× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/download-manager/src/Admin/views/metaboxes/attach-file/media-library-file.php
    • > /wp-content/plugins/download-manager/src/Package/views/link-templates/link-template-default-wdc.php
    • > /wp-content/plugins/download-manager/src/Package/views/page-templates/page-template-doc-preview.php
    • > /wp-content/plugins/download-manager/src/wpdm-start-download.php
    • > /wp-content/plugins/download-manager/src/Package/views/page-templates/page-template-extended.php
    • > /wp-content/plugins/download-manager/src/Package/views/link-templates/link-template-tabcard.php
    • > /wp-content/plugins/download-manager/src/Package/views/link-templates/link-template-panel.php
    • > /wp-content/plugins/download-manager/src/User/Login.php
    • > /wp-content/plugins/download-manager/src/Package/views/page-templates/page-template-1col-flat.php
    • > /wp-content/plugins/download-manager/src/Package/views/page-templates/page-template-simple.php
  • 35× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/download-manager/src/Admin/views/welcome.php:1
    • > PHP Notice
      Undefined variable: files in wp-content/plugins/download-manager/src/Package/views/file-list.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpdm_thumb() in wp-content/plugins/download-manager/src/Package/views/link-templates/link-template-bsthumnail.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WPDM\\wp_upload_dir() in wp-content/plugins/download-manager/download-manager.php:46
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/download-manager/src/Package/views/file-list.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WPDM\\Package\\PackageController' not found in wp-content/plugins/download-manager/src/Package/Package.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/download-manager/src/__/views/template-preview.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function maybe_unserialize() in wp-content/plugins/download-manager/src/Admin/views/metaboxes/attach-file.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/download-manager/src/Admin/views/settings/basic.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/download-manager/src/Admin/views/metaboxes/lock-options.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/index.php?page=wpdm-welcome
    • > Network (severe)
    wp-content/plugins/download-manager/assets/font-awesome/css/font-awesome.min.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=wpdmpro&page=settings
    • > Network (severe)
    wp-content/plugins/download-manager/assets/simplebar/simplebar.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=wpdmpro&page=settings
    • > Network (severe)
    wp-content/plugins/download-manager/assets/simplebar/simplebar.min.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

download-manager/download-manager.php Passed 13 tests

The main PHP script in "Download Manager" version 3.2.83 is automatically included on every request by WordPress
139 characters long description:
Manage, Protect and Track file downloads, and sell digital products from your WordPress site. A complete digital asset management solution.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin82,186 lines of code in 396 files:
LanguageFilesBlank linesComment linesLines of code
CSS426,6261,29030,565
PHP1704,3622,54822,610
JavaScript923,4813,79216,560
PO File76,43511,39010,732
HTML7176351,155
SVG7868564

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity38.71
▷ Minimum class complexity1.00
▷ Maximum class complexity479.00
Average method complexity4.94
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes63
▷ Abstract classes00.00%
▷ Concrete classes63100.00%
▷ Final classes11.59%
Methods600
▷ Static methods17429.00%
▷ Public methods59098.33%
▷ Protected methods00.00%
▷ Private methods101.67%
Functions78
▷ Named functions7393.59%
▷ Anonymous functions56.41%
Constants26
▷ Global constants26100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
163 PNG files occupy 1.41MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/themes/default/prev@2x.png4.13KB0.99KB▼ 76.02%
assets/images/templates.png2.18KB1.50KB▼ 30.91%
assets/jqui/theme/images/slider_handles.png1.90KB1.31KB▼ 30.90%
assets/images/icon_sprite.png3.14KB2.30KB▼ 26.70%
assets/images/doc.png0.64KB0.70KB0.00%