78% redpay-payment-gateway

Code Review | RedPay Payment Gateway

WordPress plugin RedPay Payment Gateway scored78%from 54 tests.

About plugin

  • Plugin page: redpay-payment-ga...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Nov 5, 2020
  • Latest release: Jun 8, 2023
  • Number of updates: 30
  • Update frequency: every 31.8 days
  • Top authors: redpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /653 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.97ms] Passed 4 tests

An overview of server-side resources used by RedPay Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.66 ▼3.54
Dashboard /wp-admin3.31 ▲0.0043.42 ▲0.13
Posts /wp-admin/edit.php3.36 ▲0.0047.92 ▼2.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.96 ▼10.25
Media Library /wp-admin/upload.php3.23 ▲0.0032.87 ▲0.84

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for RedPay Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.161.64 ▼0.3336.48 ▼13.21
Dashboard /wp-admin2,206 ▲214.85 ▼1.05110.13 ▼2.6538.93 ▼9.24
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0640.14 ▼1.8935.44 ▼0.53
Add New Post /wp-admin/post-new.php1,514 ▼017.73 ▲0.28664.40 ▲15.8558.87 ▲9.61
Media Library /wp-admin/upload.php1,391 ▲94.18 ▼0.0892.09 ▼7.8143.05 ▼1.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/redpay-payment-gateway/payment_success.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_logger() in wp-content/plugins/redpay-payment-gateway/ape_payment.php:3

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 Passed 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
4 plugin tags: woocommerce, payment request, redpay, credit card

redpay-payment-gateway/redpay.php 85% from 13 tests

The main PHP script in "RedPay Payment Gateway" version 1.2 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "5.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("redpay-payment-gateway.php" instead of "redpay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected4,119 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript29016673,373
PHP3131102730
HTML12016

PHP code Passed 2 tests

This is a very shot review of 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 complexity55.00
▷ Minimum class complexity55.00
▷ Maximum class complexity55.00
Average method complexity5.91
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.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 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.51MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
amex.png317.22KB145.18KB▼ 54.24%
visa-and-mastercard-logo.png76.00KB21.72KB▼ 71.41%
redpay_1.png8.26KB3.21KB▼ 61.15%
redpay_logo_netpay.png16.56KB7.08KB▼ 57.23%
red-pay-logo.png60.74KB17.66KB▼ 70.92%