=== ZipySearch ===
Contributors: logiclic
Tags: search, woocommerce, autocomplete, product search, filters
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Replace WooCommerce native search with ZipySearch featuring intelligent autocomplete, filters, and analytics.

== Description ==

ZipySearch is an intelligent search engine that replaces your WooCommerce native search with a powerful, fast, and feature-rich search experience.

= Features =

* **Intelligent Autocomplete** - Show relevant suggestions as customers type
* **Faceted Search** - Filter by brand, category, price, color, and more
* **Typo Tolerance** - Find products even with spelling mistakes
* **Analytics Dashboard** - Track what customers are searching for
* **Conversion Tracking** - Measure how search impacts sales
* **Easy Integration** - One-click setup, works with any theme
* **Variable Products Support** - Index all product variations
* **Multi-language Ready** - Works with WPML and Polylang

= Compatibility =

* **HPOS Compatible** - Fully compatible with WooCommerce High-Performance Order Storage
* **Block Editor Compatible** - Works with WooCommerce Cart and Checkout blocks
* **Classic and Block Themes** - Compatible with both classic and block-based themes

= Requirements =

* WordPress 6.5 or higher
* WooCommerce 8.0 or higher
* PHP 7.4 or higher
* A ZipySearch account (sign up at https://search.zipybot.com)

= External services =

This plugin connects your store to ZipySearch, a hosted search service operated by ZipyBot (https://www.zipybot.com). A ZipySearch account is required: the search index, the autocomplete and the analytics run on ZipySearch servers, not on your WordPress site. Nothing is sent before you enter your ZipySearch Account ID and API Key in the plugin settings.

The plugin uses the following services:

* **Account configuration** (`https://search.zipybot.com/api/module/configure`) - When you save the plugin settings or regenerate the export token, the plugin sends your ZipySearch Account ID, your API Key, the product export URL of your store (including its secret token), your store domain name and the search input CSS selector. This lets ZipySearch import your catalog automatically.
* **Product catalog import** - ZipySearch servers periodically download your product catalog from the export URL created by the plugin (`/wp-json/zipysearch/v1/export`, protected by a secret token). The export contains published product data only (title, description, link, price, sale price, image, category, brand, attributes, stock, SKU and GTIN). No customer or order data is included.
* **Search widget** (`https://api-search.zipybot.com`) - When the widget is enabled, the ZipySearch widget script (`/widget/zipysearch.min.js`) is loaded from ZipySearch servers on your store's front-end pages. As visitors type in the search field, their search queries, selected filters, clicked products and an anonymous random session identifier are sent to ZipySearch to return results and build your search analytics. The widget stores this anonymous session identifier in the visitor's browser (local storage and a `zs_session` cookie).
* **Conversion tracking** (`https://api-search.zipybot.com`) - When conversion tracking is enabled, the order confirmation page sends the order ID, the page URL and the anonymous session identifier to ZipySearch, so you can measure how search contributes to sales. No personal customer data (name, email, address, payment details) is sent. This can be turned off in the plugin settings.

ZipySearch is provided by ZipyBot: [Terms of Service](https://search.zipybot.com/legal/cgv), [Privacy Policy](https://search.zipybot.com/legal/confidentialite).

== Installation ==

1. Upload the `zipysearch` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to WooCommerce > ZipySearch to configure
4. Enter your ZipySearch Account ID and API Key
5. Save settings - your products will be automatically exported

== Frequently Asked Questions ==

= Where do I get my Account ID and API Key? =

Sign up for a ZipySearch account at https://search.zipybot.com. Your Account ID and API Key are shown in your ZipySearch dashboard.

= How are my products exported? =

The plugin creates a secure REST API endpoint that ZipySearch uses to import your products. This happens automatically when you save your settings and then periodically according to your import schedule.

= Does it work with variable products? =

Yes! The plugin exports each product variation as a separate search result, including variation-specific images, prices, and attributes.

= Can I customize the search input selector? =

Yes, you can specify a custom CSS selector in the plugin settings. The default is `.search-field` which works with most themes.

= How does conversion tracking work? =

The plugin automatically tracks when a customer completes a purchase after using the search. This data appears in your ZipySearch analytics dashboard.

= Is it compatible with my theme? =

ZipySearch works with any WooCommerce-compatible theme. The search widget is injected dynamically and styled to match your site.

= Is it compatible with HPOS (High-Performance Order Storage)? =

Yes! ZipySearch is fully compatible with WooCommerce HPOS. The plugin declares HPOS compatibility and works seamlessly with both legacy and HPOS order storage.

= Does it work with WooCommerce Blocks? =

Yes! ZipySearch is compatible with WooCommerce Cart and Checkout blocks as well as classic shortcode-based checkout.

= How do I completely remove all plugin data? =

By default, plugin settings are preserved when you uninstall to make reinstallation easier. To remove all data, add this line to your wp-config.php before uninstalling:
`define( 'ZIPYSEARCH_REMOVE_ALL_DATA', true );`

== Screenshots ==

1. Plugin settings page
2. Search autocomplete in action
3. Analytics dashboard

== Changelog ==

= 1.0.2 =
* Changed - WooCommerce is now declared as a required plugin
* Changed - Export token comparison uses a timing-safe check
* Changed - Admin JavaScript moved out of inline attributes
* Changed - Documented the external ZipySearch services in the readme

= 1.0.1 =
* Added - SKU (reference) and barcode (GTIN/UPC/EAN/ISBN) columns to the product export, matching the PrestaShop module

= 1.0.0 =
* Initial release
* Product export via REST API
* Search widget injection
* Conversion tracking
* Variable products support
* Admin settings page
* HPOS compatibility
* Block editor compatibility

== Upgrade Notice ==

= 1.0.2 =
Maintenance release: compatibility and security hardening.

= 1.0.1 =
Adds SKU and barcode (GTIN) to the product export. Re-import your products to index the new fields.

= 1.0.0 =
Initial release of ZipySearch for WooCommerce.
