=== CalcBold — Embeddable Calculators ===
Contributors: calcbold, semisoftwares
Tags: calculator, embed, shortcode, widget, finance, health, mortgage, bmi, loan
Requires at least: 5.5
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Drop any of CalcBold's free calculators into a post, page, or widget area with one shortcode. Auto-resizing, themeable, ad-free inside the embed.

== Description ==

**CalcBold** is a free hub of decision-grade calculators (loan, mortgage, BMI, percentage, retirement, tax brackets, and dozens more — see [calcbold.com](https://calcbold.com/) for the full catalogue). This plugin lets you drop any of them into your WordPress site with a single shortcode.

= Why use this plugin? =

* **Zero ads inside the embed** — the calculator on your page is clean. The "Powered by CalcBold" link footer is the only branding, and it opens in a new tab.
* **Auto-resize** — the iframe height matches the calculator content via `postMessage`. No scrollbar, no awkward whitespace.
* **3 size variants** — *Full* for blog posts, *Compact* for sidebars, *Mini* for at-a-glance widgets.
* **Theme picker** — light, dark, or auto (matches host site preference).
* **Brand accent** — pass a hex color and the calculator's primary accent matches your site.
* **Privacy-clean** — calculation runs entirely in the visitor's browser. No tracking cookies, no PII leaving the iframe.
* **Lazy-loaded + Cloudflare-cached** — negligible Core Web Vitals impact.
* **Free forever** — full access to every calculator at every variant, no signup.

= Quick start =

1. Install and activate the plugin.
2. Find your calculator's slug at [calcbold.com](https://calcbold.com/) (it's the URL segment, e.g. `loan-emi-calculator`).
3. Drop the shortcode into any post, page, or widget:
   `[calcbold id="loan-emi-calculator"]`
4. (Optional) Customise:
   `[calcbold id="bmi-calculator" variant="compact" theme="dark" accent="2563eb" width="640"]`

For a guided code generator with live preview, visit the **embed builder** at `https://calcbold.com/embed-builder/<calc-slug>` — pick the settings, copy the shortcode, paste into WordPress.

= Shortcode attributes =

* `id` — **required** — any CalcBold calculator slug.
* `variant` — `full` (default) · `compact` · `mini`. Comparison calculators ignore `mini` and fall back to `full`.
* `theme` — `auto` (default) · `light` · `dark`.
* `accent` — 6-char hex (no `#`). Optional; falls back to the calculator's category colour.
* `width` — fixed pixel max-width, 280–1200. Optional; defaults to 100 % responsive.

= Defaults =

Visit **Settings → CalcBold Embed** to set the default variant and theme used when a shortcode omits those attributes. Per-shortcode attributes always win.

== Installation ==

1. Upload the `calcbold-embed` folder to `/wp-content/plugins/`, or install via Plugins → Add New.
2. Activate through the **Plugins** menu in WordPress.
3. Visit **Settings → CalcBold Embed** to set defaults (optional).
4. Drop `[calcbold id="<slug>"]` into any post, page, or widget.

== Frequently Asked Questions ==

= Is the plugin really free? =

Yes — the plugin, every calculator, the API behind every answer, and the supporting platform are all free. The "Powered by CalcBold" footer link is the only catch and you can remove it on a Pro plan when that ships.

= Does the embed run scripts on my site? =

Only the resize loader (`embed.js`, < 1 KB gzipped, deferred). It listens for `postMessage` events from the iframe and resizes the iframe to its content height. Nothing else.

= Will my visitors see ads inside the calculator? =

No. The `/embed/*` surface on CalcBold is ad-free by design — both for cleaner UX on your site and to avoid AdSense's "widget designed to leech revenue" policy concerns. Ads only run on the main calculator page (calcbold.com), where the "Powered by" click-through lands.

= How does this affect Core Web Vitals? =

The iframe loads with `loading="lazy"` and is served from a Cloudflare edge cache. The resize loader is deferred. Net impact: zero on LCP and CLS, negligible on INP. Tested on a stock WordPress 6.5 install with default theme and Lighthouse mobile.

= Where do I find the calculator slugs? =

Every calculator's slug is the URL segment on calcbold.com. For example:

* Loan EMI Calculator → `loan-emi-calculator`
* BMI Calculator → `bmi-calculator`
* Percentage Calculator → `percentage-calculator`

The full list is at [calcbold.com](https://calcbold.com/) (currently 79 calculators across 7 categories).

= Can I customise the shortcode for a Gutenberg block? =

Use the standard **Shortcode** block in the Gutenberg editor. A dedicated CalcBold block with live preview lands in a future release (v0.2).

= Does this work with WordPress.com? =

The plugin works on **WordPress.com Business and higher** (plans that allow custom plugins). On Free / Personal / Premium plans, embed via the Custom HTML block using the iframe snippet from the [embed builder](https://calcbold.com/embed-builder/loan-emi-calculator) instead.

== Screenshots ==

1. The embed builder at calcbold.com/embed-builder/<slug> — pick settings, copy the shortcode, paste into WordPress.
2. Settings → CalcBold Embed admin page with default variant and theme controls.
3. Loan EMI Calculator embedded on a WordPress page (Full variant).
4. BMI Calculator embedded as a sidebar widget (Mini variant).

== Changelog ==

= 0.1.0 — 2026-04-29 =
* Initial alpha release.
* `[calcbold]` shortcode with `id`, `variant`, `theme`, `accent`, `width` attributes.
* Settings → CalcBold Embed admin page for default variant and theme.
* Resize loader auto-enqueued only on posts that contain the shortcode.

== Upgrade Notice ==

= 0.1.0 =
First public release.
