=== rtAV Video Chat Bot ===
Contributors: rtavio
Tags: chatbot, ai, video, customer-support, live-chat
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.2
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add AI-powered video chat bot to your WordPress site with real-time video avatars.

== Description ==

rtAV Video Chat Bot brings cutting-edge AI customer support to your WordPress site. Embed a customizable video chat bot widget that provides real-time AI-powered conversations with video avatars.

= Features =

* Real-time video avatars - See your AI assistant come to life
* AI-powered conversations - Natural language understanding
* Customizable appearance - Match your brand colors and style
* Easy setup - Configure in minutes
* Flexible positioning - Place widget where it works best
* Custom AI instructions - Define how your assistant behaves
* Shortcode support - Embed anywhere with [rtav_vbot]

= Get Started =

1. Install and activate the plugin
2. Get your API key from platform.rtav.io
3. Configure in Settings > rtAV VBot
4. Enable the widget and start chatting!

= How It Works =

The plugin integrates rtAV's vBot widget into your WordPress site. The widget uses WebSocket connections to provide real-time AI conversations with synchronized video avatars. All configuration is done through the WordPress admin interface - no coding required.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/rtav-vbot`, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to Settings > rtAV VBot to configure the plugin.
4. Enter your rtAV API key (get one at platform.rtav.io).
5. Customize the appearance and behavior of your chat bot.
6. Enable the widget and it will appear on your site!

== Frequently Asked Questions ==

= Do I need an rtAV account? =

Yes, you need an account at platform.rtav.io to get your API key. Basic usage is available with a free account.

= Is it free? =

The plugin itself is free. rtAV platform usage may have associated costs. Check platform.rtav.io for current pricing.

= Where does the widget appear? =

By default, the widget appears in the bottom-right corner of your site. You can change this to bottom-left, top-right, or top-left in the settings.

= Can I customize the AI's behavior? =

Yes! Use the "AI Instructions" field in settings to define how your assistant should behave. For example: "You are a friendly customer support representative for an e-commerce store."

= Can I use a custom avatar face or voice? =

Yes, if you have custom faces or voices configured in your rtAV account, you can enter their IDs in the optional fields.

= Does it work on mobile? =

Yes, the widget is responsive and works on all devices including mobile phones and tablets.

= Can I embed it in specific pages only? =

You can use the [rtav_vbot] shortcode to embed the widget on specific pages. Otherwise, it appears site-wide when enabled.

== Screenshots ==

1. Plugin settings page in WordPress admin
2. Widget on a website (collapsed state)
3. Widget expanded with video avatar

== External services ==

This plugin connects to external services provided by rtAV (rtav.io) to enable AI-powered video chat functionality.

= What services are used and why =

* **JavaScript Widget Service** (https://platform.rtav.io/vbot.js): This external JavaScript file is loaded to display the video chat bot widget on your website. It is required for the widget to function.

* **API Service** (https://api.rtav.io/v1/realtime/client_secrets): The plugin connects to this API endpoint to obtain temporary ephemeral keys (client secrets) that allow end users to establish secure chat sessions with the AI video avatar.

= What data is sent and when =

* **API Key**: Your rtAV platform API key is sent to the API service each time a user opens the chat widget to authenticate and obtain a temporary session key. This happens automatically when the widget is initialized.

* **Session Configuration**: When requesting a client secret, the plugin sends your configured session settings (AI model, instructions, avatar settings) to create a personalized chat session.

* **User Chat Data**: Once a chat session is established, user messages and interactions are sent directly to rtAV's service for AI processing and video avatar generation. This data is transmitted in real-time during active chat sessions.

= Service Information =

* **Service Provider**: rtAV (rtav.io)
* **Terms of Service**: https://rtav.io/terms
* **Privacy Policy**: https://rtav.io/privacy
* **Account Management**: https://platform.rtav.io

= Important Notes =

* Using this plugin requires an active rtAV account with a positive balance.
* The service uses GPU-powered infrastructure with hourly billing rates.
* All chat sessions are processed on rtAV's servers.
* Review the privacy policy and terms of service before use.

== Changelog ==

= 1.1.1 = 
* Use wp_strip_all_tags() to sanitize the CSS block before passing it to wp_add_inline_style()
* Added esc_attr() to RTAV_VBOT_VERSION in wp_enqueue_script() and wp_register_style()
* Added esc_url() to RTAV_VBOT_PLUGIN_URL in wp_enqueue_style() and wp_enqueue_script()
* Data is escaped via wp_json_encode() in get_inline_script()
* All template output in templates/settings.php uses appropriate escape functions
* API responses use wp_send_json() which properly escapes JSON

= 1.1.0 =
* change <script> to wp_add_inline_script()
* change <style> to wp_add_inline_style()
* refactored enqueue_scripts()
* created helper methods get_inline_script() and get_inline_style()
* add version to settings page

= 1.0.1 =
* fix plugin check issues

= 1.0.0 =
* Initial release
* Basic widget embedding
* Admin settings page
* Customizable appearance and behavior
* Shortcode support
* API integration for client secrets

== Upgrade Notice ==

= 1.1.1 =
All fixes follow the "escape late" principle — escaping right before output, not when building variables.

= 1.1.0 =
Follow best practices script and style using wp_enqueue commands, sanitize for register_setting(), variables and options escaped when echo'd

= 1.0.1 =
Bug fixes and plugin check improvements.

= 1.0.0 =
Initial release of rtAV Video Chat Bot plugin.
