=== WBN SEO Infrastructure ===
Contributors: webnest
Tags: seo, schema, meta tags, audit, json-ld
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight SEO infrastructure layer for WordPress. Audit pages, review meta and schema suggestions, safely apply approved overrides, and optionally generate AI suggestions with your own OpenAI API key.

== Description ==

WBN SEO Infrastructure is a lightweight SEO operations layer for WordPress.

It works alongside your existing SEO setup and gives you visibility, structure, and control over how pages are presented to search engines.

Most SEO plugins focus on output.
WBN focuses on auditing, governance, controlled application, and operational clarity.

With WBN SEO Infrastructure, you can review page-level SEO health, generate structured data and meta suggestions, optionally use AI Assist with your own OpenAI API key, preview changes before applying them, and maintain a safer and more consistent SEO workflow across your site.

=== What it does ===

* Audit any page and break down its SEO health
* Generate structured data (JSON-LD) and meta suggestions
* Preview title, description, and schema before applying changes
* Apply controlled overrides without replacing your existing SEO plugin
* Store audit snapshots for comparison and tracking
* Export structured audit summaries as PDF reports
* Optional AI Assist with your own OpenAI API key

=== Why use it ===

If you already use an SEO plugin, you may still face operational problems such as:

* Meta and schema spread across multiple settings
* Limited visibility into what is actually output on the page
* No clear audit workflow
* No safe process for testing and applying improvements
* Inconsistent schema and metadata across pages

WBN SEO Infrastructure adds an operational layer that helps solve those problems with:

* Clarity — understand what exists, what is missing, and what needs improvement
* Control — review and apply changes through a governed workflow
* Consistency — use templates and structured logic across pages
* Diagnostics — see issues, risks, and signals instead of managing isolated fields

=== Core Features ===

* SEO Audit
  Page-level SEO scoring with clear diagnostic breakdowns for:
  - Meta (title, description, canonical)
  - Content structure and heading signals
  - Link and CTA signals
  - Structured data (JSON-LD)

* Safe Apply (Override Layer)
  Apply suggested title, description, and schema through a controlled override system that works with:
  - Yoast SEO
  - Rank Math
  - AIOSEO
  Or output directly if no SEO plugin is detected.

* Schema and Meta Engine
  Template-based generation with preview for:
  - JSON-LD graph
  - Meta title
  - Meta description
  - Canonical handling

* Snapshots
  Store audit results locally in your WordPress database in order to:
  - Track changes over time
  - Compare page states
  - Keep structured historical records

* Reports
  Generate downloadable PDF summaries for selected pages, including:
  - Overall score
  - Key issues
  - Recommended improvements

* Diagnostics and Health
  Built-in operational checks for:
  - Database status
  - Cron activity
  - Configuration signals
  - Safe Mode support

=== How it works ===

1. Open the plugin inside your WordPress admin
2. Select a page or item
3. Load and run an audit
4. Review the score, checks, and recommendations
5. Preview meta and schema output
6. Apply changes manually through the controlled override layer
7. Optionally enable AI Assist and generate improved meta suggestions with your own OpenAI API key

No changes are applied automatically.

=== Compatibility ===

Works alongside:

* Yoast SEO
* Rank Math
* AIOSEO
* WooCommerce
* Elementor

If no SEO plugin is active, WBN SEO Infrastructure can output meta and schema directly.

=== Data Handling ===

* Audit data and snapshots are stored locally in your WordPress database
* Audit data is not sent to third-party services unless you enable optional AI Assist
* Processing happens on your own site

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install it via WordPress admin under Plugins > Add New > Upload Plugin.
2. Activate **WBN SEO Infrastructure**.
3. Open **SEO Infrastructure** from the WordPress admin menu.
4. Select a page or item and run an audit.
5. Review the results and use Apply to save approved meta and schema changes.

== Frequently Asked Questions ==

= Does this replace my SEO plugin? =

No.
It works alongside your existing SEO plugin and adds a governance and audit layer on top of it.

= Do I need a license key? =

No.
This version works without a license key.

= Does it apply changes automatically? =

No.
Changes are only applied when you explicitly choose to apply them.

= Does it send data to external services? =

Only if you enable optional AI Assist.
The core audit workflow stays on your site. When AI Assist is enabled and you click Generate with AI, selected page content is sent to OpenAI using the API key saved by the site owner.

= Who pays for AI usage? =

OpenAI usage is billed by OpenAI to the owner of the API key entered in the plugin settings.

= Can it work without another SEO plugin installed? =

Yes.
If no supported SEO plugin is detected, WBN SEO Infrastructure can output meta and schema directly.

== Screenshots ==

1. SEO Audit dashboard with page scoring and diagnostics
2. SEO Template Builder with meta and schema generation
3. Module overview with bulk operations and structured SEO tools
4. Advanced template system with dynamic preview and schema mapping

== External services ==

= URL validation =

When you use validation features such as response and schema checks, the plugin may send a request to your own site URL in order to verify page response and output.
No third-party external service is required for this process.

= OpenAI API (optional AI Assist) =

When AI Assist is enabled and an administrator clicks Generate with AI, the plugin sends selected page context such as the page title and a content excerpt to the OpenAI API in order to generate SEO title, meta description, and schema-description suggestions.

This service is optional and requires the site owner to enter their own OpenAI API key. Token usage and billing are handled by OpenAI for that API key owner.

Service provider: OpenAI
Service endpoint: https://api.openai.com/v1/responses
Terms: https://openai.com/policies/terms-of-use
Privacy policy: https://openai.com/policies/privacy-policy

== Privacy ==

WBN SEO Infrastructure stores audit-related data locally in your WordPress database.
No data is transmitted to third-party servers as part of the core audit workflow. Optional AI Assist sends selected page context to OpenAI only when enabled by an administrator and manually triggered.

== Changelog ==

= 1.1.0 =
* Added optional BYOK AI Assist using the site owner OpenAI API key
* Added AI settings for enabling, storing, masking, and clearing the API key
* Added AI suggestions in the audit screen with manual apply
* Added clean AI guards so missing or disabled AI never causes activation/runtime fatal errors

= 1.0.0 =
* Initial WordPress.org release
* SEO Audit system
* Safe Apply for meta and schema
* Snapshot storage
* PDF report generation
* Compatibility with major SEO plugins
