78% bolt-checkout-woocommerce

Code Review | Bolt Checkout for WooCommerce

WordPress plugin Bolt Checkout for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: bolt-checkout-woo...
  • Plugin version: 2.18.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 2, 2018
  • Latest release: Feb 17, 2023
  • Number of updates: 70
  • Update frequency: every 22.4 days
  • Top authors: boltpay (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

200+ active /39,639 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.99ms] Passed 4 tests

An overview of server-side resources used by Bolt Checkout for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.82 ▼2.88
Dashboard /wp-admin3.31 ▲0.0047.49 ▼1.78
Posts /wp-admin/edit.php3.36 ▲0.0047.47 ▼5.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.48 ▼14.03
Media Library /wp-admin/upload.php3.23 ▲0.0041.67 ▲0.66

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 106 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Bolt Checkout for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.371.63 ▼0.0442.17 ▼9.28
Dashboard /wp-admin2,198 ▲185.64 ▼0.0392.49 ▼0.5538.80 ▼4.90
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0137.36 ▼4.7836.26 ▼3.66
Add New Post /wp-admin/post-new.php1,528 ▼622.93 ▼1.58691.50 ▲5.5266.12 ▼26.73
Media Library /wp-admin/upload.php1,400 ▼04.13 ▼0.07111.56 ▼3.9747.19 ▼2.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/bolt-checkout-woocommerce/includes/view/bolt_account.js.php
    • > /wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_subscription_button.js.php
  • 26× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_AJAX' not found in wp-content/plugins/bolt-checkout-woocommerce/includes/view/bolt_cart.js.php:12
    • > PHP Notice
      Undefined variable: wrap_in_jquery_ready in wp-content/plugins/bolt-checkout-woocommerce/includes/view/bolt_cart.js.php on line 6
    • > PHP Notice
      Undefined variable: product in wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_button.js.php on line 5
    • > PHP Notice
      Undefined variable: json_hints in wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_ppc_button.js.php on line 10
    • > PHP Notice
      Undefined variable: currency in wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_subscription_button.js.php on line 12
    • > PHP Notice
      Undefined variable: checkoutButtonClassName in wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_subscription_button.js.php on line 84
    • > PHP Notice
      Undefined variable: json_cart in wp-content/plugins/bolt-checkout-woocommerce/includes/view/bolt_cart.js.php on line 1
    • > PHP Notice
      Undefined variable: success in wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_ppc_button.js.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_ppc_button.js.php:48
    • > PHP Notice
      Undefined variable: currency in wp-content/plugins/bolt-checkout-woocommerce/includes/view/product_page_ppc_button.js.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can look at the official readme.txt

bolt-checkout-woocommerce/bolt-checkout-woocommerce.php Passed 13 tests

The main PHP file in "Bolt Checkout for WooCommerce" ver. 2.18.0 adds more information about the plugin and also serves as the entry point for this plugin
35 characters long description:
Adds Bolt Checkout for WooCommerce.

Code Analysis Passed 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 detected13,704 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP872,8977,38313,249
JavaScript18194339
SVG606114
CSS1142

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity27.04
▷ Minimum class complexity1.00
▷ Maximum class complexity222.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces1
Interfaces1
Traits2
Classes49
▷ Abstract classes00.00%
▷ Concrete classes49100.00%
▷ Final classes12.04%
Methods550
▷ Static methods8315.09%
▷ Public methods44280.36%
▷ Protected methods122.18%
▷ Private methods9617.45%
Functions179
▷ Named functions17899.44%
▷ Anonymous functions10.56%
Constants408
▷ Global constants122.94%
▷ Class constants39697.06%
▷ Public constants396100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/amex.png2.05KB1.70KB▼ 16.90%
assets/images/mastercard.png1.15KB0.98KB▼ 15.07%
assets/images/visa.png1.16KB1.31KB0.00%
assets/images/jcb.png1.60KB1.49KB▼ 7.08%
assets/images/diners.png1.08KB1.20KB0.00%