68% simple-download-monitor

Code Review | Simple Download Monitor

WordPress plugin Simple Download Monitor scored68%from 54 tests.

About plugin

  • Plugin page: simple-download-m...
  • Plugin version: 3.9.22
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Oct 28, 2009
  • Latest release: Oct 25, 2023
  • Number of updates: 258
  • Update frequency: every 19.8 days
  • Top authors: mra13 (85.27%)pepak.net (15.12%)

Code review

54 tests

User reviews

114 reviews

Install metrics

30,000+ active /970,552 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.82MB] [CPU: ▲0.23ms] Passed 4 tests

This is a short check of server-side resources used by Simple Download Monitor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6643.70 ▲5.59
Dashboard /wp-admin4.20 ▲0.8649.93 ▼4.03
Posts /wp-admin/edit.php4.27 ▲0.9155.51 ▲8.48
Add New Post /wp-admin/post-new.php6.73 ▲0.8495.83 ▼9.11
Media Library /wp-admin/upload.php4.14 ▲0.9142.89 ▲8.69
Tags /wp-admin/edit-tags.php?taxonomy=sdm_tags&post_type=sdm_downloads4.2537.25
Categories /wp-admin/edit-tags.php?taxonomy=sdm_categories&post_type=sdm_downloads4.2538.55
Stats /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-stats4.0440.16
Add-ons /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-addons4.0537.54
Settings /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-settings4.0437.80
Add New /wp-admin/post-new.php?post_type=sdm_downloads4.3054.62
Logs /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-logs4.0447.56
Downloads /wp-admin/edit.php?post_type=sdm_downloads4.1842.03

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 76 new files
Database: 1 new table, 9 new options
New tables
wp_sdm_downloads
New WordPress options
can_compress_scripts
db_upgraded
sdm_plugin_activated_time
sdm_db_version
widget_recent-posts
widget_recent-comments
sdm_plugin_user_feedback_notice
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Simple Download Monitor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲19913.85 ▼0.439.21 ▲7.4545.14 ▲5.25
Dashboard /wp-admin2,253 ▲735.63 ▼0.0289.83 ▲3.1840.78 ▼0.99
Posts /wp-admin/edit.php2,160 ▲602.00 ▲0.0339.16 ▲0.7236.48 ▲0.04
Add New Post /wp-admin/post-new.php6,412 ▲4,88627.50 ▲3.93849.21 ▲192.8255.45 ▲4.42
Media Library /wp-admin/upload.php1,454 ▲604.19 ▼0.02103.39 ▲4.4643.84 ▼0.19
Tags /wp-admin/edit-tags.php?taxonomy=sdm_tags&post_type=sdm_downloads1,3002.1226.9226.90
Categories /wp-admin/edit-tags.php?taxonomy=sdm_categories&post_type=sdm_downloads1,3342.1126.6529.96
Stats /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-stats1,1924.5042.3748.14
Add-ons /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-addons9282.1522.7031.19
Settings /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-settings1,2522.0124.5431.21
Add New /wp-admin/post-new.php?post_type=sdm_downloads2,7867.41156.8669.43
Logs /wp-admin/edit.php?post_type=sdm_downloads&page=sdm-logs1,1992.0222.7130.09
Downloads /wp-admin/edit.php?post_type=sdm_downloads1,2551.9030.6829.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_sdm_downloads
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • sdm_plugin_user_feedback_notice
    • sdm_plugin_activated_time
    • widget_recent-posts
    • db_upgraded
    • sdm_db_version
    • widget_recent-comments

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 everything seems fine, this is not 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 output text when accessed directly:
    • > /wp-content/plugins/simple-download-monitor/includes/admin-side/sdm-admin-export-logs.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-download-monitor/includes/sdm-logs-list-table.php on line 6
    • > 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/simple-download-monitor/includes/sdm-logs-list-table.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-download-monitor/includes/sdm-user-login-related.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-download-monitor/sdm-post-type-content-handler.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-download-monitor/includes/admin-side/sdm-admin-edit-download.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-download-monitor/sdm-shortcodes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/simple-download-monitor/includes/admin-side/sdm-admin-add-ons-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-download-monitor/includes/sdm-admin-menu-handler.php:15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-download-monitor/includes/sdm-logs-list-table.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-download-monitor/includes/sdm-blocks.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 26 tag instead of maximum 10
The official readme.txt might help

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

The main PHP file in "Simple Download Monitor" ver. 3.9.22 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-download-monitor.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin8,931 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP249477524,435
PO File81,4241,7543,719
CSS53422506
JavaScript53618271

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity22.17
▷ Minimum class complexity9.00
▷ Maximum class complexity41.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods77
▷ Static methods33.90%
▷ Public methods7597.40%
▷ Protected methods00.00%
▷ Private methods22.60%
Functions101
▷ Named functions9897.03%
▷ Anonymous functions32.97%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/addons/sdm-email-on-download-addon-icon.png2.89KB1.97KB▼ 31.88%
css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
images/addons/sdm-amazon-s3-addon-icon.png4.93KB4.14KB▼ 16.11%
css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%