=== ReplyIt Chat Widget ===
Contributors: replyitai
Tags: customer support, woocommerce, chatbot, live chat, ai chatbot
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered chat widget with WooCommerce and blog content integration for automated customer support and sales.

== Description ==

ReplyIt Chat Widget brings GPT-4 powered customer support directly to your WordPress website. Unlike basic chatbots with decision trees, ReplyIt understands natural language and provides intelligent, contextual responses 24/7.

= Key Features =

* **AI-Powered Responses**: GPT-4 understands context, handles complex questions, and provides accurate answers
* **WooCommerce Integration**: Order tracking, product search, cart assistance, stock information
* **Blog Content Integration**: AI can search, summarize, and discuss your blog posts with visitors
* **Easy Setup**: Just copy Widget ID and API Secret - no coding required
* **Multi-language Support**: Communicate in 20+ languages automatically
* **Mobile Responsive**: Perfect experience on all devices
* **Privacy Focused**: GDPR compliant with encrypted communications

= WooCommerce Features =

* **Order Tracking**: Customers ask "Where is my order?" and get real-time status
* **Product Search**: AI searches products by name, SKU, or category
* **Cart Assistance**: Help with cart issues and checkout questions
* **Stock Information**: Real-time availability and pricing
* **Proactive Messages**: Cart abandonment recovery and product page assistance

= Blog Content Features =

* **Content Search**: AI searches through your posts and pages to find relevant information
* **Article Summaries**: AI can summarize long articles and provide key takeaways
* **Smart Recommendations**: Suggests related articles based on conversation context
* **Category Browsing**: Visitors can ask about topics and get relevant posts

= Use Cases =

* **E-commerce**: Product questions, order tracking, cart recovery
* **Blogs**: Content discovery, article summaries, FAQ automation
* **Service Businesses**: Lead capture, appointment questions, service info
* **Education**: Course inquiries, enrollment help, content navigation

= Requirements =

