89% woo-payment-gateway-public-bank

Code Review | WooCommerce Payment Gateway - Public Bank

WordPress plugin WooCommerce Payment Gateway - Public Bank scored89%from 54 tests.

About plugin

  • Plugin page: woo-payment-gatew...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.2
  • WordPress version: 6.3.1
  • First release: May 1, 2019
  • Latest release: Jul 20, 2021
  • Number of updates: 10
  • Update frequency: every 81.2 days
  • Top authors: freelancerviet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /666 total downloads

Benchmarks

Plugin footprint 83% from 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.01MB] [CPU: ▼50.81ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Payment Gateway - Public Bank
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0148.76 ▼36.07
Dashboard /wp-admin3.31 ▲0.0143.88 ▼49.71
Posts /wp-admin/edit.php3.42 ▲0.0746.83 ▼42.28
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.18 ▼75.16
Media Library /wp-admin/upload.php3.23 ▲0.0032.62 ▼11.18

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Payment Gateway - Public Bank
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.29 ▼0.712.00 ▼1.7540.56 ▼42.66
Dashboard /wp-admin2,206 ▲184.86 ▼0.06106.75 ▼84.0138.60 ▼46.24
Posts /wp-admin/edit.php2,089 ▼62.00 ▼0.0640.04 ▼33.1534.25 ▼39.63
Add New Post /wp-admin/post-new.php1,533 ▲17423.42 ▲5.75689.81 ▼271.4458.71 ▼12.78
Media Library /wp-admin/upload.php1,388 ▲34.24 ▲0.0796.37 ▼32.6742.65 ▼13.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Easily accept credit card payments on your own branded page.), #2 (Here is a close up of the payment form as seen by your customers (it is fully editable and already branded to perfection for all WooThemes.com themes). Notice that advanced features such as saving credit cards securely via the Inspire Commerce card vault are available if you choose to activate them in the admin area. The module even works flawlessly with the WooCommerce subscriptions module.), #3 (While you can do a lot on the back end, here is a simple screen shot of the two most important data points... your API username and password which are used to connect the gateway to your shopping cart.)
The official readme.txt is a good inspiration

woo-payment-gateway-public-bank/class-wc-gateway-public-bank.php 85% from 13 tests

The main PHP script in "WooCommerce Payment Gateway - Public Bank" version 1.1.0 is automatically included on every request by WordPress
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-gateway-public-bank.php" instead of "class-wc-gateway-public-bank.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin660 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17071660

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity61.00
▷ Minimum class complexity61.00
▷ Maximum class complexity61.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods29
▷ Static methods13.45%
▷ Public methods2068.97%
▷ Protected methods13.45%
▷ Private methods827.59%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin