84% sell-digital-downloads

Code Review | Sell Digital Downloads

WordPress plugin Sell Digital Downloads scored84%from 54 tests.

About plugin

  • Plugin page: sell-digital-down...
  • Plugin version: 2.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: May 21, 2012
  • Latest release: Apr 7, 2021
  • Number of updates: 69
  • Update frequency: every 47.0 days
  • Top authors: wpecommerce (57.97%)wp.insider (23.19%)Muneeb (21.74%)

Code review

54 tests

User reviews

9 reviews

Install metrics

600+ active /51,542 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.44MB] [CPU: ▼7.05ms] Passed 4 tests

Analyzing server-side resources used by Sell Digital Downloads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4137.78 ▲0.28
Dashboard /wp-admin3.76 ▲0.4349.80 ▲0.27
Posts /wp-admin/edit.php3.86 ▲0.4750.69 ▲1.68
Add New Post /wp-admin/post-new.php6.46 ▲0.5476.03 ▼29.96
Media Library /wp-admin/upload.php3.70 ▲0.4435.50 ▲1.21
Settings /wp-admin/admin.php?page=isell_settings_page3.6735.31
Orders /wp-admin/edit.php?post_type=isell-order3.7035.73
Products /wp-admin/edit.php?post_type=isell-product3.7036.95

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: no files
Database: no new tables, 8 new options
New WordPress options
isell_options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
isell_version
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Sell Digital Downloads
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.18 ▼1.201.62 ▼0.0340.98 ▲3.32
Dashboard /wp-admin2,246 ▲605.84 ▲0.9597.19 ▼5.4740.03 ▼3.19
Posts /wp-admin/edit.php2,134 ▲451.99 ▼0.0338.30 ▼3.9237.57 ▲1.79
Add New Post /wp-admin/post-new.php1,565 ▲5123.22 ▲5.44689.05 ▲65.4345.35 ▼3.54
Media Library /wp-admin/upload.php1,431 ▲464.22 ▼0.1095.98 ▼1.2939.53 ▼3.83
Settings /wp-admin/admin.php?page=isell_settings_page1,2292.1923.2230.95
Orders /wp-admin/edit.php?post_type=isell-order1,1081.9631.1730.42
Products /wp-admin/edit.php?post_type=isell-product1,1072.0233.7829.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • isell_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • isell_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
Please fix the following items
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sell-digital-downloads/views/notification_emails.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sell-digital-downloads/start.php:12
    • > PHP Warning
      Use of undefined constant ISELL_INVALID_TXN_ID - assumed 'ISELL_INVALID_TXN_ID' (this will throw an Error in a future version of PHP) in wp-content/plugins/sell-digital-downloads/views/isell_errors.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sell-digital-downloads/views/metabox_product_file.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sell-digital-downloads/views/metabox_product_info.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sell-digital-downloads/views/metabox_other_information.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sell-digital-downloads/views/metabox_order_buyer_info.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sell-digital-downloads/views/custom_edit_icons_style.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sell-digital-downloads/inc/new_feature_pointer.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sell-digital-downloads/views/metabox_order_product_info.php:2

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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 21 tag instead of maximum 10
You can look at the official readme.txt

sell-digital-downloads/start.php 92% from 13 tests

"Sell Digital Downloads" version 2.2.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sell-digital-downloads.php" instead of "start.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
Everything looks great! No dangerous files found in this plugin2,694 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP185023122,344
PO File1119149265
CSS2131185

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity66.33
▷ Minimum class complexity22.00
▷ Maximum class complexity141.00
Average method complexity4.32
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods59
▷ Static methods00.00%
▷ Public methods5593.22%
▷ Protected methods23.39%
▷ Private methods23.39%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants1184.62%
▷ Class constants215.38%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/product-32x32.png1.46KB1.46KB0.00%
css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.09KB0.14KB0.00%
images/product.png2.02KB1.67KB▼ 17.23%
images/order-32x32.png1.36KB1.50KB0.00%
images/order-18x18.png3.39KB0.96KB▼ 71.52%