=== Bit – AI assistant for your website ===
Contributors: bitlogs
Tags: chatbot, ai, assistant, live chat, customer support
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.3.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds your Bit assistant to every page, and keeps it up to date with your posts and pages.

== Description ==

Bit answers your visitors' questions from your own site, hands them to your team when they want a person, and collects leads.

This plugin connects a WordPress site to a Bit account:

* **The chat on every page.** No code to paste.
* **Your content, as you publish.** New and updated posts and pages are sent to the assistant's knowledge a few seconds after you save them, and removed when you unpublish or delete them.
* **Order status for WooCommerce.** Customers give their order number and email, and the assistant tells them where their order is.
* **One click to connect.** Press Connect, sign in to Bit and pick your site. No keys to copy.

You need a Bit account. Your Bit site must list this site's address in its domains.

== External services ==

This plugin connects to Bit, a service run by AskBit at https://askbit.io.

* **The chat.** On every page of your site, visitors' browsers load Bit's script from askbit.io. When a visitor opens the chat, what they type is sent to Bit to be answered.
* **Your content.** When you publish, update, unpublish or delete a post or page (of the types you pick in Settings, Bit), its address, title, excerpt and text are sent to Bit, so the assistant can answer from it. "Send all content" sends every published post of those types.
* **Connecting.** Pressing Connect sends this site's address to Bit, and stores a key and a signing secret from Bit in your database.
* **Order status (WooCommerce, only if you turn it on).** When a customer asks the assistant about an order, Bit sends the order number and email they gave to this site, signed with the secret. If they match an order, the site answers with its status, dates, item names and quantities, total, payment and shipping method, any tracking added by the Shipment Tracking extension, and the latest notes you sent the customer. Addresses, phone numbers and payment details are never sent.

Nothing is sent before you connect.

Bit is provided by AskBit under its Terms of Service (https://askbit.io/legal/terms) and Privacy Policy (https://askbit.io/legal/privacy). The chat's own privacy notice links to the privacy policy address you set for your site in Bit.

== Installation ==

1. Install and activate the plugin.
2. Go to Settings, Bit and press Connect to Bit.
3. Sign in, pick your Bit site and press Connect.
4. Back in WordPress, press Send all content once.

== Frequently Asked Questions ==

= Do I need to send WooCommerce products? =

No. Bit reads your store's products, and checks prices and stock live as shoppers ask. Leave Products off unless you want their descriptions in the assistant's knowledge as well.

= Can I keep a post out of Bit? =

Password-protected and unpublished posts are never sent. For anything else, use the `bit_assistant_send_post` filter and return false.

= How does order status work? =

Turn on "Let the assistant look up orders" in Settings, Bit (it appears when WooCommerce is active). Bit adds an "Order status" tool to your assistant; you'll find it in Bit under Tools, where you can test it. The assistant asks for the order number and the email used at checkout, and only describes the order when both match. Your site must be on a public https:// address for Bit to reach it. Use the `bit_assistant_order_answer` filter to add to or trim what the assistant is told.

= How do I stop it? =

Settings, Bit, Disconnect. The chat leaves your pages and the key is revoked in Bit.

== Changelog ==

= 0.3.3 =
* Fix: activating the plugin no longer stops with a fatal error (a helper was defined twice).
* Tested with WordPress 7.1 and WooCommerce 11.3.

= 0.3.2 =
* Bit moved to askbit.io: the chat script and the connection now use the new address.

= 0.3.1 =
* Security: a signed-in customer now sees only the orders on their account. Guest orders placed with the same email show only when you tick "My store confirms customers' emails when they sign up", because on stores where anyone can register with any email, that email alone isn't proof.
* Wrong guest look-ups are counted per email, so a few wrong guesses no longer pause order look-ups for every customer.

= 0.3.0 =
* Recognise signed-in customers: the chat tells the assistant who is signed in (signed, so it can't be faked), so it greets them by name and looks up their own orders without asking for their email. On by default; switch it off under Settings, Bit.

= 0.2.0 =
* WooCommerce order status: the assistant looks up an order by number and email.
* "Send all content" also removes pages Bit still has from this site that no longer exist.
* A page Bit already knows keeps its kind (for example your About page) when the plugin sends it.

= 0.1.0 =
* First version: connect, the chat on every page, and content sent as you publish.
