84% woo-hnb

Code Review | WooCommerce - Hatton National Bank Payment Gateway

WordPress plugin WooCommerce - Hatton National Bank Payment Gateway scored 84% from 54 tests.

About plugin

  • Plugin page: woo-hnb
  • Plugin version: 1.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.3
  • WordPress version: 6.3.1
  • First release: Jan 28, 2019
  • Latest release: Jul 23, 2023
  • Number of updates: 16
  • Update frequency: every 102.3 days
  • Top authors: ayeshrajans (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 2,189 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.27ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce - Hatton National Bank Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.79 ▲0.33
Dashboard /wp-admin3.31 ▲0.0147.06 ▲0.01
Posts /wp-admin/edit.php3.36 ▲0.0146.28 ▼0.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0193.38 ▼4.95
Media Library /wp-admin/upload.php3.24 ▲0.0135.87 ▲0.41

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce - Hatton National Bank Payment Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.21 ▼1.541.71 ▼0.3942.80 ▼5.29
Dashboard /wp-admin2,206 ▲155.91 ▲1.08107.03 ▼10.9942.09 ▲1.04
Posts /wp-admin/edit.php2,092 ▼02.05 ▲0.0240.18 ▼0.5633.89 ▼1.63
Add New Post /wp-admin/post-new.php1,533 ▼123.17 ▲0.05616.42 ▼26.6654.48 ▼1.34
Media Library /wp-admin/upload.php1,385 ▼34.19 ▼0.0298.78 ▼6.5042.65 ▼3.30

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-hnb/src/Gateway/WC_HNB_Gateway.php:38

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

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: woocommerce - hatton national bank payment gateway, hnb ipg, hnb, lkr, sri lanka...

woo-hnb/woo-hnb.php 92% from 13 tests

"WooCommerce - Hatton National Bank Payment Gateway" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("4.9" instead of "3.3")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin390 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26018390

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods22
▷ Static methods418.18%
▷ Public methods836.36%
▷ Protected methods00.00%
▷ Private methods1463.64%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants114.29%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/cards.png2.49KB2.22KB▼ 11.05%