=== Floating Contact Button ===
Contributors: madnesscode1
Tags: whatsapp, click-to-chat, floating-button, contact-button, chat-widget
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.3
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a lightweight floating WhatsApp chat button (click to chat) with styles, triggers, responsive options, and optional GDPR consent.

== Description ==

Floating Contact Button adds a customizable **WhatsApp chat button** to your WordPress site. Visitors can click the floating button and start a conversation in WhatsApp (click-to-chat) using your predefined message.

= Main features =

* WhatsApp click-to-chat link (wa.me)
* 4 button styles (circle, square, pill, with text)
* Animations and hover effects
* Responsive options (different sizes per device)
* Display rules (mobile/desktop, home/posts/pages)
* Triggers (delay, scroll, time on page)
* Optional exit-intent trigger on desktop
* Optional GDPR consent modal before opening WhatsApp
* Optional basic click tracking (date/time + page URL)
* Optional campaign metadata for Google Tag Manager and custom integrations

= Performance =

The plugin only loads its assets on pages where the button is displayed, and it is designed to be lightweight.

= Compatibility =

Works with any WordPress theme and most page builders. Compatible with WooCommerce sites (use it as a support and pre-sales contact button).

= Privacy =

You can enable a GDPR consent prompt before opening WhatsApp. If click tracking is enabled, the free version stores only minimal data for counting clicks.

= External service =

