10% bitpay-checkout-for-woocommerce

Code Review | BitPay Checkout for WooCommerce

WordPress plugin BitPay Checkout for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: bitpay-checkout-f...
  • Plugin version: 5.3.1
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2019
  • Latest release: Oct 6, 2023
  • Number of updates: 95
  • Update frequency: every 17.6 days
  • Top authors: bitpay (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

800+ active /37,097 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > User error in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/composer/platform_check.php+24
    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.16.

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

Analyzing server-side resources used by BitPay Checkout for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.43 ▼7.22
Dashboard /wp-admin3.31 ▲0.0046.17 ▼5.91
Posts /wp-admin/edit.php3.36 ▲0.0046.81 ▼4.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.53 ▼26.35
Media Library /wp-admin/upload.php3.23 ▲0.0035.23 ▼1.61

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 945 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by BitPay Checkout for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.68 ▲0.331.63 ▼0.1244.14 ▼1.33
Dashboard /wp-admin2,195 ▲155.60 ▼0.0190.26 ▼12.4738.92 ▼8.34
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0637.89 ▲1.1239.27 ▲1.57
Add New Post /wp-admin/post-new.php1,531 ▲323.09 ▲0.10688.69 ▲19.4172.60 ▲15.90
Media Library /wp-admin/upload.php1,403 ▲94.21 ▼0.0495.22 ▼4.6340.94 ▼2.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 230× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.16. in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/composer/platform_check.php on line 24
    • > PHP Parse error
      syntax error, unexpected ')', expecting '|' or variable (T_VARIABLE) in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/test/unit/BitPaySDK/Model/Payout/PayoutTest.php on line 265
    • > PHP Fatal error
      Uncaught Error: Class 'BitPayVendor\\PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/test/unit/BitPaySDK/Model/Invoice/ItemizedDetailsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BitPayVendor\\BitPaySDK\\Exceptions\\PayoutBatchException' not found in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/src/BitPaySDK/Exceptions/PayoutBatchCreationException.php:17
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.16. in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'BitPayVendor\\BitPaySDK\\Exceptions\\BitPayException' not found in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/src/BitPaySDK/Exceptions/CurrencyException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'BitPayVendor\\BitPaySDK\\Exceptions\\BillException' not found in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/src/BitPaySDK/Exceptions/BillQueryException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'BitPayVendor\\PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/test/unit/BitPaySDK/Model/Ledger/LedgerTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BitPayVendor\\PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/test/unit/BitPaySDK/Model/Settlement/PayoutInfoTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BitPayVendor\\PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bitpay-checkout-for-woocommerce/build/vendor/bitpay/sdk/test/unit/BitPaySDK/Exceptions/PayoutRecipientExceptionTest.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: cryptocurrency, bitpay, payments, bitcoin cash, erc20...

bitpay-checkout-for-woocommerce/index.php 92% from 13 tests

The main file in "BitPay Checkout for WooCommerce" v. 5.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("bitpay-checkout-for-woocommerce.php" instead of "index.php")

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin262,295 lines of code in 914 files:
LanguageFilesBlank linesComment linesLines of code
HTML44164,8000212,736
PHP4001,15417,55333,036
JavaScript537419,051
JSON39004,279
CSS42931751,464
SVG14081,395
Markdown21000200
XML60291
YAML20034
reStructuredText1409

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.12
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces47
Interfaces40
Traits5
Classes334
▷ Abstract classes20.60%
▷ Concrete classes33299.40%
▷ Final classes3811.45%
Methods3,255
▷ Static methods2317.10%
▷ Public methods2,84287.31%
▷ Protected methods341.04%
▷ Private methods37911.64%
Functions138
▷ Named functions3726.81%
▷ Anonymous functions10173.19%
Constants346
▷ Global constants10.29%
▷ Class constants34599.71%
▷ Public constants31892.17%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 5.98MB with 4.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png435.41KB162.10KB▼ 62.77%
assets/screenshot-2.png467.94KB127.38KB▼ 72.78%
assets/screenshot-7.png251.54KB62.82KB▼ 75.03%
assets/screenshot-12.png235.54KB47.35KB▼ 79.90%
assets/screenshot-3.png1,170.99KB358.47KB▼ 69.39%