88% aba-payway-woocommerce-payment-gateway

Code Review | ABA PayWay Payment Gateway for WooCommerce

WordPress plugin ABA PayWay Payment Gateway for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: aba-payway-woocom...
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.2.2
  • WordPress version: 5.9.2
  • First release: Sep 2, 2019
  • Latest release: Feb 11, 2022
  • Number of updates: 63
  • Update frequency: every 14.4 days
  • Top authors: abapayway (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 5,430 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼288.35ms] Passed 4 tests

A check of server-side resources used by ABA PayWay Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0156.40 ▲4.50
Dashboard /wp-admin3.49 ▲0.0939.76 ▲7.94
Posts /wp-admin/edit.php3.70 ▲0.0644.36 ▲4.77
Add New Post /wp-admin/post-new.php6.96 ▼0.01107.55 ▼1,169.66
Media Library /wp-admin/upload.php3.37 ▲0.0738.47 ▲6.99

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 48 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for ABA PayWay Payment Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,181 ▼57315.72 ▼0.070.41 ▼6.1232.96 ▲30.26
Dashboard /wp-admin2,888 ▲346.17 ▲0.01121.25 ▼13.68154.21 ▼3.69
Posts /wp-admin/edit.php2,694 ▼03.23 ▼0.0160.73 ▼0.50133.32 ▼8.54
Add New Post /wp-admin/post-new.php1,633 ▼11921.99 ▲1.00409.49 ▼41.05149.36 ▼7.95
Media Library /wp-admin/upload.php1,701 ▲35.56 ▲0.03137.88 ▼6.40194.13 ▲4.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/aba-payway-woocommerce-payment-gateway/aba-payway-for-woocommerce.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/aba-payway-woocommerce-payment-gateway/PayWayApiCheckout.php:2

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: online payment gateway, e-commerce

aba-payway-woocommerce-payment-gateway/aba-payway-for-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "ABA PayWay Payment Gateway for WooCommerce" version 2.0.0
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("aba-payway-woocommerce-payment-gateway.php" instead of "aba-payway-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,393 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript313256706
PHP27950638
SVG20037
CSS13312

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods1676.19%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
37 PNG files occupy 0.20MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/white/1x/credit_debit.png2.84KB1.81KB▼ 36.29%
images/color/2x/credit_debit_old.png7.89KB2.92KB▼ 63.00%
images/white/3x/aba.png7.36KB2.35KB▼ 68.03%
images/color/1x/master.png3.71KB0.95KB▼ 74.31%
images/color/3x/credit_debit_old.png10.78KB4.11KB▼ 61.88%