93% wc-lankaqr-payment-gateway

Code Review | Payment Gateway for LANKAQR on WooCommerce

WordPress plugin Payment Gateway for LANKAQR on WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: wc-lankaqr-paymen...
  • Plugin version: 1.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.5.1
  • WordPress version: 5.8.1
  • First release: Dec 1, 2020
  • Latest release: Dec 1, 2020
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: maduka (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active / 298 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼139.25ms] Passed 4 tests

An overview of server-side resources used by Payment Gateway for LANKAQR on WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.02 ▲0.3038.86 ▲17.83
Dashboard /wp-admin3.24 ▲0.1948.78 ▲2.60
Posts /wp-admin/edit.php3.35 ▲0.2444.95 ▲0.35
Add New Post /wp-admin/post-new.php5.60 ▲0.1793.36 ▼564.72
Media Library /wp-admin/upload.php3.18 ▲0.1835.70 ▲4.78

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 1 new option
New WordPress options
lankaqrwc_plugin_installed_time

Browser metrics Passed 4 tests

An overview of browser requirements for Payment Gateway for LANKAQR on WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12716.02 ▲0.4012.21 ▲1.7147.06 ▲0.93
Dashboard /wp-admin2,967 ▲345.91 ▼0.09155.54 ▼13.67112.88 ▲4.21
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0261.71 ▼17.3589.58 ▲2.71
Add New Post /wp-admin/post-new.php1,498 ▼18518.83 ▲0.16382.58 ▼23.56103.47 ▼10.95
Media Library /wp-admin/upload.php1,748 ▼595.01 ▼0.00171.21 ▲5.24117.49 ▲14.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

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
Everything seems fine, however this is by no means 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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-lankaqr-payment-gateway/includes/notice.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-lankaqr-payment-gateway/includes/payment.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
  • Donate link: Please fix this invalid URI: ""
You can look at the official readme.txt

wc-lankaqr-payment-gateway/wc-lankaqr-payment-gateway.php 92% from 13 tests

This is the main PHP file of "Payment Gateway for LANKAQR on WooCommerce" version 1.2.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.4" instead of "3.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,265 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4146252901
CSS1342161
Markdown1800153
JavaScript15050

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity99.00
▷ Minimum class complexity99.00
▷ Maximum class complexity99.00
Average method complexity5.08
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/lankaqr.png6.05KB2.51KB▼ 58.59%
assets/img/logo-footer.png12.89KB3.72KB▼ 71.16%