93% wc-transbank-webpay-plus

Code Review | Integración de Webpay Plus de Transbank para WooCommerce

WordPress plugin Integración de Webpay Plus de Transbank para WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: wc-transbank-webp...
  • Plugin version: 20.12.28
  • PHP compatiblity: 5.6++
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 5.9.2
  • First release: Aug 9, 2019
  • Latest release: Dec 28, 2020
  • Number of updates: 48
  • Update frequency: every 10.6 days
  • Top authors: AnydaSRL (68.75%)andresreyesdev (33.33%)

Code review

54 tests

User reviews

5 reviews

Install metrics

600+ active / 10,871 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.39MB] [CPU: ▼290.62ms] Passed 4 tests

Analyzing server-side resources used by Integración de Webpay Plus de Transbank para WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4266.21 ▼0.31
Dashboard /wp-admin3.78 ▲0.3836.42 ▼0.27
Posts /wp-admin/edit.php4.07 ▲0.43109.59 ▲70.54
Add New Post /wp-admin/post-new.php7.31 ▲0.34104.36 ▼1,166.12
Media Library /wp-admin/upload.php3.72 ▲0.4330.48 ▲4.24

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 287 new files
Database: 1 new table, no new options
New tables
wp_webpay_transactions

Browser metrics Passed 4 tests

A check of browser resources used by Integración de Webpay Plus de Transbank para WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,774 ▲2015.91 ▲0.135.58 ▼0.162.35 ▼0.17
Dashboard /wp-admin2,899 ▲386.03 ▼0.18120.79 ▼22.24178.41 ▲12.49
Posts /wp-admin/edit.php2,698 ▲103.37 ▲0.1363.94 ▼0.62148.30 ▲0.03
Add New Post /wp-admin/post-new.php1,665 ▼3316.38 ▼5.61446.78 ▼18.10168.82 ▼67.09
Media Library /wp-admin/upload.php1,702 ▲75.55 ▼0.04142.06 ▼17.56196.22 ▼24.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 81× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/guzzlehttp/promises/src/RejectedPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/wc-transbank-webpay-plus/libwebpay/soap/soapclient.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/guzzlehttp/psr7/src/PumpStream.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Transbank\\Onepay\\Exceptions\\TransbankException' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/transbank/transbank-sdk/lib/onepay/exceptions/TransactionCreateException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Transbank\\Onepay\\Exceptions\\TransbankException' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/transbank/transbank-sdk/lib/onepay/exceptions/SignException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/wc-transbank-webpay-plus/libwebpay/soap/soapclient.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/guzzlehttp/guzzle/src/Client.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Transbank\\Webpay\\Exceptions\\WebpayException' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/transbank/transbank-sdk/lib/webpay_rest/oneclick/mall/exceptions/MallRefundTransactionException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-transbank-webpay-plus/vendor/guzzlehttp/psr7/src/MultipartStream.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Requires php: The plugin version is formatted incorrectly
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can take inspiration from this readme.txt

wc-transbank-webpay-plus/class-wc-transbank.php 85% from 13 tests

The primary PHP file in "Integración de Webpay Plus de Transbank para WooCommerce" version 20.12.28 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-transbank-webpay-plus.php" instead of "class-wc-transbank.php")
  • Requires PHP: Required version number formatted incorrectly (ex. "7.0" instead of "5.6+")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected28,089 lines of code in 268 files:
LanguageFilesBlank linesComment linesLines of code
PHP2274,2857,25123,312
Markdown191,14603,566
JSON11001,043
CSS15047
JavaScript210340
make212028
Dockerfile28022
XML10015
YAML10013
Bourne Shell1102
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.49
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces25
Interfaces15
Traits2
Classes259
▷ Abstract classes00.00%
▷ Concrete classes259100.00%
▷ Final classes197.34%
Methods1,508
▷ Static methods24516.25%
▷ Public methods1,32287.67%
▷ Protected methods211.39%
▷ Private methods16510.94%
Functions214
▷ Named functions12457.94%
▷ Anonymous functions9042.06%
Constants237
▷ Global constants4418.57%
▷ Class constants19381.43%
▷ Public constants193100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.21MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo_webpay.png14.54KB6.90KB▼ 52.53%
assets/img/back.png116.65KB55.68KB▼ 52.27%
assets/img/hablar_whatsapp.png67.69KB27.84KB▼ 58.87%
libwebpay/images/webpay.png5.89KB2.46KB▼ 58.20%
assets/img/logo-migracion.png13.73KB5.78KB▼ 57.90%