=== FirstFiveMin ===
Contributors: firstfivemin
Tags: ai receptionist, lead form, lead capture, appointments, sms
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

An AI receptionist for your site: new leads reach you first, and when you can't take them they get a call back and a booking.

== Description ==

FirstFiveMin answers your new leads while they are still interested — your phone rings first, and if
you cannot take it, an assistant calls them, qualifies them, and books them onto your calendar.

This plugin is the WordPress half of that, and it is deliberately small. You paste the widget key from
your FirstFiveMin dashboard, and the plugin loads the FirstFiveMin form on your pages. Everything else —
the form, the consent record, the call — happens in FirstFiveMin.

**Where the form shows.** Under Settings → FirstFiveMin, "Show as" offers three choices:

* **A corner button on every page** (the default). A small button sits in the corner of every page and
  opens the form. It adds nothing to your page layout. Above the form, the button can also offer the
  other ways to reach you that you turn on in FirstFiveMin: call, text, your reviews and your contact
  card. Each one shows only when it is set up there.
* **Only where you add it.** Add `[firstfivemin]` to a page or post, or the **FirstFiveMin form** block
  in the block editor, and the form shows right there.
* **Both.** The corner button on every page, and the form where you add it. On a page that has the
  form, the button takes the visitor to it.

**Your other ways to be reached, anywhere on your site.** Besides the form, the same shortcode and block
can place one of your other ways to be reached, wherever you want it: in the **FirstFiveMin form** block,
choose it under "What this block shows", or add a type to the shortcode:

* `[firstfivemin type="call"]` and `[firstfivemin type="text"]`: a Call or Text button for your own line.
* `[firstfivemin type="reviews"]`: a link to your reviews.
* `[firstfivemin type="contact"]`: "Save our contact", which opens your contact card.
* `[firstfivemin type="qr"]`: a QR code for your contact card, so a visitor on a computer can save you on
  their phone.
* `[firstfivemin type="page"]`: a link to your page on FirstFiveMin.
* `[firstfivemin type="book"]`: "Book a call", which opens the form at its time choice so the visitor picks when you call. It shows
  on a page that also has the form or the corner button.
* `[firstfivemin type="directions"]`: "Directions", a map link to the address you typed in FirstFiveMin (Settings, Quick replies),
  shown once you turn on the Directions tile on the Get leads page.

Each one shows only when it is set up in FirstFiveMin, with the same words and links as your corner
button. One that is not set up shows nothing, never a button that does not work. You can place as many
as you like on a page.

