66% robokassa

Code Review | Robokassa payment gateway for Woocommerce

WordPress plugin Robokassa payment gateway for Woocommerce scored66%from 54 tests.

About plugin

  • Plugin page: robokassa
  • Plugin version: 1.5.7
  • PHP compatiblity: 5.6.32+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 10, 2018
  • Latest release: Nov 27, 2023
  • Number of updates: 89
  • Update frequency: every 20.4 days
  • Top authors: ipol (52.81%)robokassa (48.31%)

Code review

54 tests

User reviews

29 reviews

Install metrics

3,000+ active /35,601 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼3.27ms] Passed 4 tests

A check of server-side resources used by Robokassa payment gateway for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2937.43 ▼3.69
Dashboard /wp-admin3.60 ▲0.3048.57 ▼0.48
Posts /wp-admin/edit.php3.71 ▲0.3648.84 ▼3.88
Add New Post /wp-admin/post-new.php6.18 ▲0.2993.64 ▼5.01
Media Library /wp-admin/upload.php3.52 ▲0.2936.04 ▲6.94
Настройки Робокассы /wp-admin/admin.php?page=robokassa_payment_main_settings_rb3.6132.07

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, 16 new options
New WordPress options
robokassa_payment_FailURL
db_upgraded
widget_theysaidso_widget
robokassa_payment_type_commission
can_compress_scripts
robokassa_payment_who_commission
recovery_mode_email_last_sent
robokassa_payment_wc_robokassa_enabled
robokassa_payment_tax
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Robokassa payment gateway for Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲5914.14 ▼0.122.54 ▲0.6270.04 ▲25.17
Dashboard /wp-admin2,205 ▲245.61 ▼0.0894.57 ▼25.2744.18 ▼0.14
Posts /wp-admin/edit.php2,110 ▲131.98 ▼0.0341.67 ▲4.8138.22 ▲3.99
Add New Post /wp-admin/post-new.php1,533 ▲723.25 ▲0.16577.25 ▼40.0858.31 ▼8.21
Media Library /wp-admin/upload.php1,401 ▼24.21 ▲0.0297.84 ▼5.4641.06 ▼3.24
Генерировать YML /wp-admin/main_settings_rb.php?page=robokassa_payment_YMLGenerator260.410.0814.36
Скачать оферту /wp-admin/main_settings_rb.php?page=robokassa_payment_offer260.410.076.45
Основные настройки /wp-admin/main_settings_rb.php?page=robokassa_payment_main_rb260.410.096.11
Оплата по частям /wp-admin/main_settings_rb.php?page=robokassa_payment_credit260.410.136.13
Настройки СМС /wp-admin/main_settings_rb.php?page=robokassa_payment_sms_rb260.410.096.40
РобоМаркет /wp-admin/main_settings_rb.php?page=robokassa_payment_robomarket_rb260.410.068.35
Регистрация /wp-admin/main_settings_rb.php?page=robokassa_payment_registration260.410.096.30
Настройки Робокассы /wp-admin/admin.php?page=robokassa_payment_main_settings_rb7431.516.6921.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 16 options in the database
    • robokassa_payment_FailURL
    • robokassa_payment_wc_robokassa_enabled
    • db_upgraded
    • robokassa_payment_who_commission
    • robokassa_payment_sno
    • theysaidso_admin_options
    • widget_recent-posts
    • robokassa_payment_type_commission
    • recovery_mode_email_last_sent
    • robokassa_payment_paytype
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=robokassa_payment_main_settings_rb
    • > Error in wp-content/plugins/robokassa/labelsClasses.php+3
    Uncaught Error: Class 'Robokassa\Payment\WC_WP_robokassa' not found in wp-content/plugins/robokassa/labelsClasses.php:3
    Stack trace:
    #0 wp-content/plugins/robokassa/main_settings_rb.php(67): require_once()
    #1 wp-content/plugins/robokassa/wp_robokassa.php(842): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): robokassa_payment_main_settings()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 {main}
    thrown

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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/robokassa/data/robomarket_yml.php
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/robokassa/YMLGenerator.php:157
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/robokassa/templates/credit-menu-form.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/robokassa/sms_settings_rb.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/robokassa/main_settings_rb.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Robokassa\\Payment\\WC_WP_robokassa' not found in wp-content/plugins/robokassa/labelsClasses.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/robokassa/main_settings_registration.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/robokassa/templates/credit-menu-form.php:43
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/robokassa/classes/Robokassa/Payment/WC_WP_robokassa.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/robokassa/payment-widget.php:827
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/robokassa/templates/credit-menu-form.php on line 12

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/main_settings_rb.php?page=robokassa_payment_YMLGenerator
    • > Network (severe)
    wp-admin/main_settings_rb.php?page=robokassa_payment_YMLGenerator - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/main_settings_rb.php?page=robokassa_payment_offer
    • > Network (severe)
    wp-admin/main_settings_rb.php?page=robokassa_payment_offer - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/main_settings_rb.php?page=robokassa_payment_main_rb
    • > Network (severe)
    wp-admin/main_settings_rb.php?page=robokassa_payment_main_rb - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/main_settings_rb.php?page=robokassa_payment_credit
    • > Network (severe)
    wp-admin/main_settings_rb.php?page=robokassa_payment_credit - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/main_settings_rb.php?page=robokassa_payment_sms_rb
    • > Network (severe)
    wp-admin/main_settings_rb.php?page=robokassa_payment_sms_rb - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/main_settings_rb.php?page=robokassa_payment_robomarket_rb
    • > Network (severe)
    wp-admin/main_settings_rb.php?page=robokassa_payment_robomarket_rb - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/main_settings_rb.php?page=robokassa_payment_registration
    • > Network (severe)
    wp-admin/main_settings_rb.php?page=robokassa_payment_registration - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
  • Screenshots: These screenshots lack descriptions #-1, #-2, #-3 in robokassa/assets to your readme.txt
You can look at the official readme.txt

robokassa/wp_robokassa.php 92% from 13 tests

Analyzing the main PHP file in "Robokassa payment gateway for Woocommerce" version 1.5.7
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("robokassa.php" instead of "wp_robokassa.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin4,371 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP206094093,435
CSS31117606
JavaScript54817330

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity7.88
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods2781.82%
▷ Protected methods00.00%
▷ Private methods618.18%
Functions39
▷ Named functions3487.18%
▷ Anonymous functions512.82%
Constants24
▷ Global constants14.17%
▷ Class constants2395.83%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/rb-s1.png32.56KB16.58KB▼ 49.09%
assets/images/rb-s2.png69.87KB23.37KB▼ 66.55%
images/robokassa_help.png20.83KB11.41KB▼ 45.22%
images/RKLogo.png3.38KB2.13KB▼ 37.13%
assets/images/rb-s3.png33.34KB12.02KB▼ 63.93%