=== Monshiva – AI Receptionist & CRM ===
Contributors: monshiva
Tags: ai receptionist, voice assistant, chatbot, lead capture, crm
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Your AI receptionist on every page: voice & chat assistant, one-minute AI call-back for every lead, and all form leads in your CRM.

== Description ==

Monshiva answers your business phone with an AI receptionist that books appointments, follows up and keeps your CRM up to date. This plugin brings the same assistant to your WordPress site:

* **Voice & chat assistant on your site** – visitors talk or chat with the same AI that answers your phone. One switch, no code.
* **One-minute call-back (speed-to-lead)** – a visitor leaves a number and your AI assistant calls them back within a minute, answers questions and books a time.
* **Every form becomes a lead** – Contact Form 7, WPForms, Gravity Forms, Elementor Pro Forms, Ninja Forms, Fluent Forms and WooCommerce orders go straight into your Monshiva CRM. Name, mobile and email are detected automatically; every other field is kept in the lead note.
* **Nothing is lost** – if Monshiva cannot be reached, leads wait in a queue and are re-sent automatically (idempotent: never duplicated).
* **Dashboard widget** – today's conversations, bookings and call-back requests right on your WordPress dashboard.
* **Floating “call me in a minute” button** – opens the call-back form in a pop-up on every page; no page edits.
* **Click-to-call button** – floating on phones or anywhere with a shortcode.
* **Block & shortcodes** – “Monshiva call-back form” block, `[monshiva_callback]`, `[monshiva_call_button]`.
* **Private by design** – your API key stays on your server and is never sent to visitors' browsers. Phone numbers are masked in logs.
* **Site Health checks** – connection, key status and waiting leads appear in Tools → Site Health; a suggested privacy-policy paragraph is added to Settings → Privacy.
* **Per-form control** – list forms (e.g. a newsletter) whose leads should go to the CRM without a call.
* Persian (fa_IR) and English included; RTL ready.

== Installation ==

1. Upload the plugin and activate it.
2. In your Monshiva panel open “Connect website”, click “Create site key” and copy the key.
3. In WordPress open Monshiva, paste the key and click Connect. The assistant is enabled for your domain automatically.
4. Add the “Monshiva call-back form” block to a page, or keep using your existing forms.

== Frequently Asked Questions ==

= Do I need a Monshiva account? =
Yes. See https://monshiva.com/ for plans.

= Which phone numbers are accepted? =
Iranian mobile numbers in any form (09…, +98…, Persian digits).

= Does the plugin slow my site down? =
No. The assistant script loads deferred from monshiva.com; form leads are sent server-side after the form is submitted.

== Developers ==

* `monshiva_form_lead` (filter) – change a form lead before it is sent, or return false to skip it. Arguments: $lead, $source, $pairs.
* `monshiva_lead_submitted` (action) – after every lead, with the delivery result. Arguments: $lead, $result.

== External services ==

This plugin connects to Monshiva (https://monshiva.com/), the service you sign up for:
* `https://monshiva.com/api/public/v1/` – verifying your key, enabling the assistant for your domain, creating leads (name, mobile, email, the submitted form fields and the page URL) and reading your latest conversations for the dashboard widget. Only when you have connected an API key.
* `https://monshiva.com/widget/monshiva-widget.js` – the assistant on your pages, when enabled.
* `https://monshiva.com/wordpress/update.json` – checking for plugin updates.
Terms and privacy: https://monshiva.com/legal/

== Changelog ==

= 1.3.0 =
* New: website sign-ups become leads — Digits and other SMS login / sign-up plugins (phone saved in the user profile or used as the username) and WordPress registrations. Off by default; optional AI welcome call.

= 1.2.2 =
* Connection steps point to the new “Connect website” page of the Monshiva panel (one-click site key).

= 1.2.1 =
* Call-back form: a visitor whose device clock runs ahead is no longer mistaken for a bot (fill time is now measured in the browser).
* Call-back form: rate limits work per visitor behind CDNs and reverse proxies (Cloudflare, ArvanCloud), so busy sites are not blocked.

= 1.2.0 =
* Site Health checks (connection, rejected key, waiting leads, WP-Cron) and a Monshiva section in Site Health → Info.
* Suggested privacy-policy text in Settings → Privacy.
* “Forms that should not trigger a call” list.
* Developer hooks: monshiva_form_lead, monshiva_lead_submitted.

= 1.1.1 =
* The call-back form keeps working on sites where a security plugin blocks the REST API for visitors (automatic admin-ajax fallback).

= 1.1.0 =
* Floating “call me in a minute” button that opens the call-back form in a pop-up.
* Leads are kept (not lost) when the API key is revoked, with an admin notice to reconnect.

= 1.0.0 =
* First release.
