=== NoonElite Audit Engine ===
Contributors: noonelite, freemius
Tags: audit, quiz, lead generation, assessment, scoring
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Interactive audit quizzes that score visitors and capture leads — embed anywhere with a shortcode.

== Description ==

NoonElite Audit Engine lets you build professional, branded audit quizzes that engage your visitors, score their responses, and capture qualified leads — all without writing code.

**Core Features (Free)**

* Unlimited audit quizzes with multi-category scoring
* Customisable branding (accent colours, logo, agency name)
* Shortcode embedding: `[noon_audit type="your-slug"]`
* Lead capture with GDPR-compliant consent and marketing opt-in
* Risk-band scoring (Critical / High / Moderate / Low)
* Honeypot anti-spam on all forms
* Full lead management dashboard with pagination
* Quiz theme mode (auto-detect, force dark, or force light)
* Glass morphism background effect option
* Branded "Powered by" credit (opt-in only)

**Pro Features** (available via [NoonElite.com](https://noonelite.com))

* Salesforce CRM integration (auto-sync leads as Salesforce Leads)
* HubSpot CRM integration (auto-sync leads as HubSpot Contacts)
* Cloudflare Turnstile anti-spam (invisible CAPTCHA for lead forms)
* CSV lead export
* Bulk CRM re-sync for missed leads

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via **Plugins → Add New**.
2. Activate the plugin.
3. Go to **Site Audit → Settings** to configure branding and CTA.
4. Go to **Site Audit → Audits** to create your first audit quiz.
5. Add the shortcode `[noon_audit type="your-slug"]` to any page or post.
6. Captured leads appear under **Site Audit → Leads**.

== Source Code ==

This plugin uses React in the frontend to process forms and score leads interactively. To comply with WordPress.org guidelines, the uncompiled source code for these features is bundled directly within the plugin structure.

You can find the uncompiled frontend code and package configuration inside the `frontend/` directory.

To build the project development assets for review:
1. Navigate to the frontend directory: `cd frontend/`
2. Install dependencies: `npm install`
3. Compile the production assets: `npm run build`

The built assets will map directly to the files present in `frontend/dist/`.

== External Services ==

This plugin connects to the following third-party services under certain conditions. Please review the details below.

= Cloudflare Turnstile (Pro) =

When Cloudflare Turnstile is configured in **Settings → Security**, the plugin uses it to verify form submissions as a spam prevention measure. A challenge token is sent to the Cloudflare Turnstile API for server-side verification before a lead is saved.

* **Service:** Cloudflare Turnstile — [https://www.cloudflare.com/products/turnstile/](https://www.cloudflare.com/products/turnstile/)
* **Data sent:** Challenge response token and visitor IP address
* **When:** On every lead form submission (if Turnstile keys are configured)
* **Terms of Service:** [https://www.cloudflare.com/website-terms/](https://www.cloudflare.com/website-terms/)
* **Privacy Policy:** [https://www.cloudflare.com/privacypolicy/](https://www.cloudflare.com/privacypolicy/)

= Salesforce API (Pro) =

When Salesforce integration is enabled in **Settings → Salesforce Integration**, the plugin authenticates with the Salesforce REST API using OAuth 2.0 client credentials and creates Lead records for each captured lead.

* **Service:** Salesforce — [https://www.salesforce.com](https://www.salesforce.com)
* **Data sent:** Lead name, email, company, audit score, risk band, and category scores
* **When:** After a lead is submitted on the front end, or during a manual bulk sync from the admin Leads page
* **Terms of Service:** [https://www.salesforce.com/company/legal/agreements/](https://www.salesforce.com/company/legal/agreements/)
* **Privacy Policy:** [https://www.salesforce.com/company/privacy/](https://www.salesforce.com/company/privacy/)

= HubSpot API (Pro) =

When HubSpot integration is enabled in **Settings → HubSpot Integration**, the plugin uses the HubSpot CRM API to create or update Contact records for each captured lead.

* **Service:** HubSpot — [https://www.hubspot.com](https://www.hubspot.com)
* **Data sent:** Lead name, email, company, audit score, risk band, and category scores
* **When:** After a lead is submitted on the front end, or during a manual bulk sync from the admin Leads page
* **Terms of Service:** [https://legal.hubspot.com/terms-of-service](https://legal.hubspot.com/terms-of-service)
* **Privacy Policy:** [https://legal.hubspot.com/privacy-policy](https://legal.hubspot.com/privacy-policy)

= Freemius =

This plugin uses the Freemius SDK for license management and to offer optional premium upgrades. Freemius collects non-sensitive usage data (with opt-in consent) to help improve the product.

* **Service:** Freemius — [https://freemius.com](https://freemius.com)
* **Terms of Service:** [https://freemius.com/terms/](https://freemius.com/terms/)
* **Privacy Policy:** [https://freemius.com/privacy/](https://freemius.com/privacy/)

== Frequently Asked Questions ==

= How do I embed an audit? =

Add `[noon_audit type="your-slug"]` to any page or post. Replace `your-slug` with the slug from the Audits page.

= Can I have multiple audits? =

Yes — create as many as you like and embed each with its own shortcode.

= Is the watermark required? =

No. The "Powered by" credit is opt-in only. Enable it in **Settings → Attribution** if you'd like to show it.

== Screenshots ==

1. The audit landing screen showing the "Get Started" call to action.
2. A multi-step question view focused on Salesforce health assessment.
3. The integrated email lead capture gate.
4. The detailed, graded audit report and risk band results.
5. The lead management dashboard showing captured data and CRM sync status.
6. The audit builder interface for creating and weighting custom quizzes.

== Changelog ==

= 1.0.6 =
* Version bump to resolve repository caching and formatting issues during initial review

= 1.0.5 =
* Made quiz theme mode (force dark / force light) a free feature for all users
* Removed Pro-only restriction from theme mode setting

= 1.0.4 =
* Refactored Freemius pro-gating logic to ensure completely stripped free versions
* Consolidated and standardized plugin prefixes to adhere to WordPress guidelines
* Bundled uncompiled React source code to comply with open source requirements
* Updated generic shortcodes and localization namespaces

= 1.0.3 =
* Bug fixes to Admin settings page

= 1.0.2 =
* Renamed plugin to NoonElite Audit Engine
* Changed watermark from opt-out to explicit opt-in
* Replaced all inline scripts and styles with properly enqueued files
* Refactored pro-gating to use Freemius native compatibility methods
* Added external services documentation section
* Fixed HubSpot test connection bug (missing action parameter)
* Updated plugin URI to valid URL

= 1.0.1 =
* Added CRM sync retry logic
* Added bulk sync feature for missed leads

= 1.0.0 =
* Initial release
