=== ExpertToolkit Embeds ===
Contributors: experttoolkit
Tags: calculator, converter, unit converter, embed, widget
Requires at least: 6.3
Tested up to: 7.0
Stable tag: 2.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed free calculators and converters — wire gauge, concrete, roofing, BTU, solar, freight class, depreciation, nutrition and 800+ unit conversions.

== Description ==

ExpertToolkit Embeds drops a working calculator into any post or page. Pick a tool in the block editor, or paste a shortcode. The widget sizes itself to its content and retints itself to match your theme, so it looks like part of your site rather than a pasted-in box.

Every calculator computes from published standards, not from rounded-off rules of thumb — NEC 2023 Table 310.16 for wire ampacity, IRS Publication 946 for MACRS depreciation, NMFC density tiers for freight class, USDA data for nutrition, NIST/BIPM factors for unit conversion. Each widget links to a page showing its formula, assumptions and sources.

**Twelve tools**

* **Unit converter** — 800+ conversions across length, mass, temperature, volume, pressure, energy, data and more
* **Wire gauge (NEC)** — minimum AWG for a load, checking both ampacity and voltage drop
* **Concrete** — cubic yards, bag count and cost for a slab, footing or pad
* **Drywall** — sheets, area and cost, with real door and window deductions
* **Roofing** — squares, bundles and installed cost, with pitch slope factor and waste allowance
* **BTU / AC sizing** — cooling and heating load, then the nearest standard equipment size
* **Solar panel sizer** — system size, payback and 25-year savings from a monthly kWh bill
* **Freight class (NMFC)** — the class an LTL carrier needs before quoting
* **Dimensional weight** — billable weight against the carrier's real divisor
* **Depreciation** — full MACRS or straight-line schedule with the tax saving per year
* **Material density** — tons, cubic yards and gallons for 119 real materials
* **Nutrition** — weight, volume and nutrients for 100+ foods, density-aware

**How it behaves**

* **Auto-resize** — the widget reports its height; no double scrollbars, no clipped results
* **Adaptive theme** — measures your page background and matches it, light or dark, with no configuration
* **No layout shift** — space is reserved before the widget loads
* **Works without JavaScript** — a plain iframe fallback still renders the tool

Widgets are free and display a small "Powered by ExpertToolkit" credit.

== Installation ==

1. Install through **Plugins → Add New**, or upload the ZIP via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin.
3. In the editor, add the **ExpertToolkit Calculator** block and choose a tool. For the Classic editor, use a shortcode.

**Shortcode**

`[experttoolkit widget="wire-gauge"]`

`[experttoolkit widget="converter" category="length" converter="meters-to-feet"]`

Widget ids: `converter`, `wire-gauge`, `concrete`, `drywall`, `roofing`, `hvac`, `solar`, `freight-class`, `dim-weight`, `depreciation`, `material-density`, `nutrition`.

Optional attributes: `theme="auto|light|dark"`, `accent="#1d4ed8"`, `density="compact|comfortable|spacious"`, `controls="outline|filled|minimal"`, `height="360"`, `borderradius="12"`, `width="100%"`, and `path="..."` to address any widget route directly.

== Frequently Asked Questions ==

= Does this plugin load external code? =

No. All plugin code is bundled locally. The widget itself is displayed in an iframe served by experttoolkit.net, the same way a YouTube or Google Maps embed works.

= What data is shared with ExpertToolkit? =

Only what any iframe embed shares: the visitor's browser requests the widget from experttoolkit.net, which receives the request's IP address and standard headers. The plugin itself stores nothing, sets no cookies, and adds no tracking to your site.

= Is it free? =

Yes. Every widget is free, with a small "Powered by ExpertToolkit" credit under it.

= Which unit conversions are available? =

Any conversion on experttoolkit.net. Browse https://www.experttoolkit.net/us/convert and copy the category and pair from the URL — `/us/convert/length/meters-to-feet` becomes `category="length" converter="meters-to-feet"`.

= Can I change the credit link? =

The credit is the licence condition for using the widgets free of charge, so it is not removable from the settings. Developers can adjust its `rel` attribute with the `experttoolkit_embed_attribution_rel` filter.

== External services ==

This plugin displays calculators hosted by ExpertToolkit (https://www.experttoolkit.net).

When a page containing a widget is viewed, the visitor's browser loads an iframe from `https://www.experttoolkit.net/embed/...`. This is required for the widget to render — it is the service the plugin provides access to. The request includes the visitor's IP address, user agent and referring page, as with any embedded third-party frame. No data is sent when a page contains no widget, and the plugin transmits nothing from the WordPress admin.

Terms of service: https://www.experttoolkit.net/terms-of-service
Privacy policy: https://www.experttoolkit.net/privacy-policy

== Screenshots ==

1. Wire gauge calculator in a post on a dark page — the widget matches the host background automatically.
2. Concrete calculator on a light page — same plugin, no configuration changed.
3. Choosing a tool in the block editor, with a live preview and the settings panel.

== Changelog ==

= 2.0.0 =
* All twelve widgets are now available, not just unit converters: wire gauge, concrete, drywall, roofing, BTU/HVAC, solar, freight class, dimensional weight, depreciation, material density and nutrition.
* Block editor: tool picker grouped by trade, live preview, and appearance controls for accent colour, density and control style.
* Attribution links now point at the chosen tool's own page instead of always linking to a converter URL.
* Adaptive theming no longer reloads the widget — the background is measured before the first load rather than after it, removing a light-to-dark flash and a duplicate request.
* Added a `<noscript>` fallback so the tool still renders with JavaScript disabled.
* Added a `path` attribute for addressing any widget route directly.
* All appearance values are validated against the widget's own accepted values, so a typo is dropped instead of forwarded.
* Block registration now reads block.json in both PHP and JavaScript, fixing a name mismatch between the two.

= 1.1.0 =
* Adaptive theme (`theme="auto"`) — widget matches host site background.
* Fixed auto-resize (message type mismatch meant embeds had fixed height).
* Fixed unit dropdowns (`allowUnitChange` parameter was not applied).
* Market-neutral canonical embed URLs; deep backlink to the specific tool page.
* New `accent` attribute for brand-color tinting.

= 1.0.0 =
* Initial release: Gutenberg block + shortcode, iframe embeds, resize helper.

== Upgrade Notice ==

= 2.0.0 =
Adds eleven more calculators, a proper tool picker in the editor, and removes the theme flash on load. Existing shortcodes and blocks keep working unchanged.