The button opens WhatsApp only after the visitor clicks it. The configured phone number and prepared message are then sent to WhatsApp/Meta so the conversation can start. WhatsApp is a third-party service; its [Terms of Service](https://www.whatsapp.com/legal/terms-of-service) and [Privacy Policy](https://www.whatsapp.com/legal/privacy-policy) apply. The plugin does not load remote WhatsApp scripts, pixels, fonts, or iframes on page load.

= Pro version =

If you need advanced features like multiple agents, contextual messages, A/B testing, and advanced analytics, contact us at labsvortice@gmail.com.

== Installation ==

1. Go to Plugins > Add New in your WordPress dashboard
2. Search for "Floating Contact Button"
3. Click "Install Now"
4. Activate the plugin

1. Download the plugin ZIP file
2. Go to Plugins > Add New > Upload Plugin
3. Select the ZIP file and click "Install Now"
4. Activate the plugin

1. Go to **Floating Contact Button** in the administration menu
2. Configure your WhatsApp number
3. Customize the design and messages
4. Done! The button will appear on your site

== Frequently Asked Questions ==

= How do I add a WhatsApp button to WordPress? =

Simply install and activate the plugin, then go to **Floating Contact Button** in your WordPress admin menu. Enter your WhatsApp number, customize the design, and you're done! The button will appear on your site automatically.

= Does it work with any WordPress theme? =

Yes! It's compatible with most WordPress themes and page builders. The button uses fixed positioning and is isolated under the `mcnb-` CSS namespace.

= Can I customize the WhatsApp button appearance? =

Absolutely! You can customize colors, choose from 4 button styles (circle, square, pill, with text), select from 6 animations, and apply 5 different hover effects. You can also set different sizes for mobile, tablet, and desktop devices.

= Does it work on mobile devices? =

Yes, it's fully responsive and optimized for mobile devices. You can configure different sizes and positions specifically for mobile, tablet, and desktop to ensure the best user experience on all devices.

= Is it GDPR compliant? =

The plugin includes an optional consent prompt before opening WhatsApp. This is a technical aid, not a legal guarantee; adapt your privacy notice and consent setup to your jurisdiction.

= Does it affect my site's loading speed? =

The plugin only loads its frontend assets when the button is eligible to appear. It uses a small vanilla JavaScript renderer and does not load external fonts or libraries on the frontend.

= Can I use multiple WhatsApp numbers? =

The free version supports one WhatsApp number. If you need multiple agents or automatic number rotation, check out the Pro version which includes multi-agent support.

= Does it work with WooCommerce? =

Yes! The plugin is fully compatible with WooCommerce and all major e-commerce plugins. You can use it to provide customer support for your online store.

= Can I show the button only on specific pages? =

Yes! You can control visibility by device type (mobile/desktop), page type (home, posts, pages), and set triggers like delay, scroll, or time on page.

= Is there technical support available? =

This is a free plugin with community support. For priority email support and advanced features like A/B testing, advanced analytics, and multi-agent support, consider upgrading to the Pro version.

= How do I change the WhatsApp button position? =

Go to the plugin settings and use the position controls to place the button in the bottom-left or bottom-right corner, with adjustable margins.

= Can I add a custom message that opens with WhatsApp? =

Yes! You can set a pre-configured message that will automatically appear when users click the button, making it easier for customers to contact you with context.

== Screenshots ==

1. Main configuration panel - Easy setup in 2 minutes
2. Color and style customization - 4 styles, 6 animations, 5 hover effects
3. Responsive configuration by device - Customize sizes for mobile, tablet, desktop
4. Visibility and trigger controls - Show/hide by page, device, or user behavior
5. Privacy and GDPR configuration - Compliance settings and consent options
6. Dashboard with analytics - Track clicks and engagement (basic version)
7. Button preview - See your button design in real-time
8. Frontend button view - Floating contact button displayed on a live website
9. Frontend button variations - Different button styles and positions in action

== Changelog ==

= 1.3.0 =
* FIXED: Device visibility and opening hours now work reliably with full-page caches.
* FIXED: International phone validation follows E.164 instead of a fragile country-code list.
* FIXED: Analytics accepts only URLs from the current site and uses cache-safe background delivery.
* IMPROVED: Analytics and campaign attribution are disabled by default on new installations.
* IMPROVED: Campaign data is emitted in the click event instead of adding unsupported parameters to wa.me.
* IMPROVED: Accessible labels, translated consent controls, keyboard focus, safe-area spacing and reduced-motion behavior.
* IMPROVED: Leaner frontend CSS and extensible WhatsApp URL filtering.

= 1.2.0 =
* FIXED: WhatsApp message and UTM parameters are no longer duplicated when opening the chat.
* FIXED: Added accessible labels, keyboard focus handling and safer consent modal rendering.
* FIXED: Analytics tables are created before the first tracked click and admin requests require a nonce.
* IMPROVED: Analytics no longer stores URL query strings and no longer reports simulated conversions or fake activity.
* IMPROVED: Exit-intent trigger is now available for desktop visitors.
* IMPROVED: SEO schema is opt-in and Open Graph tags are left to SEO plugins/themes to avoid duplicates.

= 1.1.3 =
* FIXED: Responsive per-device settings now preserve values correctly when saving.
* FIXED: Device-specific size values are shown correctly after reloading the settings page.

= 1.1.2 =
* FIXED: Reduced plugin tags to 5 for WordPress.org compliance.
* FIXED: Restored a valid WordPress.org username in the Contributors field.
* CHANGED: Updated plugin metadata and version for the new release.

= 1.1.1 =
* FIXED: Button background color now applies correctly even when responsive mode is disabled.
* FIXED: Button styles (pill/text_side) no longer break due to forced width/height in frontend renderer.
* FIXED: Removed debug logging from settings sanitization for WordPress.org compliance.

= 1.1.0 =
* IMPROVED: Complete UI/UX redesign with unified styling across all admin pages.
* IMPROVED: Dashboard and settings now use consistent WhatsApp green color palette.
* IMPROVED: Better spacing between form fields and cards (increased padding to 32px).
* IMPROVED: KPI cards redesigned with vertical layout for better readability.
* IMPROVED: Form inputs now have visible dark borders (#64748b) for better usability.
* FIXED: Critical bug where checkbox values were lost when switching between tabs.
* FIXED: Collapsible fields animation works correctly after multiple open/close cycles.
* FIXED: WordPress footer positioning no longer overlaps plugin content in dashboard.
* FIXED: Test button in dashboard now works correctly.
* REMOVED: Emoji icons from interface for a cleaner, professional appearance.
* CHANGED: All CSS transitions unified to 0.25s ease-out for consistent feel.

= 1.0.8 =
* Added full internationalization (i18n) support with complete translation template (.pot file).
* Added English translation (en_US) for all plugin strings.
* Improved textdomain loading to ensure translations work correctly.
* Enhanced GDPR modal styling options with comprehensive customization controls.

= 1.0.7 =
* Added customizable styling options for GDPR modal (background colors, button colors, border radius).
* Fixed undefined array key warnings in frontend class.
* SEO optimization: Changed tag from "widget" to "floating" for better discoverability.

= 1.0.6 =
* Renamed plugin to "Floating Contact Button" to comply with WordPress.org trademark policies.
* Updated dashboard header title color to white for better visibility.
* Added new frontend screenshots showcasing button variations and live website views.

= 1.0.5 =
* Marked plugin as tested up to WordPress 6.9 for compatibility.
* Minor internal adjustments and documentation updates for the 6.9 release cycle.

= 1.0.4 =
* New global toggle to enable or disable the WhatsApp button from the Basic tab.
* Header status now synced with the toggle (shows Active/Inactive correctly).
* Visual improvements in the admin header (better contrast, main title in white, clearer status badge).
* Added a “Report a bug” button directly in the settings footer.
* Updated Pro version copy to show launch price (USD 5).

= 1.0.3 =
* SEO optimization: Updated short description with keywords (WhatsApp button, WhatsApp chat, WhatsApp widget)
* Added SEO paragraph in description section for better WordPress.org search visibility
* Added review call-to-action: Footer message and admin notice after saving settings
* UI improvements: Removed duplicate title, unified style to friendly Spanish (informal tone)
* Removed duplicate preview in Visual Effects section (already shown in sidebar)
* Fixed dashboard statistics: Prevented values from disappearing due to JavaScript conflicts
* Added Analytics field in Privacy tab with clear Basic vs Pro separation
* Optimized data collection: Free version only collects essential data (date, URL), Pro version collects detailed analytics (device, browser, country, IP, etc.)
* Improved dashboard period selector synchronization
* Enhanced user experience with consistent informal Spanish language throughout admin panel

= 1.0.2 =
* Changed all prefixes from "mcnb" to "mcnb" to comply with WordPress naming conventions (minimum 4 characters)
* Fixed security issues: all $_SERVER, $_POST, $_GET inputs are now properly sanitized and validated
* Fixed internationalization: all menu titles and section titles now use English as base language
* Fixed hook names to use proper plugin prefix
* Renamed main plugin file to follow WordPress convention (madnesschat-button.php)
* Improved code security and compliance with WordPress Coding Standards

= 1.0.1 =
Bug fixes and improvements. Fixed privacy settings saving, checkbox persistence, and visual effects preview.

= 1.0.0 =
First version of Floating Contact Button. Free plugin to add a WhatsApp button to your WordPress website.

== Upgrade Notice ==

= 1.1.3 =
Fixes saving and reloading of responsive per-device size settings. Recommended update if you use device-specific design options.

= 1.1.2 =
Metadata compliance update for WordPress.org: fixed contributors, reduced tags, and refreshed release version.

= 1.1.1 =
Critical frontend fixes for button styling/colors + WordPress.org compliance cleanup. Recommended update for all users.

= 1.1.0 =
Major UI/UX overhaul and critical fix for settings persistence. Highly recommended update for all users to ensure settings are saved correctly.

= 1.0.8 =
Internationalization update: Added full translation support with English language included. Plugin now automatically displays in English when site language is set to English. Improved GDPR modal customization. Recommended update for all users.

= 1.0.7 =
New GDPR modal styling options: customize colors, buttons, and border radius for the consent modal. Fixed warnings and improved SEO. Recommended update for all users.

= 1.0.6 =
Plugin rebranding and visual improvements: renamed to "Floating Contact Button" for WordPress.org compliance, enhanced dashboard visibility, and added frontend screenshots. Recommended update for all users.

= 1.0.5 =
Compatibility refresh: marked Floating Contact Button as tested up to WordPress 6.9 and updated documentation. Safe update recommended for all users.

= 1.0.4 =
UX and admin improvements: new global toggle to enable/disable the button, clearer header status, bug report button, and updated Pro CTA with launch price (USD 5). Recommended update for all users.

= 1.0.3 =
SEO and UX improvements update. Better search visibility, review prompts, improved dashboard stability, and optimized data collection. Free version now collects minimal data for privacy. Recommended update for all users.

= 1.0.2 =
Important WordPress.org compliance update. Prefixes updated to meet naming standards. Enhanced security and code quality. No breaking changes - all functionality remains the same.

= 1.0.1 =
Bug fixes and improvements. Fixed privacy settings saving, checkbox persistence, and visual effects preview. Recommended update for all users.

= 1.0.0 =
First version of Floating Contact Button. Free plugin to add a WhatsApp button to your WordPress website.

== Additional Info ==

**Developed by**: Vórtice Labs
**Support**: labsvortice@gmail.com

### System Requirements

* WordPress 5.6 or higher
* PHP 7.3 or higher
* PHP Memory: minimum 64MB

### Compatibility

* ✅ All WordPress themes
* ✅ Page builders (Elementor, Divi, etc.)
* ✅ Cache plugins
* ✅ WPML and translation plugins
* ✅ WooCommerce and e-commerce plugins

### License and Support

The plugin distributed here is free software under GPL v2 or later. Optional add-ons may be distributed separately.

For basic support, please review the included documentation. For advanced features and priority support, consider the Pro version.

### Pro Version

Need more features? The Pro version includes:
* Multiple agents with automatic rotation
* A/B Testing to optimize conversions
* Advanced analytics with complete dashboard
* Contextual messages per page
* Smart template system
* Priority email support

Contact us: labsvortice@gmail.com
