
WooCommerce plugin: safe formula-based product pricing, closing CVE-2026-4001's eval()-based RCE
Price a product from customer-entered numbers using a formula -- evaluated safely, never with PHP's eval().
HDWebmobile Formula Pricing lets customers enter measurements or quantities on the product page, and prices the product live from a formula you write using those field names (e.g. 10 + width * height * 0.05 for a custom-cut material priced by area). This is a common real need for stores selling custom-sized fabric, framed prints, engraved items, or anything priced by dimension or quantity, not just a flat number.
A competing "Custom Product Addons Pro" plugin implemented formula-based pricing by passing the merchant's formula text straight into PHP's eval() at calculation time (CVE-2026-4001) -- an unauthenticated remote code execution vulnerability. This plugin closes that entire vulnerability class by construction:
eval(), no create_function(), no dynamic function dispatch of any kind anywhere in this plugin -- the only operations that can ever run are addition, subtraction, multiplication, and division of plain numbers.Standard WordPress plugin structure:
hdwebmobile-formula-pricing.php Bootstrap
includes/class-hdfp-activator.php
includes/class-hdfp-admin.php
includes/class-hdfp-cart.php
includes/class-hdfp-core.php
includes/class-hdfp-formula-evaluator.php
includes/class-hdfp-frontend.php
includes/class-hdfp-hub.php
includes/class-hdfp-product.php
Part of the HDWebmobile suite of focused, single-purpose WooCommerce plugins.
GPLv2 or later. See LICENSE.