84% latpay-direct-payment

Code Review | LatPay Direct Payment Gateway

WordPress plugin LatPay Direct Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: latpay-direct-pay...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2021
  • Latest release: Feb 20, 2023
  • Number of updates: 23
  • Update frequency: every 31.9 days
  • Top authors: sivadss028 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /499 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: ▼4.94ms] Passed 4 tests

A check of server-side resources used by LatPay Direct Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.52 ▼11.75
Dashboard /wp-admin3.31 ▲0.0046.96 ▼3.85
Posts /wp-admin/edit.php3.36 ▲0.0048.58 ▲5.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.47 ▼2.12
Media Library /wp-admin/upload.php3.23 ▲0.0032.85 ▼2.05

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by LatPay Direct Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.32 ▼1.124.18 ▲2.3238.93 ▼3.12
Dashboard /wp-admin2,209 ▲215.88 ▼0.03104.28 ▼9.8339.06 ▼6.43
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0539.48 ▲5.9235.24 ▼1.09
Add New Post /wp-admin/post-new.php1,542 ▲1318.84 ▼4.02577.52 ▼64.3069.01 ▲17.15
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0298.96 ▲2.3041.94 ▼3.89

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/latpay-direct-payment/hps-checkout-gateway.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention: The official readme.txt is a good inspiration

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

The main file in "LatPay Direct Payment Gateway" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be 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
There were no executable files found in this plugin542 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP19937495
SVG30247

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
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

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.36MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Get-Started/screenshot-5.png39.11KB15.22KB▼ 61.07%
images/logo.png4.57KB1.61KB▼ 64.74%
Get-Started/screenshot-2.png80.25KB30.58KB▼ 61.90%
Get-Started/screenshot-4.png74.86KB27.32KB▼ 63.50%
Get-Started/screenshot-3.png62.32KB23.55KB▼ 62.22%