94% latpay-direct-payment

Code Review | LatPay Direct Payment Gateway

WordPress plugin LatPay Direct Payment Gateway scored 94% from 54 tests.

About plugin

  • Plugin page: latpay-direct-pay...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 5.9.2
  • First release: Feb 16, 2021
  • Latest release: Nov 1, 2021
  • Number of updates: 22
  • Update frequency: every 11.7 days
  • Top authors: sivadss028 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 233 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼300.49ms] Passed 4 tests

This is a short check of server-side resources used by LatPay Direct Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0855.07 ▲2.68
Dashboard /wp-admin3.48 ▲0.0735.41 ▲1.66
Posts /wp-admin/edit.php3.71 ▲0.0737.23 ▼2.89
Add New Post /wp-admin/post-new.php6.98 ▼0.0296.91 ▼1,201.05
Media Library /wp-admin/upload.php3.36 ▲0.0724.43 ▲0.31

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

LatPay Direct Payment Gateway: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲916.24 ▲0.575.75 ▼0.532.27 ▼0.24
Dashboard /wp-admin2,895 ▲346.11 ▼0.08123.51 ▼13.57158.62 ▼8.17
Posts /wp-admin/edit.php2,688 ▼23.24 ▲0.0163.89 ▼2.86139.97 ▼2.99
Add New Post /wp-admin/post-new.php1,668 ▲718.07 ▲1.55418.00 ▼7.33159.90 ▲6.79
Media Library /wp-admin/upload.php1,698 ▼05.50 ▼0.02145.58 ▲4.30190.40 ▲0.91

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/latpay-direct-payment/hps-checkout-gateway.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

latpay-direct-payment/hps-checkout-gateway.php 92% from 13 tests

This is the main PHP file of "LatPay Direct Payment Gateway" version 1.0.0, 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:
  • Main file name: Name the main plugin file the same as the plugin slug ("latpay-direct-payment.php" instead of "hps-checkout-gateway.php")

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
Good job! No executable or dangerous file extensions detected542 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP19937495
SVG30247

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.36MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Get-Started/screenshot-3.png62.32KB23.55KB▼ 62.22%
Get-Started/screenshot-2.png80.25KB30.58KB▼ 61.90%
images/cards.png7.69KB2.57KB▼ 66.59%
Get-Started/screenshot-5.png39.11KB15.22KB▼ 61.07%
Get-Started/screenshot-1.png98.80KB40.10KB▼ 59.41%