83% yandex-pay

Code Review | Yandex pay

WordPress plugin Yandex pay scored83%from 54 tests.

About plugin

  • Plugin page: yandex-pay
  • Plugin version: 1.1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.9
  • WordPress version: 6.3.1
  • First release: Dec 16, 2021
  • Latest release: Jul 15, 2022
  • Number of updates: 19
  • Update frequency: every 11.2 days
  • Top authors: alexkovalevv (84.21%)yandexpay (21.05%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /3,922 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Yandex pay
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.40 ▼1.75
Dashboard /wp-admin3.32 ▲0.0248.93 ▼3.69
Posts /wp-admin/edit.php3.37 ▲0.0146.63 ▼6.34
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.09 ▼12.17
Media Library /wp-admin/upload.php3.24 ▲0.0135.67 ▲1.79

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Yandex pay
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.23 ▼0.051.86 ▼0.3842.96 ▲0.64
Dashboard /wp-admin2,195 ▲185.58 ▼0.0888.20 ▼1.2740.20 ▼3.16
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0633.35 ▼8.3334.24 ▼1.79
Add New Post /wp-admin/post-new.php1,554 ▲918.50 ▼4.63667.15 ▼12.0062.52 ▼4.41
Media Library /wp-admin/upload.php1,394 ▼94.23 ▼0.01103.55 ▲0.3741.12 ▼4.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

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
Even though no errors were found, 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
The following issues need your attention
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'YandexPay\\Gateway\\Base' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-best2pay.php:13
    • > PHP Fatal error
      Trait 'YandexPay\\Helpers' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-base-abstract.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'YandexPay\\Gateway\\Base' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-rbkmoney.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'YandexPay\\Gateway\\Base' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-rbs.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'YandexPay\\Gateway\\Base' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-payture.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'YandexPay\\Gateway\\RBS' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-rbs-rshb.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'YandexPay\\Gateway\\RBS' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-rbs-mtsbank.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'YandexPay\\Gateway\\RBS' not found in wp-content/plugins/yandex-pay/includes/payment-methods/class-wc-ypay-method-rbs-alfabank.php:11

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 issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

yandex-pay/woocommerce-yandex-pay-gateway.php 77% from 13 tests

The main PHP script in "Yandex pay" version 1.1.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/i18n/languages/" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("yandex-pay.php" instead of "woocommerce-yandex-pay-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,572 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP145124941,970
JavaScript513747602

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity16.77
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces2
Interfaces0
Traits1
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods84
▷ Static methods00.00%
▷ Public methods6071.43%
▷ Protected methods2327.38%
▷ Private methods11.19%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants22
▷ Global constants522.73%
▷ Class constants1777.27%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin