=== InstantQuote — Interactive Price Calculator & Quote Builder ===
Contributors: yanickk
Tags: calculator, cost calculator, quote, price estimator, interactivity api
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build ultra-fast interactive price calculators and instant quote forms 100% natively in Gutenberg, powered by the WordPress Interactivity API.

== Description ==

**InstantQuote** lets you build modern, lightning-fast price estimators and quote calculators directly inside the WordPress Block Editor (Block API v3) — with **zero jQuery and zero React on the front-end** thanks to the native **WordPress Interactivity API**.

Also works seamlessly with **Elementor, Divi, Bricks, and Classic Editor** via the built-in reusable Calculators library (`[instantquote id="123"]` shortcode and native Elementor widget).

= Key Features =

* **8 Modular Gutenberg Blocks (API v3 + SSR `render.php`)** :
  * Calculator container (Single page & Multi-step Wizard)
  * Range Slider with live value bubble & unit
  * Number input with `−` / `+` stepper buttons
  * Toggle switch (ON/OFF with attached price)
  * Single choice field (Dropdown, Radio buttons, or Clickable Visual Cards)
  * Multi-choice Checkbox Group (cumulative pricing)
  * Step container (for Multi-step Wizard mode)
  * Summary & Total block (breakdown, optional VAT/Tax, Quote form, WooCommerce Add-to-Cart, or URL Redirect with price params)
* **Secure Shared Math Engine (JS + PHP, zero `eval()`)** :
  * Operators: `+`, `-`, `*`, `/`, `^`, parentheses `()`
  * Business functions: `IF(cond, true, false)`, `MIN()`, `MAX()`, `ROUND(x, n)`
  * Comparison operators: `>`, `<`, `>=`, `<=`, `==`, `!=`
  * Live formula validation inside Gutenberg with unknown variable detection
* **Conditional Logic** : Show or hide any field in real time (`AND` / `OR` rules). Hidden fields automatically resolve to `0` on both client and server.
* **Server-Side Security** : Every submitted quote or WooCommerce cart addition is recalculated in PHP from the stored block schema (DevTools anti-tampering), protected by REST Nonces, Honeypot, and IP rate-limiting.
* **4 Built-in Theme Presets** : Minimal, Modern, Bordered, Dark.
* **3 Ready-to-Use Block Patterns** : Web Agency Quote, Craftsman / Renovation (m²), and SaaS Subscription Calculator.
* **Quotes Back-Office (`iq_quote`)** : Status pipeline (New, Contacted, Signed, Lost), printable PDF-ready quote template, CSV export, HTML emails, and async JSON Webhooks.
* **Native WooCommerce Integration** : Dynamically add server-calculated quotes to the WooCommerce cart with HMAC-signed prices and itemized options in cart, checkout, and order emails.

== Installation ==

1. Upload the `instantquote` plugin folder to `/wp-content/plugins/` or install the ZIP file via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Insert the **Calculateur InstantQuote** block in any page, or choose one of the 3 ready-made **InstantQuote Pro** Block Patterns.
4. To use inside Elementor, Divi, or Bricks, create a reusable calculator under **InstantQuote → Calculateurs** and copy the `[instantquote id="..."]` shortcode (or use the native Elementor widget).

== Frequently Asked Questions ==

= Does it load jQuery or React on the front-end? =
No. Front-end interactivity is powered exclusively by the native WordPress Interactivity API (`viewScriptModule`, ~15 KB minified).

= Can visitors manipulate the calculated price in DevTools? =
No. Before saving any quote or adding a dynamic product to WooCommerce, the server reloads the calculator block schema from the database, enforces field bounds/options, and recalculates the exact price in PHP.

= Does it work with Elementor or Divi? =
Yes. You can use the native Elementor widget or paste the universal `[instantquote id="123"]` shortcode into any page builder.

== Screenshots ==

1. Interactive multi-step calculator with visual cards, range slider, and conditional options.
2. Live Gutenberg editor with real-time formula validation and variable chips.
3. Quotes management back-office with statuses, CSV export, and printable PDF view.

== Changelog ==

= 1.0.0 =
* Initial release: 8 Block API v3 blocks, WordPress Interactivity API engine, shared JS/PHP AST formula parser, conditional logic, Elementor widget & shortcode, WooCommerce HMAC integration, quotes CPT, printable PDF, CSV export, webhooks, and 3 Block Patterns.
