=== GSC Fixer ===
Contributors: gscfixer
Tags: google search console, seo, sitemap, indexing, canonical, yoast, schema, indexnow
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The only WordPress plugin that doesn't just report your Google Search Console issues — it fixes them.

== Description ==

Every GSC tool on the market is read-only. They tell you what's broken. None of them fix it.

GSC Fixer detects AND fixes — one click.

**Free Features:**

* Connect Google Search Console via OAuth (secure, read-only)
* Full diagnostic dashboard with health score (0-100)
* 12 automated checks detecting sitemap issues, broken canonicals, indexing gaps, position regression, and more
* Daily monitoring with admin bar health indicator
* Weekly email report with position trends and top movers
* Top queries table (clicks, impressions, position, CTR)
* Compatible with Yoast SEO, Rank Math, All in One SEO

**PRO Features (85 USD/year):**

* One-click fixes for every detected issue — with automatic rollback SQL generation
* Fix sitemap noindex headers (the #1 Yoast bug affecting 13M+ sites — no file editing needed)
* Fix null canonicals (bulk SQL with rollback)
* Fix relative canonicals (cause silent sitemap exclusion)
* Fix is_public NULL rows (pages excluded from sitemap)
* Fix stale canonicals (sync to permalinks)
* Fix robots.txt (sitemap directive injection)
* IndexNow push — automatically notify Bing/Yandex/DuckDuckGo on every post publish
* SEO drift detection — weekly baselines + daily comparison + alerts on canonical/noindex/H1 changes
* Fix history with one-click revert
* Position comparison reports (30-day vs previous 30-day)

**What makes GSC Fixer different:**

Yoast tells you to write better meta descriptions. GSC Fixer tells you your sitemap has been invisible to Google for 6 months — and fixes it with one click.

== Installation ==

1. Upload `gsc-fixer.zip` to your WordPress admin (Plugins > Add New > Upload Plugin)
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Tools > GSC Fixer (or the GSC Fixer menu item)
4. Click "Connect Google Search Console" and authorize with your Google account
5. Select the GSC property you want to monitor
6. Click "Run Scan Now" to see your first diagnostic report

== Frequently Asked Questions ==

= Does this modify my Google Search Console data? =

No. The free tier uses read-only GSC API access. PRO fixes modify your WordPress database (Yoast indexable table, rewrite rules) — never your Google account. Every fix generates a rollback SQL snippet before execution.

= Is it safe? =

Every PRO fix:
* Generates rollback SQL before executing
* Stores the rollback in the fix history table
* Shows a confirmation modal with affected row count
* Can be reverted with one click from the Fix History page

= Does it work without Yoast? =

Yes. GSC Fixer auto-detects Yoast SEO, Rank Math, All in One SEO, SEOPress, and The SEO Framework. For sites without an SEO plugin, WordPress core sitemap support is used. The diagnostic checks that read SEO plugin tables (canonicals, is_public) are skipped when no compatible plugin is detected — the remaining checks still run.

= What is the sitemap noindex bug? =

Yoast SEO emits an `X-Robots-Tag: noindex, follow` HTTP header on all sitemap XML files. Google interprets this as "don't index these sitemap URLs," which can prevent your pages from being discovered. This affects all 13M+ Yoast installs. GSC Fixer detects this and fixes it with an output buffer filter — no file editing needed, survives Yoast updates.

= How does IndexNow work? =

When you publish or update a post, GSC Fixer automatically sends the URL to the IndexNow API, which notifies Bing, Yandex, DuckDuckGo, Seznam, and Naver. This speeds up indexing of new and modified content without waiting for the search engines to crawl naturally.

== Changelog ==

= 1.1.0 =
* NEW check: canonical-redirect loop — detects indexable canonicals pointing at URLs that redirect back to the page (slug-rename drift) or at dead URLs (404/410 canonical dead-ends)
* NEW check: stale postmeta canonicals — catches postmeta vs Yoast-indexable canonical disagreement (the two-table drift that causes "Page with redirect" in GSC and silent sitemap exclusion)
* NEW check: crawler IP block — detects firewall/country-block plugins serving 403 to search-engine crawlers (site-wide 403 with text/plain body)
* NEW fix: one-click canonical-redirect loop repair (canonical → permalink, syncs postmeta, rollback recorded)
* NEW fix: one-click stale postmeta canonical alignment
* All HTTP probes now send a browser User-Agent (server-side self-fetches with the default WP UA get 403'd by ModSecurity on many hosts)

= 1.0.0 =
* Initial release
* GSC OAuth connection
* 12 diagnostic checks (sitemap noindex, null/relative/stale canonicals, is_public, is_robots_noindex, missing meta, robots.txt, schema, sitemap status, indexing, position regression)
* Health score (0-100)
* Daily monitoring with admin bar indicator
* PRO: one-click fixes with rollback
* PRO: IndexNow push
* PRO: SEO drift detection
* PRO: weekly email reports
* PRO: position comparison
* Yoast + Rank Math + AIOSEO compatibility

== Upgrade Notice ==

= 1.1.0 =
Adds detection + one-click fixes for canonical-redirect loops, stale postmeta canonicals, and crawler IP blocks. Also fixes server-side self-fetch false negatives on ModSecurity hosts.

= 1.0.0 =
First release! Install and connect your Google Search Console to start diagnosing and fixing SEO issues automatically.