=== Anslift ===
Contributors: shahzaibmustafa
Tags: seo, ai, content, faq, schema
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create AI-friendly summaries and FAQs to improve visibility in AI-driven search results.

== Description ==
Anslift helps you craft concise “AI Overviews” and FAQs that search engines and AI assistants can understand and reuse. It adds a post editor modal for generating and reviewing output, a posts list column for quick actions, optional bulk analysis, and automatic JSON‑LD schema for analyzed posts.

Key features:
- Generate AI Overview and FAQs for posts
- Editor modal to review output and optional content improvements
- Automatic JSON‑LD (Article + FAQPage) on analyzed single posts
- Auto-insert Summary/FAQs into the front-end (toggleable)
- Auto-analyze new posts on publish (license required)
- Bulk analyze selected posts from the Posts screen (license required)
- Shortcode and template tags with accessible accordion UI

Compatibility:
- WordPress 6.0+
- PHP 7.4+

Supported content types: Posts. The analyzer and UI target the standard ‘post’ type.

How it works:
1) Open a Post, click “Analyze for AEO” (or use the modal), and the plugin generates a concise overview plus FAQs.
2) Review and optionally tweak in the editor modal. Saving manual edits is a Pro feature.
3) On the front-end, Summary and FAQs can be auto-inserted (or output via shortcode).
4) On single posts that have been analyzed, the plugin injects JSON‑LD for Article + FAQPage.

== Installation ==
1. Upload the `anslift` folder to `/wp-content/plugins/`.
2. Activate the plugin from Plugins in wp-admin.
3. Go to “Anslift” in the admin sidebar:
	- Optional: activate a license to enable auto-analysis and bulk analysis.
	- Configure Display & Automation (auto-insert, auto-analyze).

== Usage ==
Editor modal and actions:
- In the Post editor, use the “Open AEO Editor” button to see the AI Overview, FAQs, and improvement suggestions.
- Click “Analyze for AEO” to generate content. “Re‑analyze” updates it based on the latest post content.
- Manual save of the Overview/FAQs in the modal is available to licensed users; saving sets a manual edit marker to avoid overwriting by auto-analysis.

Posts screen:
- A new “AEO Analysis” column shows Analyze/Re‑analyze buttons and bulk/auto statuses.
- Bulk action: “Bulk Analyze for AEO” (license required) processes selected posts in small batches.

Automation:
- Auto-insert: When enabled, Summary and FAQs are injected around the main content on single posts. If auto-insert is on, the shortcode is suppressed on single posts to prevent duplicates.
- Auto-analyze on publish: When enabled and a license is active, newly published posts are queued and analyzed in the background within seconds.

Schema:
- For analyzed single posts that have both an Overview and at least one FAQ, the plugin injects JSON‑LD for Article (with the Overview as description) and FAQPage in the document head.
- If you need to disable this entirely, add the following in a mu-plugin or your theme: `remove_action( 'wp_head', 'aeo_plugin_inject_schema' );`

Shortcode and template tags:
- Shortcode: `[aeo_content]`
- Template (return): `aeo_render_content( $args )`
- Template (echo): `aeo_the_content( $args )`

== Shortcode Reference ==
Shortcode: `[aeo_content]`

Attributes:
- show: both | overview | faqs (default: both)
- post_id: integer (default: 0 = current)
- title_overview: string (default: “Summary”)
- title_faqs: string (default: “Frequently Asked Questions”)
- heading_overview: 2..6 (default: 2)
- heading_faqs: 2..6 (default: 2)
- limit: integer number of FAQs to show (default: 0 = unlimited)
- list_style: dl | ol | ul | div (default: dl)
- accordion: true|false (legacy combined flag; default: false)
- overview_accordion: true|false (default: true)
- faq_accordion: true|false (default: inherits “accordion” when not set)
- class: string of extra CSS class (default: empty)
- show_schema: true|false (FAQ-only JSON‑LD; default: false; requires AEO_ALLOW_SHORTCODE_SCHEMA to be true)
- empty_behavior: hide | message | placeholder (default: hide)
- cache: seconds to fragment-cache the rendered markup (default: 0)

Examples:
- `[aeo_content]` — output both Summary and FAQs with default titles and accordion behavior.
- `[aeo_content show="overview" overview_accordion="false"]` — only Summary, not collapsible.
- `[aeo_content show="faqs" list_style="ol" limit="5"]` — top 5 FAQs as an ordered list.

Note: If auto-insert is enabled, the shortcode returns an empty string on single posts to avoid duplicate output. Disable auto-insert in “Anslift → Display & Automation Settings” to place content manually with the shortcode.

