=== Survey Funnel Pro ===
Contributors: surveyfunnelpro
Tags: survey, quiz, lead generation, funnels, SaaS, multi-tenant, Stripe, autoresponder
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ship-ready surveys, quizzes, and lead capture with per-member dashboards, Stripe billing, agency workspaces, and outbound integrations.

== Version bump checklist ==

1. Bump `define( 'SFP_VERSION', 'x.y.z' );` in `survey-funnel-pro.php`.
2. Bump the `Version:` line in the same file’s plugin header to match.
3. Bump `Stable tag:` in this `readme.txt` to match.
4. Bump the default `sfp_version` merge value in `SFP_Settings::defaults()` (uses `SFP_VERSION` when defined).
5. Add release notes to `docs/CHANGELOG.md`.
6. Regenerate `FILE_TREE.md` (see `docs/README.md` build section) and run `build.sh`; confirm the zip is under 8MB.

== Description ==

Survey Funnel Pro turns WordPress into the delivery layer for a survey and lead-gen SaaS: members get shortcode-powered dashboards, per-owner data isolation, entitlements (Core, Pro, Agency, Whitelabel, Leads Pro), Stripe Checkout and webhooks, outbound survey webhooks, autoresponder connectors, analytics with caching, and GDPR-oriented tools.

**Highlights**

* Multi-tenant tables keyed by `owner_id` with ownership checks on AJAX and exports.
* Hub, surveys builder, public render, leads CRM, responses, analytics, templates, integrations, branding, agency, pricing, and account flows.
* Stripe test/live keys, Checkout session creation, Customer Portal, and subscription lifecycle hooks.
* Signed outbound webhooks (`X-SFP-Signature`) with retry queue and delivery logs.

Operator documentation lives in the `/docs` folder inside the plugin (README, shortcodes, hooks, webhooks, integrations, agency, whitelabel, GDPR, developer guide, FAQ, changelog, QA checklist, security and performance audit notes).

== Installation ==

1. Upload the `survey-funnel-pro` folder to `/wp-content/plugins/` or install the zip from **Plugins → Add New → Upload**.
2. Activate **Survey Funnel Pro**. Database tables are created automatically; default hub and feature pages are generated when needed.
3. Assign **Survey Funnel Super Admin** to your operator account if you need the wp-admin super panel.
4. Open **Survey Funnel → Settings** and configure Stripe price IDs, page mappings, registration policy, and email defaults.
5. Complete Stripe webhook endpoint setup (signing secret) and run a test checkout in **test mode** before going live.

See `docs/README.md` for a full first-time setup checklist.

== Frequently Asked Questions ==

= Do respondents need WordPress accounts? =

No. Public surveys use a dedicated nonce for submit and progress tracking.

= Where is data stored? =

In custom tables prefixed with `wp_sfp_*` (actual prefix follows your site’s `$table_prefix`). Leads, responses, answers, and analytics events are scoped by `owner_id`.

= Can I uninstall cleanly? =

Uninstalling removes plugin tables, `sfp_%` options and transients, and `sfp_%` user meta. WordPress **pages** created for dashboards are not deleted automatically so you do not lose user-authored content.

= Is Chart.js loaded on every page? =

No. Chart.js is enqueued only with the analytics dashboard assets (`SFP_Analytics::enqueue_analytics_assets`). The hub activity feed does not depend on Chart.js.

== Screenshots ==

1. Member hub and navigation
2. Survey builder with logic and scoring
3. Public survey render
4. Leads dashboard
5. Analytics charts
6. Stripe pricing and checkout entry

*(Replace with real assets before WordPress.org submission, if applicable.)*

== Changelog ==

= 1.0.1 =

* Fix: fatal error in `SFP_Render::get_public_survey_bundle()` (`self::merge_survey_settings()` should be `SFP_Surveys::merge_survey_settings()`). Broke every public survey render — shortcode, token URL, and AJAX submit paths.
* Fix: `ensure_session_cookie()` now guards `setcookie()` with `headers_sent()` and uses the array-options signature with `SameSite` so embedded-survey resume actually persists.
* Fix: builder navigation could leave `idx` past the end of the visible question list when conditional logic shrank the set mid-flow; `renderOne()` now clamps `idx` each render.

= 1.0.0 =

* Initial public release: dashboards, builder, public render, Stripe, webhooks, autoresponders, agency, whitelabel branding, analytics, GDPR tools, super-admin module, and ship-readiness documentation.
