10% decimal-product-quantity-for-woocommerce

Code Review | Decimal Product Quantity for WooCommerce

WordPress plugin Decimal Product Quantity for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: decimal-product-q...
  • Plugin version: 10.31
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 10, 2021
  • Latest release: Aug 29, 2023
  • Number of updates: 34
  • Update frequency: every 25.7 days
  • Top authors: wpgear (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

700+ active /8,858 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.62ms] Passed 4 tests

This is a short check of server-side resources used by Decimal Product Quantity for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.46 ▼5.80
Dashboard /wp-admin3.34 ▲0.0449.40 ▲0.45
Posts /wp-admin/edit.php3.39 ▲0.0348.60 ▼3.08
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.90 ▼22.05
Media Library /wp-admin/upload.php3.26 ▲0.0337.46 ▲1.92

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
woodecimalproduct_updated_poductmeta
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Decimal Product Quantity for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.23 ▼1.162.16 ▲0.3742.54 ▼8.92
Dashboard /wp-admin2,205 ▲145.86 ▼0.04109.78 ▲10.1640.18 ▼3.63
Posts /wp-admin/edit.php2,091 ▲22.01 ▲0.0535.60 ▼5.3333.15 ▼4.50
Add New Post /wp-admin/post-new.php1,370 ▼16417.25 ▼5.87558.65 ▼33.2141.86 ▼9.64
Media Library /wp-admin/upload.php1,393 ▲54.21 ▲0.0496.36 ▼7.5141.58 ▼2.03

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • woodecimalproduct_updated_poductmeta
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/admin_setup_woo.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/options.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/admin_order.php:12
    • > PHP Notice
      Undefined variable: WooDecimalProduct_QuantityData in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/ajax_quantity.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/admin_setup_product.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/admin_setup_woo.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_send_json() in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/ajax_quantity.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/decimal-product-quantity-for-woocommerce/includes/admin_setup_category.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Invalid URI found ("wpgear.xyz/decimal-product-quantity-woo")
You can take inspiration from this readme.txt

decimal-product-quantity-for-woocommerce/decimal-product-quantity-for-woocommerce.php 92% from 13 tests

The principal PHP file in "Decimal Product Quantity for WooCommerce" v. 10.31 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 415 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,157 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP113341851,135
JavaScript16122

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected