=== SetChat === Contributors: setglobaldev Tags: live chat, chat, customer support, chatbot, woocommerce Requires at least: 6.3 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 1.3.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Add a professional live chat to your WordPress site. FAQ chatbot, conversational flows, ticketing and more. == Description == **SetChat** is a modern, multi-tenant live chat solution that integrates seamlessly with your WordPress site. = Features = * **One-click setup** — Paste your API key and the widget appears * **Multilingual admin** — French, English, and German admin interface (more to come) * **WordPress user sync** — Automatically identify logged-in users by name and email * **WooCommerce integration** — Sync customer data and cart info to help agents faster * **WooCommerce one-click connect** — Link your store to SetChat for order tracking without manual REST API key copy-paste (optional; read-only key) * **Page visibility control** — Hide the widget on specific pages with wildcard support * **Position control** — Place the widget bottom-right or bottom-left * **Language override** — Force a widget language or auto-detect from the visitor's browser * **Enable/disable toggle** — Temporarily deactivate without losing configuration = Prerequisites = An active [SetChat](https://setchat.co) account with an API key. = Third-Party Services = This plugin connects to the **SetChat** external service to provide live chat functionality. The following external requests are made: 1. **Widget script** — The plugin loads a JavaScript file from `https://widget.setchat.co/setchat.iife.js`. This script renders the chat widget on your website. 2. **Chat API** — The widget communicates with `https://api.setchat.co` via WebSocket and HTTPS to send and receive chat messages in real time. These connections are essential for the plugin to function. No data is sent unless the plugin is enabled and an API key is configured. **When "Sync logged-in users" is enabled**, the logged-in user's display name and email address are passed to the widget via HTML data attributes. This data is transmitted to the SetChat API when a chat conversation is started. **When "WooCommerce sync" is enabled**, WooCommerce customer information (name, email, phone, company) and cart summary (item count, total, currency) are also transmitted. * SetChat website: [https://setchat.co](https://setchat.co) * Terms of Service: [https://setchat.co/terms](https://setchat.co/terms) * Privacy Policy: [https://setchat.co/privacy](https://setchat.co/privacy) == Installation == 1. Upload the `setchat` folder to `/wp-content/plugins/` 2. Activate the plugin through the *Plugins* menu 3. Go to *Settings > SetChat* 4. Enter your API key (found in [app.setchat.co](https://app.setchat.co/settings) > Settings > Integration) 5. Configure options (language, position, user sync, page exclusions) 6. The chat widget appears on your site == Frequently Asked Questions == = Where do I find my API key? = Log in to [app.setchat.co](https://app.setchat.co/settings), go to Settings > Integration, and copy your API key. = Can I hide the widget on specific pages? = Yes. Under Settings > SetChat > Page visibility, add one URL path per line. Wildcards are supported: `/shop/*` hides the widget on all shop subpages. = Does it work with WooCommerce? = Yes. When WooCommerce is detected, an extra option appears to sync customer data (phone, company) and cart information to the chat. Agents see this data in the dashboard. You can also use **Connect WooCommerce in 1 click** to link your store to SetChat for order tracking (optional). = Is the admin interface translated? = Yes. The plugin ships with French (`fr_FR`) and German (`de_DE`) translations. English is the default. WordPress uses the site language setting to pick the right translation. = What data is sent to SetChat? = Only the data required for chat functionality: visitor messages, and optionally the logged-in user's name/email and WooCommerce cart data (if the corresponding options are enabled). See the "Third-Party Services" section for full details. = What happens when I uninstall the plugin? = All plugin settings are removed from the database. Chat history remains on the SetChat platform and can be accessed from [app.setchat.co](https://app.setchat.co). == Privacy Policy == SetChat processes personal data (visitor messages, optionally name and email) on behalf of the site operator. Data is stored on servers in Frankfurt, Germany (EU) and is subject to the General Data Protection Regulation (GDPR). Site operators are data controllers and should update their privacy policy to disclose the use of SetChat for live chat. SetChat acts as a data processor. For more details, see [SetChat Privacy Policy](https://setchat.co/privacy). == Screenshots == 1. Settings page — General configuration 2. Settings page — User identification & WooCommerce sync 3. Settings page — Page visibility exclusions 4. Frontend — Widget in bottom-right position == Upgrade Notice == == 1.3.0 == New: WooCommerce one-click connection to SetChat for order tracking; Plugin Check compatibility (no manual `load_plugin_textdomain`); PHPCS-friendly DB access for API keys; updated FR/DE strings. == 1.2.9 == Improved: Added notification smoke-test button, notification health badge, and onboarding KPI event tracking in `Settings > SetChat`. == 1.2.8 == Improved: Checklist in `Settings > SetChat` now aligns with dashboard onboarding “done” signals (site + live test + notifications) to maximize trial conversion. == 1.2.7 == Improved: Gutenberg block icon + removed duplicate CSS class field. = 1.2.6 = Improved: Activation checklist in `Settings > SetChat` (KB/flows/pre-chat readiness) + auto-diagnose. = 1.2.5 = Improved: Gutenberg block editor UI (InspectorControls) for button text and CSS class. = 1.2.4 = Improved: Widget colors customization + Gutenberg block `[setchat/chat]` for one-click widget opening. = 1.2.3 = Maintenance release: compatibility, compliance and UX improvements. Recommended for all users. = 1.2.0 = Security hardening: sanitized all inputs, whitelist validation, proper script enqueuing. Recommended for all users. == Changelog == = 1.3.0 = * Added: "Connect WooCommerce in 1 click" in `Settings > SetChat` (creates read-only Woo REST key and links to SetChat for site-scoped order tracking). * Added: Short onboarding notice above WooCommerce sync options. * Improved: French and German translations for new WooCommerce strings. * Improved: PHPCS WordPress.DB direct-query annotations for WooCommerce `woocommerce_api_keys` table access. * Removed: Manual `load_plugin_textdomain()` call (WordPress.org auto-loads translations since 4.6; satisfies Plugin Check). = 1.2.9 = * Added: "Test notification" action in plugin settings (email/teams smoke test through API key). * Added: Notification health status badge with last test timestamp and channels used. * Added: Onboarding KPI instrumentation events (`WIDGET_EVENT`) for conversion funnel tracking. = 1.2.8 = * Improved: Activation checklist updated to match dashboard “done” signals (site + live test + notifications). = 1.2.6 = * Improved: Activation checklist in `Settings > SetChat` = 1.2.5 = * Improved: Gutenberg editor UI for block `[setchat/chat]` (text/class) = 1.2.4 = * Improved: Added Gutenberg block `[setchat/chat]` to open the widget * Improved: Added optional widget color overrides (primary/secondary/accent) = 1.2.3 = * Improved: Compliance fixes for WordPress.org checks (headers and direct file access guards) * Improved: Updated packaging and release readiness workflow for WordPress.org deployment * Improved: Minor UX and localization consistency updates = 1.2.0 = * Security: Sanitized all superglobals with wp_unslash + sanitize_text_field * Security: Added whitelist validation for locale and position settings * Security: Added sanitize_callback for all boolean settings * Improved: Widget script loaded via wp_enqueue_script instead of raw printf * Improved: WooCommerce metadata injected via wp_add_inline_script * Added: Third-Party Services disclosure in readme * Added: Privacy Policy section in readme * Added: GPL-2.0 LICENSE file = 1.1.0 = * Added: WordPress user sync (name, email passed to widget automatically) * Added: WooCommerce integration (customer data, cart info) * Added: Page visibility control (exclude URLs with wildcard support) * Added: Multilingual admin (FR, DE translations via .po/.mo) * Added: Uninstall hook (clean removal of all options) * Changed: Source strings switched to English per WordPress i18n standards = 1.0.0 = * Initial release with API key, locale, position, and enable/disable settings