**How it looks.** Light, dark, or transparent (the form takes your site's colours), a button colour, how
round the corners are, the width, your site's font or the form's own, and which corner the button sits
in. A button colour too light for white text is refused and the standard blue is used, so the button
always stays readable. No choice changes the consent wording on the form. The same choices, with a live
preview, are on the Get leads page in FirstFiveMin.

**What it does not do.** We think a site owner should be able to check this in about a minute, so
there is not much to check:

* It makes **no outbound request of its own** — not on activation, not on save, not on a page view.
  The only thing that contacts FirstFiveMin is the form script, running in your visitor's browser.
* It **collects and stores no visitor data**. No database table, no cookie, nothing read about the
  visitor.
* It registers **no REST route and no AJAX handler**. Its shortcode and its block print an empty
  placeholder that the form fills.
* It uses no `eval`, no obfuscation, and runs no code it fetches on your server.
* When you uninstall it, it deletes its options and leaves nothing behind.

**One thing to set on the FirstFiveMin side.** On the same Get leads page in FirstFiveMin, add your
site under **Allowed website domains**, or leads from here are refused. That refusal is on purpose — it
is what stops somebody else embedding your form on their site and filling your dashboard.

== External services ==

This plugin shows the FirstFiveMin lead form, a service run by FirstFiveMin (https://firstfivemin.com/).
Your server never contacts FirstFiveMin because of this plugin. Everything below happens in your
visitor's browser, on the pages where the form or the corner button shows. Like any web request, each
one carries the visitor's IP address and browser details.

* **When the page loads:** the browser loads the form script from
  `https://firstfivemin.com/pages/widget/stl-widget.js` (or the FirstFiveMin address you set) and asks
  FirstFiveMin for the form's settings, sending your widget key and the page's language. On a page where
  you placed any of your other ways to be reached, it asks for those too (which ones the page has), and
  draws them from the answer.
* **When a visitor types a phone number and leaves that field:** the number is sent to FirstFiveMin to
  check whether it is outside calling hours, so the form can offer a time for the call. It is not saved.
* **Only if you are testing two versions of the form:** the browser remembers, for that visit only
  (session storage), which version it showed; and when the visitor first clicks into the form, a count
  that the form was started is sent, with nothing the visitor typed.
* **When a visitor submits the form:** what they typed (their name, phone, email and the other fields
  shown) and their answer to the consent question on the form are sent to your FirstFiveMin account,
  together with your widget key.
* **Why:** so your FirstFiveMin account receives the lead and can reach them as the visitor agreed.
* FirstFiveMin terms of service: https://firstfivemin.com/terms
* FirstFiveMin privacy policy: https://firstfivemin.com/privacy

The form also uses **Cloudflare Turnstile**, a check that tells people apart from automated spam. When a
visitor submits the form, the Turnstile check loads from `https://challenges.cloudflare.com/`, and
Cloudflare receives the browser and network details it needs for that check.

* Cloudflare Turnstile privacy addendum: https://www.cloudflare.com/turnstile-privacy-policy/
* Cloudflare terms of use: https://www.cloudflare.com/website-terms/

== Installation ==

1. Install and activate the plugin (Plugins → Add New → Upload Plugin, and choose the firstfivemin.zip
   from your FirstFiveMin Get leads page).
2. In FirstFiveMin, open **Get leads** and copy your widget key (it begins `wk_`).
3. In WordPress, go to **Settings → FirstFiveMin**, paste the key, and save.
4. In FirstFiveMin, on the same **Get leads** page, add this site under **Allowed website domains**.
5. A corner button now shows on every page. To show the form in a particular place instead, choose
   "Only where I add it" and add `[firstfivemin]` or the **FirstFiveMin form** block there.

Leave the key empty to switch the form off without deactivating the plugin.

== Frequently Asked Questions ==

= Where does the form appear? =

By default, behind a corner button on every page. Where you add `[firstfivemin]` or the FirstFiveMin
form block, the form shows there instead. Settings → FirstFiveMin → "Show as" changes this.

= Does this send anything to FirstFiveMin from my server? =

No. Your server never contacts FirstFiveMin because of this plugin. The form script runs in the
visitor's browser; "External services" above lists what it sends and when.

= Do I need a FirstFiveMin account? =

Yes — the key comes from your dashboard. The plugin is not useful on its own, which is why it asks
for the key up front rather than pretending to work without one.

= Why does my form not appear? =

The usual reasons: the key is missing or mistyped (the settings page refuses a key of the wrong shape
and tells you so), "Show as" is set to "Only where I add it" and the page has no `[firstfivemin]` or
block, or this site is not under Allowed website domains in FirstFiveMin (then the form shows but
refuses to send).

= Can the form match my site? =

Yes: light, dark or transparent, your button colour, corner roundness, width, font, and the button's
corner. The consent wording always stays as it is, and a button colour too light to read is refused.

= Do I need to update the plugin to get fixes to the form? =

No. The form script comes from FirstFiveMin, so improvements to the form reach your site on their own.
Plugin updates only change the plugin itself.

= Where does the data go, and who can see it? =

To your FirstFiveMin account, under the consent your visitor gives on the form itself. The plugin
adds nothing to that and cannot see it.

= Does it slow my site down? =

The script loads `async`, so it never blocks your page from rendering. The corner button is fixed in
place, so it does not move anything on your page.

== Privacy ==

This plugin stores four options in your WordPress database — your widget key, the FirstFiveMin
address, "Show as", and your look choices — and nothing else. It does not read or store any
information about your visitors. Information your visitors type into the FirstFiveMin form goes to
FirstFiveMin under the consent shown on that form; see https://firstfivemin.com/privacy and
"External services" above.

== Changelog ==

= 1.2.5 =
* Every function, constant and option now uses the "firstfivemin_" prefix. Settings saved by an earlier version are moved to the new names automatically, then the old ones are removed.

= 1.2.4 =
* Two more things the shortcode and the block can place: "Book a call" (the form, opened at its time choice) and "Directions"
  (a map link to your address). Directions shows only after you turn on its tile in FirstFiveMin.

= 1.2.3 =
* The shortcode and the block can now place your other ways to be reached, not only the form: a Call or
  Text button, your reviews, your contact card, a QR code for it, and a link to your page. In the block,
  choose under "What this block shows"; in the shortcode, add a type, e.g. `[firstfivemin type="call"]`.
  Each one shows only when it is set up in FirstFiveMin.

= 1.2.2 =
* A "Settings" link beside Deactivate on the Plugins list.
* Until you save your widget key, one notice on the Plugins list and the Dashboard links to the setting. It goes away once the key
  is saved.

= 1.2.1 =
* The corner button can also offer call, text, your reviews and your contact card above the form. You
  choose them on the Get leads page in FirstFiveMin; the plugin itself changes nothing and sends nothing
  new.

= 1.2.0 =
* New: a corner button on every page that opens the form — now the default. It adds nothing to your
  page layout and works from the key alone.
* New: the FirstFiveMin form block, beside the `[firstfivemin]` shortcode.
* New: "Show as" (corner button, only where you add it, or both) replaces "At the end of every page".
  A site that had turned that off keeps showing the form only where it was added.
* New: the look — light, dark or transparent, button colour, corners, width, font and the button's
  corner. A button colour too light for white text is refused.
* External services now lists everything the form sends and when, including Cloudflare Turnstile.

= 1.1.0 =
* Fix: the form now always shows. 1.0.0 put the form inside the page head, where nobody could see it.
* New: `[firstfivemin]` puts the form exactly where you want it; "At the end of every page" can be turned off.
* The form script is now loaded through WordPress's script API.
* Tested up to WordPress 7.1.

= 1.0.0 =
* First release: one key, one script tag.

== Upgrade Notice ==

= 1.2.4 =
Adds "Book a call" and "Directions" to what a shortcode or block can place. Nothing you have placed changes.

= 1.2.3 =
Place your call, text, reviews, contact card, its QR code or your page anywhere on your site, with the
same shortcode or block. Nothing you have placed changes.

= 1.2.2 =
A Settings link on the Plugins list, and a reminder to paste your key until you do. Nothing else changes.

= 1.2.1 =
Describes the corner button's other ways to reach you, chosen in FirstFiveMin. Nothing to change here.

= 1.2.0 =
The form now shows behind a corner button by default. If you had turned off "At the end of every page",
nothing changes: the form still shows only where you added it.
