57% download-monitor

Code Review | Download Monitor

WordPress plugin Download Monitor scored57%from 54 tests.

About plugin

  • Plugin page: download-monitor
  • Plugin version: 4.9.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: Mar 12, 2008
  • Latest release: Nov 21, 2023
  • Number of updates: 483
  • Update frequency: every 12.4 days
  • Top authors: jolley_small (56.52%)raldea89 (19.67%)barrykooij (12.42%)mikejolley (7.87%)giucu91 (4.14%)

Code review

54 tests

User reviews

464 reviews

Install metrics

100,000+ active /4,677,496 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲5.82MB] [CPU: ▲54.05ms] 75% from 4 tests

This is a short check of server-side resources used by Download Monitor
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.82MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.91 ▲5.4483.12 ▲45.41
Dashboard /wp-admin9.31 ▲6.00107.89 ▲57.90
Posts /wp-admin/edit.php9.32 ▲5.96108.61 ▲61.18
Add New Post /wp-admin/post-new.php11.96 ▲6.06149.15 ▲51.69
Media Library /wp-admin/upload.php9.12 ▲5.89108.68 ▲74.25
Legacy Upgrader /wp-admin/admin.php?page=dlm_legacy_upgrade9.0983.04
Freemius Debug [v.2.5.11] /wp-admin/admin.php?page=freemius9.3681.17

Server storage [IO: ▲14.15MB] [DB: ▲0.03MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 774 new files
Database: 8 new tables, 39 new options
New tables
wp_dlm_order
wp_dlm_downloads
wp_dlm_order_transaction
wp_download_log
wp_dlm_order_item
wp_dlm_session
wp_dlm_order_customer
wp_dlm_reports_log
New WordPress options
dlm_turn_off_file_browser
dlm_current_version
download-monitor-rate-time
dlm_user_agent_blacklist
dlm_generate_hash_sha1
dlm_log_admin_download_count
dlm_xsendfile_enabled
dlm_generate_hash_md5
dlm_default_template
dlm_custom_template
...

Browser metrics Passed 4 tests

A check of browser resources used by Download Monitor
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,985 ▲23813.86 ▼0.729.18 ▲7.6731.73 ▼4.24
Dashboard /wp-admin2,299 ▲1225.75 ▲0.0897.49 ▲2.6444.47 ▼3.56
Posts /wp-admin/edit.php2,168 ▲682.10 ▲0.0941.09 ▲1.2739.57 ▲2.07
Add New Post /wp-admin/post-new.php1,735 ▲20624.78 ▲1.56703.68 ▲83.3441.59 ▼8.50
Media Library /wp-admin/upload.php1,498 ▲1014.31 ▲0.13110.82 ▲8.2845.89 ▲2.85
Legacy Upgrader /wp-admin/admin.php?page=dlm_legacy_upgrade8421.6729.2428.54
Freemius Debug [v.2.5.11] /wp-admin/admin.php?page=freemius1,1221.7130.1332.21

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/download-monitor/includes/submodules/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 8 tables in the database
    • wp_dlm_order_transaction
    • wp_dlm_order_item
    • wp_dlm_downloads
    • wp_download_log
    • wp_dlm_reports_log
    • wp_dlm_order_customer
    • wp_dlm_order
    • wp_dlm_session
  • This plugin does not fully uninstall, leaving 39 options in the database
    • widget_recent-posts
    • dlm_product_errors
    • dlm_logging_ip_type
    • dlm_hotlink_protection_enabled
    • dlm_generate_hash_sha1
    • dlm_turn_off_file_browser
    • dlm_enable_window_logging
    • dlm_log_admin_download_count
    • can_compress_scripts
    • dlm_download_endpoint
    • ...

Smoke tests 50% 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 | 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/download-monitor/src/Admin/Reports/templates/dlm-js-templates.php
  • 83× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'WPChill\\DownloadMonitor\\Dependencies\\PayPalHttp\\Serializer' not found in wp-content/plugins/download-monitor/src/Dependencies/PayPalHttp/Serializer/Multipart.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'WPChill\\DownloadMonitor\\Dependencies\\Pimple\\ServiceProviderInterface' not found in wp-content/plugins/download-monitor/src/Dependencies/Pimple/Tests/Fixtures/PimpleServiceProvider.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/download-monitor/src/Dependencies/Pimple/Tests/PimpleTest.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'WPChill\\DownloadMonitor\\Dependencies\\Psr\\Container\otFoundExceptionInterface' not found in wp-content/plugins/download-monitor/src/Dependencies/Pimple/Exception/InvalidServiceIdentifierException.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'WPChill\\DownloadMonitor\\Dependencies\\PayPalHttp\\HttpRequest' not found in wp-content/plugins/download-monitor/src/Shop/Checkout/PaymentGateway/PayPal/Payments/CapturesGetRequest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'WPChill\\DownloadMonitor\\Dependencies\\Pimple\\ServiceProviderInterface' not found in wp-content/plugins/download-monitor/src/Shop/Services/ServiceProvider.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/download-monitor/src/Admin/Reports/components/php-components/top-downloads-footer.php:9
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/download-monitor/src/Admin/class-dlm-empty-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WPChill\\DownloadMonitor\\Dependencies\\PayPalHttp\\HttpClient' not found in wp-content/plugins/download-monitor/src/Shop/Checkout/PaymentGateway/PayPal/Core/PayPalHttpClient.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/download-monitor/src/Dependencies/Pimple/Tests/PimpleServiceProviderInterfaceTest.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt might help

download-monitor/download-monitor.php 92% from 13 tests

The primary PHP file in "Download Monitor" version 4.9.3 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 164 characters long)

Code Analysis 97% from 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
There were no executable files found in this plugin181,158 lines of code in 636 files:
LanguageFilesBlank linesComment linesLines of code
PHP43614,61829,14957,240
PO File2922,33023,76449,261
JavaScript652,4781,44936,967
CSS504,74923532,238
LESS198141304,727
EJS14815345
Markdown1680214
JSON3200138
XML13016
SVG20112

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,087)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity23.70
▷ Minimum class complexity1.00
▷ Maximum class complexity3,087.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces38
Interfaces14
Traits0
Classes294
▷ Abstract classes82.72%
▷ Concrete classes28697.28%
▷ Final classes20.70%
Methods2,994
▷ Static methods2839.45%
▷ Public methods2,45081.83%
▷ Protected methods260.87%
▷ Private methods51817.30%
Functions202
▷ Named functions11255.45%
▷ Anonymous functions9044.55%
Constants180
▷ Global constants11161.67%
▷ Class constants6938.33%
▷ Public constants69100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
49 PNG files occupy 1.84MB with 0.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/features/track-your-content.png1.47KB0.87KB▼ 40.69%
assets/images/features/easy-duplication.png6.38KB4.06KB▼ 36.34%
assets/images/filetypes/document-illustrator.png0.62KB0.70KB0.00%
assets/images/filetypes/document-text-image.png0.59KB0.60KB0.00%
includes/submodules/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%