=== Kabook Auto Schema & Accordion for Rank Math ===
Contributors: saeidafshari
Tags: rank math, schema, faq, accordion, schema-injection
Requires at least: 5.6
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically injects Rank Math FAQ schema and converts it to a stylish, customizable accordion with smooth animations.

== Description ==

This plugin is a power-up for **Rank Math SEO PRO** users.
It solves common SEO and UX issues by automatically ensuring FAQ schema markup is present on your posts, and by transforming its default output into a visually appealing, interactive accordion — without requiring manual shortcode insertion.
**Key Features:**

* **Auto Injection:** Automatically adds the `[rank_math_rich_snippet]` shortcode to your single posts if you have defined an FAQ schema but forgot to insert the block.
* **New: Animation Effects:** Choose between Slide, Fade, or Zoom effects for your accordion opening.
* **New: Speed Control:** Fully customize the animation duration (ms) to match your site's feel.
* **Per-Post Control:** Manually enable or disable schema injection for specific posts via a simple checkbox in the editor.
* **Smart Detection:** Checks the raw database content to ensure the shortcode is never duplicated.
* **Stylish Accordion:** Converts the boring list format into a beautiful, interactive accordion.
* **Fully Customizable:** Change colors, fonts, borders, and alignment via a modern "Blue Harmony" settings panel.
* **Ultra Lightweight:** Rebuilt with Vanilla JS (No jQuery) for maximum performance.
* **Perfect RTL Support:** Deep integration for Right-to-Left languages like Persian and Arabic.

**Note:** This plugin relies on the schema data generated by the **Rank Math SEO PRO** plugin.
Please ensure it is installed and active.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/kabook-auto-rank-math-snippet` directory.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Settings > Kabook RM Snippet** to configure the styling and animation options.

== Frequently Asked Questions ==

= Can I use the accordion styling without enabling automatic schema injection? =
Yes! The plugin gives you full control over its features:
• To use only the accordion styling (without auto-injecting schema): Disable "Auto Inject Schema" and keep "Enable Accordion" checked.
• To inject schema automatically but use your own accordion (e.g., from theme or another plugin): Enable "Auto Inject Schema" and uncheck "Enable Accordion".
Both features work independently — you can mix and match based on your needs.

= Does this plugin work without Rank Math PRO? =
No. This plugin acts as an add-on and depends on the schema data generated by the Rank Math SEO PRO plugin.

= Can I change the opening speed of the accordion? =
Yes! In version 1.2.0, we added an "Animation Speed" setting where you can define the speed in milliseconds (e.g., 300ms for fast or 1200ms for slow).

= Does it load scripts on every page? =
No. To ensure maximum performance, the plugin only loads its CSS and JS files on pages where an FAQ schema or shortcode is actually detected.

= Will it slow down my site? =
Absolutely not. The plugin uses Vanilla JS instead of jQuery, making it extremely fast and lightweight.

== Screenshots ==

1. **General Settings:** The new "Blue Harmony" UI for managing global plugin options and auto-injection.
2. **Animation Controls:** Choose your desired opening effect (Slide, Fade, Zoom) and set the animation speed.
3. **Style Customization:** Full control over colors, typography, borders, and corner radius to match your theme.
4. **Frontend Example (LTR):** A beautiful, animated FAQ accordion as seen on an English site.
5. **RTL Support (Persian):** Perfect alignment and styling for Right-to-Left languages.

== Changelog ==

= 1.4.0 =
* **Enhancement:** Seamless Admin UX – The settings page now features instant tab switching without page reloads (SPA-like experience).
* **Improvement:** Unified Settings Saving – Saving changes now updates all configurations across all tabs simultaneously.
* **Improvement:** Integrated Browser History API so the active tab state is preserved even if the page is manually refreshed.

= 1.3.0 =
* **New:** Smart Error Visibility – The "Schema not found" error message is now hidden for regular users and guests. It remains visible only to Administrators to assist with debugging.
* **Improvement:** Enhanced conditional logic to check for Schema ID existence before injection.
* **Fix:** Prevented potential layout issues on posts where schema data is missing.

= 1.2.0 =
* New: Added Opening Animations (Slide, Fade, Zoom).
* New: Added Animation Speed control setting.
* New: Brand new "Blue Harmony" Admin UI for better user experience.
* Improvement: Optimized Asset Loading (scripts only load when needed).
* Improvement: Enhanced RTL support for both Admin and Frontend.
* Security: Implemented Nonce verification and better output escaping for WP.org standards.
* Compatibility: PHP requirement lowered to 7.4 for better compatibility.

= 1.1.0 =
* New: Added "Injection Control Meta Box" per post.
* Improvement: Rewrote frontend logic in Vanilla JS (removed jQuery).
* Security: Fixed non-sanitized input variable warnings.

= 1.0.0 =
* Initial release.