83% payhero-sps-gateway

Code Review | Payhero SPS Gateway

WordPress plugin Payhero SPS Gateway scored83%from 54 tests.

About plugin

  • Plugin page: payhero-sps-gateway
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1
  • WordPress version: 6.3.1
  • First release: Jan 5, 2023
  • Latest release: Apr 7, 2023
  • Number of updates: 10
  • Update frequency: every 9.2 days
  • Top authors: payherokenya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /306 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.60MB] [CPU: ▼19.76ms] Passed 4 tests

An overview of server-side resources used by Payhero SPS Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.49 ▲0.66
Dashboard /wp-admin3.40 ▲0.0549.11 ▼17.14
Posts /wp-admin/edit.php3.45 ▲0.0950.26 ▲2.55
Add New Post /wp-admin/post-new.php3.28 ▼2.6239.03 ▼65.12
Media Library /wp-admin/upload.php3.32 ▲0.0939.14 ▲5.70

Server storage [IO: ▲81.50MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • The filesystem usage should be lower than 25MB (currently using 81.50MB)
Filesystem: 4,064 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payhero SPS Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲12514.25 ▼0.022.16 ▲0.5148.33 ▲8.28
Dashboard /wp-admin2,248 ▲715.54 ▼0.1483.15 ▼5.5339.55 ▼6.59
Posts /wp-admin/edit.php2,121 ▲242.01 ▲0.0039.71 ▲1.9435.42 ▲2.16
Add New Post /wp-admin/post-new.php1,557 ▲2918.09 ▼5.03644.43 ▼44.9186.64 ▲26.12
Media Library /wp-admin/upload.php1,427 ▲304.18 ▲0.01100.42 ▼3.2344.49 ▲0.84

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/payhero-sps-gateway/tag/1.3.2/tag/1.3.1/tags/1.3.0/index.php
    • > /wp-content/plugins/payhero-sps-gateway/tag/1.3.2/tag/1.3.1/index.php
    • > /wp-content/plugins/payhero-sps-gateway/tags/1.3.0/index.php
    • > /wp-content/plugins/payhero-sps-gateway/tag/1.3.2/index.php
    • > /wp-content/plugins/payhero-sps-gateway/index.php
    • > /wp-content/plugins/payhero-sps-gateway/tag/1.3.2/tags/1.3.0/index.php
    • > /wp-content/plugins/payhero-sps-gateway/tag/1.3.1/index.php
    • > /wp-content/plugins/payhero-sps-gateway/tag/1.3.1/tags/1.3.0/index.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4 in payhero-sps-gateway/assets to your readme.txt
  • Contributors: Plugin contributors not specified
You can look at the official readme.txt

payhero-sps-gateway/payhero-callback-url-functions.php 85% from 13 tests

The main PHP script in "Payhero SPS Gateway" version 1.3.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("payhero-sps-gateway.php" instead of "payhero-callback-url-functions.php")
  • Description: The description should be shorter than 140 characters (currently 288 characters long)

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 detected76,990 lines of code in 318 files:
LanguageFilesBlank linesComment linesLines of code
CSS162,70514236,588
JavaScript1368,2123,18829,324
Sass881,3361,2896,771
PHP61031752,965
TypeScript6404491
Markdown31710472
JSON500379

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions68
▷ Named functions68100.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
No PNG images were found in this plugin