88% gtpay-woo-payment-gateway

Code Review | GTPay Woocommerce Payment Gateway

WordPress plugin GTPay Woocommerce Payment Gateway scored 88% from 54 tests.

About plugin

  • Plugin page: gtpay-woo-payment...
  • Plugin version: 3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 5.8.1
  • First release: Nov 25, 2015
  • Latest release: Nov 4, 2017
  • Number of updates: 23
  • Update frequency: every 30.9 days
  • Top authors: elnino.akin (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 5,914 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼140.65ms] Passed 4 tests

A check of server-side resources used by GTPay Woocommerce Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1636.51 ▲15.47
Dashboard /wp-admin3.11 ▲0.0547.71 ▼5.07
Posts /wp-admin/edit.php3.16 ▲0.0546.26 ▼1.02
Add New Post /wp-admin/post-new.php5.46 ▲0.03100.66 ▼561.48
Media Library /wp-admin/upload.php3.05 ▲0.0438.50 ▲4.99

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by GTPay Woocommerce Payment Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,742 ▲17215.83 ▲0.3210.42 ▲0.1155.30 ▼1.51
Dashboard /wp-admin2,980 ▲435.85 ▼0.08145.95 ▼2.62110.38 ▼5.83
Posts /wp-admin/edit.php2,775 ▲392.69 ▼0.0270.99 ▼4.59101.65 ▲7.89
Add New Post /wp-admin/post-new.php1,508 ▼7317.86 ▼2.33288.77 ▼95.44122.72 ▼5.47
Media Library /wp-admin/upload.php1,842 ▲354.99 ▼0.03150.68 ▼9.68114.41 ▼11.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/gtpay-woo-payment-gateway/gtpay-payment.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/gtpay-woo-payment-gateway/includes/settings.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: interswitch, payment, nigeria, master, credit card...

gtpay-woo-payment-gateway/gtpay-payment.php 85% from 13 tests

The main PHP file in "GTPay Woocommerce Payment Gateway" ver. 3.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 328 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gtpay-woo-payment-gateway.php" instead of "gtpay-payment.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected479 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP67012461
JavaScript10018

PHP code Passed 2 tests

Analyzing 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.14
Average class complexity7.25
▷ Minimum class complexity3.00
▷ Maximum class complexity17.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods17
▷ Static methods15.88%
▷ Public methods1694.12%
▷ Protected methods15.88%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png14.27KB5.80KB▼ 59.33%
assets/images/logo1.png27.85KB9.86KB▼ 64.60%