=== Smashre AI Agent ===
Contributors: mirservices447
Tags: ai, chatbot, woocommerce, customer support, multilingual
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI chat assistant for WordPress, grounded in your own content. Captures leads, hands off to WhatsApp, answers in many languages, and supports WooCommerce.

== Description ==

Smashre AI Agent adds a smart AI chat widget to your WordPress site. It answers visitors using **your approved website content** — not random internet data — so replies stay accurate and on‑brand. It can capture leads, hand conversations to WhatsApp, take callback requests, email you transcripts, recommend WooCommerce products, and show an owner dashboard of what visitors ask (including the questions your AI could not answer, so you know what to add to your site).

**Key features**

* **Grounded AI answers** — replies come only from content you scan and approve, plus FAQs you add. No made‑up facts.
* **Custom Knowledge (FAQ)** — add your own question/answer pairs the AI can use, beyond your pages.
* **WooCommerce assistant** — sync your products so the AI can answer product, price and stock questions and recommend items (text only; no customer data leaves your site).
* **Multilingual** — answers in English, Urdu, Roman Urdu and many more.
* **Lead capture** — optional pre‑chat name/email/phone, included in the transcript so you can follow up.
* **WhatsApp handover & callback requests** — turn chats into real conversations in one tap.
* **Voice chat** — visitors can speak their question and hear replies, using their own browser (no extra cost).
* **Transcript email** — each completed chat emailed to you (or a chosen recipient).
* **Insights dashboard** — conversations, leads, callbacks and the top unanswered questions, with CSV export.
* **Weekly AI report** — an automatic weekly summary of activity and estimated time saved.
* **One‑click connect** — secure sign‑in links your site; reconnect any time with a clear Connected status and a Disconnect button.
* **Secure by design** — your backend token never reaches the browser; chat is proxied server‑side; only approved content is sent; per‑site scoped credentials.

Smashre AI Agent is WordPress‑first and works on any theme. Setup takes minutes: install, connect, scan your content, and go live.

= External services =

This plugin connects your site to the **SMASHRE AI** backend service (https://smashre.com) to generate AI replies and to store the knowledge you approve. You create and pair an account during setup.

What is sent, and when:

* **During pairing (setup):** your site URL and a one‑time pairing proof, to link your site to your account.
* **When you sync content / products:** the title, text and URL of the pages, FAQs and WooCommerce products **you approve** — so the AI can answer from them. No images and no customer/order data are sent.
* **When a visitor chats:** the visitor's message (and short recent chat context) is sent to generate a reply. Do not ask visitors to enter passwords or payment details in chat.

What is **not** sent: WooCommerce order and customer records are read **locally on your site** for order status and are never sent to the backend.

Service provided by SMASHRE AI. Terms: https://smashre.com/ · Privacy: https://smashre.com/ (see the site footer for the current Terms and Privacy pages).

== Upgrading from Smashre AI Agent ==

This release has a different WordPress plugin directory name. Back up your site and database before changing plugins. Deactivate the old plugin, but do not uninstall it (uninstall removes stored settings and reporting tables). Install and activate Smashre AI Agent and confirm the existing account connection, settings, and features before removing any old plugin files. Internal settings and database identifiers are retained for compatibility. Do not run both plugin versions simultaneously.

== Installation ==

1. In wp‑admin, go to **Plugins → Add New → Upload Plugin**, choose the Smashre AI Agent ZIP and click **Install Now**, then **Activate**.
2. Go to **Settings → Smashre AI Agent**.
3. Click **Connect Smashre AI**, sign in, approve your site, and finish — your backend URL and token fill in automatically.
4. Tick **Show widget on public pages**, set a title and welcome message, and **Save Changes**.
5. Click **Scan My Website**, approve the pages you want, then **Sync Approved Content**.
6. (Optional) Add FAQs, enable WhatsApp/voice, and — on WooCommerce stores — enable product sync.
7. Open your site: the chat bubble appears in the bottom‑right. Ask a question to confirm it replies.

== Frequently Asked Questions ==

= Does it work on any WordPress theme? =
Yes. The widget is self‑contained and loads on the front end regardless of theme.

= Where do the AI's answers come from? =
From the content you scan and approve, the FAQs you add, and (optionally) your WooCommerce products. If something isn't covered, the assistant says it cannot verify it and offers a handoff.

= Is my data safe? =
Your backend token is never exposed to browsers — chat is proxied server‑side. Only content you approve is sent. WooCommerce order/customer data stays on your site.

= Does it cost anything to run? =
The plugin is free. AI replies are generated by the connected Smashre AI backend; see https://smashre.com for plans.

= Does voice chat need any paid service? =
No. Voice uses the visitor's own browser (Web Speech API). It appears only where the browser supports it (best in Chrome/Edge).

= Can I use it on multiple sites? =
Yes. Each site connects independently with its own isolated, scoped credentials.

== Screenshots ==

1. The AI chat widget on a live site, answering a visitor.
2. Connecting the plugin to your Smashre AI account (one‑click, with a Disconnect option).
3. Settings: widget, lead capture, WhatsApp, voice and badge options.
4. Custom Knowledge — adding an FAQ.
5. Smashre AI Insights dashboard — leads, callbacks and top unanswered questions.
6. WooCommerce product sync (on stores running WooCommerce).

== Changelog ==

= 1.1.3 =
* New: AI Image Scanner. Reads text inside images on your approved pages (phone numbers, emails, addresses and service names in banners or graphics) that normal page scanning cannot see.
* Text is extracted on your secure Smashre AI backend — your AI key never reaches your website or visitors. Scanning runs only when you click "Scan Images on Approved Pages", and never during a visitor chat.
* Review before use: extracted text is shown as unverified and becomes part of a page's AI knowledge only after you tick "Use" and run Sync Now.
* Already-scanned images are skipped to save cost; "Rescan All" re-reads every image. Per-image size, type, rate and monthly limits apply.

= 1.1.2 =
* Knowledge sync reliability: initial scan now covers your published pages and posts (not just the 30 most recent), while still excluding private, draft and password-protected content.
* New "Sync Now" button plus a synchronization status panel: last sync time, number of pages indexed, and clear per-page errors (a changed page no longer silently aborts the whole sync).
* Automatic incremental sync (twice daily): already-approved pages are refreshed when their content changes, and pages that are unpublished or deleted are automatically removed from the AI's knowledge. New pages still require your approval.
* Improved extraction of contact details and quotation instructions (phone, email, address and "how to request a quote/proposal") so the AI can answer these even when they live in a contact form or footer.
* Existing approvals are preserved across re-scans when the page content is unchanged.

= 1.1.1 =
* Migration: backend service endpoint moved from ai.smashre.com to smashre.com. Updated pairing/connection, auto-update, and license links. After updating, reconnect from Settings > Smashre AI (one sign-in).

= 1.1.0 =
* New: Settings > Smashre AI License. Activate a Pro or Business license key, see your plan, status and renewal date, manage the websites on your license and open the billing portal.
* The license key is verified by the Smashre AI service and is not stored on your website.

= 1.0.9 =
* Widget styling: white launcher and Send button with dark text.

= 1.0.8 =
* Redesigned chat widget — larger, more professional: branded header with "Online" status, roomier bubbles, typing indicator, Expand button, polished composer; near full‑screen on mobile.

= 1.0.7 =
* Clear "Connected" status with a one‑click Disconnect button; reconnecting a site works in one sign‑in.

= 1.0.6 =
* WooCommerce product sync: answer product questions and recommend items (text only).

= 1.0.5 =
* Weekly AI report email (activity summary + estimated time saved).

= 1.0.4 =
* Voice chat (speak your question, hear replies) and an optional "AI by Smashre AI" badge.

= 1.0.3 =
* Custom Knowledge — add your own FAQ pairs for the AI to use.

= 1.0.2 =
* Fix: "start_failed" on sites with a persistent object cache.

= 1.0.1 =
* Auto‑updates, transcript email, lead capture, WhatsApp handover, callbacks, Insights dashboard.

== Upgrade Notice ==

= 1.0.9 =
Cleaner widget styling plus all the latest features — WooCommerce, voice, weekly report and one‑click connect.
