=== Askery Forms ===
Contributors: askery
Tags: forms, contact form, lead generation, surveys, ai forms
Requires at least: 6.3
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed Askery forms anywhere on your WordPress site. AI-built forms, one-click connect, auto-resizing, host-styled.

== Description ==

Askery is an AI-first form builder — describe the form you want and it builds it for you. This plugin lets you drop those forms onto any WordPress page or post.

* **Connect once.** Sign in to your Askery account inside WordPress; the plugin remembers the connection.
* **Paste a shortcode.** `[askery slug="..."]` renders the form anywhere shortcodes work.
* **Auto-resizing.** Forms grow to fit their content; no scrollbars, no dead space.
* **Host-styled.** By default the form inherits your site's fonts and colors.
* **Multi-page, logic, file upload.** Anything you can build in Askery works in the embed.
* **No iframe maintenance.** When you update a form on Askery, every page using it updates automatically.

== Installation ==

1. Install and activate the plugin.
2. Go to **WP Admin → Askery Forms** and click **Connect Askery account**.
3. Sign in (or sign up free) and click **Allow** to grant the WordPress plugin read access to your forms.
4. Copy the `[askery slug="..."]` shortcode for any of your published forms and paste it onto a page.

You can also use the Askery block in the Gutenberg editor in a future release.

== Frequently Asked Questions ==

= Do I need an Askery account? =

Yes. The plugin renders forms you've built on askery.app. The free plan supports unlimited forms.

= What data does the plugin store? =

Only an OAuth access token in `wp_options`, plus a small JSON cache of your form list. No respondent data ever passes through WordPress — submissions go directly from the visitor's browser to Askery.

= How do I disconnect the plugin? =

WP Admin → Askery Forms → **Disconnect**. The plugin clears the token immediately and your forms stop rendering until you re-connect.

= Does it work without the script (no JS sites)? =

For now, the shortcode emits the modern script-based embed. A no-JS iframe option is on the roadmap.

== Changelog ==

= 0.2.1 =
* Fix: emit all scripts via `wp_register_script` + `wp_enqueue_script` + `wp_add_inline_script` instead of raw `<script>` echoes (matches WP.org plugin guidelines).
* Fix: OAuth admin callback now enforces a `current_user_can( 'manage_options' )` capability check before any input is read, and verifies the `state` query parameter as a WordPress nonce.
* Fix: switch preconnect hint to the `wp_resource_hints` filter instead of an inline `<link>` echo.

= 0.2.0 =
* New: "Askery Form" Gutenberg block with a form picker dropdown and live preview inside the editor.
* New: `mode="fast"` shortcode default — emits the form iframe directly in HTML so it loads in parallel with the page, no JS waterfall.
* New: `mode="modern"` opt-in for cases that need host-page theme inheritance via the hosted embed.js.
* Improvement: preconnect hint to the Askery origin, saving DNS + TLS on first load.

= 0.1.0 =
* Initial release.
* OAuth connect via `/oauth/authorize` (forms:read scope only).
* `[askery slug="..."]` shortcode.
* Plugin settings page lists connected workspace + your published forms with copy-paste shortcodes.

== Upgrade Notice ==

= 0.2.0 =
Adds the Gutenberg block + a faster default render. Existing shortcodes keep working unchanged.
