10% komtetkassa

Code Review | КОМТЕТ Касса для WooCommerce

WordPress plugin КОМТЕТ Касса для WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: komtetkassa
  • Plugin version: 1.3.0
  • PHP compatiblity: 5.6.31+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6.1
  • WordPress version: 6.3.1
  • First release: Sep 23, 2017
  • Latest release: Aug 17, 2021
  • Number of updates: 10
  • Update frequency: every 143.3 days
  • Top authors: komtet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,302 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/komtetkassa/includes/class-komtetkassa-install.php+25
    Undefined variable: db_version

Server metrics [RAM: ▲0.15MB] [CPU: ▼2.65ms] Passed 4 tests

Analyzing server-side resources used by КОМТЕТ Касса для WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1439.23 ▼3.10
Dashboard /wp-admin3.46 ▲0.1552.31 ▲0.86
Posts /wp-admin/edit.php3.57 ▲0.2151.93 ▲2.26
Add New Post /wp-admin/post-new.php6.04 ▲0.1594.58 ▼10.20
Media Library /wp-admin/upload.php3.38 ▲0.1536.83 ▲1.83
KOMTET Касса /wp-admin/admin.php?page=komtetkassa3.3535.94
Отчеты /wp-admin/admin.php?page=komtetkassa-reports3.3539.28
Настройки /wp-admin/admin.php?page=komtetkassa-settings3.3532.13

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 40 new files
Database: 1 new table, 8 new options
New tables
wp_komtetkassa_reports
New WordPress options
recovery_mode_email_last_sent
widget_recent-posts
komtetkassa_db_version
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for КОМТЕТ Касса для WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.73 ▲0.381.80 ▲0.0642.31 ▼2.37
Dashboard /wp-admin2,218 ▲385.52 ▼0.1690.69 ▲1.5143.02 ▲0.65
Posts /wp-admin/edit.php2,126 ▲261.95 ▲0.0140.05 ▲2.7036.97 ▲2.07
Add New Post /wp-admin/post-new.php1,545 ▲1923.22 ▼0.52627.10 ▼42.6352.78 ▲2.06
Media Library /wp-admin/upload.php1,423 ▲234.34 ▲0.12102.16 ▼2.8144.46 ▲0.74
KOMTET Касса /wp-admin/admin.php?page=komtetkassa8391.516.5417.75
Отчеты /wp-admin/admin.php?page=komtetkassa-reports9552.1523.5328.74
Настройки /wp-admin/admin.php?page=komtetkassa-settings8391.128.1621.79

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=komtetkassa-settings
    • > Error in wp-content/plugins/komtetkassa/includes/views/html-admin-settings.php+63
    Uncaught Error: Call to undefined function wc_get_order_statuses() in wp-content/plugins/komtetkassa/includes/views/html-admin-settings.php:63
    Stack trace:
    #0 wp-content/plugins/komtetkassa/includes/class-komtetkassa-admin-settings.php(18): include()
    #1 wp-content/plugins/komtetkassa/includes/class-komtetkassa-admin.php(58): KomtetKassa_AdminSettings::out()
    #2 wp-includes/class-wp-hook.php(310): KomtetKassa_Admin::settings_page()
    #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 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/komtetkassa/includes/class-komtetkassa-report.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/komtetkassa/includes/libs/komtet-kassa-php-sdk/tests/VatTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Komtet\\KassaSdk\\Exception\\SdkException' not found in wp-content/plugins/komtetkassa/includes/libs/komtet-kassa-php-sdk/src/Exception/ClientException.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/komtetkassa/komtetkassa.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/komtetkassa/includes/class-komtetkassa-install.php:13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/komtetkassa/includes/class-komtetkassa-report.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/komtetkassa/includes/class-komtetkassa-report.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/komtetkassa/includes/libs/komtet-kassa-php-sdk/tests/QueueManagerTest.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: woocommerce, woo, ecommerce, woo commerce

komtetkassa/komtetkassa.php Passed 13 tests

The primary PHP file in "КОМТЕТ Касса для WooCommerce" version 1.3.0 is used by WordPress to initiate all plugin functionality
132 characters long description:
Фискализация платежей с помощью сервиса КОМТЕТ Касса для плагина WooCommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin2,320 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP365531,1321,965
Markdown21470355

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.62
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes619.35%
Methods158
▷ Static methods2717.09%
▷ Public methods15497.47%
▷ Protected methods10.63%
▷ Private methods31.90%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants70
▷ Global constants57.14%
▷ Class constants6592.86%
▷ Public constants65100.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
No PNG images were found in this plugin