78% wc-kalkulator

Code Review | Product Fields, Addons and Price Calculator for WooCommerce

WordPress plugin Product Fields, Addons and Price Calculator for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: wc-kalkulator
  • Plugin version: 1.6.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 9, 2022
  • Latest release: Sep 20, 2023
  • Number of updates: 73
  • Update frequency: every 7.3 days
  • Top authors: wckalkulator (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

900+ active /6,389 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.65MB] [CPU: ▼1.58ms] Passed 4 tests

A check of server-side resources used by Product Fields, Addons and Price Calculator for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6726.70 ▼13.18
Dashboard /wp-admin3.95 ▲0.6551.42 ▲2.61
Posts /wp-admin/edit.php4.00 ▲0.6552.09 ▲1.56
Add New Post /wp-admin/post-new.php6.55 ▲0.6697.56 ▲2.71
Media Library /wp-admin/upload.php3.87 ▲0.6442.53 ▲9.75
Settings /wp-admin/admin.php?page=wck_settings3.7839.75

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Product Fields, Addons and Price Calculator for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,497 ▼24914.45 ▲0.150.70 ▼1.1518.96 ▼27.17
Dashboard /wp-admin2,235 ▲474.88 ▼1.02114.50 ▲1.7346.09 ▼0.62
Posts /wp-admin/edit.php2,121 ▲352.03 ▲0.0441.91 ▲3.7138.29 ▲2.99
Add New Post /wp-admin/post-new.php1,541 ▲2717.62 ▲0.06676.31 ▼3.0563.91 ▲5.54
Media Library /wp-admin/upload.php1,420 ▲324.26 ▲0.12101.53 ▼7.7149.20 ▲1.53
Settings /wp-admin/admin.php?page=wck_settings7902.0828.2728.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wc-kalkulator/vendor/symfony/expression-language/Resources/bin/generate_operator_regex.php
  • 100× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\ExpressionLanguage\\ParsedExpression' not found in wp-content/plugins/wc-kalkulator/vendor/symfony/expression-language/SerializedParsedExpression.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\ExpressionLanguage\ode\\ArrayNode' not found in wp-content/plugins/wc-kalkulator/vendor/symfony/expression-language/Node/ArgumentsNode.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/wc-kalkulator/vendor/symfony/service-contracts/ServiceProviderInterface.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Cache\\Adapter\\TraceableAdapter' not found in wp-content/plugins/wc-kalkulator/vendor/symfony/cache/Adapter/TraceableTagAwareAdapter.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarExporter\\Exception\\ExceptionInterface' not found in wp-content/plugins/wc-kalkulator/vendor/symfony/var-exporter/Exception/ClassNotFoundException.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WCKalkulator\\Fields\\SelectField' not found in wp-content/plugins/wc-kalkulator/src/Fields/ImageselectField.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WCKalkulator\\Fields\\TextField' not found in wp-content/plugins/wc-kalkulator/src/Fields/DatepickerField.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\Service\\ResetInterface' not found in wp-content/plugins/wc-kalkulator/vendor/symfony/cache/ResettableInterface.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\ExpressionLanguage\ode\ode' not found in wp-content/plugins/wc-kalkulator/vendor/symfony/expression-language/Node/NameNode.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WCKalkulator\\wp_die() in wp-content/plugins/wc-kalkulator/wc-kalkulator.php:22

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 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7 in wc-kalkulator/assets to your readme.txt
  • Contributors: Plugin contributors field is missing
Please take inspiration from this readme.txt

wc-kalkulator/wc-kalkulator.php 92% from 13 tests

The main PHP file in "Product Fields, Addons and Price Calculator for WooCommerce" ver. 1.6.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 197 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected21,095 lines of code in 308 files:
LanguageFilesBlank linesComment linesLines of code
PHP2483,1746,59516,142
JavaScript16177631,887
JSON13001,157
CSS112111776
Sass31450623
Markdown171780510

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity14.84
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces27
Interfaces24
Traits11
Classes148
▷ Abstract classes64.05%
▷ Concrete classes14295.95%
▷ Final classes139.15%
Methods976
▷ Static methods18518.95%
▷ Public methods79281.15%
▷ Protected methods969.84%
▷ Private methods889.02%
Functions92
▷ Named functions1516.30%
▷ Anonymous functions7783.70%
Constants71
▷ Global constants11.41%
▷ Class constants7098.59%
▷ Public constants4868.57%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_555555_256x240.png6.91KB4.18KB▼ 39.47%
assets/css/images/ui-icons_cc0000_256x240.png4.52KB4.18KB▼ 7.56%
assets/css/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
assets/css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
assets/css/images/ui-icons_777620_256x240.png4.57KB4.18KB▼ 8.43%