51% easy-digital-downloads

Code Review | Easy Digital Downloads – Sell Digital Files (eCommerce Store & Payments Made Easy)

WordPress plugin Easy Digital Downloads – Sell Digital Files (eCommerce Store & Payments Made Easy) scored51%from 54 tests.

About plugin

  • Plugin page: easy-digital-down...
  • Plugin version: 3.2.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Apr 10, 2012
  • Latest release: Nov 10, 2023
  • Number of updates: 531
  • Update frequency: every 8.0 days
  • Top authors: mordauk (61.39%)cklosows (34.46%)NoseGraze (2.07%)BrashRebel (1.88%)

Code review

54 tests

User reviews

509 reviews

Install metrics

50,000+ active /4,671,012 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲19.12MB] [CPU: ▲186.23ms] 25% from 4 tests

An overview of server-side resources used by Easy Digital Downloads – Sell Digital Files (eCommerce Store & Payments Made Easy)
Please fix the following
  • RAM: Total memory usage should be kept under 10MB (currently 22.43MB on /wp-admin/edit.php?post_type=download&page=edd-customers)
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,146.96ms on /wp-admin/post-new.php?post_type=download)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 19.12MB on /wp-admin/edit.php?post_type=download&page=edd-customers)
PageMemory (MB)CPU Time (ms)
Home /22.75 ▲19.28268.61 ▲229.94
Dashboard /wp-admin22.42 ▲19.11424.20 ▲379.04
Posts /wp-admin/edit.php22.43 ▲19.07189.40 ▲140.18
Add New Post /wp-admin/post-new.php25.44 ▲19.55258.95 ▲162.52
Media Library /wp-admin/upload.php22.25 ▲19.01244.12 ▲212.28
Add New /wp-admin/post-new.php?post_type=download25.731,146.96
Extensions /wp-admin/edit.php?post_type=download&page=edd-addons23.15235.22
Tools /wp-admin/edit.php?post_type=download&page=edd-tools22.33185.51
Downloads /wp-admin/edit.php?post_type=download22.47184.29
Orders /wp-admin/edit.php?post_type=download&page=edd-payment-history22.81191.71
Setup /wp-admin/edit.php?post_type=download&page=edd-onboarding-wizard22.61197.90
EDD Upgrades /wp-admin/admin.php?page=edd-upgrades22.21176.14
Discounts /wp-admin/edit.php?post_type=download&page=edd-discounts22.45189.41
Settings /wp-admin/edit.php?post_type=download&page=edd-settings22.64196.71
Customers /wp-admin/edit.php?post_type=download&page=edd-customers22.43201.73

