77% ebanx-local-payment-gateway-for-woocommerce

Code Review | EBANX Local Payment Gateway for WooCommerce

WordPress plugin EBANX Local Payment Gateway for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: ebanx-local-payme...
  • Plugin version: 3.4.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.5
  • WordPress version: 6.3.1
  • First release: Jan 8, 2020
  • Latest release: Mar 24, 2021
  • Number of updates: 61
  • Update frequency: every 7.3 days
  • Top authors: ebanxpay (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 3,940 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Server-side resources used by EBANX Local Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.34 ▼1.76
Dashboard /wp-admin3.31 ▲0.0146.04 ▼2.69
Posts /wp-admin/edit.php3.36 ▲0.0049.29 ▲0.09
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.13 ▼22.99
Media Library /wp-admin/upload.php3.23 ▲0.0034.10 ▼1.40

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

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

Browser metrics Passed 4 tests

A check of browser resources used by EBANX Local Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.051.63 ▼0.0240.82 ▲2.21
Dashboard /wp-admin2,203 ▲295.84 ▲0.9397.07 ▼17.1638.85 ▼9.03
Posts /wp-admin/edit.php2,092 ▲32.00 ▲0.0039.95 ▼0.4135.48 ▼0.33
Add New Post /wp-admin/post-new.php1,533 ▼923.26 ▲4.97665.72 ▲13.8261.63 ▲1.71
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.0298.70 ▼0.4844.83 ▼1.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/templates/ebanx-credit-card-international/card-template.php
  • 88× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Gateways\\DirectGateway' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Services/Gateways/Servipag.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Gateways\\DirectGateway' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Services/Gateways/DebitCard.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Adapters\\BrazilPaymentAdapter' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Services/Adapters/BankTransferPaymentAdapter.php:4
    • > PHP Notice
      Undefined variable: is_sandbox_mode in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/templates/sandbox-checkout-alert.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Adapters\\BaseAdapter' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Services/Adapters/ExchangeAdapter.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Models\\BaseModel' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Models/Responses/PaymentTerm.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Gateways\\DirectGateway' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Services/Gateways/Oxxo.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Models\\BaseModel' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Models/Configs/CreditCardConfig.php:7
    • > PHP Warning
      require_once(WC_EBANX_VENDOR_DIR/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/services/class-wc-ebanx-api.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Models\\BaseModel' not found in wp-content/plugins/ebanx-local-payment-gateway-for-woocommerce/vendor/ebanx/benjamin-local/src/Models/Request.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (EBANX Features - Allow your customers to save their credit card data to buy with just one-click; in addition to increasing your sales even more.), #4 (Plugin Configuration - To start your integration, send an email to [hello@ebanxpay.com](mailto:hello@ebanxpay.com) to request your test and live keys. Insert them and choose to enable the sandbox mode for testing.), #6 (Plugin Configuration - Set more advanced options such as Save Card Data, One-click payment, Enable Auto-Capture, Maximum number of Instalments, etc.)
The official readme.txt might help

ebanx-local-payment-gateway-for-woocommerce/woocommerce-gateway-ebanx.php 77% from 13 tests

Analyzing the main PHP file in "EBANX Local Payment Gateway for WooCommerce" version 3.4.6
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "4.0.1")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("ebanx-local-payment-gateway-for-woocommerce.php" instead of "woocommerce-gateway-ebanx.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
Everything looks great! No dangerous files found in this plugin15,312 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1531,8603,5638,273
JSON4003,194
PO File47107971,891
CSS71393648
JavaScript913527585
Markdown51340280
Bourne Shell34322272
XML37663
YAML33055
Dockerfile111233
SVG10115
Bourne Again Shell1003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.99
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces13
Interfaces1
Traits1
Classes118
▷ Abstract classes1311.02%
▷ Concrete classes10588.98%
▷ Final classes1110.48%
Methods560
▷ Static methods19835.36%
▷ Public methods34962.32%
▷ Protected methods11720.89%
▷ Private methods9416.79%
Functions16
▷ Named functions318.75%
▷ Anonymous functions1381.25%
Constants91
▷ Global constants1516.48%
▷ Class constants7683.52%
▷ Public constants76100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ebanx-banking-ticket.png0.24KB0.25KB0.00%
assets/images/ebanx-account.png1.39KB1.41KB0.00%
assets/images/icons/mastercard.png0.51KB0.52KB0.00%
assets/images/icons/ebanx-account.png1.55KB1.56KB0.00%
assets/images/icons/visa.png0.64KB0.65KB0.00%