=== CitedSEO ===
Contributors: adworksbid
Tags: ai seo, local seo, rank tracker, schema, google search console
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 1.3.17
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The WordPress SEO plugin built for AI-era search. On-page analysis, schema, rank tracker, local SEO, AI search visibility, GSC & GA4 — all free. PRO adds AI prompt tracking across ChatGPT, Gemini, Perplexity and Copilot, plus GEO, AEO, and white-label reports.

== Description ==

The first WordPress SEO plugin built for AI-era search. While other plugins optimize only for Google's traditional results, CitedSEO also prepares your content for where search is going: ChatGPT, Perplexity, Gemini, and Google AI Overviews. Everything below is free — no locked features, no trial limits.

**On-Page SEO**
Analyze any post or page against its focus keyword. Scores title, meta description, content length, keyword usage, headings, images, and internal links. Scores appear as a colored circle directly in the Posts and Pages list tables (similar to Rank Math's column) so you can triage your entire site at a glance.

**XML Sitemaps**
Auto-generated sitemaps for posts, pages, taxonomies, images, and Google News. Served virtually — no static file needed. Submit to Google Search Console and Bing Webmaster Tools from the Sitemap admin page. Flush cache on demand.

**Google Search Console Integration**
Connect GSC via OAuth and pull clicks, impressions, CTR, and average position directly into your WordPress dashboard. Date-range selector (7/28/90/180 days and custom). Top pages and top queries tables with period-over-period change.

**Google Analytics 4 Integration**
Connect GA4 via the same OAuth flow. Traffic data feeds the CitedSEO dashboard alongside GSC data.

**Rank Tracker**
Track unlimited keywords and their Google Search Console positions. Historical position chart per keyword. Daily automatic position refresh via WP-Cron.

**Local SEO**
Add and manage business locations with full address, phone, email, geo-coordinates, business hours, and price range. Automatically generates LocalBusiness schema markup.

**Hreflang Manager**
Define language/region pairs and let CitedSEO inject the correct hreflang link elements in `<head>` across your site.

**Redirects**
Create, edit, and delete 301/302 redirects from the admin. Tracks hit counts per redirect.

**Broken Link Checker**
Scans all internal and external links in your content. Displays HTTP status codes and last-checked timestamps. Manual scan on demand, with opt-in automatic daily background scan via WP-Cron.

**Bulk Editor**
Edit title tags and meta descriptions for hundreds of posts in a spreadsheet-style table. Export to CSV.

**Content Decay**
Flag posts whose organic traffic has been declining. Prioritize which content to refresh first.

**Keyword Cannibalization Scanner**
Detect when multiple pages are competing for the same focus keyword and risking self-competition in Google.

**Schema Markup**
Add Article, FAQ, Product, Recipe, Event, Local Business, Breadcrumb, and more — with a clean admin UI. Output as JSON-LD in `<head>`.

**Instant Indexing**
Submit URLs directly to Google's Indexing API and Bing Webmaster Tools for faster crawling after publish or update.

**WooCommerce SEO**
Optimized title and meta templates for product pages. Bulk-fix missing product image alt text.

**Dashboard**
KPI strip showing clicks, impressions, CTR, and average position from GSC and Bing. Traffic chart with range selector. SEO snapshot widget on the native WordPress Dashboard screen.

**Built for AI-Era Search**
AI engines like ChatGPT, Perplexity, Gemini, and Google AI Overviews now surface content before users ever click a search result. CitedSEO builds the foundations these engines rely on: structured schema markup, well-defined entities, clean on-page signals, and fast-loading pages. Every feature in this plugin contributes to how confidently an AI engine can read, understand, and cite your content.

For full AI Search Optimization including GEO (Generative Engine Optimization), AEO (Answer Engine Optimization), AI prompt tracking across ChatGPT, Gemini, Perplexity, Copilot, and Claude, and llms.txt generation, upgrade to CitedSEO PRO.

**Extend with CitedSEO PRO**
CitedSEO PRO is a separate, optional add-on available at [adworks.bid/awbseo-pro](https://adworks.bid/awbseo-pro/). Pro features include:

* **GEO / AI SEO** — Optimize content for Generative Engine Optimization and Answer Engine Optimization. Auto-generates llms.txt and structured AI-friendly content signals.
* **AI Search Optimizer** — Track how your brand appears in ChatGPT, Gemini, Perplexity, Copilot, and Claude across your target prompts.
* **Brand Visibility on AI Engines** — Monitor and grow brand citations in AI-generated answers.
* **AI Content Writer** — Generate SEO-optimized drafts using your own AI API key (OpenAI, Anthropic, Google, Perplexity).
* **AI Link Architecture** — Smart internal linking powered by semantic analysis.
* **Local Rank Grid** — Visualize keyword rankings across a geographic grid map.
* **Core Web Vitals Monitor** — Track LCP, INP, and CLS via PageSpeed Insights API.
* **Revenue Intelligence** — Connect revenue data to SEO performance.
* **White-label Client Reports** — Branded PDF reports with your logo and client data.

The free plugin works fully without Pro.

== Installation ==

1. Upload the `adworksbid-seo` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **CitedSEO → Dashboard** to start setup.
4. Connect Google Search Console via **Settings → GSC** to unlock traffic data.

== Frequently Asked Questions ==

= Is everything really free? =

Yes. All features listed in the description are fully functional with no usage limits. CitedSEO PRO is a separate add-on, not a trial or upgrade gate on the free features.

= Does this plugin track my users? =

No. CitedSEO does not collect or transmit user data. The Google Search Console and GA4 integrations use OAuth tokens stored only in your own WordPress database and communicate directly between your site and Google's servers.

= Is it compatible with Gutenberg? =

Yes. The meta box and all admin pages work in both the classic editor and the block editor.

= Can I use this with WooCommerce? =

Yes. The WooCommerce SEO module generates optimized title and meta templates for product archive pages and individual product pages.

= Does it conflict with Yoast, Rank Math, or SEOPress? =

Running two SEO plugins simultaneously can cause duplicate meta tags. We recommend deactivating other SEO plugins when using CitedSEO.

= How is CitedSEO different from Yoast SEO or Rank Math? =

CitedSEO includes everything those plugins offer — on-page analysis, schema, sitemaps, redirects — plus features they don't have: a built-in rank tracker, content decay detection, keyword cannibalization scanner, AI search visibility foundations, and local SEO, all free with no feature gates. CitedSEO PRO adds AI prompt tracking across ChatGPT, Gemini, Perplexity, Copilot, and Claude, plus GEO and AEO content optimization and white-label client reports.

= Does CitedSEO help with AI search visibility (ChatGPT, Perplexity, Gemini)? =

Yes. CitedSEO builds the technical foundations AI engines rely on to read, understand, and cite your content: structured schema markup, clean on-page signals, entity optimization, and fast-loading pages. CitedSEO PRO adds full AI prompt tracking across ChatGPT, Gemini, Perplexity, Copilot, and Claude, plus GEO (Generative Engine Optimization) and AEO (Answer Engine Optimization) content transformation.

= What is GEO and AEO? =

GEO (Generative Engine Optimization) and AEO (Answer Engine Optimization) are the practices of structuring and writing content so AI engines can extract, cite, and recommend it in their answers. This goes beyond traditional SEO — it means direct-answer paragraphs, clear entity definitions, scannable Q&A structure, and content that AI engines can quote accurately. CitedSEO PRO handles this for WordPress sites.

== Screenshots ==

1. Dashboard — GSC and Bing traffic KPIs with date range selector
2. Posts list — SEO score column with keyword and T/D/K status pills
3. Bulk Editor — spreadsheet-style title and meta editing
4. Sitemap admin — live URL counts and reachability status
5. Rank Tracker — keyword positions with history chart
6. Local SEO — business location manager

== External Services ==

This plugin connects to the following external services when you explicitly configure and use those integrations. No data is sent automatically without user action.

= Google Search Console API =
Used to pull clicks, impressions, CTR, and position data into your WordPress dashboard. Activated when you connect GSC via OAuth in Settings. Data is sent to `https://searchconsole.googleapis.com` and `https://oauth2.googleapis.com`.
* [Google Privacy Policy](https://policies.google.com/privacy)
* [Google Terms of Service](https://policies.google.com/terms)

= Google Analytics 4 API =
Used to display GA4 traffic data in the dashboard. Activated when you connect GA4 via OAuth in Settings. Data is sent to `https://analyticsdata.googleapis.com` and `https://analyticsadmin.googleapis.com`.
* [Google Privacy Policy](https://policies.google.com/privacy)
* [Google Terms of Service](https://policies.google.com/terms)

= Bing Webmaster Tools API =
Used to pull Bing search performance data and submit sitemaps. Activated when you connect Bing in Settings. Data is sent to `https://ssl.bing.com/webmaster`.
* [Microsoft Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement)
* [Microsoft Services Agreement](https://www.microsoft.com/en-us/servicesagreement)

= IndexNow API =
Used to notify search engines (Bing, Yandex, Cloudflare) when URLs are published or updated. Activated only when the Instant Indexing feature is enabled and auto-submit is turned on in Settings. URLs are sent to `https://api.indexnow.org/indexnow`.
* [IndexNow Privacy Policy](https://www.indexnow.org/privacy)
* [IndexNow Terms](https://www.indexnow.org/terms)

= AdWorks.Bid OAuth Broker =
Used to exchange Google OAuth authorization codes for access tokens without exposing client secrets in the browser. Activated when you connect GSC or GA4. Your site URL, a temporary authorization code, and a nonce are sent to `https://oauth.adworksbid.com`. No post content or user data is transmitted.
* [AdWorks.Bid Privacy Policy](https://adworks.bid/privacy-policy)
* [AdWorks.Bid Terms of Service](https://adworks.bid/terms-of-service)

= Google Fonts (Cairo) =
Used to load the Cairo typeface for the plugin admin interface. A request is made to `https://fonts.googleapis.com` on every CitedSEO admin page load to fetch the font stylesheet. No user data is transmitted — only a standard browser font request.
* [Google Privacy Policy](https://policies.google.com/privacy)
* [Google Fonts Terms of Service](https://developers.google.com/fonts/faq/privacy)

== Changelog ==

= 1.3.15 =
* Fix: Admin sidebar icon now displays in its original golden color instead of being converted to white by WordPress's default menu filter.

= 1.3.12 =
* Fix: On-page analyzer word count now accurate for WPBakery, Elementor, and all page builders — falls back to HTTP fetch of the public page URL when admin-context rendering cannot extract meaningful text.

= 1.3.11 =
* Fix: On-page analyzer shortcode extraction now uses O(n) PCRE-safe regex — eliminates silent failures on large page builder pages that hit PHP's pcre.backtrack_limit.

= 1.3.10 =
* Fix: On-page analyzer page builder fallback now triggers correctly for all WPBakery and Elementor pages regardless of content structure.

= 1.3.9 =
* Fix: On-page analyzer now extracts text from shortcode attributes (text, title, heading) in addition to inner content — button labels and heading text now included in word count.

= 1.3.8 =
* Fix: On-page analyzer word count fallback for page builders now uses a dedicated raw-content extraction path that preserves structural checks (images, links, headings).

= 1.3.7 =
* Fix: On-page analyzer correctly detects page builder content and applies text extraction fallback when the_content filter returns unrendered shortcodes in admin AJAX context.

= 1.3.6 =
* Fix: Shorten plugin description to 3 lines in the WordPress admin plugins list.

= 1.3.5 =
* Fix: Add load_plugin_textdomain() so bundled translations load correctly.
* Fix: Remove dead database query in sitemap page count (post_type = 'post_type' typo).
* Fix: Remove Google Fonts hotlink from admin CSS — no external font requests on admin pages (GDPR).
* Fix: Replace number_format() with number_format_i18n() across all display contexts for proper locale support.
* Fix: Replace date('Y') with date_i18n('Y') in content decay suggestions.
* Fix: Extend disable_competitors() to also suppress Rank Math, All in One SEO, and SEOPress head output.

= 1.3.4 =
* Fix: Replace all remaining AWBSEO references in readme description, FAQ, and installation with CitedSEO branding.

= 1.3.3 =
* Add citedseo search tags to improve discoverability on WordPress.org.

= 1.3.2 =
* Fix: Dashboard widget title and footer link now display CitedSEO branding.

= 1.3.1 =
* Rebranded plugin display name from AdWorksBid SEO to CitedSEO. Internal prefixes unchanged.

= 1.3.0 =
* New: React-powered meta box with live on-page analysis.

= 1.2.11 =
* New: Export / Import — back up all SEO data (settings, redirects, rank tracker, local SEO, per-page meta) to a JSON file and restore it on any site. Available under AWBSEO > Export / Import.

= 1.2.10 =
* Improvement: CitedSEO dashboard widget now always appears at the top of the WordPress admin dashboard, above all other widgets.

= 1.2.9 =
* Fix: Setup wizard no longer freezes at "Scanning for existing SEO data..." — a PHP nowdoc was incorrectly used to build the wizard's inline JavaScript, causing a `<?php echo ... ?>` tag to appear as literal text instead of being evaluated, which produced a JS syntax error that prevented the entire wizard script from running.

= 1.2.8 =
* Fix: AJAX action names now use the consistent `awbseo_*` prefix throughout the admin — eliminates silent failures when multiple AJAX handlers were registered under mismatched action strings.
* Fix: Inline admin JavaScript blocks now attach to the correct enqueued script handle (`awbseo-admin`) so all admin UI interactions load reliably.
* Compatibility: Improved compatibility with CitedSEO PRO — shared action hooks and nonce names are now consistent across both plugins.

= 1.2.7 =
* Fix: Instant Indexing — when "Submissions Logged" is 0, a contextual info box now explains that submissions only trigger on publish/update and directs users to Bulk Submission for existing content.
* Fix: Revenue Intelligence — when Google Search Console is not connected, a prominent full-width callout now dominates the screen instead of a small inline banner, making the setup requirement impossible to miss.
* Fix: Client Reports — default report title now includes the current time (e.g. "SEO Report - Jul 12, 2026 (3:45 PM)") so clicking Generate multiple times no longer creates identically-named duplicate entries.
* Fix: Core Web Vitals Monitor — when no PageSpeed Insights API key is set, a large prominent callout (with setup instructions and a direct link to the settings form) now appears at the top of the screen before the URLs table.
* Fix: AI Link Architecture — when 0 of N pages have been scanned (indexed === 0), the overview tab now shows a "Run your first scan" prompt instead of misleading zero-counts for Orphan Pages, Broken Links, and Health Score.
* Fix: WooCommerce SEO menu item is now automatically hidden when WooCommerce is not installed or active.
* Fix: Freemius "Yee-haw!" activation banner now auto-dismisses after 5 seconds on first display, so it confirms license activation once without persisting across every admin page.
* Fix: Arabic URL paths in the Rank Tracker Quick Wins table now display as readable text (was showing percent-encoded strings).
* Fix: Schema Types page no longer references "RankMath" by name — replaced with "Other SEO plugins".

= 1.2.6 =
* Improvement: Full visual redesign of all plugin sections — lighter page background (#f1f5f9), white cards with soft shadows, deeper navy palette, updated teal accent (#00c9a7), cleaner borderless tables with colored position pills, pill-shaped range selector, modern KPI cards with larger values and colored change badges, updated severity/badge colors throughout.
* Improvement: "Suggest For Me" button redesigned — gradient teal pill with shimmer animation, hover lift effect, and drop shadow. Distinct and premium-looking, matching the new design language.

= 1.2.5 =
* Feature: "Suggest For Me" now routes through AdWorks.Bid's own AI broker (Claude Haiku). No API key required from users — the feature works out of the box.

= 1.2.4 =
* Improvement: "Suggest For Me" button now works without an OpenAI API key — falls back to extracting the first 155 characters from the post content. Add an OpenAI key in Settings for AI-written suggestions.

= 1.2.3 =
* Fix: "Suggest For Me" now surfaces the actual OpenAI error message (quota exceeded, invalid key, rate limit, etc.) instead of the generic "empty response" fallback.

= 1.2.2 =
* Fix: "Suggest For Me" AJAX handler was calling AWBSEO_Core::get_settings() which does not exist, causing a 500 error. Now uses get_option('awb_seo_settings') directly.

= 1.2.1 =
* Fix: "Suggest For Me" AI button now works in the Bulk Editor — admin scripts were not loading on plugin submenu pages due to an incorrect hook check.
* Feature: "Suggest For Me" AI button added to the individual post/page meta box meta description field.
* Fix: Meta description counter and maxlength in the meta box updated to 155 characters (was 160/200).

= 1.2.0 =
* Fix: Bulk Editor meta description field now enforces a hard 155-character limit (maxlength) and marks the counter red above 155.

= 1.1.9 =
* Feature: Bulk Editor now has a "Suggest For Me" button on each meta description field — calls OpenAI gpt-4o-mini to generate an SEO-optimized description from the post title, focus keyword, and content. Requires an OpenAI API key in Settings.

= 1.1.8 =
* Improvement: Bulk editor meta description placeholder now shows a suggestion derived from the post excerpt or content instead of generic text.

= 1.1.7 =
* Fix: Added wp_unslash() around $_SERVER['REQUEST_URI'] in class-instant-indexing.php and class-redirects.php per WPCS standards.
* Fix: Added wp_unslash() around $_SERVER['PHP_SELF'] in class-setup-wizard.php.
* Fix: Added absint() and (int) casts to all unescaped integer echoes in bulk-editor.php.

= 1.1.6 =
* Fix: Restored privacy policy and terms of service links in readme.txt External Services section — pages are now live at adworks.bid/privacy-policy and adworks.bid/terms-of-service.

= 1.1.5 =
* Fix: Text domain changed from 'awb-seo' to 'adworksbid-seo' across all PHP files to match the WordPress.org plugin slug. Language files renamed accordingly.
* Fix: Chart.js updated from 4.4.0 to 4.5.1 (latest stable).
* Fix: Removed 404 privacy/terms URLs from External Services section in readme.txt.

= 1.1.4 =
* Fix: Rank Tracker page now displays in Arabic when site language is set to Arabic. All strings in rank-tracker.php are now wrapped with __()/_e() so the .mo translations take effect.
* Updated: awb-seo-ar.po/.mo expanded from 256 to 280 strings — all rank tracker strings added with Arabic translations.

= 1.1.3 =
* Fix: Health check rows (.awb-hc-*) now render as a proper grid with icon, label, progress bar, count, and fix link — previously had no CSS so all elements ran together without layout.
* Fix: Cairo font now applied to all text inside the plugin via .awb-seo-wrap * — fixes inconsistent font across labels, table cells, and stat values.
* Fix: On Arabic/RTL sites, Cairo applied to entire #wpbody including the admin sidebar via admin-rtl.css, so all AWBSEO menu items also render in Cairo.
* Improvement: More generous padding on cards (26px 30px), KPI cards (22px 24px), and page body to give the dashboard more breathing room.
* Improvement: Health score ring sized to 72px; section header layout uses flex to keep score ring aligned with title.
* Improvement: RTL overrides for KPI strip, date picker, chart legend, analytics tables, and health-check row column order added to admin-rtl.css.

= 1.1.2 =
* New: Cairo font (Google Fonts) loaded across all AWBSEO admin pages. Cairo supports Arabic and Latin, giving the plugin a consistent typeface in both languages. RTL sites get Cairo applied explicitly via admin-rtl.css.

= 1.1.1 =
* Fix: Dashboard content area (KPI cards, table headers, chart labels, health checks) now displays in Arabic when site language is set to Arabic. All strings in dashboard.php are now wrapped with __()/_e() so the .mo translations take effect. (1.1.0 only translated menu items, which were already wrapped — the content area was still hardcoded English.)
* Updated: awb-seo-ar.po/.mo expanded from 202 to 256 strings — all dashboard strings added with Arabic translations.

= 1.1.0 =
* New: Full Arabic UI — 202 strings translated to Arabic (languages/awb-seo-ar.po + awb-seo-ar.mo). Set WordPress site language to Arabic and the entire admin interface switches to Arabic automatically.
* New: RTL admin stylesheet (admin-rtl.css) — WordPress loads it automatically on Arabic/Hebrew/RTL sites. Covers all admin pages, meta box, score column, tables, forms, and the setup wizard.
* New: Arabic-aware on-page analyzer — detects Arabic content and switches to Unicode-safe word counting (fixing str_word_count() which returns 0 for Arabic). Keyword density uses morphological root matching for single-word Arabic keywords, and sliding-window phrase matching for multi-word Arabic keywords.
* Fix: 3 hardcoded strings in meta-box.php now wrapped with esc_html__() for translatability.

= 1.0.7 =
* Fixed: Pro plugin admin menu not appearing when both plugins are active. Root cause: WordPress loads plugins alphabetically, so adworksbidseo-pro loads before awb-seo and defines awb_fs() first; the free plugin's Freemius guard then returned early, skipping all class and admin menu registration. The guard now only prevents true double-loads — the free plugin always initializes fully regardless of load order.

= 1.0.6 =
* Fixed: Pro plugin dependency check — "CitedSEO PRO requires the free plugin" error no longer appears when Pro loads before the free plugin. AWB_SEO_VERSION is now defined before the Freemius guard so Pro can always detect the free plugin regardless of load order.

= 1.0.5 =
* SEO score column: fixed colored circle not rendering on Posts/Pages list tables — CSS was only loaded on plugin admin pages, now also loads on edit.php.

= 1.0.4 =
* Bulk Editor: fixed fatal error when switching post type to Pages — the Bulk Editor now correctly loads and displays all published post types including Pages.

= 1.0.3 =
* Schema output: removed `JSON_UNESCAPED_UNICODE` flag from `wp_json_encode()` calls — non-ASCII characters are now safely encoded as `\uXXXX` sequences.
* Schema meta-manager: replaced `stripslashes()` with `wp_unslash()` per WordPress coding standards.
* Updated all plugin-internal URLs from `adworksbid.com` to `adworks.bid` (upgrade prompts, admin Go Pro page, OAuth broker, readme external service declaration).

= 1.0.2 =
* Removed WooCommerce SEO locked overlay — all features are now fully free with no upgrade gate.
* Broken Link Scanner: removed false "daily auto-scan" claim; added opt-in toggle (off by default) to comply with WP.org Guideline 7.
* Instant Indexing: changed auto-submit default from ON to OFF — user must explicitly enable in Settings.
* Removed `JSON_UNESCAPED_SLASHES` from schema JSON-LD output to prevent XSS via forward-slash sequences.
* Fixed plugin header URLs (Plugin URI, Author URI) from 404 domain to https://adworks.bid/.
* Fixed `uninstall.php` — removed non-existent `awb_seo_instant_indexing_settings` option key; added `awbseo_bls_auto`.
* Updated all readme.txt adworksbid.com links to adworks.bid.

= 1.0.1 =
* Renamed plugin to "CitedSEO" for WordPress.org directory compliance.
* Tested up to WordPress 7.0.
* Moved all inline `<script>` and `<style>` blocks to `wp_enqueue_script()` / `wp_enqueue_style()` / `wp_add_inline_script()` / `wp_add_inline_style()`.
* Added `wp_unslash()` and proper sanitization to all `$_POST` reads.
* Bundled Chart.js 4.4.0 locally — removed external CDN dependency.
* Made Broken Link Scanner background cron opt-in (off by default).
* Fixed Instant Indexing auto-submit checkbox save logic.
* Added `== External Services ==` section to readme.txt.

= 1.0.0 =
* Initial release as a standalone free plugin.
* Includes: on-page analysis, schema, XML sitemaps, redirects, bulk editor, rank tracker (unlimited keywords), local SEO, hreflang manager, GSC integration, GA4 integration, Bing integration, broken link checker, content decay detection, keyword cannibalization scanner, WooCommerce SEO, instant indexing, SEO score post column, and dashboard widget.

== Upgrade Notice ==

= 1.0.1 =
WordPress.org compliance update — recommended for all users.

= 1.0.0 =
Initial release.
