78% bolt-checkout-bigcommerce

Code Review | Bolt Checkout for BigCommerce

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

About plugin

  • Plugin page: bolt-checkout-big...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-5.0
  • WordPress version: 6.3.1
  • First release: Jan 3, 2019
  • Latest release: Jan 3, 2019
  • Number of updates: 4
  • Update frequency: every 2.3 days
  • Top authors: boltpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /824 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.49ms] Passed 4 tests

Analyzing server-side resources used by Bolt Checkout for BigCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0042.73 ▼2.14
Dashboard /wp-admin3.35 ▼0.0452.74 ▼7.82
Posts /wp-admin/edit.php3.40 ▲0.0053.81 ▼0.72
Add New Post /wp-admin/post-new.php5.93 ▲0.0085.17 ▼19.27
Media Library /wp-admin/upload.php3.27 ▲0.0040.21 ▲4.33

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bolt Checkout for BigCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.08 ▼0.062.36 ▲0.6845.28 ▲0.66
Dashboard /wp-admin2,198 ▲245.57 ▼0.0684.51 ▼7.0940.62 ▼0.48
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0936.44 ▼14.6439.14 ▼6.40
Add New Post /wp-admin/post-new.php1,526 ▼023.49 ▲0.31672.01 ▲15.3760.85 ▲8.70
Media Library /wp-admin/upload.php1,403 ▲34.16 ▼0.0197.07 ▼3.7344.73 ▲0.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/example/order_confirmation.php
  • 19× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant total_amount - assumed 'total_amount' (this will throw an Error in a future version of PHP) in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/playground.php on line 16
    • > PHP Warning
      Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/playground.php on line 21
    • > PHP Warning
      Use of undefined constant cart - assumed 'cart' (this will throw an Error in a future version of PHP) in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/playground.php on line 13
    • > PHP Warning
      Use of undefined constant currency - assumed 'currency' (this will throw an Error in a future version of PHP) in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/playground.php on line 18
    • > PHP Warning
      Use of undefined constant tax_amount - assumed 'tax_amount' (this will throw an Error in a future version of PHP) in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/playground.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'BigCommerce\\Cart\\Cart' not found in wp-content/plugins/bolt-checkout-bigcommerce/src/class-bolt-cart.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'BoltBigcommerce\\BugsnagHelper' not found in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/Http/CurlClient.php:66
    • > PHP Fatal error
      Uncaught Error: Class 'BoltBigcommerce\\BugsnagHelper' not found in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/Http/CurlClient.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/bolt-checkout-bigcommerce/view/main.js.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'BoltPay\\Bolt' not found in wp-content/plugins/bolt-checkout-bigcommerce/lib/bolt-php/lib/ApiClient.php:55

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt might help

bolt-checkout-bigcommerce/bolt-bigcommerce-wordpress.php 92% from 13 tests

"Bolt Checkout for BigCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("bolt-checkout-bigcommerce.php" instead of "bolt-bigcommerce-wordpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected4,407 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP411,0252,8353,936
JavaScript397116461
CSS1006
Markdown1404

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.27
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces4
Interfaces0
Traits1
Classes29
▷ Abstract classes00.00%
▷ Concrete classes29100.00%
▷ Final classes00.00%
Methods405
▷ Static methods18946.67%
▷ Public methods35086.42%
▷ Protected methods143.46%
▷ Private methods4110.12%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants28
▷ Global constants725.00%
▷ Class constants2175.00%
▷ Public constants21100.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
No PNG images were found in this plugin