Server storage [IO: ▲15.03MB] [DB: ▲0.22MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2,436 new files
Database: 23 new tables, 39 new options
New tables
wp_edd_order_adjustments
wp_edd_logs_file_downloads
wp_edd_order_itemmeta
wp_edd_notes
wp_edd_customermeta
wp_edd_logs_api_requests
wp_edd_logs_api_requestmeta
wp_edd_order_adjustmentmeta
wp_edd_customers
wp_edd_notifications
...
New WordPress options
widget_theysaidso_widget
edd_version
wpdb_edd_order_transactions_version
edd_completed_upgrades
wpdb_edd_notemeta_version
widget_edd_product_details
wpdb_edd_notifications_version
wpdb_edd_logmeta_version
wpdb_edd_order_adjustmentmeta_version
wpdb_edd_order_itemmeta_version
...

Browser metrics Passed 4 tests

An overview of browser requirements for Easy Digital Downloads – Sell Digital Files (eCommerce Store & Payments Made Easy)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,770 ▲1,00816.29 ▲1.9410.35 ▲8.4947.10 ▲2.55
Dashboard /wp-admin3,012 ▲8386.71 ▲1.08124.33 ▲25.05128.72 ▲86.76
Posts /wp-admin/edit.php2,245 ▲1452.41 ▲0.4041.09 ▼0.0232.03 ▼6.37
Add New Post /wp-admin/post-new.php2,136 ▲61023.69 ▲0.49667.84 ▲32.8034.14 ▼20.27
Media Library /wp-admin/upload.php1,535 ▲1384.12 ▼0.05100.72 ▼1.5743.31 ▲0.45
Add New /wp-admin/post-new.php?post_type=download7,23320.32938.6949.38
Extensions /wp-admin/edit.php?post_type=download&page=edd-addons5,8194.5094.2079.58
Tools /wp-admin/edit.php?post_type=download&page=edd-tools1,9804.6970.3392.25
Downloads /wp-admin/edit.php?post_type=download2,1784.6783.0881.47
Orders /wp-admin/edit.php?post_type=download&page=edd-payment-history3,9955.74101.44104.82
Setup /wp-admin/edit.php?post_type=download&page=edd-onboarding-wizard3,6655.6088.65110.44
EDD Upgrades /wp-admin/admin.php?page=edd-upgrades3,9208.53136.1945.59
Discounts /wp-admin/edit.php?post_type=download&page=edd-discounts2,1654.4768.8893.00
Settings /wp-admin/edit.php?post_type=download&page=edd-settings3,7045.0780.4895.84
Customers /wp-admin/edit.php?post_type=download&page=edd-customers2,0494.4665.2386.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 23 tables in the database
    • wp_edd_order_addresses
    • wp_edd_notes
    • wp_edd_ordermeta
    • wp_edd_adjustments
    • wp_edd_order_adjustments
    • wp_edd_logs_file_downloadmeta
    • wp_edd_customermeta
    • wp_edd_order_items
    • wp_edd_notifications
    • wp_edd_logs_file_downloads
    • ...
  • Zombie WordPress options detected upon uninstall: 39 options
    • wpdb_edd_adjustments_version
    • wpdb_edd_order_items_version
    • wpdb_edd_notifications_version
    • widget_edd_product_details
    • wpdb_edd_logmeta_version
    • edd_activation_date
    • wpdb_edd_logs_api_requests_version
    • wpdb_edd_order_adjustmentmeta_version
    • widget_edd_cart_widget
    • wpdb_edd_customers_version
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=download&page=edd-customers
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/easy-digital-downloads/libraries/Stripe/update_certs.php
    • > /wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/content.php
    • > /wp-content/plugins/easy-digital-downloads/libraries/Stripe/build.php
  • 616× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'EDD\\Vendor\\Stripe\\Service\\AbstractService' not found in wp-content/plugins/easy-digital-downloads/libraries/Stripe/lib/Service/FinancialConnections/SessionService.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/footer.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/upgrade-functions.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'EDD\\Vendor\\Stripe\\ApiResource' not found in wp-content/plugins/easy-digital-downloads/libraries/Stripe/lib/Reporting/ReportRun.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function EDD\\Gateways\\PayPal\\add_action() in wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/refunds.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'EDD\\Vendor\\Stripe\\ApiResource' not found in wp-content/plugins/easy-digital-downloads/libraries/Stripe/lib/TestHelpers/TestClock.php:24
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-upgrader-skin.php): failed to open stream: No such file or directory in wp-content/plugins/easy-digital-downloads/src/Admin/Installers/PluginSilentUpgraderSkin.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-sales.php:2
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-items.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/easy-digital-downloads/libraries/Symfony/Contracts/Translation/Test/TranslatorTest.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (Detailed and actionable reports)
The official readme.txt might help

easy-digital-downloads/easy-digital-downloads.php Passed 13 tests

The main PHP script in "Easy Digital Downloads – Sell Digital Files (eCommerce Store & Payments Made Easy)" version 3.2.5 is automatically included on every request by WordPress
56 characters long description:
The easiest way to sell digital products with WordPress.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/easy-digital-downloads/libraries/Stripe/data/ca-certificates.crt
    • .bat - Batch File in Windows
      • wp-content/plugins/easy-digital-downloads/libraries/Carbon/bin/carbon.bat
194,599 lines of code in 2,129 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,86936,626102,174149,916
JSON330035,990
XSD391482,842
Markdown1393301,929
JavaScript901011411,390
XML29161,123
Sass321470798
SVG3002509
CSS5541569
make110029
DOS Batch1004

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 128)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity13.69
▷ Minimum class complexity1.00
▷ Maximum class complexity367.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity128.00
Code structure
Namespaces153
Interfaces47
Traits42
Classes794
▷ Abstract classes465.79%
▷ Concrete classes74894.21%
▷ Final classes577.62%
Methods5,563
▷ Static methods68712.35%
▷ Public methods4,14774.55%
▷ Protected methods5309.53%
▷ Private methods88615.93%
Functions2,334
▷ Named functions1,95583.76%
▷ Anonymous functions37916.24%
Constants996
▷ Global constants313.11%
▷ Class constants96596.89%
▷ Public constants96299.69%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
77 compressed PNG files occupy 0.42MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshots/17checkout.png5.77KB6.15KB0.00%
assets/images/icons/icon-arrow-down.png0.24KB0.24KB0.00%
assets/images/screenshots/order-details.png10.61KB12.30KB0.00%
assets/images/edd-cpt.png0.43KB0.44KB0.00%
assets/images/promo/brands/plugin-seedprod.png12.04KB4.79KB▼ 60.17%