=== Conversell ===
Contributors: mohamedbenoughidene
Tags: woocommerce, ai, chat, sales, conversational
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Proactive conversational sales agent for WooCommerce. Turn store visitors into customers with intelligent, timely product conversations.

== Description ==

Conversell brings AI-powered conversational commerce to your WooCommerce store. When a visitor browses your products, Conversell can engage them with helpful product information, answer questions, and guide them toward a purchase — just like a knowledgeable sales associate.

== Installation ==

1. Upload the `conversell` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to WooCommerce → Conversell in your admin menu.
4. Follow the onboarding flow to connect your store.

== Frequently Asked Questions ==

= What permissions does the plugin need? =

Conversell requires WooCommerce REST API read-only access. No write access to products, orders, or customer data is used.

= Does Conversell modify my WooCommerce data? =

No. Conversell only reads product data for its conversational AI. It never modifies products, orders, or settings.

= What happens when I deactivate the plugin? =

The chat widget is removed from your storefront. Your connection settings are preserved for when you reactivate.

= Does Conversell send data to external servers? =

Yes. Conversell communicates with its own cloud backend (Convex) for session management, AI conversation processing, and product sync. It also uses OpenRouter to process AI conversations with third-party language models (e.g., DeepSeek). No personal data is shared with third parties for marketing or analytics. Your store URL and a unique identifier are sent to keep your store connected to our servers. See the WordPress Privacy Page for full details.

== External services ==

This plugin connects to the following external services to provide its conversational AI functionality:

### Convex (Cloud Backend)
- **Service**: Session management, AI conversation routing, product catalog sync, webhook delivery
- **Data sent**: Store URL and ID, product catalog data, visitor session and behavioral signals, conversation history, order metadata
- **When**: On page load (theme config), product updates, checkout completion, plugin activation/deactivation, periodic heartbeat
- **Links**: [Terms of Service](https://www.convex.com/terms-of-service), [Privacy Policy](https://www.convex.com/privacy-policy)

### OpenRouter (AI Provider)
- **Service**: Routes conversation prompts to language models (DeepSeek V4 Flash)
- **Data sent**: Visitor messages and AI conversation content
- **When**: When a visitor interacts with the chat widget
- **Links**: [Terms of Service](https://openrouter.ai/terms), [Privacy Policy](https://openrouter.ai/privacy)

== Source Code ==

The source code for this plugin is included in the plugin ZIP under:
- `widget/src/` — widget React source (built to `assets/widget.js`)
- `dashboard/src/` — dashboard React source (built to `assets/dashboard/index.js`)

Build tools required: Node.js 18+, npm 9+
Build command: npm install && npm run build

== Screenshots ==

1. Conversation with the AI sales agent — visitor asks a question, the widget responds with personalized guidance.
2. Product comparison — the widget surfaces a side-by-side comparison of two products in the catalog.
3. Quick-prompt suggestions — first-time visitors see contextual prompt suggestions to start a conversation.
4. Admin: Transcripts — full conversation history with sentiment and signal annotations.
5. Admin: Metrics — aggregated engagement, intent, and outcome metrics across all sessions.
6. Admin: Objection Library — manage objection detection rules and AI responses.
7. Admin: QA Manager — review flagged conversations and approve/override AI responses.
8. Admin: Theme Editor — customize widget colors, typography, and brand voice.
9. Admin: Revenue — attributed revenue by channel, product, and persuasion technique.
10. Admin: Settings — API keys, sync status, GDPR consent, and integration settings.

== Changelog ==

= 0.2.0 =
* Added missing WordPress plugin header fields (License, Author, Plugin URI, etc.)
* Fixed Host header injection by gating ngrok tunnel rewriting behind environment check
* Removed unauthenticated AJAX endpoints (security hardening)
* Added nonce verification to conversell_store_session AJAX endpoint
* Replaced raw script echoes with wp_add_inline_script for XSS hardening
* Added session cookie sanitization with UUID validation
* Added is-dismissible class to admin error notices
* Implemented multisite companion network form handler
* Fixed uninstall deactivation (was using unset option)
* Added LICENSE.txt, screenshots, Languages directory, .pot template
* Added data privacy documentation and cookie consent filter
* Wrapped all user-facing strings in translatable __() calls
 * Updated Stable tag to 0.2.0, Tested up to WordPress 7.0

= 0.1.0 =
* Initial release
* WooCommerce plugin with settings page
* Magic link onboarding via email
* AES-256 encrypted API key storage
* Product catalog sync
* Real-time webhook handlers
* Add-to-cart detection and session tracking
* Checkout session propagation
* HMAC webhook signature verification
* Read-only API key enforcement
* Polar subscription integration

== Upgrade Notice ==

= 0.1.0 =
Initial release.

= 0.2.0 =
Bug fixes, security hardening, and wp.org submission compliance.
