=== WebMate AI Assistant ===
Contributors: oguzhancem
Donate link: https://cyucel.tr
Tags: ai, chatbot, assistant, customer support, lead generation
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.2.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WebMate AI Assistant adds a customizable, glassmorphic AI chatbot to your WordPress site. Bring your own API key or use the WordPress 7.0+ AI Client.

== Description ==

WebMate AI Assistant is a professional AI chatbot plugin designed for clinics, consultants, and service-oriented businesses. It connects to your own AI provider account, so you stay in full control of your data and costs.

The plugin is built and maintained by **Oğuzhan Cem Yücel**.

= Key Features =

* Bring your own API key (OpenAI, Azure OpenAI, Anthropic, Google Gemini, or any OpenAI-compatible endpoint)
* WordPress 7.0+ AI Client support: uses the site-wide AI provider configured in Settings > Connectors
* Custom system prompt, welcome message, and trigger messages
* Page-based visibility controls (show on all pages, selected pages, or exclude specific pages)
* Automatic knowledge learning from your site pages or manual entries
* Lead generation with built-in contact form and session ratings
* Token usage and estimated cost tracking
* Spam guard and profanity filter
* Fully customizable glassmorphic design with primary color and launcher icon
* Detailed reporting and session management in the WordPress admin
* Shortcode support: `[webmate_ai_widget]`

= AI Providers =

WebMate AI Assistant works with any provider that uses an OpenAI-compatible chat completions API, plus dedicated support for Azure OpenAI, Anthropic Claude, and Google Gemini. On WordPress 7.0 or newer, the plugin can also use the built-in AI Client so credentials are managed centrally by WordPress.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/webmate-ai-assistant/`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **WebMate AI > Hızlı Kurulum** and follow the setup steps.
4. Enter your API key on the **WebMate AI > Ayarlar** page (WordPress < 7.0), or configure the provider in **Settings > Connectors** (WordPress 7.0+).
5. Customize the chatbot appearance and behavior, then save.

== Frequently Asked Questions ==

= Do I need my own API key? =

On WordPress versions older than 7.0, yes. WebMate AI Assistant connects to your own AI provider account and your API key is encrypted before it is stored in the database. On WordPress 7.0+, the plugin can use the built-in AI Client and the credentials configured under Settings > Connectors.

= Which AI providers are supported? =

OpenAI, Azure OpenAI, Anthropic Claude, Google Gemini, and any custom endpoint that implements the OpenAI chat completions format. On WordPress 7.0+, any provider registered with the WordPress AI Client can be used.

= Can I choose which pages the chatbot appears on? =

Yes. You can show the widget on all pages, only on selected pages, or hide it on specific pages.

= Is the chatbot mobile-friendly? =

Yes. The chat widget is responsive and works on desktop, tablet, and mobile devices.

= Where can I get support? =

You can reach out through the plugin support forums or visit https://cyucel.tr.

== External services ==

This plugin connects to third-party AI services to generate chatbot responses. The service used depends on the provider you select (or the provider configured in WordPress 7.0+ Settings > Connectors).

= OpenAI =

When the OpenAI provider is selected, the plugin sends the user's message and conversation context to OpenAI's API.
* Service: OpenAI API
* What is sent: chat messages, system prompt, model parameters (temperature, max tokens), and optional learned knowledge snippets
* When: each time the user sends a message in the chat widget
* Terms of service: https://openai.com/policies/terms-of-use
* Privacy policy: https://openai.com/policies/privacy-policy

= Anthropic =

When the Anthropic provider is selected, the plugin sends the user's message and conversation context to Anthropic's API.
* Service: Anthropic API
* What is sent: chat messages, system prompt, model parameters
* When: each time the user sends a message in the chat widget
* Terms of service: https://www.anthropic.com/legal/commercial-terms
* Privacy policy: https://www.anthropic.com/legal/privacy

= Google Gemini =

When the Google Gemini provider is selected, the plugin sends the user's message and conversation context to Google's Gemini API.
* Service: Google Gemini API
* What is sent: chat messages, system prompt, model parameters
* When: each time the user sends a message in the chat widget
* Terms of service: https://ai.google.dev/gemini-api/terms
* Privacy policy: https://policies.google.com/privacy

= Azure OpenAI / Custom endpoints =

When Azure OpenAI or a custom OpenAI-compatible endpoint is configured, the plugin sends the same chat data to the endpoint URL you provide. You are responsible for ensuring that endpoint's terms and privacy policy comply with your requirements.

= Automatic knowledge learning =

The plugin can fetch pages from URLs you define in the settings to build an internal knowledge base. These requests are made from your server to the URLs you specify.
* What is sent: a server-side HTTP GET request to the configured URLs
* When: manually via the "Şimdi Öğren" button or on the configured schedule (daily/weekly)
* What is stored: the page title and extracted text content in your local WordPress database

= Data collected and stored locally =

To provide chat sessions, lead tracking, and spam protection, the plugin stores the following data locally in your WordPress database:
* A randomly generated session key (cookie-based identifier)
* The page URL where the chat widget was opened
* Browser user agent and IP address of the visitor
* Chat messages and optional user-provided contact/rating information

This data is stored on your own server and is not sent to third parties except for the AI provider you choose. You should inform your visitors about this processing in your privacy policy.

== Screenshots ==

1. Glassmorphic chat widget on the frontend
2. AI provider settings in the WordPress admin
3. Knowledge base management screen
4. Session reports and export tools

== Changelog ==

= 1.2.0 =
* Added extra floating button (WhatsApp, phone, email, Telegram, Instagram presets)
* Fixed Custom API provider routing — no longer routed through WordPress AI Client
* Improved admin preset selector with inline vanilla JS for reliability
* Removed dismiss button from extra floating button

= 1.1.0 =
* Rebranded as WebMate AI Assistant with a distinctive plugin name and slug
* Added WordPress 7.0+ AI Client integration as the preferred AI provider mechanism
* Documented all external AI services in the readme with terms and privacy links
* Fixed register_setting sanitize_callback configuration
* Removed load_plugin_textdomain() (WordPress 4.6+ loads translations automatically)
* Fixed empty-session issue: sessions are now created only when a user sends a message
* Session list now defaults to showing only sessions with actual conversations
* Added advanced session filters: message status, minimum message count, page URL
* Improved pagination with WordPress-style paginate_links()

= 1.0.5 =
* Initial public release
* Support for OpenAI, Azure OpenAI, Anthropic, and Gemini providers
* Page-based visibility controls
* Knowledge base and automatic learning
* Lead generation, ratings, and contact forms
* Token usage and cost tracking
* Admin reports and session exports

== Upgrade Notice ==

= 1.2.0 =
Adds extra floating button feature and fixes Custom API provider routing.

= 1.1.0 =
Major update: plugin renamed to WebMate AI Assistant, adds WordPress 7.0 AI Client support, and improves session management. Existing settings and conversations are migrated automatically on activation.
