83% zanjir-cryptocurrency-payment-gateway-for-woocommerce

Code Review | Zanjir Payment Gateway for WooCommerce

WordPress plugin Zanjir Payment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: zanjir-cryptocurr...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9
  • WordPress version: 6.3.1
  • First release: Feb 12, 2022
  • Latest release: Sep 19, 2023
  • Number of updates: 3
  • Update frequency: every 195.0 days
  • Top authors: zanjir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,945 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Server-side resources used by Zanjir Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.06 ▼4.39
Dashboard /wp-admin3.31 ▼0.0445.24 ▼19.84
Posts /wp-admin/edit.php3.36 ▲0.0048.41 ▲1.34
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.92 ▼3.32
Media Library /wp-admin/upload.php3.23 ▲0.0036.73 ▲1.92

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Zanjir Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.20 ▼1.492.09 ▲0.1144.65 ▼1.75
Dashboard /wp-admin2,208 ▲205.83 ▲0.95101.56 ▼16.1240.76 ▼3.50
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0541.06 ▲4.1236.27 ▲2.95
Add New Post /wp-admin/post-new.php1,533 ▼423.20 ▼0.03649.58 ▼19.6649.85 ▼8.13
Media Library /wp-admin/upload.php1,396 ▲114.30 ▲0.1399.07 ▼13.2542.66 ▼4.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/zanjir-cryptocurrency-payment-gateway-for-woocommerce/define.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/zanjir-cryptocurrency-payment-gateway-for-woocommerce/define.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/zanjir-cryptocurrency-payment-gateway-for-woocommerce/function.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Requires php: Invalid version format
The official readme.txt is a good inspiration

zanjir-cryptocurrency-payment-gateway-for-woocommerce/Zanjir.php 77% from 13 tests

The primary PHP file in "Zanjir Payment Gateway for WooCommerce" version 1.0.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 147 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("zanjir-cryptocurrency-payment-gateway-for-woocommerce.php" instead of "Zanjir.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,194 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14195395978
CSS1130111
JSON21085
JavaScript16019
Markdown1101

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity20.17
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods56
▷ Static methods1933.93%
▷ Public methods5292.86%
▷ Protected methods00.00%
▷ Private methods47.14%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants4
▷ Global constants4100.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.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/success.png11.55KB4.58KB▼ 60.37%
static/check.png15.76KB9.28KB▼ 41.13%