=== EBQ SEO ===
Contributors: ebq
Tags: seo, search console, analytics, rank tracking, core web vitals
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connected SEO suite — real-data focus keyword scoring, live audits, rank tracking, AI assistant, schema, sitemap, redirects.

== Description ==

EBQ SEO is a connected SEO suite that pairs the WordPress editor with your EBQ workspace so content editors get real-data answers, not heuristics.

**On-page essentials**

* Focus keyphrase + additional keyphrases scoring with worst-bullet-wins verdicts (Excellent / Good / Needs work).
* SEO title + meta description editor with live SERP preview (desktop + mobile) and character-band gauges.
* Title variables: `%%title%%`, `%%sep%%`, `%%sitename%%`.
* Open Graph + Twitter card overrides per post; default fallbacks from featured image.
* Canonical URL, robots noindex/nofollow, slug — all in one panel.
* JSON-LD schema output (Article, BlogPosting, NewsArticle, Product, Recipe, HowTo, FAQ, Event, and more) with per-post overrides.
* XML sitemap at `/ebq-sitemap.xml` (posts, pages, custom post types, taxonomies).
* Breadcrumb shortcode + JSON-LD BreadcrumbList output.

**Live insights from your EBQ workspace**

* Live SEO score combining Search Console, Lighthouse, and on-page audit signals — refreshes after every save.
* Per-post Search Console performance: 30-day and 90-day clicks, impressions, average position, CTR.
* Top GSC queries actually driving traffic to each page.
* Cannibalization detection from real GSC data — flags when other pages on your site compete for the same query.
* Striking-distance opportunity flags (queries ranking 5–20 with strong impressions).
* Rank tracking with daily position snapshots and movement deltas.
* Core Web Vitals + Lighthouse performance scores per page.
* Page audit deep-links into your EBQ dashboard.

**AI writing assistant (Pro)**

* **Rank Assist** — a floating SEO copilot on every post edit screen. Ask for fixes; it explains what it understood and proposes structured changes you confirm with one click. Auto-saves on apply.
* **Inline AI block toolbar** — re-write, extend, summarise, fix grammar, change tone, translate, convert to list, convert to table, custom command — all from any text block.
* **AI Writer** — generate full-post drafts from a focus keyphrase + brief.
* **Title generator** — five SEO-optimised title suggestions based on focus keyphrase and SERP intent.

**Migration tools**

* Detect and import data from existing SEO plugins (titles, descriptions, focus keyphrases, schema choices, redirects).
* Run as a one-time bulk operation from Settings → EBQ SEO.

**Redirects & 404 tracking**

* 301/302 redirect manager with import from existing redirect plugins.
* 404 tracker logs missing-page hits and suggests automated redirects from related content.

**One-click connect — no codes, no tokens**

