=== VariantFlow - Lightweight A/B Testing Block ===
Contributors: upluggit
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight, native Gutenberg block A/B tester with zero bloat. 100% compatible with page caching.

== Description ==

VariantFlow is a blazingly fast, zero-bloat A/B testing tool built natively for the WordPress Gutenberg editor. Instead of relying on heavy third-party SaaS platforms or bloated plugins that ruin your site speed, VariantFlow runs entirely within your WordPress dashboard.

Major Features:
* **Native Gutenberg Experience:** Design your Variation A and Variation B directly inside the block editor. No external builders.
* **100% Cache Compatible:** The plugin uses a lightweight client-side script (< 1kb) to randomize variations, guaranteeing it works perfectly with WP Rocket, LiteSpeed Cache, W3 Total Cache, and any host-level page caching.
* **Zero Performance Hit:** The tracking REST API endpoint is asynchronously called, ensuring your page load speed is never affected.
* **Clean Analytics:** View a beautifully designed, minimal dashboard right in your WordPress admin to see Views, Clicks, and Click-Through Rates (CTR).
* **Smart Winner Declaration:** Set a custom "Minimum Views" threshold (e.g., 50 or 100 views) before the plugin automatically highlights the statistically winning variation, preventing false positives.
* **Privacy Focused:** Stores data securely in your own database. No tracking pixels, no third-party data sharing.

### Common Use Cases
Not sure what to test? Here are a few ways VariantFlow can instantly increase your conversions:
* **Call-to-Action (CTA) Buttons:** Test "Buy Now" vs. "Add to Cart" or "Get Started" vs. "Learn More". See which text generates more clicks.
* **Pricing Pages:** Test displaying a monthly pricing table vs. an annual pricing table to see which yields a higher click-through rate to your checkout.
* **Landing Page Headlines:** Write two drastically different H1 headlines for your sales page to see which hooks more readers into clicking your links.
* **Lead Generation Forms:** Test a short, simple form against a longer form with more details to find the sweet spot for email signups.

== Installation ==

1. Upload the `variantflow` folder to the `/wp-content/plugins/` directory, or install the ZIP file via the WordPress Plugins menu.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Open any page or post and add the "A/B Test Container" block.
4. Design your "Variation A" and "Variation B" by dropping text, images, or buttons into the respective sections.
5. Publish the page! Go to the "A/B Tests" menu in your WordPress dashboard to monitor your live conversion rates.

== Frequently Asked Questions ==

= Does this work with my caching plugin? =

Yes! VariantFlow was built specifically to solve the caching problem. It delivers both variations in the initial HTML and uses an ultra-lightweight client-side script to instantly hide the losing variation before the user sees it. It works seamlessly with any caching setup.

= Do I need React or coding knowledge? =

No. You use standard Gutenberg blocks to build your variations natively.

= Where is the data stored? =

All analytics data is stored securely in your own WordPress database in a custom, lightweight table (`wp_ab_test_stats`). We do not use the bloated `wp_postmeta` table.

= How does the plugin decide which variation wins? =

The plugin calculates the Click-Through Rate (CTR) for both Variation A and Variation B. However, to ensure statistical accuracy, you can set a global "Minimum Views" threshold in the A/B Tests dashboard. The plugin will only declare a winner in green once a variation hits that minimum threshold, preventing a variation with 1 view and 1 click from instantly winning.

= Will this slow down my website? =

Absolutely not. The frontend code is less than 1kb of vanilla JavaScript, and the backend tracking occurs asynchronously via the WordPress REST API. It is designed to be completely invisible to your site's performance metrics.

= Can I test more than two variations? =

Currently, VariantFlow is designed strictly for A/B testing (two variations) to keep the plugin as lightweight and easy to use as possible.

== Screenshots ==

1. A/B Test Container block in the Gutenberg Block editor.
2. Container block with two variations.
3. Sample A/B testing for CTA button text
4. Minimal Analytics

== Changelog ==

= 1.0.0 =
* Initial public release.
* Added native Gutenberg A/B Test Container block.
* Added caching-resilient client-side variation randomization.
* Added minimal Analytics Dashboard with dynamic threshold settings.
