=== tufu AI ===
Contributors: tufu
Tags: chatbot, ai, support, live chat, search
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI support chat and docs search for small teams: answers from your own pages, each with its source, and a person when it can't help.

== Description ==

tufu answers your visitors from your website, docs and files. When it can't help, or a visitor asks for a person, it hands the conversation to your team, and you reply from where you already work.

What makes it different from other AI chat plugins:

* **Every answer cites its page.** Answers link to the page on your site they came from, so visitors can check them, and you can see what the bot read.
* **A real handoff to a person.** The visitor's question reaches your team in the tufu inbox and by email (and in Slack or Discord on the Team plan), and you reply from there. Your reply reaches the visitor in the chat, or by email if they left.
* **Docs search, not only a bubble.** The "tufu Ask" block (or the `[tufu_ask]` shortcode) puts a search box for your docs on any page, with short answers and links to the right pages.
* **Works on the free plan.** One bot, with the chat bubble and the Ask console, on as many pages as you like.

This plugin puts tufu on your WordPress site with no code:

* **Support chat**: a chat bubble on every page, or only on the pages you choose.
* **Ask console**: the "tufu Ask" block and the `[tufu_ask]` shortcode.
* **Connect in a minute**: press "Connect to tufu", sign in or create a free account, pick a bot, and you're back. No API key to copy, nothing secret stored on your site.

The look (colors, button, greeting) and what the bot knows are set in tufu, so they change on your site without touching WordPress.

= A plugin for a service =

The plugin is free and has no locked features: everything in it works the same on every plan. It shows a service that runs on tufu.ai, and you need a tufu account. tufu has a free plan, and a paid Team plan with more bots, answers and channels: https://tufu.ai/pricing/ . Plan limits are set and counted by tufu, not by this plugin.

On the free plan, the chat and the Ask console show a small "Powered by tufu" link to https://tufu.ai. On a paid plan you can hide it on the bot's Appearance page in tufu.

== External services ==

This plugin connects your site to tufu (https://tufu.ai), an AI support service run by tufu. Nothing is loaded or sent until you connect a bot in Settings > tufu AI.

* **Connecting your bot.** When you press "Connect to tufu" in Settings > tufu AI, your browser goes to https://tufu.ai/connect/wordpress/ with your site's address, the address of the settings page to come back to, and a random code that the plugin checks when you come back. You sign in to tufu there and pick a bot; tufu sends your browser back with the bot's team and bot IDs, which are public. No password or key passes through your site.
* **The chat bubble and the Ask console.** On pages that show them, your visitors' browsers load tufu's script from https://tufu.ai/widget/v1/tufu-chat.esm.js and fetch the bot's public settings from https://tufu.ai. When a visitor opens the chat or the Ask console, what they type is sent to tufu so the bot can answer. With these requests tufu receives the page address, the usual request data (IP address, browser user agent), and the plugin's name and version (`wordpress/0.2.0`), so tufu can tell WordPress installs apart. If a visitor asks for a person and leaves an email address, tufu uses it to send your reply.

The plugin itself stores only its settings (team, bot, where the chat shows) and, for 30 minutes while you connect, the random code; it sets no cookies. The chat remembers a visitor's conversation in their browser's storage for tufu.ai.

* Terms of Service: https://tufu.ai/terms/
* Privacy Policy: https://tufu.ai/privacy/

== Installation ==

1. Download the plugin from https://tufu.ai/integrations/wordpress/ , then in WordPress go to Plugins > Add New Plugin > Upload Plugin, choose the zip, install and activate it.
2. Go to Settings > tufu AI and press "Connect to tufu".
3. Sign in to tufu, or create a free account, and pick your bot (or make one). You come back to WordPress with it saved, and the chat bubble shows on your site.
4. For a docs search box, add the "tufu Ask" block to a page, or the `[tufu_ask]` shortcode.

Prefer to type it in? Under "Enter IDs instead", fill in the team and bot IDs from the snippet on your bot's Preview page in tufu.

== Frequently Asked Questions ==

= Does it slow my site down? =

The script loads only on pages that show the chat or the Ask console, as a small module after the page, and visitors' browsers cache it. The chat itself loads only when a visitor opens it.

= The chat bubble doesn't show =

Check that "Show the chat bubble" is ticked and that the page isn't ruled out by the page rules here or in tufu. If you use a caching plugin, clear its cache after connecting. Connecting makes the bot public and adds your site to its allowed websites when it needs that, so a bot you changed in tufu since may not show.

= I use Cloudflare Rocket Loader =

The plugin asks Rocket Loader to skip tufu's script. If the bubble still doesn't show, add a Page Rule that turns Rocket Loader off for your site, or exclude the script in your optimization plugin.

= Can I use a different bot for the Ask console? =

Yes: `[tufu_ask bot="your-docs-bot"]`, or set the Bot ID in the block's settings. It has to be a bot of the same team.

= Shortcode options =

`[tufu_ask placeholder="Search the help" hotkey="k"]`. `placeholder` is the text in the box; `hotkey` is the letter that opens it with Cmd or Ctrl (`hotkey=""` turns the shortcut off); `bot` uses another bot of the same team.

= What happens when I delete the plugin? =

Deleting it removes its settings from your site (every site, on a multisite network). Your bot and its conversations stay in tufu.

== Screenshots ==

1. The chat bubble on a WordPress site, answering from the docs, with a Talk to a human button.
2. The tufu Ask block: a search box for your docs, with a short answer and the pages to read.
3. Settings > tufu AI after connecting: the connected bot, and where the chat bubble shows.
4. Connect to tufu: tufu names your site, you pick the bot, and you're back in WordPress.

== Changelog ==

= 0.2.0 =
* "Connect to tufu": sign in, pick a bot, done. Replaces pasting an API key, so no key ever touches your site.
* "Disconnect", and "Enter IDs instead" for typing the IDs.
* Renamed to "tufu AI" (folder tufu-ai). Activating it carries over the settings of 0.1.0 and switches 0.1.0 off; delete 0.1.0 afterwards.

== Upgrade Notice ==

= 0.2.0 =
Connect with one button instead of an API key. Replaces the plugin "tufu" 0.1.0: activate this one, then delete the old one.