== Filters, Actions, and Constants ==
Developer filters:
- aeo_analysis_max_chars (int, default 18000)
- aeo_analysis_timeout (int, seconds, default 30)
- aeo_analysis_queue_timeout (int, seconds, default 15)
- aeo_analysis_poll_timeout (int, seconds, default 20)
- aeo_analysis_process_timeout (int, seconds, default 90)
- aeo_analysis_retries (int, default 0)
- aeo_analyzed_meta_value (string, meta value for analyzed flag)
- aeo_auto_analysis_schedule_delay (int, seconds, default 5)
- aeo_auto_analysis_random_delay_max (int, seconds, default 5)
- aeo_bulk_batch_size (int, default 10)
- aeo_bulk_batch_interval (int, seconds, default 15)
- aeo_editor_faq_max_items (int, default 0 = unlimited)
- aeo_editor_faq_question_max_chars (int, default 160)
- aeo_editor_faq_answer_max_chars (int, default 600)
- aeo_editor_overview_max_chars (int, default 1200)
- aeo_enqueue_frontend_assets (bool, default true)
- aeo_shortcode_pre_render_args (array)
- aeo_shortcode_raw_data (array)
- aeo_shortcode_overview_markup (string)
- aeo_shortcode_faqs_markup (string)
- aeo_shortcode_schema_object (array)
- aeo_shortcode_markup (string)

Actions:
- aeo_analysis_retry_sleep (fires between retry attempts)
- aeo_run_auto_analysis_event (cron event with post ID)
- aeo_run_bulk_batch_event (cron event)
- aeo_shortcode_after_render (args, post_id, state)

Constants and options:
- AEO_ALLOW_SHORTCODE_SCHEMA (bool): default false. If true, `[aeo_content show_schema="true"]` can inject FAQPage JSON‑LD.
- AEO_API_URL or option `aeo_api_url`: analysis endpoint override.
- AEO_USAGE_STATUS_API_URL or option `aeo_status_api_url`: usage/quota endpoint override.

== Frequently Asked Questions ==
= Does this send data to an external service? =
Yes. When you analyze (manually, bulk, or auto), the post title/content (or normalized segments) and site URL are sent to our service to generate the overview, FAQs, and suggestions. If a license is active, the license key is included for quota validation. See Privacy Policy below.

= Can I disable automatic analysis? =
Yes. Go to “Anslift → Display & Automation Settings” and toggle off “Automatically analyze new posts on publish”. This requires a license to enable; disabling is always allowed.

= Can I disable automatic front‑end insertion? =
Yes. You can independently control automatic insertion of the AI summary and FAQs. Go to "Anslift → Display & Automation Settings" and toggle "Automatically insert AI summary before content" or "Automatically insert FAQs after content" according to your needs. When a section is auto-inserted, the shortcode will not render that section on single posts, allowing you fine-grained manual placement via shortcode or template tag.

= Which post types are supported? =
Posts. The analyzer and UI target the built‑in ‘post’ type.

= Can I customize API endpoints? =
Yes. You can override the analysis URL via constant AEO_API_URL or option `aeo_api_url`, and the usage-status URL via AEO_USAGE_STATUS_API_URL or option `aeo_status_api_url`.

= How do I disable the global JSON‑LD injection? =
Add this to a mu-plugin or your theme: `remove_action( 'wp_head', 'aeo_plugin_inject_schema' );`

= Is there a cleanup tool for legacy injected HTML? =
Yes. If legacy injected Overview/FAQ HTML is detected, you’ll see a dismissible admin notice with a “Run Cleanup” button that safely removes it from posts.

== Screenshots ==
1. Post editor modal showing AI Overview, FAQs, and improvements (screenshot-1.png)
2. Admin page with license, plan usage bar, and display/automation settings (screenshot-2.png)
3. Posts list column with Analyze/Re‑analyze and bulk/auto statuses (screenshot-3.png)
4. Front-end Summary and FAQ accordion UI (screenshot-4.png)

== Changelog ==
= 1.0.0 =
- Initial release

== Upgrade Notice ==
= 1.0.0 =
Initial release.

== Privacy Policy ==
When you use Analyze (manual, bulk, or auto) this plugin sends your site URL and post content/title (or segmented content) to our Supabase‑hosted endpoints to generate AI Overviews, FAQs, and improvement suggestions. If a license is active, the license key is included to verify quota. Results are stored as WordPress post meta on your site:
- _aeo_ai_overview, _aeo_faqs, _aeo_analyzed_at, _aeo_plugin_analyzed, _aeo_improvements

On uninstall, plugin options are removed; post meta/content are not deleted by default. You can remove the JSON‑LD injection by disabling it as noted above if needed.

Service homepage: https://aeogeorank.com/
Contact: https://www.linkedin.com/in/shahzaib-mustafa/
