68% best-upsell-for-woocommerce

Code Review | Best Upsell for WooCommerce

WordPress plugin Best Upsell for WooCommerce scored 68% from 54 tests.

About plugin

  • Plugin page: best-upsell-for-w...
  • Plugin version: 1.1.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Nov 2, 2021
  • Latest release: Nov 7, 2022
  • Number of updates: 62
  • Update frequency: every 6.0 days
  • Top authors: identixweb (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

100+ active / 7,795 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.55MB] [CPU: ▼0.57ms] Passed 4 tests

A check of server-side resources used by Best Upsell for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5846.33 ▼0.44
Dashboard /wp-admin3.88 ▲0.5752.28 ▲4.78
Posts /wp-admin/edit.php3.93 ▲0.5749.98 ▲1.53
Add New Post /wp-admin/post-new.php6.46 ▲0.5792.34 ▼6.49
Media Library /wp-admin/upload.php3.74 ▲0.5138.25 ▲3.10

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 60 new files
Database: 1 new table, 6 new options
New tables
wp_identixweb_bestupsell
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Best Upsell for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲16613.53 ▼0.855.62 ▲3.7143.07 ▼8.80
Dashboard /wp-admin2,221 ▲305.83 ▼0.0896.34 ▼2.5739.14 ▼0.68
Posts /wp-admin/edit.php2,107 ▲182.05 ▲0.0639.39 ▲3.9932.16 ▼0.76
Add New Post /wp-admin/post-new.php1,543 ▲1023.43 ▲0.30639.11 ▼18.4151.40 ▼4.31
Media Library /wp-admin/upload.php1,406 ▲184.16 ▲0.0894.04 ▼16.1839.85 ▼4.74

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_identixweb_bestupsell
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/best-upsell-for-woocommerce/admin/partials/bestupsell-admin-display.php
    • > /wp-content/plugins/best-upsell-for-woocommerce/public/partials/bestupsell-public-display.php
  • 34× 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 add_action() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/API/remove-product-cart.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/API/bundle-product.php:6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/templates/bestupsell-admin.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/Functions/show-prices.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/API/set-discount-session.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/API/apply-coupons.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/Functions/override-add-cart-button-for-listing-page.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/Functions/update-order-meta.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/API/add-product-cart.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/best-upsell-for-woocommerce/admin/partials/inc/API/post-skeleton-html.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: ajax cart, upsell, cart drawer, cart upsell, full cart...

best-upsell-for-woocommerce/best-upsell.php 77% from 13 tests

This is the main PHP file of "Best Upsell for WooCommerce" version 1.1.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("best-upsell-for-woocommerce.php" instead of "best-upsell.php")
  • Requires PHP: Required version must match the one declared in readme.txt ("7.0" instead of "5.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected3,077 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP504439073,068
CSS2186
JavaScript23383

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions86
▷ Named functions4248.84%
▷ Anonymous functions4451.16%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin