=== Batimo – AI Chatbot & Automation ===
Contributors: rezaplus
Donate link: https://batimo.ai
Tags: chatbot, ai, automation, whatsapp, ecommerce
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your WordPress site to Batimo — an AI sales assistant that chats with customers on WhatsApp, Instagram, and your website 24/7.

== Description ==

= What is Batimo? =

[Batimo](https://batimo.ai) is an AI-powered conversational platform built for businesses that want to stop missing customer messages and start closing more sales — automatically.

At the heart of Batimo is **Timo**, an AI sales assistant that chats with your customers in real time across multiple channels:

* **WhatsApp** — Respond to inquiries, qualify leads, and close sales without lifting a finger.
* **Instagram** — Automate DM conversations and convert followers into customers.
* **Website Chat** — Embed a smart chatbot widget that engages visitors around the clock.

Timo captures leads, books appointments (with Google Calendar sync), answers product questions, and processes orders — all from a single unified inbox. No technical knowledge needed to get started.

= The Batimo AI Plugin for WordPress =

This plugin is the official bridge between your WordPress / WooCommerce store and your Batimo account. Once connected, Timo can read your site's content, search your product catalog, and even generate pre-filled checkout links — turning conversations into completed orders.

**Key capabilities:**

* **One-click connection** — Paste your Batimo token and your site is linked instantly.
* **Webchat widget** — Automatically embed Timo's chat widget in your site footer.
* **AI Tools (MCP)** — Give Timo direct access to your WordPress content and WooCommerce store through secure, authenticated REST endpoints.
* **Per-tool control** — Enable or disable each AI tool individually from the admin panel.
* **Signed checkout links** — Timo can generate HMAC-secured, pre-filled checkout URLs and share them with customers inside the chat.
* **WooCommerce integration** — Product search, order creation, shipping info, payment methods, and more.
* **Built-in debug log** — A log viewer in the admin panel makes troubleshooting easy.

= Supported AI Tools =

**WordPress:**

* `get_posts` — Search and list published posts.
* `get_post` — Fetch a single post by ID.
* `get_page` — Fetch a single page by ID.
* `get_site_info` — Retrieve site name, description, and URL.

**WooCommerce (requires WooCommerce):**

* `get_products` — Search and list products with keyword, category, and price filters.
* `get_product` — Fetch full product details including gallery, attributes, variations, and pricing.
* `get_checkout_info` — Retrieve available payment methods, shipping zones, and required checkout fields.
* `get_checkout_link` — Generate a signed, pre-filled cart/checkout URL with selected items and coupons.
* `create_order` — Programmatically create a WooCommerce order on behalf of a customer.

= Third-Party Service =

This plugin connects to the **Batimo API** (`api.batimo.ai`) to:

* Authenticate and register your WordPress site with your Batimo account.
* Fetch the webchat embed script for your selected channel.
* Expose AI tools that allow your Timo assistant to query your site content and WooCommerce data.

**No data is ever sent to Batimo unless you explicitly connect your site using your token.** All communication is secured with Bearer token authentication stored in your WordPress database.

* [Batimo](https://batimo.ai)
* [Terms of Service](https://batimo.ai/terms-of-service/)
* [Privacy Policy](https://batimo.ai/privacy-policy/)

== Installation ==

1. Upload the `batimo-ai` folder to `/wp-content/plugins/` or install directly from the WordPress plugin directory.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → Batimo** in your WordPress admin.
4. Don't have a Batimo account? Sign up free at [console.batimo.ai](https://console.batimo.ai).
5. In your Batimo dashboard, copy your connection token and paste it into the plugin settings.
6. Click **Connect**, then select your chatbot channel and enable the webchat widget.
7. Turn on the AI tools you want Timo to use — your AI assistant is now live.

== Frequently Asked Questions ==

= Do I need a Batimo account? =

Yes. A free Batimo account is required. Sign up at [console.batimo.ai](https://console.batimo.ai) — no credit card needed for the free trial.

= Does this plugin require WooCommerce? =

No. The webchat widget and WordPress AI tools (posts, pages, site info) work without WooCommerce. WooCommerce is only required to use the e-commerce tools (products, orders, checkout links).

= Is the connection secure? =

Yes. The plugin generates a unique, cryptographically secure API key that is stored in your WordPress database. All REST endpoints require Bearer token authentication, and checkout links use HMAC-SHA256 signatures with expiry timestamps to prevent tampering.

= What data does Batimo access? =

Only the data you explicitly enable through AI Tools settings. Each tool is individually controlled — if you don't enable `get_products`, Timo cannot access your products. No data is ever sent passively or without your action.

= Does this plugin affect my site's performance? =

No. The plugin is lightweight. Admin assets only load on the Batimo settings page. The webchat script is fetched from Batimo once and cached via WordPress transients, so it does not make an external request on every page load.

= Which WordPress versions are supported? =

WordPress 5.8 or higher. Tested up to WordPress 6.9. Requires PHP 7.4 or higher.

= Can I use this plugin without the webchat widget? =

Yes. The webchat widget is optional. You can connect your site purely to enable AI tools for a WhatsApp or Instagram channel, without embedding anything on your site.

== Screenshots ==

1. Admin settings page — connection, webchat, and AI tools in one place.

== Changelog ==

= 1.0.0 =
* Initial release.
* One-click site connection with Batimo token.
* Webchat widget embedding with transient caching.
* MCP Streamable HTTP transport (JSON-RPC 2.0) for AI tools.
* 9 AI tools: get_posts, get_post, get_page, get_site_info, get_products, get_product, get_checkout_info, get_checkout_link, create_order.
* Per-tool enable/disable from the admin panel.
* Signed checkout link generation with HMAC-SHA256 and expiry.
* Built-in debug log viewer.
* Responsive admin settings page.

== Upgrade Notice ==

= 1.0.0 =
Initial release. Install, connect your site to Batimo, and let Timo start helping your customers.
