89% hamrahpay-online-payment-gateway

Code Review | Hamrahpay Online Payment Gateway for WooCommerce

WordPress plugin Hamrahpay Online Payment Gateway for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: hamrahpay-online-...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.5
  • WordPress version: 6.3.1
  • First release: Oct 8, 2020
  • Latest release: Oct 8, 2020
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: hamrahpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /655 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.11ms] Passed 4 tests

Analyzing server-side resources used by Hamrahpay Online Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.88 ▼1.64
Dashboard /wp-admin3.39 ▲0.0450.35 ▼10.51
Posts /wp-admin/edit.php3.44 ▲0.0854.04 ▲3.97
Add New Post /wp-admin/post-new.php5.97 ▲0.0894.67 ▼16.81
Media Library /wp-admin/upload.php3.31 ▲0.0839.80 ▲0.52

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hamrahpay Online Payment Gateway for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.161.93 ▲0.1543.10 ▼1.49
Dashboard /wp-admin2,192 ▲155.52 ▼0.1586.67 ▼10.0939.49 ▼6.07
Posts /wp-admin/edit.php2,100 ▲32.06 ▲0.0139.67 ▲4.9336.06 ▼4.01
Add New Post /wp-admin/post-new.php1,545 ▲1423.21 ▼0.06646.10 ▼42.2751.18 ▼7.68
Media Library /wp-admin/upload.php1,403 ▲34.14 ▼0.08110.27 ▼5.3150.15 ▲2.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (بخش تنظیمات) image missing
You can look at the official readme.txt

hamrahpay-online-payment-gateway/index.php 92% from 13 tests

The primary PHP file in "Hamrahpay Online Payment Gateway for WooCommerce" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hamrahpay-online-payment-gateway.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin393 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP27620393

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.37
Average class complexity61.00
▷ Minimum class complexity61.00
▷ Maximum class complexity61.00
Average method complexity9.57
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
9 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png5.85KB5.14KB▼ 12.10%
assets/banner-1544x500-rtl.png20.94KB19.41KB▼ 7.30%
assets/icon-128x128.png3.92KB3.05KB▼ 21.98%
assets/banner-772x250.png11.13KB9.97KB▼ 10.43%
assets/banner-772x250-rtl.png11.28KB10.12KB▼ 10.29%