93% woo-myghpay-payment-gateway

Code Review | myghpay WooCommerce Payment Gateway

WordPress plugin myghpay WooCommerce Payment Gateway scored 93% from 54 tests.

About plugin

  • Plugin page: woo-myghpay-payme...
  • Plugin version: 3.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-5.8.1
  • WordPress version: 5.8.1
  • First release: Dec 20, 2017
  • Latest release: Oct 14, 2021
  • Number of updates: 35
  • Update frequency: every 39.9 days
  • Top authors: emmaadu (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 4,806 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by myghpay WooCommerce Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0036.03 ▲0.90
Dashboard /wp-admin3.06 ▲0.0136.87 ▼6.05
Posts /wp-admin/edit.php3.11 ▲0.0045.69 ▲1.93
Add New Post /wp-admin/post-new.php5.42 ▼0.0196.10 ▼540.63
Media Library /wp-admin/upload.php3.00 ▲0.0032.14 ▼2.03

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by myghpay WooCommerce Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.86 ▲0.268.80 ▼2.3049.26 ▼2.06
Dashboard /wp-admin2,970 ▲365.89 ▼0.09139.33 ▼2.63116.23 ▲1.73
Posts /wp-admin/edit.php2,739 ▲32.71 ▼0.0064.89 ▼0.3694.06 ▲4.49
Add New Post /wp-admin/post-new.php1,502 ▼17018.41 ▼0.36344.69 ▼16.71106.67 ▼3.50
Media Library /wp-admin/upload.php1,813 ▲35.04 ▼0.02141.42 ▼10.12119.46 ▼10.16

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-myghpay-payment-gateway/index.php:13

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 90% from 29 tests

readme.txt 88% 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #2 (myghpay Wooocommerce Payment Gateway method on the checkout page) image required
  • Tags: You are using too many tags: 27 tag instead of maximum 10
Please take inspiration from this readme.txt

woo-myghpay-payment-gateway/index.php 92% from 13 tests

Analyzing the main PHP file in "myghpay WooCommerce Payment Gateway" version 3.0
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-myghpay-payment-gateway.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected355 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP313055355

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.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 Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin