83% irandargah-payment-gateway-for-woocommerce

Code Review | IranDargah Payment Gateway for Woocommerce

WordPress plugin IranDargah Payment Gateway for Woocommerce scored 83% from 54 tests.

About plugin

  • Plugin page: irandargah-paymen...
  • Plugin version: 2.1.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2022
  • Latest release: Mar 14, 2023
  • Number of updates: 16
  • Update frequency: every 24.8 days
  • Top authors: irandargah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,628 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.62ms] Passed 4 tests

Server-side resources used by IranDargah Payment Gateway for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.75 ▲3.34
Dashboard /wp-admin3.32 ▲0.0246.33 ▲0.11
Posts /wp-admin/edit.php3.37 ▲0.0148.06 ▲1.95
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.66 ▼15.88
Media Library /wp-admin/upload.php3.24 ▲0.0134.92 ▲4.43

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

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

Browser metrics Passed 4 tests

IranDargah Payment Gateway for Woocommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.35 ▼1.051.74 ▲0.0243.37 ▼4.13
Dashboard /wp-admin2,206 ▲154.85 ▼0.00107.85 ▲6.1138.72 ▼3.98
Posts /wp-admin/edit.php2,092 ▲32.03 ▲0.0238.97 ▼0.7035.57 ▲0.77
Add New Post /wp-admin/post-new.php1,541 ▲1318.28 ▼0.16606.90 ▲23.5155.60 ▲4.25
Media Library /wp-admin/upload.php1,382 ▼94.15 ▼0.0593.58 ▼3.9340.35 ▼2.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/irandargah-payment-gateway-for-woocommerce/includes/class-wc-gateway-irandargah.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/irandargah-payment-gateway-for-woocommerce/includes/class-wc-gateway-irandargah-blocks-support.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Contributors: Plugin contributors not specified
The official readme.txt might help

irandargah-payment-gateway-for-woocommerce/gateway-irandargah.php 85% from 13 tests

"IranDargah Payment Gateway for Woocommerce" version 2.1.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("irandargah-payment-gateway-for-woocommerce.php" instead of "gateway-irandargah.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin917 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP398221630
PO File16072159
Markdown168083
JavaScript351235
SVG10010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity38.00
▷ Minimum class complexity6.00
▷ Maximum class complexity70.00
Average method complexity3.73
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods27
▷ Static methods13.70%
▷ Public methods2488.89%
▷ Protected methods00.00%
▷ Private methods311.11%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin