=== LeadForms Quiz ===
Contributors: leadforms
Tags: quiz, lead generation, forms, survey, embed
Requires at least: 6.1
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed LeadForms quizzes into posts and pages with a shortcode or an editor block. Inline and popup display modes.

== Description ==

This plugin places quizzes built with **LeadForms** (leadforms.ru) on your WordPress site. The quiz itself is created and stored in your LeadForms account; the plugin embeds it into a page using the official LeadForms widget loader.

**Features**

* Shortcode `[leadforms id="123"]` for any post, page or text widget.
* A "LeadForms Quiz" block for the block editor, with all options in the sidebar and no code to write.
* Two display modes:
  * **Inline** — the quiz is embedded directly into the content.
  * **Popup** — a button is placed in the content and the quiz opens in a modal window when it is clicked.
* Width and height options for the inline mode; button text and shape for the popup mode.
* The loader script is enqueued only on pages that actually contain a quiz.

**How to use**

1. Create and publish a quiz in your LeadForms account.
2. Copy the quiz ID — the number in the quiz URL.
3. Add the "LeadForms Quiz" block to a page, or insert the shortcode `[leadforms id="YOUR_ID"]`.

Shortcode examples:

`[leadforms id="123"]`
`[leadforms id="123" mode="popup" button_text="Get a quote"]`
`[leadforms id="123" height="700px"]`

== External services ==

This plugin loads the LeadForms widget loader and displays the quiz in an iframe. This is required for the plugin to work: the quiz itself is stored and served by the LeadForms service.

What is loaded and when:

* **Widget loader** — the script `https://script.leadforms.ru/v1.js`. It is loaded in the visitor's browser on pages where a quiz is placed.
* **Quiz content** — the quiz page served from the LeadForms domain and embedded in an iframe when the quiz is displayed.

What data is sent: when the quiz loads, the loader sends technical details of the page to LeadForms — the current URL, the referrer and browser cookies — so that the quiz works correctly and submissions are attributed to the right page. Personal data entered by a visitor into the quiz is processed by the LeadForms service, not by this plugin.

Service provider: LeadForms.

* Website: https://leadforms.ru
* Terms of use: https://leadforms.ru/conditions
* Privacy policy: https://leadforms.ru/policy
* Consent to personal data processing: https://leadforms.ru/consent

== Frequently Asked Questions ==

= Where do I find the quiz ID? =

It is the number in the quiz URL in your LeadForms account. The same value goes into the block settings and into the `id` attribute of the shortcode.

= Do I need a LeadForms account? =

Yes. The plugin only embeds an existing quiz; quizzes are created and configured in LeadForms.

= The quiz does not appear on the page =

Check that the ID is correct and that the quiz is published. If a caching or script optimisation plugin is active, make sure it does not strip the `script.leadforms.ru/v1.js` loader.

= Can I place several quizzes on one page? =

Yes. Each shortcode and each block is independent, including quizzes with different IDs.

== Screenshots ==

1. The "LeadForms Quiz" block and its settings in the block editor.
2. A quiz embedded inline in a page.
3. Popup mode: a button that opens the quiz in a modal window.

== Changelog ==

= 1.0.0 =
* Initial release: shortcode, editor block, inline and popup display modes.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
