=== Alynivo ===
Contributors: genco87
Tags: chatbot, ai, chat, woocommerce, product finder
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.15.9
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Chatbot and product advisor for WordPress. Guided selling for WooCommerce, plus optional managed AI for free-text answers.

== Description ==

Alynivo adds a responsive chat widget to your site. On a WooCommerce store, visitors can pick a category and budget (or answer a short guided flow), receive matching product recommendations, and add simple products directly to the cart — no WooCommerce, no problem: an "Assistant mode" setting lets the widget run as a plain free-text chat instead, so service businesses, agencies, and any non-store WordPress site can use it too.

The core plugin works entirely inside WordPress and does not send visitor or catalog data to any external service. Deterministic answers cover common questions about delivery, payment, and security (or a simple fallback in Service mode). An optional managed AI connection and store-specific package adapters are available as separate extensions for stores that need custom catalogs or natural-language answers.

= Features =

* Conversational widget with quick replies and free-text questions
* Uses published WooCommerce products and categories
* Budget-aware recommendations
* Direct add-to-cart for simple products
* Responsive and keyboard-accessible widget
* Customizable title, welcome text, logo, color, position, a proactive teaser bubble, a persistent chat badge, and a choice of launcher style (brand-first or neutral-icon-first)
* Granular page-type visibility (homepage, shop, product, cart, checkout, account, blog, everything else)
* Per-product teaser bubble override, editable directly from the product edit screen
* Redesigned settings page with grouped sections, a live launcher preview, and a visual funnel chart
* Deterministic answers for delivery, payment, and security questions
* Built-in, privacy-friendly funnel analytics (no data leaves your site)
* Developer filters for custom catalogs, pricing, and question flows
* Extensible planner contract for store-specific package adapters

== Installation ==

1. Upload the `alynivo` folder to `/wp-content/plugins/` or install the ZIP through WordPress.
2. Activate Alynivo.
3. Go to WooCommerce > Alynivo (on a WooCommerce store) or the standalone Alynivo menu item in the main admin sidebar (on any other WordPress site).
4. Configure and enable the widget.

== Frequently Asked Questions ==

= Does Alynivo require an external AI account? =

No. The core plugin uses deterministic WooCommerce recommendations and works without any external account. A managed AI connection is available separately for stores that want natural-language answers.

= Does it support variable products? =

Variable products are linked to their product page so visitors can select attributes. Direct add-to-cart is limited to simple purchasable products.

= Is it compatible with custom pricing systems? =

Developers can adjust recommendation queries and product payloads with the documented Alynivo filters, or build a dedicated store adapter using the planner contract.

= Does Alynivo track or store visitor data? =

Alynivo records pseudonymous, aggregate funnel events (for example, "planner started" or "added to cart") in your own WordPress database to help you see conversion rates. No raw IP addresses are stored; sessions are counted using a daily-rotating hash generated on your server. No data is sent to Alynivo or any third party by the core plugin. See the Privacy section below for details.

== Privacy Statement ==

Alynivo does not transmit visitor or catalog data to Alynivo or any third-party service by default.

The plugin stores the following data locally in your WordPress database, in a table it creates on activation:

* Funnel events (for example: planner started, platform chosen, plan viewed, plan chosen, added to cart) with a timestamp and the associated product/category identifiers.
* A daily-rotating pseudonymous session hash used only to estimate unique visitors for the funnel summary. Raw visitor IP addresses are never stored in the Alynivo events table.

This data stays on your own site and is automatically deleted after 90 days. It is also removed when the plugin is uninstalled. If you enable the optional managed AI extension, the widget clearly identifies itself as an AI assistant and links to the site's WordPress privacy-policy page. The current message, a short conversation window, language, page context, and any configured knowledge/persona context are sent to the disclosed AI provider through Alynivo's server-side proxy; no provider API keys are ever exposed to the visitor's browser. The managed service does not persist message content in its current implementation. Provider processing and retention are governed by the separately disclosed managed-service terms and subprocessor list.

== Screenshots ==

1. Guided-selling widget open on a WooCommerce product page.
2. Category and budget selection step.
3. Product recommendation cards with add-to-cart.
4. Alynivo settings screen (standalone admin menu when WooCommerce is not active).
5. Funnel analytics summary on the settings page.

== Changelog ==

= 0.15.9 =
* New "Chat statistics" card on the Alynivo settings page: see how many of your Managed AI messages are used this month (with a progress bar that turns amber at 75% and red at 90%), how many conversations and visitor messages the assistant handled in the last 30 days, the daily average, and a 14-day bar chart of messages per day.
* Chat usage is now counted locally alongside the existing shop funnel. As before, only counters are stored — never the content of any message.

