84% woo-payment-for-banknet-in-viet-nam

Code Review | Payment for BANKNET Gateway in Viet Nam

WordPress plugin Payment for BANKNET Gateway in Viet Nam scored 84% from 54 tests.

About plugin

  • Plugin page: woo-payment-for-b...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-5.6.2
  • WordPress version: 6.3.1
  • First release: Mar 1, 2017
  • Latest release: Mar 5, 2021
  • Number of updates: 19
  • Update frequency: every 77.1 days
  • Top authors: crazycat2007 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,794 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Payment for BANKNET Gateway in Viet Nam
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.55 ▼4.98
Dashboard /wp-admin3.31 ▲0.0145.28 ▼1.36
Posts /wp-admin/edit.php3.36 ▲0.0044.78 ▼1.58
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.56 ▼5.26
Media Library /wp-admin/upload.php3.23 ▲0.0031.69 ▼1.39

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment for BANKNET Gateway in Viet Nam
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.19 ▼1.041.70 ▼0.2738.99 ▼7.45
Dashboard /wp-admin2,206 ▲174.87 ▼0.23100.53 ▼22.7838.45 ▼3.86
Posts /wp-admin/edit.php2,092 ▲31.97 ▼0.0234.51 ▲0.5532.33 ▼1.20
Add New Post /wp-admin/post-new.php1,537 ▲2323.29 ▲5.81622.33 ▼46.3951.83 ▼11.03
Media Library /wp-admin/upload.php1,388 ▲64.28 ▲0.1293.31 ▼17.5844.46 ▼3.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woo-payment-for-banknet-in-viet-nam/index.php

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (WooCommerce Checkout section's payment gateway setting page), #2 (BANKNET Payments setting page), #3 (BANKNET Payments option at Checkout page)
Please take inspiration from this readme.txt

woo-payment-for-banknet-in-viet-nam/banknet.php 92% from 13 tests

The main PHP file in "Payment for BANKNET Gateway in Viet Nam" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-payment-for-banknet-in-viet-nam.php" instead of "banknet.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected353 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP25325353

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity63.00
▷ Minimum class complexity63.00
▷ Maximum class complexity63.00
Average method complexity5.77
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods969.23%
▷ Protected methods00.00%
▷ Private methods430.77%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.36MB with 0.25MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png87.99KB31.90KB▼ 63.75%
images/banknet_logo.png29.72KB6.83KB▼ 77.03%
screenshot-3.png174.18KB61.79KB▼ 64.52%
screenshot-1.png75.87KB23.22KB▼ 69.39%