=== Atina Chat ===
Contributors: atinachat
Tags: live chat, whatsapp, woocommerce, customer support, chat
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your store with Atina in one click: web chat on your site and a WhatsApp button. On the free plan a person from your team answers; with a paid plan, an AI agent does.

== Description ==

Atina Chat connects your WordPress site or WooCommerce store with [Atina](https://atina.chat), where your team answers your customers' conversations.

= One-click connection =

Click **Connect with Atina**, sign in or create a free account, choose the team that answers, and you are back in WordPress with the chat working. There is no code to copy and your site's domain is allowed automatically.

= Web chat on your site =

The Atina chat shows on your site's pages. By default it is hidden on checkout and on "My account", so it never gets in the way of a purchase. You can set the name shown, the color and the greeting of the chat from the plugin's settings; the position is set in the Atina panel. The chat always carries a small "Powered by atina.chat" label; with a paid plan you can remove it from the Atina panel.

= WhatsApp button =

A floating button that opens WhatsApp with your number and a ready-made message. On a product page the message includes the product name and link. The conversation happens in your own WhatsApp: the number stays in your WordPress and is not sent to Atina. The button works even if the site is not connected.

= Plans =

Who answers the chat depends on your Atina plan:

* **Free plan:** a person from your team answers every conversation from the first message, in the Atina panel. There is no AI on this plan.
* **Paid plans:** conversations start with an AI agent, which answers with your WooCommerce catalog and hands over to your team when needed. The agent turns on when you connect an agent to the channel from the Atina panel (**Channels**); until then, your team answers.

Limits and plan features are applied by Atina, never by the plugin. The plugin shows your plan and who answers, and links to upgrade it.

== External services ==

This plugin is the interface to an external service, **Atina** (https://atina.chat), operated by Atina. Without that service the web chat does not work; the WhatsApp button does not depend on it.

The plugin sends data to Atina only in these cases:

* **When you connect the site** (you click "Connect with Atina"): your browser goes to `app.atina.chat` with your site's address, the address of this plugin's settings page, a random one-time state, a security challenge and the plugin version. Then your server sends `app.atina.chat` a one-time code, its security verifier, your site's address and the plugin version, and receives the chat ID and a site token.
* **When you open the plugin's settings page:** your server sends the site token and the plugin version to `app.atina.chat` to read the connection and plan status (cached for 5 minutes). If the site is not connected, it asks `app.atina.chat` whether free licenses are available; that request carries no site data.
* **On your site's public pages:** visitors' browsers load the chat from `conversation.api.atina.chat`. What a visitor writes in the chat, the page they write from and an anonymous identifier stored in their browser are sent to Atina so your team can answer. The chat sets no cookies.
* **When someone opens a cart link from Atina's agent** (a link to your store ending in `?atina_cart=…`, only with WooCommerce): your server sends the site token and the link's code to `app.atina.chat`, and receives the WooCommerce product IDs and quantities to add to that visitor's cart. No visitor data is sent, and the prices are always your store's.
* **When you disconnect or uninstall the plugin:** your server sends the site token to `app.atina.chat` to revoke it.

The WhatsApp number you enter is never sent to Atina. The WhatsApp button only links to `wa.me`, which is operated by WhatsApp.

* Atina terms of service: https://atina.chat/terminos
* Atina privacy policy: https://atina.chat/privacidad
* WhatsApp terms and privacy: https://www.whatsapp.com/legal

== Installation ==

1. Install and activate the plugin from **Plugins → Add New**.
2. Go to **Atina Chat** in the admin menu and click **Connect with Atina**.
3. Sign in or create an account, choose the team and confirm. You are back in WordPress with the chat working.
4. Optionally, turn on the WhatsApp button and enter your number with the country code.

If your hosting does not let WordPress reach Atina, use manual mode: paste the chat ID shown in the Atina panel under "Install the chat", and add your site's domain there as allowed.

== Frequently Asked Questions ==

= Do I need an Atina account? =

Yes, for the web chat. You can create a free one while connecting. The WhatsApp button works without an account.

= Does the plugin read my WooCommerce orders or products? =

No. The plugin does not read or send your catalog or your orders. On paid plans with an AI agent, the catalog is connected from the Atina panel through WooCommerce's own authorization screen.

= Who answers the chat: a person or the AI? =

It depends on your plan. On the free plan a person from your team answers from the first message, with no AI. With a paid plan, conversations start with the AI agent once you connect an agent to the channel from the Atina panel (Channels), and your team can take over at any time.

= Where do the conversations go? =

Web chat conversations go to the team you chose, in the Atina panel. WhatsApp button conversations happen in your own WhatsApp.

= Can I hide the chat on some pages? =

Yes. Checkout and "My account" are hidden by default. Developers can use the `atina_chat_show_chat` and `atina_chat_show_whatsapp` filters.

= What happens if I uninstall the plugin? =

The connection is revoked in Atina and every option the plugin saved is deleted. Your conversations stay in Atina.

== Screenshots ==

1. Connect your site with Atina in one click.
2. Connected: your organization, team and plan, with the actions your plan allows.
3. Web chat and WhatsApp button settings.
4. The WhatsApp button and the Atina chat on a product page.

== Changelog ==

= 0.1.0 =
* First release: one-click connection with Atina, web chat, WhatsApp button, plan status and manual mode.

== Licenses ==

The Quicksand and Comfortaa fonts, used only on the plugin's settings page, are distributed under the SIL Open Font License 1.1; their license texts are in `assets/fonts/`.