A guided setup wizard runs on first activation: connect to EBQ, pick a plan (skip if you'd rather), and you're done in under a minute. Core SEO features (sitemap, schema, meta tags, redirects, on-page scoring) work without an EBQ account; AI features and live data unlock when you connect.

**Pro is free for 30 days.** Pick Pro in the wizard → 30-day trial starts → no charge during the trial → cancel anytime from your EBQ workspace. Card on file required to start the trial.

Free tier covers all on-page essentials and live insights once connected; Pro unlocks the AI assistant, AI Writer, AI inline toolbar, and live audits. Every paid plan starts with the 30-day free trial.

**Self-hosted EBQ:** add `define('EBQ_API_BASE', 'https://your-ebq-host');` to `wp-config.php` before activating.

== Installation ==

1. Upload the `ebq-seo` folder to `/wp-content/plugins/` (or use *Plugins → Add New → Upload*).
2. Activate through **Plugins** in WordPress.
3. Go to **Settings → EBQ SEO** and click **Connect to EBQ**.
4. Log in to EBQ, pick which website to link, approve.
5. You'll bounce back to WordPress with the connection live.

== Frequently Asked Questions ==

= Do I need an EBQ account to use this plugin? =

Yes. EBQ SEO is a connected plugin — the live insights, rank tracking, and AI features all come from your EBQ workspace. Sign up free at https://ebq.io. The plugin's core on-page output (meta tags, sitemap, schema, redirects) works immediately on connect; live data populates as your EBQ workspace pulls Search Console history.

= Will this conflict with another SEO plugin I already have installed? =

EBQ SEO detects when another SEO plugin is active and disables its own meta-tag output to avoid duplicates. To fully migrate, run the migration banner under Settings → EBQ SEO — it imports your existing focus keyphrases, titles, descriptions, schema settings, and redirects, then you can deactivate the old plugin.

= Is the AI writer included? =

Yes — Rank Assist (the chatbot), the AI block toolbar, and the AI Writer page are bundled. They require an EBQ Pro plan, which starts with a 30-day free trial. The free tier shows the features but routes Pro-only actions to an upgrade prompt.

= How does the free trial work? =

Pick Pro (or Starter / Agency) in the setup wizard or on https://ebq.io/pricing. You'll be sent to Stripe's hosted checkout to put a card on file. The trial begins immediately, no charge for 30 days. Cancel anytime during the trial from your EBQ workspace and you won't be billed. After the trial ends, your card is charged the monthly amount and the subscription continues until cancelled.

= Where does my data go? =

Connection traffic flows between your WordPress install and your EBQ workspace at `https://ebq.io` (or your self-hosted EBQ instance). EBQ doesn't share your data with third parties. See https://ebq.io/privacy.

= Does the plugin work without connecting? =

The plugin shows a connect prompt until you link a site. On-page essentials (meta, schema, sitemap, breadcrumbs, redirects) start emitting once connected; AI features and live data require an active EBQ workspace.

= How do I disable a specific feature site-wide? =

EBQ workspace admins can toggle individual value-add features (Rank Assist, AI Writer, AI inline toolbar, live audit, rank tracking, dashboard widget, posts-list column, redirects) on or off per website from the EBQ admin portal. Core SEO output (sitemap, schema, meta tags, breadcrumbs) is always on.

= I'm self-hosting EBQ. Can I still use the plugin? =

Yes. Add `define('EBQ_API_BASE', 'https://your-ebq-host');` to `wp-config.php` before activating, then connect normally — the OAuth flow will route through your self-hosted EBQ instance.

== Screenshots ==

1. Gutenberg sidebar — focus keyphrase, score chips, snippet preview, AI rewrite button.
2. Live insights tab — Search Console performance, rank tracking, cannibalization warnings.
3. Rank Assist chatbot — floating SEO copilot with structured action proposals.
4. Inline AI block toolbar — re-write, extend, summarise, translate, custom command.
5. Settings — one-click connect to EBQ workspace.
6. EBQ HQ admin page — keyword tracking, performance, indexing status.

== Upgrade Notice ==

= 1.0.5 =
Fixes the self-update from EBQ HQ deactivating the plugin and showing an access error after updating.

= 1.0.4 =
Maintenance release.

= 1.0.3 =
Fixes the "not allowed to access this page" error on the EBQ HQ → Plugin update screen.

= 1.0.2 =
Plugin updates now run from EBQ HQ → Plugin update (no WordPress Updates screen needed). Promotional pricing messaging: free for a limited time, then from $5/month.

= 1.0.1 =
Adds a Plugin update page under EBQ HQ (one-click in-place update), plus fixes for the block-editor slash console, cannibalization/striking-distance/quick-wins reports (now showing ranking URLs), and SEO Performance table alignment.

= 1.0.0 =
Production release on WordPress.org. Adds remote feature toggles, tightened SEO + readability scoring, 16-action AI assistant, live audit refresh on save, and a comprehensive set of on-page checks.

= 2.2.0 =
Adds title variables, taxonomy XML sitemaps, breadcrumbs, content analysis checklist, readability panel, advanced robots field.

== Changelog ==

= 1.0.5 =
* Fixed self-update from EBQ HQ → Plugin update deactivating the plugin and then showing "Sorry, you are not allowed to access this page". The plugin's active state is now preserved across the in-place upgrade.

= 1.0.4 =
* Maintenance release.

= 1.0.3 =
* Fixed "Sorry, you are not allowed to access this page" on EBQ HQ → Plugin update — the page now uses the same `manage_options` capability as the rest of EBQ HQ, with a clear message when file modifications are locked (DISALLOW_FILE_MODS).

= 1.0.2 =
* Updates run entirely from EBQ HQ → Plugin update (the native WordPress Updates screen is no longer used).
* Setup wizard pricing step: during a free promotion the plan grid is hidden and replaced with "free for a limited time, then just $5/month" messaging.

= 1.0.1 =
* Plugin update page: EBQ HQ → Plugin update shows the installed vs latest version and updates the plugin in place with one click. Updates can be paused globally from the EBQ workspace admin.
* EBQ HQ Insights/Reports: cannibalization report now shows primary page, page count, total clicks/impressions, "at stake" value, and competing pages with share %; striking-distance and quick-wins now show the ranking URL with its position.
* Block editor: fixed the "//" AI slash console rendering with no styling on some installs (layout now inline-resilient).
* SEO Performance: fixed Top winning/losing keyword tables where right-aligned headers didn't line up with their cells.
* Rank tracker: removed the manual "re-check now" action (checks run on the automatic schedule).

= 1.0.0 =
* Public release on WordPress.org plugin marketplace.
* Remote feature-toggle system: EBQ workspace admins enable/disable Rank Assist, AI Writer, AI inline toolbar, live audit, EBQ HQ, redirects, dashboard widget, and posts-list column per website. Core SEO output stays always-on.
* SEO scoring rewrite: worst-bullet-wins headline, weighted numeric score, floor-cap so the chip's number, colour, and label always agree.
* Readability scoring rewrite: worst-bullet-wins, weighted score, consecutive-sentence-start check, stricter paragraph thresholds.
* Sidebar header: replaced averaged "overall" chip with two per-tab chips (SEO + Readability) so failures aren't masked by averages.
* Rank Assist: 16 structured action types (post title, focus keyword, meta title/description, slug, canonical, OG/Twitter cards, schema type, robots, prepend heading, rewrite paragraph, refresh live audit). Auto-saves on Apply in the block editor. Refetches live audit after every send.
* New SEO checks: keyphrase length, keyphrase distribution, cross-post cannibalization (live GSC data), additional-keyphrase stuffing detection, number-in-title CTR boost, power-words CTR boost, dofollow/nofollow split.
* New readability check: consecutive sentence starts.
* Token-boundary slug check (no more substring false positives).
* Relative-URL link classification fix in the body analyser.
* Inline AI toolbar: icon sized to match Dashicons, dark-mode media-query removed (was breaking light-mode editors), CSS enqueue path fixed.
* Schema sources panel generalised — no longer names competitor plugins by brand.
* WP.org compliance: Domain Path header, .distignore, license.txt, FAQ + Screenshots + Upgrade Notice readme sections.

= 2.2.1 =
* Version bump.

= 2.2.0 =
* Title variables (`%%title%%`, `%%sep%%`, `%%sitename%%`), taxonomy XML sitemaps, visible breadcrumbs + shortcode, analysis cache on save.
* Gutenberg: content analysis checklist, readability panel, advanced robots field, SERP preview uses resolved titles.
* EBQ API: primary GSC query, URL Inspection summary, audit report deep links; sidebar actions for new audit and full report.

= 1.0.0 =
* Initial release: one-click OAuth-style connect, Gutenberg sidebar, admin column, dashboard widget.
