78% yookassa

Code Review | ЮKassa для WooCommerce

WordPress plugin ЮKassa для WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: yookassa
  • Plugin version: 2.6.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 22, 2020
  • Latest release: Oct 12, 2023
  • Number of updates: 80
  • Update frequency: every 12.8 days
  • Top authors: yoomoney (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

7,000+ active /62,738 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by ЮKassa для WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.85 ▼3.11
Dashboard /wp-admin3.31 ▲0.0044.12 ▼4.97
Posts /wp-admin/edit.php3.36 ▲0.0047.67 ▲3.73
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.31 ▼13.86
Media Library /wp-admin/upload.php3.23 ▲0.0035.51 ▼1.02

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 931 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by ЮKassa для WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.34 ▼0.221.91 ▲0.1537.41 ▼2.89
Dashboard /wp-admin2,195 ▲155.61 ▼0.0697.76 ▲9.9340.34 ▼7.79
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0540.42 ▲4.0036.96 ▼0.73
Add New Post /wp-admin/post-new.php1,526 ▼023.19 ▼0.10665.98 ▲8.4659.78 ▲12.05
Media Library /wp-admin/upload.php1,403 ▲34.17 ▲0.0395.43 ▼18.5043.78 ▼3.90

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/yookassa/includes/partials/widget.php
  • 479× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'YooKassa\\Common\\AbstractObject' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Webhook/Webhook.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'YooKassa\\Model\\PaymentMethod\\AbstractPaymentMethod' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodQiwi.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Deal/DealBalanceAmountTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\YooKassa\\Model\otification\\AbstractNotificationTest' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationWaitingForCaptureTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\YooKassa\\Request\\Payouts\\PayoutDestinationData\\AbstractPayoutDestinationDataTest' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payouts/PayoutDestinationData/PayoutDestinationDataBankCardTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'YooKassa\\Model\\PaymentData\\AbstractPaymentData' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataWechat.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'YooKassa\\Common\\AbstractObject' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Refund.php:51
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\YooKassa\\Request\\Receipts\\AbstractReceiptResponseTest' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/PaymentReceiptResponseTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'YooKassa\\Model\\PaymentMethod\\AbstractPaymentMethod' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodBankCard.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'YooKassa\\Request\\Payouts\\PayoutDestinationData\\AbstractPayoutDestinationData' not found in wp-content/plugins/yookassa/includes/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payouts/PayoutDestinationData/PayoutDestinationDataSbp.php:45

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
7 plugin tags: woocommerce, payment, kassa, yoomoney, yookassa...

yookassa/yookassa.php 92% from 13 tests

"ЮKassa для WooCommerce" version 2.6.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.2" instead of "3.7.0")

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 plugin124,480 lines of code in 896 files:
LanguageFilesBlank linesComment linesLines of code
Markdown24629,158063,079
PHP61210,00932,06758,663
PO File24545801,354
JSON2600725
CSS32117300
JavaScript21836196
XML462136
YAML18427

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity8.02
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces64
Interfaces42
Traits2
Classes563
▷ Abstract classes396.93%
▷ Concrete classes52493.07%
▷ Final classes00.00%
Methods4,771
▷ Static methods1082.26%
▷ Public methods4,31590.44%
▷ Protected methods2755.76%
▷ Private methods1813.79%
Functions27
▷ Named functions622.22%
▷ Anonymous functions2177.78%
Constants383
▷ Global constants61.57%
▷ Class constants37798.43%
▷ Public constants377100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 PNG files occupy 0.07MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ac.png2.02KB1.64KB▼ 18.83%
assets/images/sbp.png1.06KB0.99KB▼ 6.83%
assets/images/installments.png1.14KB1.45KB0.00%
assets/images/ma.png1.49KB1.54KB0.00%
assets/images/kassa.png3.34KB1.14KB▼ 65.75%