72% pardakht-delkhah

Code Review | پلاگین پرداخت دلخواه

WordPress plugin پلاگین پرداخت دلخواه scored72%from 54 tests.

About plugin

  • Plugin page: pardakht-delkhah
  • Plugin version: 2.9.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 26, 2017
  • Latest release: Jan 21, 2023
  • Number of updates: 42
  • Update frequency: every 49.9 days
  • Top authors: Goback2 (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active /32,409 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.08MB] [CPU: ▲1.85ms] Passed 4 tests

Server-side resources used by پلاگین پرداخت دلخواه
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.62 ▼1.81
Dashboard /wp-admin3.44 ▲0.1463.23 ▲11.11
Posts /wp-admin/edit.php3.28 ▼0.0845.58 ▲0.12
Add New Post /wp-admin/post-new.php6.03 ▲0.14101.64 ▼2.03
Media Library /wp-admin/upload.php3.36 ▲0.1357.21 ▲20.02
Gateway Settings /wp-admin/edit.php?post_type=cupri_pay&page=cupri-gateways3.4047.34
Export /wp-admin/edit.php?post_type=cupri_pay&page=cupri-export3.3648.82
Help /wp-admin/edit.php?post_type=cupri_pay&page=cupri-help3.3648.66
Custom link /wp-admin/edit.php?post_type=cupri_pay&page=cupri-custom-link3.3548.43
Custom Fields /wp-admin/edit.php?post_type=cupri_pay&page=cupri-fields3.3548.50
Settings /wp-admin/edit.php?post_type=cupri_pay&page=cupri-settings3.4449.82

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

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

Browser metrics Passed 4 tests

A check of browser resources used by پلاگین پرداخت دلخواه
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲4714.56 ▲0.211.76 ▼0.7842.16 ▼3.57
Dashboard /wp-admin2,242 ▲675.64 ▼0.0395.90 ▼27.2342.45 ▼7.59
Posts /wp-admin/edit.php2,144 ▲442.02 ▲0.0235.19 ▼0.7433.67 ▼4.87
Add New Post /wp-admin/post-new.php1,561 ▲3523.10 ▲0.09683.87 ▼42.5159.53 ▲2.97
Media Library /wp-admin/upload.php1,441 ▲414.17 ▼0.0795.05 ▼21.3941.61 ▼3.47
Gateway Settings /wp-admin/edit.php?post_type=cupri_pay&page=cupri-gateways1,1972.0632.4765.70
Export /wp-admin/edit.php?post_type=cupri_pay&page=cupri-export8912.0425.5731.36
Help /wp-admin/edit.php?post_type=cupri_pay&page=cupri-help8372.0425.6333.02
Custom link /wp-admin/edit.php?post_type=cupri_pay&page=cupri-custom-link8552.1724.5939.26
Custom Fields /wp-admin/edit.php?post_type=cupri_pay&page=cupri-fields1,2262.1231.6530.63
Settings /wp-admin/edit.php?post_type=cupri_pay&page=cupri-settings2,3006.96155.6282.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=cupri_pay&page=cupri-gateways
    • > Notice in wp-content/plugins/pardakht-delkhah/gateways.php+117
    Trying to access array offset on value of type bool
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=cupri_pay&page=cupri-fields
    • > Notice in wp-content/plugins/pardakht-delkhah/class-fields-generator.php+489
    Undefined index:
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=cupri_pay&page=cupri-fields
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 0% 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
Please take a closer look at the following
  • 23× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/pardakht-delkhah/help.php
    • > /wp-content/plugins/pardakht-delkhah/admin-export.php
    • > /wp-content/plugins/pardakht-delkhah/cupri.php
    • > /wp-content/plugins/pardakht-delkhah/admin-custom-fields.php
    • > /wp-content/plugins/pardakht-delkhah/gateways/initial.php
    • > /wp-content/plugins/pardakht-delkhah/class-payments-list-table.php
    • > /wp-content/plugins/pardakht-delkhah/admin-table-header.php
    • > /wp-content/plugins/pardakht-delkhah/extra.php
    • > /wp-content/plugins/pardakht-delkhah/class-meta-box.php
    • > /wp-content/plugins/pardakht-delkhah/gateways/class-cupri-melli-gateway.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/pardakht-delkhah/assets/styles/1.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/pardakht-delkhah/assets/styles/3.php:72
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/pardakht-delkhah/assets/styles/2.php:90

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

pardakht-delkhah/cupri.php 92% from 13 tests

The main file in "پلاگین پرداخت دلخواه" v. 2.9.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pardakht-delkhah.php" instead of "cupri.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin21,097 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP301,8767,89220,505
PO File1152171389
CSS222126
JavaScript19276
HTML1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity76.59
▷ Minimum class complexity1.00
▷ Maximum class complexity390.00
Average method complexity8.72
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes56
▷ Abstract classes11.79%
▷ Concrete classes5598.21%
▷ Final classes00.00%
Methods550
▷ Static methods30.55%
▷ Public methods54498.91%
▷ Protected methods61.09%
▷ Private methods00.00%
Functions36
▷ Named functions3597.22%
▷ Anonymous functions12.78%
Constants2
▷ Global constants2100.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 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/cancel.png1.73KB1.66KB▼ 3.84%
assets/checked.png1.41KB1.36KB▼ 4.07%