83% download-now-for-woocommerce

Code Review | Free Downloads WooCommerce

WordPress plugin Free Downloads WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: download-now-for-...
  • Plugin version: 3.5.7.1
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 4, 2016
  • Latest release: Oct 17, 2023
  • Number of updates: 107
  • Update frequency: every 25.2 days
  • Top authors: squareonemedia (51.4%)rwebster85 (41.12%)wpenhanced (9.35%)

Code review

54 tests

User reviews

74 reviews

Install metrics

5,000+ active /189,904 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼3.23ms] Passed 4 tests

An overview of server-side resources used by Free Downloads WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3231.78 ▼8.31
Dashboard /wp-admin3.74 ▲0.4449.74 ▲0.69
Posts /wp-admin/edit.php3.80 ▲0.4449.69 ▲3.14
Add New Post /wp-admin/post-new.php6.27 ▲0.3886.83 ▼8.43
Media Library /wp-admin/upload.php3.60 ▲0.3841.17 ▲4.38

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 88 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Free Downloads WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,566 ▼19513.82 ▼0.907.47 ▲5.8215.77 ▼20.24
Dashboard /wp-admin2,218 ▲445.48 ▼0.1898.19 ▲11.2042.73 ▲2.33
Posts /wp-admin/edit.php2,120 ▲202.14 ▲0.1042.36 ▲7.4037.17 ▼3.28
Add New Post /wp-admin/post-new.php1,544 ▲1423.05 ▼0.13669.68 ▲70.9261.59 ▲18.37
Media Library /wp-admin/upload.php1,414 ▲144.10 ▼0.01102.91 ▼18.0550.69 ▼1.75

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'SOM\\FreeDownloads\\Abstracts\\AbstractPlugin' not found in wp-content/plugins/download-now-for-woocommerce/Includes/Abstracts/AbstractSingletonPlugin.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'SOM\\FreeDownloads\otices\\WordPressNotice' not found in wp-content/plugins/download-now-for-woocommerce/Includes/Notices/ErrorNotice.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'SOM\\FreeDownloads\\Interfaces\\SystemNoticeInterface' not found in wp-content/plugins/download-now-for-woocommerce/Includes/Notices/WordPressNotice.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'SOM\\FreeDownloads\\Lib\\Requirements\\RequirementInterface' not found in wp-content/plugins/download-now-for-woocommerce/Lib/Requirements/AbstractRequirement.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SOM\\FreeDownloads\\Lib\\Requirements\\AbstractRequirement' not found in wp-content/plugins/download-now-for-woocommerce/Lib/Requirements/WordPressPluginRequirement.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SOM\\FreeDownloads\\Lib\\Requirements\\AbstractRequirement' not found in wp-content/plugins/download-now-for-woocommerce/Lib/Requirements/PhpMinVersionRequirement.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SOM\\FreeDownloads\\Abstracts\\AbstractSingletonPlugin' not found in wp-content/plugins/download-now-for-woocommerce/Includes/Plugin.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

download-now-for-woocommerce/som-woocommerce-download-now.php 85% from 13 tests

Analyzing the main PHP file in "Free Downloads WooCommerce" version 3.5.7.1
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 ("download-now-for-woocommerce.php" instead of "som-woocommerce-download-now.php")
  • Requires PHP: Required version must match the one declared in readme.txt ("7.4" instead of "7.4.0")

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
Good job! No executable or dangerous file extensions detected10,090 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP472,3121,1426,163
PO File49281,0442,576
CSS338351,140
JavaScript25043154
JSON10057

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity5.18
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces7
Interfaces2
Traits0
Classes15
▷ Abstract classes426.67%
▷ Concrete classes1173.33%
▷ Final classes654.55%
Methods91
▷ Static methods22.20%
▷ Public methods6470.33%
▷ Protected methods66.59%
▷ Private methods2123.08%
Functions298
▷ Named functions29598.99%
▷ Anonymous functions31.01%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
20 PNG files occupy 2.13MB with 1.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/owned-example.png168.73KB42.32KB▼ 74.92%
assets/images/multi-3.png5.96KB3.79KB▼ 36.35%
woo-files/images/quick-view-shop.png294.42KB60.00KB▼ 79.62%
assets/images/multi-1.png4.17KB2.83KB▼ 32.26%
assets/images/redirect-example.png12.90KB7.42KB▼ 42.47%