= 0.15.8 =
* Added a compact AI disclosure and privacy-policy link inside the widget whenever Managed AI is active.
* Added automatic daily deletion of local funnel events older than 90 days and clears the scheduled cleanup on uninstall.
* Clarified that the locally generated daily session value is pseudonymous rather than anonymous.
* Fixed the setup wizard prefilling the welcome-message field with the built-in English default. Clicking through the wizard without touching the field would save that English text as an explicit override, replacing the translated per-language welcome (and the neutral Service-mode variant) on non-English sites. The field now starts empty and only saves when you type your own text.
* Pressing Enter in a wizard field now moves to the next step instead of accidentally triggering "Skip setup" (the browser's implicit form submission hit the skip button).
* The wizard now shows a live widget preview while you pick a brand color and write your welcome message, and the final step summarizes your choices (mode, color, greeting) before going live.
* Completed wizard steps are clickable to jump back, and on sites without WooCommerce the Service mode is preselected instead of the unavailable Store mode.
* The wizard's final step now mentions the optional Managed AI service with a link to alynivo.de.

= 0.15.7 =
* Setup wizard now opens every time you click Activate (deactivate → activate or a fresh install). Plugin updates do not re-trigger it. Also fixed the wizard being skipped when the setup flag was missing.

= 0.15.6 =
* Added a short first-run setup wizard after activation: choose assistant mode, brand color and welcome message, then enable the widget. Existing installs are unaffected; skip anytime to reach the full settings page.

= 0.15.5 =
* Fixed the built-in default title and welcome message always assuming a shop ("Product advisor", "...answer common store questions") even in Service mode, where there is no shop at all. Service mode now uses a neutral default title/welcome ("Assistant" / "Hi! How can I help you?") in all 6 supported languages; unaffected if you've already set your own title/welcome text.
* Made the chat panel more compact: raised the desktop/tablet height so it fills more of the available space instead of leaving a large empty margin above and below, and switched the mobile panel to a true edge-to-edge full-screen layout (no more wasted margin around it on phones).
* Fixed a mobile Safari bug where opening the on-screen keyboard could visually detach the fixed chat panel from the screen, making the site's own header/footer appear through it. The widget now tracks the real visible area with the Visual Viewport API while typing.

= 0.15.4 =
* Fixed a real access bug on non-WooCommerce sites: the settings page was registered under WooCommerce's admin menu and gated on the `manage_woocommerce` capability, which does not exist without WooCommerce active — so even site administrators were locked out of configuring Alynivo in Service mode (the mode built specifically for agencies and other non-store WordPress sites). Now uses a top-level menu with `manage_options` when WooCommerce is not active, and stays under the WooCommerce submenu with `manage_woocommerce` on shop sites.

= 0.15.3 =
* Fixed a "textdomain loaded too early" notice (WP_DEBUG, WP 6.7+): defaults() called __() for two default strings while running on plugins_loaded, before WordPress's init action. Those two strings are now untranslated literals (no compiled translation catalog exists yet, so this is not a visible behavior change) — found and fixed during a full WP_DEBUG pass on a clean install ahead of resubmission.

= 0.15.2 =
* Fixed a WordPress.org plugin review issue: brand color from the database is now re-validated with sanitize_hex_color() at output time before being interpolated into admin inline CSS (escape late). Also hardened frontend config JSON encoding.

= 0.15.1 =
* Fixed a WordPress.org plugin review issue: the settings page's inline `<style>` block is now registered and enqueued through `wp_enqueue_style()` / `wp_add_inline_style()` instead of being echoed directly into the page markup.
* Added the plugin author's WordPress.org username to the readme's Contributors list.

= 0.15.0 =
* Added a "Persona and tone" setting so the hosted AI assistant's voice (name, tone, style) can be configured per site, without touching code.
* Fixed the hosted assistant not actually receiving the "Knowledge context" text — it was sent by WordPress but silently dropped by the managed service before reaching the AI. Both fields now reach the model as clearly separated instructions.

= 0.14.0 =
* Replaced the waving-hand launcher badge/icon with a neutral speech-bubble icon (same glyph used on mavilab.de's own chat), recolored to the site's brand color.
* Fixed the "Logo always visible" launcher style so a real custom logo now shows cleanly, with no icon/badge overlapping it. Without a custom logo, the closed launcher always falls back to the neutral chat icon instead of the default Alynivo mark, since there is nothing store-specific to brand it with yet.

= 0.13.0 =
* Added Spanish as a 6th fully supported widget language (alongside German, English, French, Turkish, Italian): all 33 built-in widget strings now have a Spanish translation, and Spanish is available as a tab in the per-language override fields (title, welcome message, teaser bubble) on the settings page.

= 0.12.0 =
* WooCommerce is no longer a hard requirement. Added an "Assistant mode" setting (Store / Service / Both): Service mode runs the chat widget as a free-text AI assistant with no product catalog, for sites that are not a WooCommerce store. Store mode keeps the existing guided-selling behavior and still requires WooCommerce; Both shows the product finder and free-text chat together. Without WooCommerce active, the assistant always runs in Service mode regardless of this setting.
* Added a "Knowledge context" field: free text describing the business/services, sent to the hosted AI assistant as background for every conversation.
* Fixed the deterministic (non-AI) fallback replies to no longer offer a "Find products" quick reply in Service mode, where there is no catalog to search.

= 0.11.1 =
* Resolved all Plugin Check warnings in the funnel-analytics code: table names now use the `%i` identifier placeholder in `$wpdb->prepare()` instead of string interpolation, and the two read queries (summary and per-platform breakdown) are now cached for one minute via the object cache to satisfy the "no caching" check on direct database queries.

= 0.11.0 =
* Added complete French, Turkish, and Italian translations for all built-in widget text (title, buttons, questions, delivery/payment/security answers, teaser bubble, etc.). Previously only German and English were built in and every other language fell back to English.

= 0.10.0 =
* Replaced the single "WooCommerce pages only / all public pages" visibility toggle with granular checkboxes: homepage, shop & category, product, cart, checkout, my account, blog, and everything else. Existing sites keep their previous behavior automatically.
* Added a per-product teaser bubble override: a new "Alynivo teaser bubble" box on each product's edit screen lets you show a different invitation on that specific product page, without touching the global text.
* The teaser bubble's built-in default text now includes a 👋 wave, matching the original design proposal.
* Redesigned the settings page into grouped cards (Status & AI, Branding, Teaser bubble, Visibility, Recommendations) with a live launcher preview and a visual funnel chart with progress bars, replacing the plain table layout.

= 0.9.0 =
* Added a "Launcher style" setting: choose between the logo always visible on the launcher (with a chat badge), or a neutral chat icon when closed with the logo appearing only after opening the chat (the common Intercom/Drift/Crisp pattern). The logo itself remains a separate paid white-label setting either way.

= 0.8.4 =
* Rebalanced launcher proportions: the logo now sits on a white background with breathing room (66% scale) instead of filling the button edge-to-edge, and the chat badge grew from 24px to 30px with a larger emoji, matching common chat-widget conventions (Intercom/Drift/Crisp-style launcher).

= 0.8.3 =
* Changed the launcher badge glyph from a generic speech-bubble icon to a waving-hand emoji, matching the original design proposal.

= 0.8.2 =
* Added a permanent small chat-bubble badge on the launcher button (overlapping the logo's corner) so the button reads as "this is a chat" even after the proactive teaser bubble has disappeared or on a custom white-label logo. The badge hides while the panel is open.

= 0.8.1 =
* Declared compatibility with WooCommerce's High-Performance Order Storage and Cart/Checkout Blocks features to clear the "incompatible plugin" admin notice.

= 0.8.0 =
* Added a proactive teaser bubble that invites visitors to chat a few seconds after page load, once per browser session.

= 0.7.0 =
* Added a per-site chat logo setting with a media-library picker, so store owners can replace the default Alynivo mark with their own logo.

= 0.6.0 =
* Added local, privacy-friendly funnel analytics (planner started, platform chosen, plans viewed/unavailable, plan chosen, added to cart) with a summary view on the settings page. No data leaves the site.

= 0.5.1 =
* Fixed a multilingual product-matching bug affecting translated catalogs.

= 0.5.0 =
* Extended the planner contract to support multiple platforms/question flows via store-specific adapters.

= 0.4.0 =
* Renamed the product and plugin to Alynivo after an expanded collision review.
* Prepared the extension contract for store-specific package planners.

= 0.3.0 =

* Added an optional server-side proxy for the managed Alynivo AI service.
* Added hosted-service credentials without exposing provider keys in browser code.
* Added graceful fallback when the hosted service is unavailable.

= 0.2.0 =

* Added a conversational interface with message input and quick replies.
* Added localized German storefront copy.
* Modernized the responsive widget design.

= 0.1.0 =

* Initial guided-selling foundation.

== Upgrade Notice ==

= 0.8.0 =
Adds an optional proactive teaser bubble; no action required, a sensible localized default is shown until you customize it.

= 0.7.0 =
Adds an optional custom logo setting; no action required, the default Alynivo mark is used until you set one.

= 0.6.0 =
Adds local funnel analytics stored in a new database table; no action required, no external data transfer.
