68% sell-downloads

Code Review | Sell Downloads

WordPress plugin Sell Downloads scored 68% from 54 tests.

About plugin

  • Plugin page: sell-downloads
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 20, 2013
  • Latest release: Sep 4, 2023
  • Number of updates: 274
  • Update frequency: every 13.9 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

200+ active / 87,082 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.00MB] [CPU: ▲8.75ms] Passed 4 tests

Analyzing server-side resources used by Sell Downloads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.50 ▲1.0349.63 ▲8.09
Dashboard /wp-admin4.33 ▲1.0259.74 ▲12.92
Posts /wp-admin/edit.php4.37 ▲1.0254.00 ▲0.33
Add New Post /wp-admin/post-new.php6.87 ▲0.98104.17 ▲14.45
Media Library /wp-admin/upload.php4.19 ▲0.9648.91 ▲13.67
Products for Sale /wp-admin/edit.php?post_type=sd_product4.2943.37
Sales Report /wp-admin/admin.php?page=sell-downloads-menu-reports4.2047.19
Set File Types /wp-admin/edit-tags.php?taxonomy=sd_type4.1740.10
Products Templates /wp-admin/admin.php?page=sell-downloads-menu-templates4.2048.75
Sell Downloads /wp-admin/options-general.php?page=sell-downloads-menu-settings14.2051.80
Sell Downloads Settings /wp-admin/admin.php?page=sell-downloads-menu-settings4.2053.16

Server storage [IO: ▲0.58MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 80 new files
Database: 4 new tables, 10 new options
New tables
wp_sddb_reviews
wp_msdb_shopping_cart
wp_msdb_purchase
wp_msdb_post_data
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
sd_has_been_configured
installed_sell-downloads
widget_theysaidso_widget
sd_social_buttons
can_compress_scripts
sell_downloads_version_number

Browser metrics Passed 4 tests

Checking browser requirements for Sell Downloads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲20214.21 ▼0.0215.16 ▲13.1443.48 ▲2.43
Dashboard /wp-admin2,253 ▲685.23 ▼0.64103.04 ▼0.6269.69 ▲28.44
Posts /wp-admin/edit.php2,131 ▲392.04 ▼0.0136.62 ▼4.4334.55 ▼2.37
Add New Post /wp-admin/post-new.php6,468 ▲4,92620.62 ▲2.49969.49 ▲357.6537.77 ▼11.38
Media Library /wp-admin/upload.php1,421 ▲304.18 ▼0.1295.25 ▲0.4468.63 ▲24.75
Products for Sale /wp-admin/edit.php?post_type=sd_product1,1391.9533.2534.24
Sales Report /wp-admin/admin.php?page=sell-downloads-menu-reports1,1083.1339.5775.57
Set File Types /wp-admin/edit-tags.php?taxonomy=sd_type1,2822.1327.2033.53
Products Templates /wp-admin/admin.php?page=sell-downloads-menu-templates3,6006.82122.3299.01
Sell Downloads /wp-admin/options-general.php?page=sell-downloads-menu-settings13,2533.1439.2593.41
Sell Downloads Settings /wp-admin/admin.php?page=sell-downloads-menu-settings3,2503.0542.6385.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 4 tables
    • wp_sddb_reviews
    • wp_msdb_shopping_cart
    • wp_msdb_post_data
    • wp_msdb_purchase
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • sd_social_buttons
    • widget_theysaidso_widget
    • installed_sell-downloads
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • sell_downloads_version_number
    • sd_has_been_configured
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sell-downloads/sd-core/sd-product.php
    • > /wp-content/plugins/sell-downloads/sd-core/sd-submit.php
    • > /wp-content/plugins/sell-downloads/sd-core/sd-ipn.php
    • > /wp-content/plugins/sell-downloads/sd-core/sd-review.php
    • > /wp-content/plugins/sell-downloads/sd-core/sd-functions.php
    • > /wp-content/plugins/sell-downloads/sd-core/sd-templates.php
    • > /wp-content/plugins/sell-downloads/sd-page-builder/beaverbuilder/sd/includes/frontend.php
    • > /wp-content/plugins/sell-downloads/sd-core/tpleng.class.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sell-downloads/banner.php:107
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/sell-downloads/sd-page-builder/siteorigin/siteorigin-sd-product/tpl/siteorigin-sd-product-shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'FLBuilderModule' not found in wp-content/plugins/sell-downloads/sd-page-builder/beaverbuilder/sd/sd.pb.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SiteOrigin_Widget' not found in wp-content/plugins/sell-downloads/sd-page-builder/siteorigin/siteorigin-sd/siteorigin-sd.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sell-downloads/feedback/cp-feedback.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sell-downloads/sd-core/sd-wizard.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sell-downloads/sd-page-builder/siteorigin/siteorigin-sd/tpl/siteorigin-sd-shortcode.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SiteOrigin_Widget' not found in wp-content/plugins/sell-downloads/sd-page-builder/siteorigin/siteorigin-sd-product/siteorigin-sd-product.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'FLBuilderModule' not found in wp-content/plugins/sell-downloads/sd-page-builder/beaverbuilder/sd/sd.pb.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/sell-downloads/sd-addons/affiliateroyale.addon.php:9

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
These attributes need your attention:
  • Tags: Please delete some tags, you are using 39 tag instead of maximum 10
Please take inspiration from this readme.txt

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

Analyzing the main PHP file in "Sell Downloads" version 1.1.1
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 227 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected8,946 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP227534535,336
PO File26247441,398
JavaScript711034952
CSS912030859
HTML72726381
INI30018
SVG2002

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 154)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity51.00
▷ Minimum class complexity1.00
▷ Maximum class complexity371.00
Average method complexity5.81
▷ Minimum method complexity1.00
▷ Maximum method complexity154.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods125
▷ Static methods1612.80%
▷ Public methods11289.60%
▷ Protected methods43.20%
▷ Private methods97.20%
Functions30
▷ Named functions2893.33%
▷ Anonymous functions26.67%
Constants39
▷ Global constants39100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
paypal_buttons/shopping_cart/button_g.png1.26KB0.86KB▼ 31.76%
sd-layouts/02/star_on.png0.42KB0.29KB▼ 28.94%
sd-layouts/01/corner.png0.26KB0.15KB▼ 40.84%
sd-layouts/02/star_off.png0.46KB0.33KB▼ 28.21%
sd-layouts/01/star_off.png0.46KB0.33KB▼ 28.21%