74% pay-via-barion-for-woocommerce

Code Review | Barion Payment Gateway for WooCommerce

WordPress plugin Barion Payment Gateway for WooCommerce scored 74% from 54 tests.

About plugin

  • Plugin page: pay-via-barion-fo...
  • Plugin version: 3.5.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1
  • WordPress version: 6.3.1
  • First release: May 13, 2016
  • Latest release: Nov 6, 2022
  • Number of updates: 105
  • Update frequency: every 22.6 days
  • Top authors: szelpe (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

6,000+ active / 47,584 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
This plugin's installer ran successfully

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

Server-side resources used by Barion Payment Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.24 ▼2.80
Dashboard /wp-admin3.31 ▲0.0143.26 ▼4.47
Posts /wp-admin/edit.php3.36 ▲0.0143.72 ▲0.38
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.21 ▼15.20
Media Library /wp-admin/upload.php3.24 ▲0.0133.70 ▼3.47

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Barion Payment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.48 ▲0.101.68 ▼0.2643.80 ▼13.44
Dashboard /wp-admin2,206 ▲214.87 ▼0.0098.16 ▼13.4738.94 ▼9.22
Posts /wp-admin/edit.php2,092 ▼02.01 ▲0.0140.25 ▲2.3135.02 ▼1.19
Add New Post /wp-admin/post-new.php1,535 ▲223.08 ▼0.05677.73 ▲36.8255.62 ▼0.39
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0394.22 ▼11.3240.60 ▼4.90

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 were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Please fix the following
  • 40× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BaseRequestModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/payment/CaptureRequestModel.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'iBarionModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/3dsecure/BillingAddressModel.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'iBarionModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/common/BankCardModel.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'BaseRequestModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/refund/RefundRequestModel.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'BaseRequestModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/payment/PaymentStateRequestModel.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'BaseResponseModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/payment/CancelAuthorizationResponseModel.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'BarionClient' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/examples/example_start_delayedcapture_payment.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'iBarionModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/common/ItemModel.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'BaseRequestModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/payment/PaymentQRRequestModel.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'BaseRequestModel' not found in wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/models/payment/FinishReservationRequestModel.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: woocommerce, gateway, payment, barion

pay-via-barion-for-woocommerce/index.php 85% from 13 tests

"Barion Payment Gateway for WooCommerce" version 3.5.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0" instead of "3.0.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pay-via-barion-for-woocommerce.php" instead of "index.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/pay-via-barion-for-woocommerce/barion-library/library/ssl/gd_bundle-g2.crt
5,732 lines of code in 81 files:
LanguageFilesBlank linesComment linesLines of code
PHP635631,0632,859
Markdown946502,484
PO File3118124338
XML50043
JSON1008

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity3.74
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes68
▷ Abstract classes2232.35%
▷ Concrete classes4667.65%
▷ Final classes00.00%
Methods147
▷ Static methods21.36%
▷ Public methods13390.48%
▷ Protected methods32.04%
▷ Private methods117.48%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants97
▷ Global constants00.00%
▷ Class constants97100.00%
▷ Public constants97100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png9.65KB3.40KB▼ 64.72%
assets/banner-772x250.png16.12KB7.26KB▼ 54.96%
assets/icon-256x256.png14.16KB5.08KB▼ 64.14%
assets/barion-card-strip-intl__small.png3.36KB3.31KB▼ 1.42%
assets/screenshot-1.png51.55KB23.83KB▼ 53.77%