=== CalcMagnet Calculators ===
Contributors: calcmagnet
Tags: calculator, mortgage, embed, lead capture, shortcode
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed your CalcMagnet calculators anywhere on your WordPress site with a shortcode or a block.

== Description ==

CalcMagnet Calculators lets you embed calculators built with CalcMagnet (mortgage and more) using a simple shortcode or a Gutenberg block. The calculator is served by CalcMagnet in a responsive iframe that resizes itself to fit its content.

* Shortcode: `[calcmagnet id="YOUR-CALCULATOR-ID" width="100%" align="center"]`
* Gutenberg block: "CalcMagnet Calculator"
* Optional default calculator ID, so `[calcmagnet]` works with no attributes
* Popup button: `[calcmagnet id="YOUR-CALCULATOR-ID" mode="popup" button_text="Calculate your payment"]`
* Floating button in a corner of every page (Settings > CalcMagnet)

= External service =

This plugin loads a script and an iframe from the CalcMagnet service (default `https://www.calcmagnet.com`) in the browser of each visitor when a calculator is displayed. The plugin itself makes no requests from your server. You can change the origin under Settings > CalcMagnet.

== Installation ==

1. Upload the `calcmagnet-calculators` folder to `/wp-content/plugins/`, or install the zip from Plugins > Add New > Upload.
2. Activate the plugin.
3. Optionally go to Settings > CalcMagnet to set a default calculator ID.
4. Add `[calcmagnet id="YOUR-CALCULATOR-ID"]` to a post or page, or insert the "CalcMagnet Calculator" block.

== Frequently Asked Questions ==

= Where do I find my calculator ID? =

In your CalcMagnet Dashboard, go to Calculators and use copy embed. The ID is the UUID in the embed code (the value of `data-calculator-id`).

= Does the free plugin include lead capture? =

Yes. The calculator is served by CalcMagnet, so lead capture, branded PDF and CRM push work on any plan. The plugin only embeds the calculator.

= The calculator does not appear. =

Check that the ID is a valid UUID. Logged-in editors see a notice when the ID is missing or invalid; visitors see nothing.

= Can I use a custom domain? =

Yes. Set the App origin under Settings > CalcMagnet. It must use https.

== Changelog ==

= 1.1.1 =
* The default CalcMagnet address is now https://www.calcmagnet.com. Sites that saved the earlier address keep working: it redirects.

= 1.1.0 =
* New: show a calculator as a button that opens it in a popup, or as a floating button in a corner of the page. Choose it in the block's "Popup button" panel, with the shortcode's `mode` attribute, or turn on a floating button for the whole site under Settings > CalcMagnet. Buttons use your CalcMagnet brand colour unless you choose one.

= 1.0.1 =
* Tested with WordPress 6.8. The embedded calculator now reports the page it is on, so leads record the correct source page and campaign, and fires a `calcmagnet:lead` event (plus GTM, GA4 and Meta Pixel events when present) when a lead is captured.

= 1.0.0 =
* Initial release: shortcode, Gutenberg block and settings page.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
