83% xpay-payment-gateway

Code Review | XPAY Payment GateWay

WordPress plugin XPAY Payment GateWay scored 83% from 54 tests.

About plugin

  • Plugin page: xpay-payment-gateway
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0 or higher+
  • WordPress version: 6.3.1
  • First release: Nov 8, 2022
  • Latest release: Nov 10, 2022
  • Number of updates: 14
  • Update frequency: every 0.9 days
  • Top authors: xpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 157 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.01ms] Passed 4 tests

Analyzing server-side resources used by XPAY Payment GateWay
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0842.19 ▲2.25
Dashboard /wp-admin3.38 ▲0.0842.39 ▼4.22
Posts /wp-admin/edit.php3.50 ▲0.1449.56 ▲2.75
Add New Post /wp-admin/post-new.php5.96 ▲0.0877.77 ▼12.68
Media Library /wp-admin/upload.php3.30 ▲0.0831.23 ▼1.37

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for XPAY Payment GateWay
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.061.55 ▼0.2336.65 ▼2.56
Dashboard /wp-admin2,206 ▲155.90 ▲0.01110.36 ▲6.0642.87 ▲1.52
Posts /wp-admin/edit.php2,086 ▼02.04 ▲0.0437.27 ▲0.7133.29 ▼1.45
Add New Post /wp-admin/post-new.php1,514 ▼317.57 ▼0.01677.94 ▼17.1568.75 ▲8.80
Media Library /wp-admin/upload.php1,391 ▼04.23 ▲0.0393.47 ▼7.2742.62 ▼0.89

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/xpay-payment-gateway/XPAY-Payment-GateWay.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 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
These attributes need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5 in xpay-payment-gateway/assets to your readme.txt
  • Contributors: Plugin contributors field is missing
  • Tested up to: Version format is invalid
The official readme.txt is a good inspiration

xpay-payment-gateway/XPAY-Payment-GateWay.php 85% from 13 tests

This is the main PHP file of "XPAY Payment GateWay" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("xpay-payment-gateway.php" instead of "XPAY-Payment-GateWay.php")
  • Requires at least: Required version number formatted incorrectly (ex. "7.0" instead of "3.0 or higher")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected512 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP19767442
XML40070

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity41.00
▷ Minimum class complexity41.00
▷ Maximum class complexity41.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods15.56%
▷ Public methods1266.67%
▷ Protected methods211.11%
▷ Private methods422.22%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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
PNG images were not found in this plugin