84% checkout-com-unified-payments-api

Code Review | Checkout.com Payment Gateway

WordPress plugin Checkout.com Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: checkout-com-unif...
  • Plugin version: 4.4.16
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 9, 2019
  • Latest release: Nov 24, 2023
  • Number of updates: 399
  • Update frequency: every 3.6 days
  • Top authors: checkoutintegration (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

700+ active /26,745 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

Server-side resources used by Checkout.com Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▼0.0025.28 ▼15.81
Dashboard /wp-admin3.38 ▲0.0445.15 ▼20.68
Posts /wp-admin/edit.php3.43 ▲0.0851.20 ▲3.93
Add New Post /wp-admin/post-new.php5.98 ▲0.1090.94 ▲1.51
Media Library /wp-admin/upload.php3.31 ▲0.0834.61 ▲1.56

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 795 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Checkout.com Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,459 ▼28814.30 ▼0.050.61 ▼1.1817.60 ▼24.83
Dashboard /wp-admin2,200 ▲205.68 ▲0.0895.79 ▲4.5340.20 ▼5.33
Posts /wp-admin/edit.php2,108 ▲52.01 ▲0.0440.06 ▼3.7433.31 ▼2.83
Add New Post /wp-admin/post-new.php1,531 ▲523.24 ▲0.07624.53 ▲23.0260.82 ▲7.15
Media Library /wp-admin/upload.php1,405 ▲54.21 ▼0.0497.35 ▼10.3943.25 ▼4.81

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
  • 295× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/guzzlehttp/psr7/src/BufferStream.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Checkout\\Payments\\Destination\\PaymentRequestDestination' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/checkout/checkout-sdk-php/lib/Checkout/Payments/Destination/PaymentRequestTokenDestination.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Checkout\\HttpClientBuilderInterface' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/checkout/checkout-sdk-php/lib/Checkout/DefaultHttpClientBuilder.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Checkout\\Tokens\\WalletTokenRequest' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/checkout/checkout-sdk-php/lib/Checkout/Tokens/GooglePayTokenRequest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Checkout\\Workflows\\Conditions\\WorkflowConditionRequest' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/checkout/checkout-sdk-php/lib/Checkout/Workflows/Conditions/EntityWorkflowConditionRequest.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Checkout\\AbstractStaticKeysCheckoutSdkBuilder' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/checkout/checkout-sdk-php/lib/Checkout/Four/FourStaticKeysCheckoutSdkBuilder.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Checkout_Com_Alternative_Payments' not found in wp-content/plugins/checkout-com-unified-payments-api/includes/apms/class-wc-gateway-checkout-com-alternative-payments-sepa.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Checkout\\Sessions\\Completion\\CompletionInfo' not found in wp-content/plugins/checkout-com-unified-payments-api/vendor/checkout/checkout-sdk-php/lib/Checkout/Sessions/Completion/HostedCompletionInfo.php:5

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 96% 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
7 plugin tags: google pay, credit card, payment gateway, payment request, checkout...

checkout-com-unified-payments-api/woocommerce-gateway-checkout-com.php 92% from 13 tests

The main PHP file in "Checkout.com Payment Gateway" ver. 4.4.16 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("checkout-com-unified-payments-api.php" instead of "woocommerce-gateway-checkout-com.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected56,684 lines of code in 745 files:
LanguageFilesBlank linesComment linesLines of code
PHP6248,06018,01047,881
Markdown261,56804,505
JSON16001,561
CSS419736965
JavaScript717084964
SVG59288679
YAML622398
XML14112
Dockerfile18010
make1409

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.87
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces78
Interfaces38
Traits8
Classes544
▷ Abstract classes274.96%
▷ Concrete classes51795.04%
▷ Final classes6211.99%
Methods2,031
▷ Static methods29114.33%
▷ Public methods1,62680.06%
▷ Protected methods1849.06%
▷ Private methods22110.88%
Functions204
▷ Named functions9144.61%
▷ Anonymous functions11355.39%
Constants346
▷ Global constants7922.83%
▷ Class constants26777.17%
▷ Public constants22985.77%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin