10% paystar-wp-paid-downloads

Code Review | افزونه فروش فایل درگاه پی استار برای وردپرس

WordPress plugin افزونه فروش فایل درگاه پی استار برای وردپرس scored10%from 54 tests.

About plugin

  • Plugin page: paystar-wp-paid-d...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8.1
  • WordPress version: 6.3.1
  • First release: Dec 14, 2021
  • Latest release: Apr 15, 2022
  • Number of updates: 3
  • Update frequency: every 41.0 days
  • Top authors: mrfazeli666paystar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /244 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method paystarpaiddownloads_class::install() should not be called statically

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.22ms] Passed 4 tests

Server-side resources used by افزونه فروش فایل درگاه پی استار برای وردپرس
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.79 ▼33.35
Dashboard /wp-admin2.05 ▼1.265.94 ▼44.48
Posts /wp-admin/edit.php2.05 ▼1.316.34 ▼43.78
Add New Post /wp-admin/post-new.php2.05 ▼3.845.74 ▼95.26
Media Library /wp-admin/upload.php2.05 ▼1.184.86 ▼32.85
لينک هاي دريافت /wp-admin/admin.php?page=paid-downloads-links2.055.70
تنظيمات /wp-admin/admin.php?page=paid-downloads2.056.20
پرداخت ها /wp-admin/admin.php?page=paid-downloads-transactions2.055.40
اضافه کردن لينک /wp-admin/admin.php?page=paid-downloads-add-link2.056.20
فايلها /wp-admin/admin.php?page=paid-downloads-files2.055.52
اضافه کردن فايل /wp-admin/admin.php?page=paid-downloads-add2.055.54

Server storage [IO: ▲0.17MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 20 new files
Database: 4 new tables, 6 new options
New tables
wp_paystarpaiddownloads_downloadlinks
wp_paystarpaiddownloads_files
wp_paystarpaiddownloads_transactions
wp_paystarpaiddownloads_orders
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for افزونه فروش فایل درگاه پی استار برای وردپرس
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲17113.79 ▼0.507.95 ▲5.9941.07 ▼2.80
Dashboard /wp-admin2,245 ▲685.64 ▼0.0379.03 ▼21.9388.80 ▲43.58
Posts /wp-admin/edit.php2,153 ▲531.98 ▼0.0239.01 ▲3.4049.19 ▲11.19
Add New Post /wp-admin/post-new.php1,578 ▲5220.29 ▼2.81646.76 ▼45.8348.52 ▼9.24
Media Library /wp-admin/upload.php1,441 ▲414.13 ▲0.0097.72 ▼5.7381.27 ▲37.72
لينک هاي دريافت /wp-admin/admin.php?page=paid-downloads-links8891.9926.1465.55
تنظيمات /wp-admin/admin.php?page=paid-downloads1,1652.0524.9177.67
پرداخت ها /wp-admin/admin.php?page=paid-downloads-transactions8742.0024.4543.70
اضافه کردن لينک /wp-admin/admin.php?page=paid-downloads-add-link8312.0324.1839.38
فايلها /wp-admin/admin.php?page=paid-downloads-files9151.9924.4744.10
اضافه کردن فايل /wp-admin/admin.php?page=paid-downloads-add1,0302.0424.3387.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_paystarpaiddownloads_orders
    • wp_paystarpaiddownloads_files
    • wp_paystarpaiddownloads_transactions
    • wp_paystarpaiddownloads_downloadlinks
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paid-downloads-add
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paid-downloads-add
    • > Notice in wp-content/plugins/paystar-wp-paid-downloads/paystar-wp-paid-downloads.php+481
    Undefined variable: message
    • > GET request to /wp-admin/admin.php?page=paid-downloads
    • > Notice in wp-content/plugins/paystar-wp-paid-downloads/paystar-wp-paid-downloads.php+241
    Undefined index: updated
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paid-downloads-add
    • > Notice in wp-content/plugins/paystar-wp-paid-downloads/paystar-wp-paid-downloads.php+546
    Undefined variable: file_details
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paid-downloads-add
    • > Notice in wp-content/plugins/paystar-wp-paid-downloads/paystar-wp-paid-downloads.php+546
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=paid-downloads-add
    • > Notice in wp-content/plugins/paystar-wp-paid-downloads/paystar-wp-paid-downloads.php+511
    Undefined variable: files
    • > GET request to /wp-admin/admin.php?page=paid-downloads-add
    • > Warning in wp-content/plugins/paystar-wp-paid-downloads/paystar-wp-paid-downloads.php+511
    sizeof(): Parameter must be an array or an object that implements Countable

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: payment, file, gateway, file selling, download...

paystar-wp-paid-downloads/paystar-wp-paid-downloads.php 92% from 13 tests

The primary PHP file in "افزونه فروش فایل درگاه پی استار برای وردپرس" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,481 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP236181,736
PO File1169179410
CSS1510335

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity151.50
▷ Minimum class complexity9.00
▷ Maximum class complexity294.00
Average method complexity11.38
▷ Minimum method complexity1.00
▷ Maximum method complexity81.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/linkhistory.png0.52KB0.56KB0.00%
images/delete.png0.65KB0.67KB0.00%
images/download01.png0.52KB0.52KB0.19%
images/downloadlink.png0.54KB0.65KB0.00%
images/fancy_close.png1.48KB1.73KB0.00%