=== Yanifend ===
Contributors: skippedaga
Tags: feedback, survey, questionnaire, widget, lottie
Requires at least: 5.2
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 0.22.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Engage visitors with animated, character-driven questionnaires that collect feedback through friendly Lottie characters.

== Description ==

Yanifend embeds an interactive questionnaire widget on your WordPress site. Visitors are greeted by an animated character that asks questions one at a time — ratings, multiple choice, or free text — and their answers flow into your Yanifend dashboard in real time.

**Features**

* Animated characters powered by Lottie — far more engaging than a plain form
* Multiple question types: star rating, single/multiple choice, text, email, phone
* Page Rules: route different pages to different characters by URL pattern (e.g. `/products/*`), or switch the widget off on pages such as checkout
* Live preview on the settings page: see each personage exactly as visitors do, before you save
* Every API key shows which personage it belongs to, so a mistyped key is caught right away
* Optional auto-open: the questions open as soon as a page loads
* `[yanifend_form]` shortcode: link to a personage's hosted form from any post or page
* Session continuity across page visits via cookies
* One-click connection test that also checks your key
* Mobile-friendly, responsive card layout
* No tracking scripts — only the widget code from your Yanifend instance

**What you need**

A free Yanifend account to obtain an API key. Sign up at [yanifend.com](https://yanifend.com/).

**How it works**

Once activated, the plugin injects a small script into your site's front-end. The script loads the widget from your configured Yanifend instance using your API key, and handles all rendering and data collection. No data touches your WordPress database.

== Installation ==

1. In your WordPress admin, go to **Plugins → Add New Plugin**, search for "Yanifend", and click **Install Now**. (Or upload the ZIP via **Upload Plugin**.)
2. Click **Activate**.
3. Go to **Settings → Yanifend** and paste your API key into **Default API Key**.
4. The personage's name appears next to the key, and the **Preview** shows the widget. Click **Save**.
5. Visit any page of your site — the widget appears in the bottom-right corner.

== Frequently Asked Questions ==

= Where do I get an API key? =

Sign up at [yanifend.com](https://yanifend.com/), go to your dashboard, and copy the key from the plugin section.

= Can I manage my forms from an AI assistant? =

Yes. Yanifend has an MCP server, so Claude, ChatGPT or Grok can create and edit your questions and read the answers without opening the dashboard. [Watch the demo](https://www.youtube.com/watch?v=hWxvbYEk5Z8).

= Does this plugin collect visitor data itself? =

No. The plugin only embeds a widget script. Visitor answers go directly from the visitor's browser to your Yanifend instance.

= Can I customize the widget appearance? =

Yes — colors, font, size, position and language are set in your Yanifend dashboard (Customize widget), not in WordPress. Changes propagate to every site running the plugin.

= Can I hide the widget on some pages? =

Yes. Add a Page Rule with the page's URL pattern (for example `/checkout/*`) and choose **No widget**.

= How do I link to a hosted form? =

Copy the form's link in your dashboard (Share → Hosted form) and add `[yanifend_form url="https://app.yanifend.com/f/your-form" text="Share your feedback"]` to any post or page. Add `style="link"` for a plain link instead of a button.

= Does it work on mobile? =

Yes. The widget is responsive and tested on modern mobile browsers.

= Does it slow down my site? =

The embedded script is loaded asynchronously after page content. Impact on page-load metrics is minimal.

== Screenshots ==

1. One widget, many personalities — pick an animated character personage for your site.
2. Settings page: the default key and Page Rules, each key showing its personage.
3. Live preview of each personage, exactly as visitors see it.

== External services ==

This plugin connects to the Yanifend API (by default `https://app.yanifend.com`) to load the widget script and transmit visitor answers. Data sent: visitor API key (yours), question answers, and an anonymous session ID. No personally identifiable information from your WordPress site is transmitted by the plugin itself. On the settings page, the plugin also asks the Yanifend API which personage each entered API key belongs to (the key is sent; the personage's name comes back), to show the name and the live preview; the preview loads the same widget script inside the page. Yanifend Terms of Service: https://yanifend.com/terms. Privacy Policy: https://yanifend.com/privacy.

== Changelog ==

= 0.22.0 =
* Live preview on the settings page: see each personage exactly as visitors do.
* Every API key shows which personage it belongs to, or "Key not found"; Test Connection now checks your key too.
* Page Rules are numbered cards you can reorder, show which pages each pattern matches, can switch the widget off on pages such as checkout, and end with what every other page shows.
* Optional auto-open of the questions on page load (a cookie-consent question still comes first).
* New `[yanifend_form]` shortcode links to a personage's hosted form.
* "Go to Dashboard" now opens the YaniFend dashboard; the Diagnostics tab is replaced by a status line.

= 0.21.1 =
* Readme only: FAQ on managing your forms from Claude through the Yanifend MCP server, and installation steps for installing from the plugin directory. No code changes.

= 0.21.0 =
* Page Rules are available on every install — removed all plan-based feature gating from the plugin. The plugin is fully functional without any account tier checks.

= 0.20.3 =
* The Plugin URI now differs from the Author URI, as WordPress.org requires.

= 0.20.2 =
* Stored Page Rules are never wiped when settings are saved on a Free or trial-reset account.

= 0.20.0 =
* The Page Rules URL pattern field is a combo box of your site's pages.

= 0.17.2 =
* Passes the official Plugin Check: the widget script is enqueued with wp_enqueue_script, the request path is sanitised, global functions are prefixed and the translation template was regenerated.

= 0.17.1 =
* Separate internal API URL (YANIFEND_API_URL_INTERNAL) for server-side calls.

= 0.16.0 =
* Page Rules: route different pages to different personages by URL pattern (e.g. `/products/*` → Cook, `/support/*` → Doctor). Pages that don't match any rule fall back to the Default API Key.
* Persistent "Yanifend" entry in the WP admin bar linking to the dashboard.

= 0.15.0 =
* WordPress.org submission preparation: readme rewritten to the WordPress.org spec, plugin header cleaned up, translations support.

= 0.14.0 =
* The production API host is fixed in the plugin; only the API Key is user-configurable.

= 0.13.3 =
* The widget loads as a client-side script tag instead of being proxied through your WordPress server.

= 0.12.0 =
* The API key is sent in an X-Api-Key header instead of in the URL.

= 0.7.0 – 0.11.3 =
* Early releases: tabbed admin settings with connection diagnostics, the character rendering above theme content, an Analytics tab (later removed), and admin polish. The full history is in the plugin's CHANGELOG.

== Upgrade Notice ==

= 0.22.0 =
New settings page with a live preview, key checks and easier Page Rules. Your key and rules carry over unchanged.

= 0.21.1 =
Readme-only update. No functional changes.

= 0.21.0 =
Page Rules now work on every install — no plan checks. Existing rules keep working unchanged.

= 0.16.0 =
Adds optional Page Rules to route different pages to different personages. Existing single-key setups keep working unchanged.

= 0.13.3 =
Loads the widget as a client-side script instead of through your server. Reconfirm your API key after upgrade.