* WordPress 5.8 or higher
* PHP 7.4 or higher
* Active ReplyIt account ([sign up free](https://replyit.ai))
* WooCommerce 5.0+ (optional, for e-commerce features)

== External Services ==

This plugin connects to the **ReplyIt.ai** external service (https://replyit.ai) to provide AI-powered chat functionality on your website. The plugin cannot function without this external service. All API requests are sent to the domain `https://replyit.ai`. Below is a detailed explanation of all external connections and data transmissions.

= Service Provider =

* **Service Name:** ReplyIt.ai
* **Website:** [https://replyit.ai](https://replyit.ai)
* **Terms of Service:** [https://replyit.ai/terms](https://replyit.ai/terms)
* **Privacy Policy:** [https://replyit.ai/privacy](https://replyit.ai/privacy)

= Data Transmitted =

**1. Chat Widget Script**

* **URL:** `https://replyit.ai/widget.js`
* **When:** On every page load where the widget is enabled
* **Data sent:** Widget ID (configured in settings)
* **Purpose:** Loads the chat interface for visitors

**2. Domain Registration**

* **URL:** `https://replyit.ai/api/widgets/{widget_id}/add-domain`
* **When:** When you save the plugin settings in the WordPress admin
* **Data sent:** Your website domain name
* **Purpose:** Registers your domain so the widget is authorized to load on your site

**3. WooCommerce Context Data**

* **URL:** `https://replyit.ai/api/widgets/{widget_id}/context`
* **When:** On page load when WooCommerce integration is enabled
* **Data sent:**
  - Current page type (product page, cart, checkout)
  - Cart contents (product names, quantities, prices) if on cart/checkout
  - Current product details if on a product page
  - Customer email and name (only if logged in and customer consented to chat)
* **Purpose:** Provides context to the AI so it can assist with relevant product and order queries

**4. Order Status Data**

* **URL:** `https://replyit.ai/api/widgets/{widget_id}/tools/order-status`
* **When:** When a customer requests order tracking through the chat widget
* **Authentication:** Server-to-server only (requires API Secret in X-Widget-Secret header)
* **Data sent:**
  - Order ID and order key (customer must provide from their confirmation email)
  - Order status and items
  - Shipping information
* **Purpose:** Enables the AI to provide order tracking information to verified customers
* **Security:** This endpoint is NOT publicly accessible - it requires valid API credentials

**5. WooCommerce Settings Synchronization**

* **URL:** `https://replyit.ai/api/widgets/{widget_id}/settings/woocommerce`
* **When:** When you save WooCommerce settings in the plugin admin
* **Data sent:** Feature enable/disable settings (e.g., order tracking on/off, product search on/off). No personal data is sent.
* **Purpose:** Synchronizes which WooCommerce features are enabled with the AI service

**6. Blog Settings Synchronization**

* **URL:** `https://replyit.ai/api/widgets/{widget_id}/settings/blog`
* **When:** When you save Blog settings in the plugin admin
* **Data sent:** Feature enable/disable settings (e.g., blog search on/off, blog content on/off). No personal data is sent.
* **Purpose:** Synchronizes which blog features are enabled with the AI service

= Data Security =

* All data is transmitted over HTTPS (encrypted in transit)
* API requests are authenticated using your Widget Secret (X-Widget-Secret header)
* Order data requires customer verification (order key) before retrieval
* No data is stored on ReplyIt servers longer than necessary for chat functionality
* You can delete all data by removing the widget from your ReplyIt dashboard

= User Consent =

We recommend informing your website visitors about the chat widget in your privacy policy. The widget only processes data when visitors actively engage with it or when they are logged in and have consented to data processing.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/replyit-chat-widget/` or install through WordPress admin
2. Activate the plugin through the 'Plugins' screen
3. Go to **ReplyIt Chat → Settings** in your WordPress admin
4. Enter your Widget ID and API Secret from your [ReplyIt Dashboard](https://replyit.ai/dashboard)
5. Enable WooCommerce and/or Blog Content features as needed
6. Save settings and your chat widget is live!

= Getting Your Credentials =

1. Sign up at [replyit.ai](https://replyit.ai)
2. Create a new Widget in your dashboard
3. Train your AI with your business information
4. Copy the Widget ID and API Secret
5. Paste them in the plugin settings

== Frequently Asked Questions ==

= Do I need a ReplyIt account? =

Yes, you need to sign up at [replyit.ai](https://replyit.ai) and create a widget to get your Widget ID and API Secret. We offer a free plan to get started.

= Is it free? =

The WordPress plugin is free. ReplyIt offers a free plan with limited messages per month. Paid plans are available for higher usage and additional features.

= Does it work without WooCommerce? =

Yes! The widget works on any WordPress site. WooCommerce integration is optional and only appears if WooCommerce is installed.

= Can the AI access my blog content? =

Yes! With Blog Content Features enabled, the AI can search your posts and pages, summarize articles, and recommend related content to visitors.

= Is my data secure? =

Yes. All communication is encrypted (HTTPS) and we're GDPR compliant. See our [Privacy Policy](https://replyit.ai/privacy) for details.

= Can I customize the widget appearance? =

Yes, customize colors, position, welcome messages, and avatar from your ReplyIt Dashboard.

= What languages does it support? =

The AI can communicate in 20+ languages. It automatically detects and responds in the visitor's language.

= Can I have multiple widgets on one site? =

Currently, the plugin supports one widget per WordPress installation.

== Screenshots ==

1. Chat widget on your website - clean, modern design
2. Plugin settings page - easy configuration
3. WooCommerce integration settings
4. Blog content settings
5. Mobile responsive view
6. Analytics dashboard in ReplyIt

== Changelog ==

= 1.0.2 =
* Security: Order lookup endpoint now requires server authentication (X-Widget-Secret header)
* Security: Removed public access to sensitive order data - endpoint is no longer publicly accessible
* Security: Added WooCommerce order_key verification as secondary authentication layer
* Security: Removed order_key from API responses to prevent token exposure
* Improved: Comprehensive external services documentation in readme
* Improved: Clear documentation of which endpoints are public vs authenticated

= 1.0.1 =
* Added Blog Content Integration feature
* AI can now search, summarize, and discuss blog posts
* Added content search functionality
* Added article summary feature
* Added related posts recommendations
* Improved WooCommerce order tracking
* Bug fixes and performance improvements

= 1.0.0 =
* Initial release
* WordPress integration
* WooCommerce deep integration
* Multi-language support
* Mobile responsive design

== Upgrade Notice ==

= 1.0.2 =
Security enhancement: Order tracking now uses secure order_key verification. Update recommended for improved security.

= 1.0.1 =
New Blog Content Integration feature! AI can now search and summarize your blog posts. Update recommended.

= 1.0.0 =
Initial release of ReplyIt Chat Widget.
