=== Far Better Off Calculators ===
Contributors: calcwisehq
Tags: calculator, mortgage, loan, finance, embed
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Put a free financial calculator, or a live rates table that keeps itself current, on any post or page. No account, no ads, no cookies.

== Description ==

Far Better Off is a calculator, not a funnel. There is no signup, no email capture, no lead form, no ads and no tracking — a reader types a number and gets the answer as they type. This plugin puts one of those calculators on your site.

Three ways to add one, all of them the same widget:

1. **The block.** Add the "Far Better Off Calculator" block, pick a calculator from the dropdown, and see it in the editor. Set the theme, the maximum width, and starting numbers if you want the reader to arrive at a figure that suits your audience — a local lender can open the mortgage calculator at their own rate.
2. **The shortcode.** `[calcwise slug="mortgage-calculator"]` anywhere shortcodes run, including widgets and page builders.
3. **Paste the link.** With this plugin active, pasting a Far Better Off URL such as `https://farbetteroff.com/calculators/auto-loan-calculator` — or `https://farbetteroff.com/rates` — on its own line turns into the live widget, because the plugin registers Far Better Off as an oEmbed provider.

= The live tables =

Four of the choices in that dropdown are not calculators. They are tables of numbers that go out of date, and that is the point: you paste one once and it keeps itself current on your page after you have forgotten it is there.

* **Today's rates** — nine rates with their reading dates and their move since the last one, from the Federal Reserve's own feed, refreshed every six hours.
* **Mortgage rates** — the three rows a mortgage page wants: the 30-year and 15-year fixed national averages and the 10-year Treasury yield they track.
* **Savings & CD rates** — the national savings average, the 12-month CD average, and the Fed funds target both of them follow.
* **Money numbers** — ten figures a personal-finance page quotes and has to re-check every January: contribution limits, the standard deduction, the Social Security wage base and the rest.

There is nothing to set on one of these. No starting values, because there is no form; no compact layout, because the table is already the short form of its page. Pick it, pick a theme and a width, and you are done.

= What your readers get =

* 27 calculators: mortgage, mortgage payoff, refinance, rent vs buy, house affordability, debt-to-income, rent affordability, take-home paycheck, budget, salary to hourly, auto loan, car affordability, personal loan, credit card payoff, debt snowball vs avalanche, compound interest, net worth, retirement, 401(k), FIRE, Roth vs traditional, Roth IRA, 401(k) match, savings goal, CD, emergency fund and inflation.
* Answers that update as they type, with a plain-English explanation of the result.
* A widget that resizes itself to its content, so no calculator sits in a box with its own scrollbar.
* Light, dark, or whatever the reader's own device is set to — your choice, per widget.

= What it does to your site =

Close to nothing, which is the point.

* **No cookies.** The plugin sets none and the widget sets none.
* **No tracking scripts, no third-party requests from your server.** Your PHP makes no outbound call at all; the reader's browser loads the widget.
* **No database tables, no options, no cron jobs.** Deactivating it removes every trace except the shortcodes in your posts.
* **1.5 KB of JavaScript and 0.7 KB of CSS** before compression, loaded only on pages that actually show a calculator. Nothing at all is added to pages that don't.

= Honest about what the calculators do =

* The take-home paycheck calculator is **federal only** — federal income tax, Social Security and Medicare. It does not compute state or local income tax.
* The house-affordability and rent-vs-buy calculators do **not** include PMI. The mortgage calculator does.
* Every calculator is an estimate for planning, not tax, legal or investment advice.

== Installation ==

1. Install and activate the plugin.
2. Edit a post or page, add the **Far Better Off Calculator** block, and pick a calculator. Or type a shortcode: `[calcwise slug="mortgage-calculator"]`.
3. Publish.

There are no settings to configure and no account to create.

== Frequently Asked Questions ==

= Do I need an account or an API key? =

No. There is nothing to sign up for, and nothing to pay.

= How do I set a starting number? =

In the block, open **Starting numbers** in the sidebar. In a shortcode, add the field as an attribute: `[calcwise slug="mortgage-calculator" home_price="525000" rate="5.875"]`. Readers can change anything you set — a starting number is a starting point, not a lock.

= Can I preset a dropdown, not just a number? =

Yes — every dropdown the calculator has is in the same **Starting numbers** panel: the state a paycheck is taxed in and its filing status, a 15-year term instead of 30, monthly or yearly compounding, "minimum only" on the card payoff. Pick one and it rides in the widget the same way a number does. In a shortcode it is the field's own value: `[calcwise slug="mortgage-calculator" term_years="15"]`, or `[calcwise slug="take-home-paycheck-calculator" state="44" status="1"]` for Texas, married filing jointly.

= Which attributes does the shortcode take? =

`slug` (required), `theme` (`auto`, `light` or `dark`), `layout` (`standard` or `compact`), `max_width` in pixels, `height` in pixels, and any of the calculator's own fields in snake_case. For example:

`[calcwise slug="auto-loan-calculator" theme="dark" max_width="720" price="32000" rate="7.25"]`

= What does layout="compact" do? =

It trims the widget to the answer and the inputs — no chart, no breakdown, no schedule — and moves the answer above the sliders, which is what makes a calculator usable in a sidebar too narrow to scroll one into view. Asking for it also narrows the widget to 360px and starts it taller, so one attribute is the whole change:

`[calcwise slug="mortgage-calculator" layout="compact"]`

Set `max_width` as well if you want a different width; yours wins.

= Can I put two calculators on one page? =

Yes, including two copies of the same one. Each frame sizes itself independently.

= Will it match my theme? =

The widget uses its own typography inside the frame so it stays readable everywhere, and follows the reader's light/dark setting unless you pin it. The credit line below it inherits your theme's text color.

