78% secure-downloads

Code Review | Secure Downloads

WordPress plugin Secure Downloads scored 78% from 54 tests.

About plugin

  • Plugin page: secure-downloads
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 22, 2017
  • Latest release: Jul 25, 2023
  • Number of updates: 47
  • Update frequency: every 47.3 days
  • Top authors: wpdevelop (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

900+ active / 23,622 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.20MB] [CPU: ▼2.52ms] Passed 4 tests

A check of server-side resources used by Secure Downloads
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2339.40 ▼4.49
Dashboard /wp-admin3.54 ▲0.2444.99 ▲0.60
Posts /wp-admin/edit.php3.59 ▲0.2444.93 ▼1.53
Add New Post /wp-admin/post-new.php6.06 ▲0.1781.70 ▼4.67
Media Library /wp-admin/upload.php3.40 ▲0.1735.07 ▲0.93
Settings /wp-admin/admin.php?page=opsd-settings3.4943.17
Secure Links /wp-admin/admin.php?page=opsd3.4639.66
Files /wp-admin/admin.php?page=opsd-files3.4237.76

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 89 new files
Database: no new tables, 30 new options
New WordPress options
opsd_defualt_expiration
opsd_csv_separator
opsd_user_role_settings
can_compress_scripts
opsd_products_csv
opsd_url_download_expired
opsd_url_file_not_exist
theysaidso_admin_options
opsd_email_link_user
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Secure Downloads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,998 ▲25214.04 ▼0.615.40 ▲3.7141.85 ▼1.00
Dashboard /wp-admin2,274 ▲895.82 ▼0.0898.60 ▼1.1238.01 ▼6.23
Posts /wp-admin/edit.php2,157 ▲682.03 ▼0.0239.73 ▲1.3033.93 ▼1.38
Add New Post /wp-admin/post-new.php1,556 ▲1417.81 ▼0.60675.69 ▲38.7051.03 ▲0.24
Media Library /wp-admin/upload.php1,454 ▲694.31 ▲0.09101.32 ▼2.9944.51 ▲0.99
Settings /wp-admin/admin.php?page=opsd-settings2,3453.6254.5457.17
Secure Links /wp-admin/admin.php?page=opsd1,6003.6851.1651.21
Files /wp-admin/admin.php?page=opsd-files1,3943.5646.9756.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 30 options in the database
    • opsd_url_ip_not_valied
    • opsd_download_url_path
    • opsd_version_num
    • opsd_url_download_expired
    • opsd_date_format
    • widget_recent-posts
    • widget_recent-comments
    • opsd_user_role_settings
    • opsd_url_wrong_hash
    • opsd_email_download_notification
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/secure-downloads/index.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'OPSD_JS_CSS' not found in wp-content/plugins/secure-downloads/core/opsd-css.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'OPSD_JS_CSS' not found in wp-content/plugins/secure-downloads/core/opsd-js.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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: Please delete some tags, you are using 12 tag instead of maximum 10
You can take inspiration from this readme.txt

secure-downloads/index.php 92% from 13 tests

The primary PHP file in "Secure Downloads" version 1.2.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("secure-downloads.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected24,464 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
PHP454,2375,43511,605
CSS1712738210,387
JavaScript77774582,184
SVG100288

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity23.00
▷ Minimum class complexity1.00
▷ Maximum class complexity141.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes517.86%
▷ Concrete classes2382.14%
▷ Final classes313.04%
Methods243
▷ Static methods4116.87%
▷ Public methods22291.36%
▷ Protected methods20.82%
▷ Private methods197.82%
Functions196
▷ Named functions196100.00%
▷ Anonymous functions00.00%
Constants33
▷ Global constants3296.97%
▷ Class constants13.03%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon-16x16.png0.24KB0.23KB▼ 5.71%