=== Releva.ai Integration ===
Contributors: relevaai
Tags: personalization, ai, recommendations, woocommerce, marketing
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.74
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Releva helps you grow your business via state-of-the-art AI with 1:1 web personalization and omnichannel marketing tailored to each individual.

== Description ==

Releva helps you grow your business with state-of-the-art AI - building a loyal customer base through 1:1 web personalization and omnichannel marketing tailored to each individual, delivered at the right time via the right channel.

**AI & Personalization**

* AI-powered product recommendations (recommended for you, trending, cross-sell, upsell, next basket prediction, and more)
* 1:1 web personalization (banners, pop-ups, recommenders)
* Real-time anonymous & registered user personalization
* Anonymous-to-registered user profile merging
* Brand identity analysis for tone & voice consistency

**Marketing Channels**

* Email - drag & drop editor, dynamic product blocks, AI-generated content
* SMS / Text messages - long message format supported, links auto-shortened
* Web push notifications - rich push with images, buttons, icons & behavioral controls
* Viber messages - AI-generated content supported
* WhatsApp messages - AI-generated content supported
* Facebook Ads - one-off campaigns & retargeting
* Dynamic coupons across all channels

**Automation & Workflows**

* Omnichannel marketing automation workflows
* Triggered campaigns (browse abandonment, cart abandonment, post-purchase, etc.)
* Quiet hours & send-frequency controls

**Segmentation & Data**

* Advanced customer segmentation
* Custom event tracking (frontend & API)
* Purchase & revenue attribution

**Integrations & Compliance**

* WooCommerce product catalog sync
* Multi-language support (WPML compatible)
* Dynamic pricing support (Flycart / Discount Rules)
* Custom consent management for GDPR compliance

**Requirements:**

* A Releva.ai account - sign up at [releva.ai](https://releva.ai), or [book a demo](https://relevaad.zohobookings.eu/#/187906000000034054?utm_source=wordpress-plugin&utm_medium=plugin&utm_campaign=book-a-demo&utm_content=book-a-demo-wordpress-readme) if you do not have one yet

**Optional:**

* WooCommerce 3.0 or later - enables the product catalog sync and cart/order tracking; the plugin works without WooCommerce

**Third-Party Services:**

This plugin connects to the [Releva.ai](https://releva.ai) platform, a third-party service, in order to provide AI-powered personalization and product recommendations. The following data may be sent to Releva.ai servers:

* WooCommerce product catalog data (during sync)
* Page view and user interaction events (via the Releva JavaScript SDK loaded on your storefront)
* Cart and order data for personalization purposes

The Releva JavaScript SDK is loaded from Releva.ai external servers on your storefront pages.

This plugin does not send any data to Releva.ai until you configure it with your account credentials. By using this plugin, you agree to Releva.ai's terms and policies:

* [Terms of Service](https://releva.ai/terms-of-use/)
* [Privacy Policy](https://releva.ai/privacy-policy)

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Settings > Releva.ai** and enter your Releva.ai access token, secret key, and page tokens.

You need a Releva.ai account to get your access token, secret key, and page tokens. If you do not have them yet, [book a demo](https://relevaad.zohobookings.eu/#/187906000000034054?utm_source=wordpress-plugin&utm_medium=plugin&utm_campaign=book-a-demo&utm_content=book-a-demo-wordpress-readme) and our team will set you up.

== Frequently Asked Questions ==

= Do I need a Releva.ai account? =

Yes. You need an active Releva.ai account to use this plugin. Sign up at [releva.ai](https://releva.ai).

= Is the plugin compatible with WPML? =

Yes. The plugin syncs products for all active WPML locales and passes the current language to WooCommerce product queries.

= Does it support variable products? =

Yes. Variation IDs, prices, and attributes are synced alongside the parent product.

= How does the product sync work? =

The plugin provides a REST API endpoint that Releva.ai calls to fetch your WooCommerce product catalog. Products are synced with prices (including tax), images, categories, tags, custom taxonomies, and meta fields.

== Changelog ==

= 1.0.74 =
* Installation docs: explain how to obtain the access token, secret key, and page tokens, with a link to book a demo

= 1.0.73 =
* Add a "Book a demo" prompt on the settings page for stores that do not have their Releva credentials yet

= 1.0.71 =
* Sync variable products with groupId and per-variation variants (SKU, prices, availability, image, option values)
* Fix variable products whose variations are all out of stock being synced as available
* Fix products being synced as discounted after the WooCommerce sale-price end date has passed
* Do not emit preconnect/preload resource hints until an access token is configured

= 1.0.69 =
* Only load Releva SDK when access token is configured
* Fix permission callback security on /products REST endpoint
* Rename main plugin file to match plugin slug

= 1.0.68 =
* Address WordPress Plugin Directory review feedback
* Use wp_enqueue_script/wp_add_inline_script instead of inline script tags
* Prefix AJAX actions and script handles to avoid naming collisions
* Fix text domain to match plugin slug (releva-ai-integration)
* Lower admin menu position

= 1.0.67 =
* Prepare plugin for WordPress.org directory submission
* Add readme.txt in WordPress.org format

= 1.0.66 =
* Add realm configuration

= 1.0.65 =
* Optimize product block loading performance
* Add preconnect and preload hints in head for early SDK connection and download
* Switch SDK script from defer to async to avoid waiting for other deferred scripts

= 1.0.64 =
* Export all custom product taxonomies as custom string fields during product sync

= 1.0.63 =
* Add support for Flycart (Discount Rules) dynamic pricing when syncing product discount prices

= 1.0.62 =
* Fix empty product sync when WPML is installed but not fully configured

= 1.0.61 =
* Fix product ID always showing the same value on product pages

= 1.0.60 =
* Fix fatal error with null WC customer in REST API contexts
* Fix warning for empty variationsIds array
* Fix warning for invalid get_post_meta return value

= 1.0.59 =
* Add null coalescing and escaping to consent-related JavaScript variables

= 1.0.58 =
* Skip sync on ACF-style field keys
* Add short_description to custom string object
* Add product tags to custom string object

= 1.0.57 =
* Fix warnings returned from get_term_by()

= 1.0.56 =
* Add AJAX action get_user_location

= 1.0.55 =
* Get customer default location

= 1.0.54 =
* Add SKU as a default field for products

= 1.0.53 =
* Get the geo location country of the user

= 1.0.52 =
* Add custom parameter lang to wc_get_products when WPML installed

= 1.0.51 =
* Remove overly general CSS rules

= 1.0.50 =
* Get products for all active locales

= 1.0.49 =
* Fix PHP error dynamic property

= 1.0.48 =
* Fix errors from PHP 8

= 1.0.47 =
* Add data-cookieconsent ignore to script tags for Cookiebot CMP compatibility
* Pass hasConsent function as reference to SDK

= 1.0.46 =
* If product type variant get meta data by first variant ID
* Fix custom array key issue from meta fields
* Add custom consent function field in plugin settings

= 1.0.45 =
* Remove checkout hook and add timestamp to cart

= 1.0.44 =
* Add new checkout hook woocommerce_store_api_checkout_order_processed

= 1.0.43 =
* Fix product meta fields causing illegal argument exception in Elasticsearch

= 1.0.42 =
* Check class WooCommerce exists

= 1.0.41 =
* Pass search query to Releva

= 1.0.40 =
* Gracefully handle missing headers

= 1.0.39 =
* Getting cart item attributes from the passed item

= 1.0.38 =
* Switch to using x-rlv-authorization header

= 1.0.37 =
* Added permission_callback to register_rest_route function

= 1.0.36 =
* Remove hooks that were not in use

= 1.0.35 =
* Added blog category page token in settings
* Added blog post page token in settings
* Made the Releva SDK load asynchronously

= 1.0.34 =
* Added configuration for data protection compliance

= 1.0.33 =
* Sync product meta data as custom fields with proper key-value pair types

= 1.0.32 =
* Sync product meta data as custom fields

= 1.0.31 =
* Can set Search page from Releva app

= 1.0.30 =
* Can set Home and Cart page from Releva app

= 1.0.29 =
* Add product variations IDs in custom data

= 1.0.28 =
* Get current currency

= 1.0.27 =
* Fix showing discount and list prices correctly for product variations

= 1.0.26 =
* Adding all variant prices into custom data

= 1.0.25 =
* Fix showing variant price correctly

= 1.0.24 =
* Fix PHP warnings on PHP 8.1

= 1.0.23 =
* Consider tax when syncing product prices

= 1.0.22 =
* Properly track profile info in guest checkout

= 1.0.21 =
* Propagate product untrash to Releva

= 1.0.20 =
* Exclude Releva from NitroPack optimizations

= 1.0.19 =
* Add wpnonce to window for template use

= 1.0.18 =
* Bugfix: handle missing creation date on product
