=== MW Messenger Button ===
Contributors:      igor800
Tags:              whatsapp, chat, ai chatbot, floating button, contact
Requires at least: 5.0
Requires PHP:      7.2
Tested up to:      7.1
Stable tag:        1.8.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Plugin URI:        https://moiseefweb.com/en/news9
Author URI:        https://moiseefweb.com

Floating WhatsApp button with animations, plus an optional AI assistant chat: paste a Claude, OpenAI or free OpenRouter key and it answers visitors.

== Description ==

MW Messenger Button is a lightweight and customizable plugin that adds a beautiful floating WhatsApp contact button to your WordPress site — and, if you want, an AI assistant that answers your visitors' questions in a small chat window.

**AI assistant (new in 1.8.0, optional):**

- 🤖 Paste your own Claude (Anthropic), OpenAI or OpenRouter API key in the settings and a chat button appears on your site — no other setup, no account with us
- 🆓 Free option: an OpenRouter key works with free AI models (simpler answers, a limited number of messages per day)
- 💸 The cheapest model of your provider is used by default; type a stronger one if you want smarter answers
- 📝 Describe your business in plain words (services, prices, opening hours); the assistant answers from that text and says so when it does not know
- 🌍 Replies in the language the visitor writes in
- 💬 A "WhatsApp" link inside the chat hands the visitor over to you
- 🔒 Your API key stays on your server and is never sent to the visitor's browser
- 💰 A daily message limit and a per-visitor limit keep your AI bill under control
- ✅ A "Test the assistant" button shows right away whether the key works

The AI assistant is off until you save an API key. With Claude and OpenAI you pay the provider directly for what the assistant uses; OpenRouter has free models. The plugin itself is free.

**Key features:**

- 🔧 Customize phone number, button color and text
- 🎯 Control button position: vertical & horizontal offsets
- ↔️ Align button to the left or right side
- 📐 Set a custom button size for desktop and mobile
- 🎬 Choose a hover animation: grow, bounce, pulse, rotate, shake, wobble or tada
- ✨ Choose an entrance animation: fade, slide up or zoom in
- 🌀 Turn the pulsing rings on/off and pick their speed (slow, normal, fast)
- 🖱️ Optionally show the button only after the visitor scrolls down
- ♿ Respects the visitor's "reduce motion" accessibility setting
- 🎨 Add your own CSS class and/or ID
- 💬 Set a default message (e.g. `Hello, I'm interested in your services`)
- 👁️ Hide the button on desktop or mobile devices
- 🎭 Choose between two styles: classic icon or button with text
- 📱 Fully responsive design

Perfect for support, chat, sales, and direct contact.

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the "Plugins" menu in WordPress
3. Open the **MW Messenger Button** menu in the WordPress admin sidebar to configure the options
4. Enjoy 🎉

== Frequently Asked Questions ==

= Does it support different button styles? =
Yes, you can choose between a classic WhatsApp icon or a button with text and animated rings.

= Can I control the animations? =
Yes. You can pick a hover animation (grow, bounce, pulse, rotate, shake, wobble, tada), an entrance animation (fade, slide up, zoom in), turn the pulsing rings on or off, and set their speed.

= Will animations bother users who prefer less motion? =
No. When "Respect Reduced Motion" is enabled (the default), animations are automatically disabled for visitors whose system requests reduced motion.

= Can I use a custom class or ID? =
Yes, both are supported for better control via your CSS or JavaScript.

= Will it work on all devices? =
Yes. You can also control visibility for desktop or mobile.

= How do I turn on the AI assistant? =
Open **MW Messenger Button** in the admin menu, scroll to **AI Assistant**, paste your Claude, OpenAI or OpenRouter API key and save. The chat button appears on your site above the WhatsApp button. Fill in "About Your Business" so the assistant knows your services, prices and opening hours.

= Where do I get an API key? =
Create one in your account at platform.claude.com (Claude), platform.openai.com (OpenAI) or openrouter.ai (OpenRouter). The plugin recognises the kind of key automatically.

= Is there a free option? =
Yes. Create a free account at openrouter.ai, make a key and paste it. The assistant then uses OpenRouter's free models: they are slower and less smart than paid ones, and OpenRouter answers about 50 messages a day for free accounts (1000 a day after a one-time top-up of 10 credits).

