93% a-gateway-for-pasargad-bank-on-woocommerce

Code Review | a Gateway for Pasargad Bank on WooCommerce

WordPress plugin a Gateway for Pasargad Bank on WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: a-gateway-for-pas...
  • Plugin version: 2.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 5.9.2
  • First release: Nov 13, 2016
  • Latest release: Mar 31, 2017
  • Number of updates: 10
  • Update frequency: every 25.6 days
  • Top authors: AlaFalaki (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 3,412 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼301.12ms] Passed 4 tests

An overview of server-side resources used by a Gateway for Pasargad Bank on WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0562.00 ▲7.49
Dashboard /wp-admin3.45 ▲0.0436.45 ▼2.34
Posts /wp-admin/edit.php3.68 ▲0.0442.64 ▲1.78
Add New Post /wp-admin/post-new.php6.92 ▼0.0599.52 ▼1,211.39
Media Library /wp-admin/upload.php3.33 ▲0.0436.60 ▲12.21

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by a Gateway for Pasargad Bank on WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4116.22 ▲0.176.12 ▼0.772.38 ▲0.17
Dashboard /wp-admin2,895 ▲346.04 ▼0.15121.51 ▼17.39153.59 ▼14.08
Posts /wp-admin/edit.php2,694 ▲63.24 ▲0.0161.25 ▼4.85141.20 ▼1.44
Add New Post /wp-admin/post-new.php1,661 ▼020.64 ▲5.13515.18 ▲119.65251.74 ▲94.08
Media Library /wp-admin/upload.php1,695 ▼35.50 ▲0.02178.12 ▲39.33226.61 ▲42.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/a-gateway-for-pasargad-bank-on-woocommerce/index.php:12

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

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

a-gateway-for-pasargad-bank-on-woocommerce/index.php 92% from 13 tests

The main file in "a Gateway for Pasargad Bank on WooCommerce" v. 2.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("a-gateway-for-pasargad-bank-on-woocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected515 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP57573515

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity9.40
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png1.51KB1.73KB0.00%