83% ebanx-payment-gateway-for-woocommerce

Code Review | EBANX Payment Gateway for WooCommerce

WordPress plugin EBANX Payment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: ebanx-payment-gat...
  • Plugin version: 1.41.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Jan 9, 2017
  • Latest release: Jun 19, 2020
  • Number of updates: 148
  • Update frequency: every 8.5 days
  • Top authors: ebanxwp (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

90+ active /17,363 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

An overview of server-side resources used by EBANX Payment Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.25 ▼1.59
Dashboard /wp-admin3.31 ▲0.0052.21 ▼2.41
Posts /wp-admin/edit.php3.36 ▲0.0046.65 ▼6.82
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.11 ▼11.90
Media Library /wp-admin/upload.php3.23 ▲0.0034.61 ▼2.05

Server storage [IO: ▲1.04MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/ebanx-payment-gateway-for-woocommerce/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 356 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for EBANX Payment Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.20 ▼1.182.22 ▲0.2840.91 ▼3.84
Dashboard /wp-admin2,224 ▲214.83 ▼0.1099.12 ▼23.1239.17 ▼8.42
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0335.85 ▲1.6538.22 ▲2.34
Add New Post /wp-admin/post-new.php1,549 ▲2323.12 ▲5.60684.48 ▼28.3864.42 ▲14.61
Media Library /wp-admin/upload.php1,403 ▲34.20 ▲0.0095.63 ▼12.4543.54 ▼3.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 97× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_EBANX_Logger' not found in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/services/loggers/class-wc-ebanx-payment-by-link-logger.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Adapters\\PaymentAdapter' not found in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/vendor/ebanx/benjamin/src/Services/Adapters/EftPaymentAdapter.php:4
    • > PHP Warning
      require_once(payment-processing.php): failed to open stream: No such file or directory in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/templates/safetypay/payment-completed.php on line 1
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/database/class-wc-ebanx-database.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Gateways\\BaseGateway' not found in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/vendor/ebanx/benjamin/src/Services/Gateways/DirectGateway.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/database/class-wc-ebanx-database.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Gateways\\DirectGateway' not found in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/vendor/ebanx/benjamin/src/Services/Gateways/Spei.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Adapters\\BaseAdapter' not found in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/vendor/ebanx/benjamin/src/Services/Adapters/RequestAdapter.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Services\\Gateways\\DirectGateway' not found in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/vendor/ebanx/benjamin/src/Services/Gateways/Tef.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Ebanx\\Benjamin\\Models\\BaseModel' not found in wp-content/plugins/ebanx-payment-gateway-for-woocommerce/vendor/ebanx/benjamin/src/Models/Responses/PaymentResponse.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% 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: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

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

"EBANX Payment Gateway for WooCommerce" version 1.41.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 ("ebanx-payment-gateway-for-woocommerce.php" instead of "woocommerce-gateway-ebanx.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin15,080 lines of code in 264 files:
LanguageFilesBlank linesComment linesLines of code
PHP2212,3174,06110,734
PO File47258821,811
JavaScript1218232805
CSS71323643
Markdown51960552
Bourne Shell34023232
JSON300113
XML36680
YAML32053
Dockerfile110239
SVG10115
Bourne Again Shell1003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.79
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces14
Interfaces1
Traits1
Classes136
▷ Abstract classes1410.29%
▷ Concrete classes12289.71%
▷ Final classes119.02%
Methods660
▷ Static methods21532.58%
▷ Public methods41963.48%
▷ Protected methods14421.82%
▷ Private methods9714.70%
Functions17
▷ Named functions423.53%
▷ Anonymous functions1376.47%
Constants109
▷ Global constants1513.76%
▷ Class constants9486.24%
▷ Public constants94100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
41 compressed PNG files occupy 0.08MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/visa-debit.png0.69KB0.70KB0.00%
assets/images/ebanx-oxxo.png0.86KB0.88KB0.00%
assets/images/icons/ebanx-account.png1.55KB1.56KB0.00%
assets/images/ebanx-pagando.png2.02KB2.06KB0.00%
assets/images/icons/discover.png0.76KB0.77KB0.00%