83% wc-upsell-and-order-bump

Code Review | Woocommerce Checkout Upsell Order Bump

WordPress plugin Woocommerce Checkout Upsell Order Bump scored83%from 54 tests.

About plugin

  • Plugin page: wc-upsell-and-ord...
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.3
  • WordPress version: 6.3.1
  • First release: May 6, 2021
  • Latest release: Aug 11, 2023
  • Number of updates: 17
  • Update frequency: every 48.7 days
  • Top authors: xfinitysoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /797 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.36ms] Passed 4 tests

A check of server-side resources used by Woocommerce Checkout Upsell Order Bump
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.00 ▲1.87
Dashboard /wp-admin3.33 ▼0.0246.93 ▼14.79
Posts /wp-admin/edit.php3.38 ▲0.0246.63 ▼4.17
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.80 ▼14.70
Media Library /wp-admin/upload.php3.25 ▲0.0238.19 ▲0.23
Upsell Funnel /wp-admin/admin.php?page=wc_upsellorderbump3.2231.13
Order Bump /wp-admin/admin.php?page=woocommerce-upsellorderbump-orderbump3.2232.10
Support /wp-admin/admin.php?page=xswcusop-support3.2833.46

Server storage [IO: ▲1.37MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
xswcusop-orderbumpdata
can_compress_scripts
xswcusop-upselloptiondata

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Checkout Upsell Order Bump
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲14814.02 ▼0.2414.83 ▲12.8139.29 ▼1.36
Dashboard /wp-admin2,229 ▲494.93 ▼0.7486.94 ▼3.9736.19 ▼0.19
Posts /wp-admin/edit.php2,134 ▲342.32 ▲0.3436.85 ▲1.8334.14 ▼0.95
Add New Post /wp-admin/post-new.php1,567 ▲1318.58 ▲0.45629.62 ▼6.50109.40 ▲19.84
Media Library /wp-admin/upload.php1,440 ▲404.42 ▲0.13107.10 ▲10.2842.79 ▼1.24
Upsell Funnel /wp-admin/admin.php?page=wc_upsellorderbump8162.0532.6923.60
Order Bump /wp-admin/admin.php?page=woocommerce-upsellorderbump-orderbump8132.0327.2121.82
Support /wp-admin/admin.php?page=xswcusop-support9122.0130.0430.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • xswcusop-orderbumpdata
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • xswcusop-upselloptiondata

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-includes/xswcusop-orderbump/xswcusop-orderbumps-tab.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function xswcusop_get_fieldorderbump() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-frontend/xswcusop-orderbumpcheckoutpage.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/wc-upsell-and-order-bump/xs-wc-upsell-orderbump.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-includes/xswcusop-upsell/xswcusop-upsellrulesdesing-tab.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-frontend/xswcusop-upsellcheckoutpage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-includes/xswcusop-options.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-includes/xswcusop-orderbump/xswcusop-orderbumpgeneral-tab.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-includes/xswcusop-upsell/xswcusop-upsellrulescustomcss-tab.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-includes/xswcusop-support-page.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-upsell-and-order-bump/xswcusop-includes/xswcusop-upsell/xswcusop-upsellrulesproducts-tab.php:6

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 86% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: upsell, woocommerce, checkout, order bump

wc-upsell-and-order-bump/xs-wc-upsell-orderbump.php 69% from 13 tests

The main file in "Woocommerce Checkout Upsell Order Bump" v. 2.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 169 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-upsell-and-order-bump.php" instead of "xs-wc-upsell-orderbump.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "4.4.0")

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
No dangerous file extensions were detected3,930 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP111831512,557
PO File2252610538
JavaScript74870518
CSS560406317

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin