78% flexible-quantity-measurement-price-calculator-for-woocommerce

Code Review | Flexible Quantity - Measurement Price Calculator for WooCommerce

WordPress plugin Flexible Quantity - Measurement Price Calculator for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: flexible-quantity...
  • Plugin version: 1.0.22
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Jun 7, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 47
  • Update frequency: every 11.1 days
  • Top authors: wpdesk (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /15,103 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼8.37ms] Passed 4 tests

An overview of server-side resources used by Flexible Quantity - Measurement Price Calculator for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4643.44 ▼2.05
Dashboard /wp-admin3.76 ▲0.4648.93 ▲0.65
Posts /wp-admin/edit.php3.81 ▲0.4552.15 ▼12.04
Add New Post /wp-admin/post-new.php6.34 ▲0.4584.59 ▼18.87
Media Library /wp-admin/upload.php3.68 ▲0.4537.12 ▼0.51

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 443 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
plugin_activation_flexible-quantity-measurement-price-calculator-for-woocommerce/flexible-quantity-measurement-price-calculator-for-woocommerce.php
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
wpdesk_requirements_plugins_data
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Flexible Quantity - Measurement Price Calculator for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3114.25 ▲0.011.64 ▼0.2143.98 ▲0.03
Dashboard /wp-admin2,198 ▲185.51 ▼0.1286.59 ▼8.5038.38 ▼5.19
Posts /wp-admin/edit.php2,103 ▲31.94 ▼0.0236.19 ▼4.1534.83 ▼3.42
Add New Post /wp-admin/post-new.php1,529 ▲323.25 ▲0.14693.63 ▲5.3361.02 ▲4.93
Media Library /wp-admin/upload.php1,406 ▲64.20 ▼0.0397.77 ▼7.6141.74 ▼1.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • plugin_activation_flexible-quantity-measurement-price-calculator-for-woocommerce/flexible-quantity-measurement-price-calculator-for-woocommerce.php
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/row_open.php
    • > /wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/row_close.php
    • > /wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/all.php
  • 243× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/flexible-quantity-core/src/Admin/writepanels/panel-part/dimensions-decimals.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WDFQVendorFree\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/wp-logs/src/WC/WooCommerceHandler.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WDFQVendorFree\\Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php:18
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/all.php on line 29
    • > PHP Fatal error
      Uncaught Error: Interface 'WDFQVendorFree\\WPDesk\\Plugin\\Flow\\Initialization\\InitializationFactory' not found in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/wp-plugin-flow-common/src/Initialization/Simple/SimpleFactory.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woocommerce_wp_checkbox() in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/flexible-quantity-core/src/Admin/writepanels/measurements/volume-lxwxh.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WDFQVendorFree\\Monolog\\Handler\\MailHandler' not found in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WDFQVendorFree\\Monolog\\Handler\\BufferHandler' not found in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php:40
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/all.php on line 17
    • > PHP Fatal error
      Uncaught Error: Interface 'WDFQVendorFree\\WPDesk\\Persistence\\PersistentContainer' not found in wp-content/plugins/flexible-quantity-measurement-price-calculator-for-woocommerce/vendor_prefixed/wpdesk/flexible-quantity-core/src/WooCommerce/Persistence/WooCommerceProductContainer.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: measurement price, product quantity, price calculator, quantity increment, unit of measure

flexible-quantity-measurement-price-calculator-for-woocommerce/flexible-quantity-measurement-price-calculator-for-woocommerce.php 85% from 13 tests

This is the main PHP file of "Flexible Quantity - Measurement Price Calculator for WooCommerce" version 1.0.22, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "5.2")
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)

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
Good job! No executable or dangerous file extensions detected29,357 lines of code in 428 files:
LanguageFilesBlank linesComment linesLines of code
PHP3801,09615,13322,899
JavaScript121,4432,1584,607
JSON20001,044
CSS1411363782
Markdown25025

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity9.48
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces62
Interfaces42
Traits13
Classes275
▷ Abstract classes145.09%
▷ Concrete classes26194.91%
▷ Final classes218.05%
Methods1,845
▷ Static methods24113.06%
▷ Public methods1,44078.05%
▷ Protected methods20110.89%
▷ Private methods20411.06%
Functions89
▷ Named functions3842.70%
▷ Anonymous functions5157.30%
Constants185
▷ Global constants52.70%
▷ Class constants18097.30%
▷ Public constants15284.44%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.11MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.pl.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/flexible-quantity-core/assets/images/product-data-icon.png0.41KB0.83KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-marketing/assets/owl-slider/owl.video.play.png4.86KB2.74KB▼ 43.61%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%