94% paystar-payment-for-mycred

Code Review | PayStar.ir Payment Method for MyCred

WordPress plugin PayStar.ir Payment Method for MyCred scored 94% from 54 tests.

About plugin

  • Plugin page: paystar-payment-f...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8.1
  • WordPress version: 5.8.1
  • First release: Oct 30, 2021
  • Latest release: Oct 30, 2021
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: mrfazeli666paystar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 11 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼145.63ms] Passed 4 tests

Server-side resources used by PayStar.ir Payment Method for MyCred
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.20 ▲13.18
Dashboard /wp-admin3.06 ▲0.0144.51 ▼2.73
Posts /wp-admin/edit.php3.11 ▲0.0136.99 ▼6.86
Add New Post /wp-admin/post-new.php5.42 ▼0.0188.45 ▼576.31
Media Library /wp-admin/upload.php3.00 ▲0.0035.08 ▲3.39

Server storage [IO: ▲0.45MB] [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: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for PayStar.ir Payment Method for MyCred
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.81 ▲0.229.75 ▼0.9145.59 ▼1.20
Dashboard /wp-admin2,973 ▲425.88 ▼0.10136.58 ▼5.67108.18 ▼0.07
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0267.96 ▲4.6687.29 ▼5.43
Add New Post /wp-admin/post-new.php1,672 ▼1118.70 ▼0.01360.09 ▲1.43107.77 ▼5.04
Media Library /wp-admin/upload.php1,807 ▼05.02 ▲0.01162.56 ▲8.13118.34 ▼7.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paystar-payment-for-mycred/paystar.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: payment, gateway, wordpress, paystar, mycred

paystar-payment-for-mycred/paystar.php 92% from 13 tests

The main file in "PayStar.ir Payment Method for MyCred" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("paystar-payment-for-mycred.php" instead of "paystar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin249 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2910185
PO File2141464

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png2.30KB2.32KB0.00%