88% tripay-payment-gateway

Code Review | TriPay Payment Gateway

WordPress plugin TriPay Payment Gateway scored88%from 54 tests.

About plugin

  • Plugin page: tripay-payment-ga...
  • Plugin version: 3.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-6.0
  • WordPress version: 6.3.1
  • First release: May 5, 2020
  • Latest release: Jan 11, 2023
  • Number of updates: 36
  • Update frequency: every 27.3 days
  • Top authors: trijayadigital (94.44%)rofiqdev (8.33%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /26,619 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.07MB] [CPU: ▼6.47ms] Passed 4 tests

An overview of server-side resources used by TriPay Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.08 ▲0.31
Dashboard /wp-admin3.39 ▲0.0548.04 ▼13.57
Posts /wp-admin/edit.php3.44 ▲0.0845.85 ▲2.04
Add New Post /wp-admin/post-new.php5.97 ▲0.0883.75 ▼13.30
Media Library /wp-admin/upload.php3.31 ▲0.0835.55 ▲0.70

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 47 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for TriPay Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.33 ▼1.051.71 ▼0.2043.92 ▼1.59
Dashboard /wp-admin2,203 ▲115.80 ▼0.1299.29 ▼17.3740.45 ▼1.72
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0036.62 ▲0.0932.89 ▼3.35
Add New Post /wp-admin/post-new.php1,535 ▲2122.93 ▲5.45670.28 ▲18.7055.99 ▲3.09
Media Library /wp-admin/upload.php1,388 ▲64.21 ▲0.0394.83 ▼2.1641.54 ▼1.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% 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 your attention:
  • Tags: There are too many tags (19 tag instead of maximum 10)
You can take inspiration from this readme.txt

tripay-payment-gateway/woocommerce-gateway-tripay.php 69% from 13 tests

The main PHP file in "TriPay Payment Gateway" ver. 3.2.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7" instead of "3.1.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tripay-payment-gateway.php" instead of "woocommerce-gateway-tripay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected3,158 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP25368243,158

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity8.60
▷ Minimum class complexity3.00
▷ Maximum class complexity74.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods75
▷ Static methods2128.00%
▷ Public methods7498.67%
▷ Protected methods00.00%
▷ Private methods11.33%
Functions3
▷ Named functions3100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
21 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/permata-va.png2.64KB1.80KB▼ 31.84%
includes/assets/cc.png2.56KB1.70KB▼ 33.50%
(invalid) includes/assets/sampoerna-va.png3.30KB0.00KB▼ 100.00%
includes/assets/bni-va.png3.08KB1.96KB▼ 36.39%
includes/assets/shopeepay.png1.54KB1.39KB▼ 10.00%