68% yandex-money-button

Code Review | Кнопка ЮMoney

WordPress plugin Кнопка ЮMoney scored 68% from 54 tests.

About plugin

  • Plugin page: yandex-money-button
  • Plugin version: 2.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.0-5.8
  • WordPress version: 5.9.2
  • First release: Dec 23, 2018
  • Latest release: Jan 8, 2022
  • Number of updates: 32
  • Update frequency: every 34.8 days
  • Top authors: milukove (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active / 11,636 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.18MB] [CPU: ▼282.31ms] 75% from 4 tests

This is a short check of server-side resources used by Кнопка ЮMoney
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,338.66ms on /wp-admin/admin.php?page=yandex-money-button)
PageMemory (MB)CPU Time (ms)
Home /8.35 ▲4.8369.02 ▲4.47
Dashboard /wp-admin8.37 ▲4.9655.02 ▲19.40
Posts /wp-admin/edit.php8.37 ▲4.7259.35 ▼27.96
Add New Post /wp-admin/post-new.php9.17 ▲2.19160.14 ▼1,125.13
Media Library /wp-admin/upload.php8.37 ▲5.0747.84 ▲22.88
Кнопка ЮMoney /wp-admin/admin.php?page=yandex-money-button8.371,338.66
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.3745.63

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 174 new files
Database: no new tables, 5 new options
New WordPress options
widget_ymb_button
fs_active_plugins
fs_gdpr
fs_accounts
fs_debug_mode

Browser metrics Passed 4 tests

An overview of browser requirements for Кнопка ЮMoney
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,986 ▲26424.69 ▲8.92158.04 ▲152.233.07 ▲0.63
Dashboard /wp-admin2,919 ▲586.02 ▼0.18113.52 ▼22.54190.88 ▲28.88
Posts /wp-admin/edit.php2,722 ▲343.24 ▲0.0067.23 ▲1.35166.71 ▲17.50
Add New Post /wp-admin/post-new.php1,685 ▲4719.79 ▼0.90442.91 ▼11.84169.38 ▲18.21
Media Library /wp-admin/upload.php1,726 ▲315.65 ▲0.15158.70 ▲14.93213.04 ▲20.36
Кнопка ЮMoney /wp-admin/admin.php?page=yandex-money-button1,2562.4855.24251.80
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4532.5060.09122.71

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/yandex-money-button/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 5 options
    • widget_ymb_button
    • fs_gdpr
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/yandex-money-button/freemius/templates/ajax-loader.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/yandex-money-button/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/yandex-money-button/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/yandex-money-button/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/yandex-money-button/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/yandex-money-button/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/yandex-money-button/freemius/templates/partials/network-activation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/yandex-money-button/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/yandex-money-button/freemius/templates/account/partials/addon.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

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
5 plugin tags: yandex, woo, woocommerce, block, widget

yandex-money-button/yandex-money-button.php 92% from 13 tests

The primary PHP file in "Кнопка ЮMoney" version 2.4.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 205 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected31,571 lines of code in 132 files:
LanguageFilesBlank linesComment linesLines of code
PHP1137,24316,19930,705
JavaScript562135726
CSS1383571
Markdown141069

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,908)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity86.87
▷ Minimum class complexity1.00
▷ Maximum class complexity2,908.00
Average method complexity4.64
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes24.26%
▷ Concrete classes4595.74%
▷ Final classes00.00%
Methods1,140
▷ Static methods17315.18%
▷ Public methods80070.18%
▷ Protected methods151.32%
▷ Private methods32528.51%
Functions101
▷ Named functions9998.02%
▷ Anonymous functions21.98%
Constants124
▷ Global constants9979.84%
▷ Class constants2520.16%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/yandex-money-button.png9.06KB4.62KB▼ 48.99%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%