=== SEO Preflight AI ===
Contributors: abhishekchauhan60
Tags: seo, ai, content audit, editorial, keywords
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered SEO audits and keyword insights for WordPress editorial teams using Anthropic Claude and Ahrefs.

== Description ==

SEO Preflight AI helps editors and content teams audit posts directly inside the WordPress editor.

The plugin can analyze:

* URL slug
* Internal linking
* Meta title
* Meta description
* Image alt text
* H1/article title

The audit returns:

* SEO score
* Pass/fail checklist
* Improvement recommendations
* Editorial guidance

The plugin also supports audit history, prompt history, keyword checks, API usage logs, score history, role-based access, usage limits, CSV exports, a privacy disclosure page, configurable log retention with selectable cleanup types, and multisite installations.

The internal-linking engine includes:

* Related post and page suggestions from the classic editor and block editor.
* Suggested anchor text based on shared content topics.
* Detection of links that are already present in the current editor.
* An orphan-content report under SEO Preflight AI > Internal Linking.

= Third-Party Services =

This plugin connects to third-party services only when a site administrator configures the relevant API key and an authorized editor/admin runs the related feature.

Anthropic Claude API:

* Used for SEO audit generation.
* Endpoint: https://api.anthropic.com
* Data sent: the audit prompt, which may include post title, post URL, post content, headings, metadata, image alt text, internal-link context, brand tone, and previous audit recommendations.
* Service terms: https://www.anthropic.com/legal/commercial-terms
* Privacy policy: https://www.anthropic.com/legal/privacy

Ahrefs API:

* Used for keyword metrics.
* Endpoint: https://api.ahrefs.com
* Data sent: keyword text, selected country, and API authentication data.
* Service terms: https://ahrefs.com/terms
* Privacy policy: https://ahrefs.com/legal/privacy-policy

No external API call is made until the relevant feature is used from the WordPress admin area.

== Installation ==

1. Upload the `seo-preflight-ai` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the Plugins screen in WordPress.
3. Go to SEO Preflight AI > Settings.
4. Add your Anthropic API key to enable SEO audits.
5. Add your Ahrefs API key to enable keyword metrics.
6. Configure role access, usage limits, log retention, and privacy review options as needed.

== Frequently Asked Questions ==

= Does this plugin require an external API key? =

Yes. SEO audits require an Anthropic API key. Keyword metrics require an Ahrefs API key.

= Does the plugin send post content to external services? =

Yes, only when an authorized user runs an SEO audit. The plugin sends audit-relevant post data to Anthropic Claude so the service can generate the audit response.

= Does the plugin support multisite? =

Yes. The plugin creates site-specific tables and supports network-level settings.

= Can plugin data be removed on uninstall? =

Yes. Enable "Delete Data on Uninstall" in the plugin settings before deleting the plugin.

== Screenshots ==

1. SEO audit summary inside the post editor.
2. Full audit report popup with per-item scoring.
3. Plugin settings for API keys and prompts.
4. Keyword metrics, keyword history, usage logs, exports, and log retention settings.
5. Internal-link suggestions and orphan-content reporting.

== Changelog ==

= 1.0.2 =

* Integrated the internal-linking engine into the main plugin.
* Added classic-editor and block-editor internal-link suggestions.
* Added suggested anchor text and existing-link detection.
* Added an orphan-content report for published posts and pages.

= 1.0.1 =

* Added configurable log retention settings.
* Added selectable cleanup types for audit, prompt, internal-link, API, score, and keyword history records.
* Added daily cleanup for selected old history records.
* Added cleanup of scheduled log-retention tasks on deactivation and uninstall.
* Added role-based access controls and daily usage limits.
* Added privacy and data disclosure admin page.
* Added CSV exports for audit history, keyword history, and usage logs.

= 1.0.0 =

* Initial release.
* Added AI SEO audits using Anthropic Claude.
* Added Ahrefs keyword metrics.
* Added audit history, prompt history, usage logs, and score history.
* Added multisite support.

== Upgrade Notice ==

= 1.0.2 =

Adds internal-link suggestions, anchor recommendations, Gutenberg integration, and orphan-content reporting.

= 1.0.1 =

Adds optional automatic cleanup, access controls, usage limits, privacy disclosure, and CSV exports.

= 1.0.0 =

Initial release.