= How much does the AI assistant cost? =
The plugin is free. With Claude or OpenAI the provider charges your account for each answer, depending on the model. The plugin uses the cheapest model of your provider unless you type another one in the "Model" field, and "Messages per Day" caps the number of answers. OpenRouter's free models cost nothing.

= Is my API key safe? =
The key is stored in your site's database and used only on your server. It is never printed in the page or sent to visitors. Developers can also set it in wp-config.php with the `MWMESSBTN_AI_API_KEY` constant.

= Can I use the AI assistant without the WhatsApp button? =
Yes. Leave the WhatsApp number empty and only the chat button is shown.

= Is it free? =
Yes, this plugin is 100% free. The optional AI assistant uses your own account with the AI provider, which bills you for usage.

== External services ==

The optional AI assistant connects to an AI provider to write its answers. Nothing is sent anywhere until you save an API key in the plugin settings; without a key the plugin makes no external requests.

Which service is used depends on the key you save:

**Anthropic API (Claude)** — used when you save a Claude API key. Requests go to `https://api.anthropic.com/v1/messages`.
[Terms of service](https://www.anthropic.com/legal/commercial-terms) · [Privacy policy](https://www.anthropic.com/legal/privacy)

**OpenAI API** — used when you save an OpenAI API key. Requests go to `https://api.openai.com/v1/chat/completions`.
[Terms of use](https://openai.com/policies/terms-of-use/) · [Privacy policy](https://openai.com/policies/privacy-policy/)

**OpenRouter API** — used when you save an OpenRouter API key (by default with its free models). Requests go to `https://openrouter.ai/api/v1/chat/completions`.
[Terms of service](https://openrouter.ai/terms) · [Privacy policy](https://openrouter.ai/privacy)

What is sent, and when: each time a visitor sends a message in the chat (or you press "Test the assistant" in the settings), your server sends the provider your API key, the recent messages of that conversation, the "About Your Business" text, and your site's name and address. The visitor's IP address and other personal data are not sent by the plugin. The conversation is kept only in the visitor's browser until the tab is closed; the plugin does not store it.

== Screenshots ==

1. Admin panel with customizable options
2. Button with text style
3. Classic icon style on mobile
4. Floating effect with animation

== Changelog ==

= 1.8.0 =
* New: optional AI assistant chat. Paste your own Claude (Anthropic), OpenAI or OpenRouter API key and a chat button appears on the site, above the WhatsApp button
* New: free option — an OpenRouter key works with free AI models; with Claude and OpenAI the cheapest model is used by default
* New: "About Your Business" text the assistant answers from, chat title, welcome message and optional model choice
* New: daily message limit and a per-visitor limit to protect your AI budget; "Test the assistant" button; a clear message in the settings when the provider rejects a request
* New: suggested privacy policy text (Settings → Privacy) for sites that use the AI assistant
* Improved: the settings screen now confirms "Settings saved."
* Improved: the plugin's settings are removed from the database when the plugin is deleted

= 1.7.0 =
* New: Hover animations (grow, bounce, pulse, rotate, shake, wobble, tada), driven by a lightweight script over CSS keyframes
* New: Entrance animations (fade, slide up, zoom in)
* New: Toggle the pulsing rings on/off and choose their speed (slow / normal / fast)
* New: Option to show the button only after the visitor scrolls down, with a configurable offset
* New: "Respect Reduced Motion" accessibility option (enabled by default)
* Improved: Pulsing rings are now correctly staggered for both button styles
* Improved: Settings screen grouped with an "Animations" section

= 1.6.0 =
* Added custom button size for desktop and mobile

= 1.3 =
* Added alignment options (left/right)
* Added button style switcher (text or classic icon)
* Added custom CSS class and ID fields
* Improved mobile/desktop offset settings
* Refactored CSS and hover behavior

= 1.2 =
* Prefilled message support
* Visibility control (hide on mobile/desktop)
* Initial admin panel styling

= 1.0 =
* First release: basic WhatsApp button with customization

== Upgrade Notice ==

= 1.8.0 =
Adds an optional AI assistant chat that answers visitors with your own Claude, OpenAI or free OpenRouter key. Nothing changes until you save a key.

= 1.7.0 =
Adds hover & entrance animations, a rings on/off + speed control, show-after-scroll, and reduced-motion support. Recommended update.

= 1.3 =
Recommended update. New styling and control options.

== License ==

This plugin is released under the GPLv2 or later. You are free to use, modify, and distribute it.