= Does it work with page builders and classic editor? =

Yes — anywhere `do_shortcode()` runs.

= Can I serve the calculators from somewhere else? =

Yes, with a filter, if you run your own copy of Far Better Off:

`add_filter( 'calcwise_base_url', function () { return 'https://calculators.example.com'; } );`

= Is the source available? =

Yes. Far Better Off is at github.com/calcwisehq/calcwise, MIT licensed, including the calculation library behind these widgets and a free, keyless JSON API.

== External services ==

This plugin displays calculators hosted by Far Better Off (https://farbetteroff.com), operated by the plugin author.

**What is sent, and by whom.** Your server sends nothing. When a visitor loads a page containing a calculator, their browser requests `https://farbetteroff.com/embed/<calculator>` in an iframe — carrying whatever a browser normally sends with any request (IP address, user agent, and a referrer header naming the page the widget is on) plus the settings you chose, such as the theme and any starting numbers. The widget then loads its own CSS and JavaScript from the same domain.

**What comes back.** The calculator. It sets no cookies, loads no third-party scripts and includes no advertising or analytics trackers.

**Where the reader's numbers go.** Nowhere. The calculators run entirely in the browser — what a visitor types is not sent to Far Better Off or to anyone else.

Privacy policy: https://farbetteroff.com/privacy

== Privacy ==

The plugin stores no personal data, sets no cookies and adds nothing to your database. It does not register with the WordPress privacy exporter or eraser because it has nothing to export or erase.

Note for site owners in the EU and UK: embedding any third-party frame means the visitor's browser contacts that third party. Nothing here sets a cookie or fingerprints anyone, but the request itself (and the IP address it carries) is what your own privacy policy should mention.

== Screenshots ==

1. The Far Better Off Calculator block selected in the editor. The preview is the live calculator, at the height that calculator actually is — not a placeholder and not a cropped box.
2. The block's Starting numbers panel. Every field the calculator has, dropdowns included: the state a paycheck is taxed in, the filing status, the loan term. Leave one alone and the calculator's own default stands.
3. A published post. The widget sits in the content column at your width, sized to its content, with the one small credit line under it.
4. One line of shortcode, pinned to dark and trimmed to the answer with layout="compact" — the sidebar-sized version, answer first.

== Changelog ==

= 1.3.0 =
* The block, the shortcode and a pasted link now reach Far Better Off's four live-data widgets, not only its 27 calculators: Today's rates, Mortgage rates, Savings & CD rates and Money numbers. A table you paste once and never come back to was the one thing this plugin could not put on a page.
* `[calcwise slug="rates"]` works anywhere shortcodes run, and the block's dropdown says which of the four you are picking — "3 of 9 rows" is the reason a mortgage page takes the narrower cut over the full table.
* Pasting `https://farbetteroff.com/rates` or `https://farbetteroff.com/money-numbers` on its own line now renders the widget. Previously only the `/embed/` form of that URL did, so the link you actually have in your clipboard stayed a link.
* Each live table opens at its own measured height and its own width, so it does not shift your page as it settles, and its "Powered by Far Better Off" link points at the page those numbers live on with their charts and history.

= 1.2.1 =
* Re-measured the height every widget opens at. The stored table had gone stale as the calculators grew: a mortgage widget 600px wide is 2,650px tall, not the 2,280 the last release shipped, and How Much House Can I Afford is 2,700px, not 1,920. Ten of the 27 moved; the other 17 measured the same to the pixel.
* Nothing you set changes. The bundled resize script corrected the frame either way, so what this removes is the jump between the two — the reason the measurement exists.

= 1.2.0 =
* The block's "Starting numbers" panel now offers every dropdown a calculator has, not only the boxes you type into: the state a paycheck is taxed in and its filing status, a 15-year term instead of 30, monthly or yearly compounding, "minimum only" on the card payoff, the mortgage's $/% down-payment toggle. That is 27 dropdowns across 15 of the 27 calculators, none of which the block could set before.
* The shortcode accepted these all along — `[calcwise slug="mortgage-calculator" term_years="15"]` has always worked — so this is the editor catching up with what the widget already did.

= 1.1.2 =
* Every widget now opens at the height that calculator actually is, instead of a single 640px (or 900px compact) for all 27. The frame was corrected within a moment of loading either way, but the correction was a jump — a mortgage widget 600px wide is 2,280px tall, so the post below it moved 1,640px on every page load. It no longer moves at all.
* The block's editor preview and its published frame both start at that measured height, with nothing for you to set.
* Fixed four starting numbers the block's "Starting numbers" panel had kept after the calculators themselves changed: home insurance ($1,800, now $1,900) on the mortgage and rent-vs-buy calculators, and the property tax rate (1.1%, now 0.89%) on rent-vs-buy and house affordability. Three newer fields the panel had never offered — utilities on rent affordability, running costs on car affordability and Social Security income on the retirement calculator — are there now too.

= 1.1.1 =
* The block's editor preview now sizes itself to the calculator, as the published page always did. Previously the editor showed the top 640px of it — or the top 900px of a compact widget — because the script that measures the frame does not run in the editor.
* Fixed the version the plugin stamped on its own script and stylesheet, which had stayed at 1.0.0 — so an upgrade could leave a browser using the cached 1.0.0 files.

= 1.1.0 =
* The `[calcwise]` shortcode and the block both take a `layout` attribute. `layout="compact"` trims the widget to the answer and the inputs for a sidebar, and starts it at 360px wide.
* A pasted compact embed URL now stays compact.

= 1.0.0 =
* First release: the Far Better Off Calculator block with a live editor preview, the `[calcwise]` shortcode, oEmbed support for pasted Far Better Off links, and 27 calculators.
