=== Content Performance Analyzer – GA4 & Search Console Content Audit ===
Contributors: wajahatmubashir
Tags: content audit, content decay, search console, google analytics, seo audit
Requires at least: 6.2
Tested up to: 7.0.2
Requires PHP: 7.4
Stable tag: 1.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Audit content decay with GA4 and Search Console data, and get a specific AI fix plan for every page losing traffic.

== Description ==

**Your AI content strategist for WordPress.** Content Performance Analyzer finds the pages that are quietly losing traffic, rankings, or conversions — and tells you exactly how to fix each one. It connects your Google Analytics 4 (GA4) and Google Search Console accounts, joins that data with the actual content of each page, and lets AI turn it into specific, page-level recommendations — so you spend your time refreshing content that matters instead of digging through spreadsheets.

Everything needed to find problems and get clear recommendations is free, with no URL limits. Bring an OpenAI, Groq, or Gemini key for free page-level AI recommendations. The optional Pro plan adds hosted AI with no provider key, ready-to-use draft assets, and full WordPress draft writing.

Every scan checks each page for three common problems:

* **Content decay** — pages that used to rank and are now losing traffic. Refreshing an old post is far cheaper than writing a new one, and these are the fastest wins.
* **SEO opportunities** — pages with strong impressions but weak click-through or ranking, where a title or heading change has outsized impact.
* **Conversion gaps** — pages getting real traffic but few conversions, often just missing a clear call to action.

For each flagged page, the built-in AI analysis writes a specific recommendation you can act on — not generic advice. Add an optional Serper API key and it also compares your page against the pages currently ranking for your keyword, so you can see what top results cover that you don't.

This plugin is a strong fit for blogs, resource libraries, and content-heavy sites with dozens to a few hundred posts, and for freelancers or agencies managing content for clients.

= What You Get =

* **AEO readiness score** — every page rated 0-100 on how quotable it is for AI search (question headings, direct answers, schema, freshness), with each failed check named
* **Question gaps** — real Search Console queries you rank for that no heading on the page answers, plus one-click AI answer blocks with FAQ schema
* **AI referral tracking** — see which pages get visitors from ChatGPT, Perplexity, Copilot, and Gemini
* **llms.txt** — optional machine-readable site guide for AI crawlers, generated from your analyzed pages
* **One-click Google connection** — connect Analytics and Search Console with a single sign-in, then pick your property and site from dropdowns. No Google Cloud setup required
* **One-click page import** — load every published page and post from your site with checkboxes, instead of pasting URLs
* **Works before any setup** — content-only mode checks pages for missing alt text, thin content, and heading problems with zero credentials
* **Performance flagging** — every page automatically labeled for decay, SEO opportunity, or conversion gap
* **AI content recommendations** — specific, page-level refresh guidance powered by OpenAI, Groq, or Google Gemini (free tier)
* **AI alt text fixes** — lists the exact images missing alt text and writes and applies alt text for you, using image recognition
* **Competitor gap analysis** — optional Serper integration compares your content against top-ranking pages
* **GA4 conversion tracking** — uses your GA4 key events by default, with support for custom conversion events like demo or trial signups
* **Keyword insights** — shows the primary keyword each page ranks for, pulled from Search Console
* **Recovery tracking** — mark a page as fixed and the plugin watches it for 28-60 days, then tells you whether the fix worked: recovered, improving, or no lift
* **One-click refresh drafts** — create a draft copy of any flagged page with its fix plan embedded at the top, so a refresh starts in the editor, not in a spreadsheet
* **Dashboard widget** — your top priority pages and fix results, right on the WordPress dashboard
* **Page age at a glance** — every page shows time since its last update, with stale pages highlighted
* **Smart interlinking** — safe, AI-suggested internal links inserted only on exact anchor matches
* **PageSpeed Insights without a key** — Core Web Vitals and performance scores through the free hosted service, or your own API key if you prefer
* **Background processing** — analyzes hundreds of URLs in batches without timeouts, with live progress
* **CSV export** — download the full insights table for reporting or further analysis

= Optional Pro Workflow =

Pro does not lock the audit or diagnosis. It removes setup and writing work:

* **Hosted AI with no provider key** — recommendations work immediately after license activation
* **200 included AI generations per month** — the latest remaining allowance is visible in the page-plan modal
* **Competitor gap analysis with no Serper key** — 600 included searches a month compare your pages against what currently ranks
* **Ready-to-use draft assets** — finished titles, meta descriptions, question headings, FAQ answers, quotable passages, and evidence-based internal-link suggestions
* **Smart relevance and verification notes** — only justified assets are generated, and missing or unverified facts are called out for review
* **Full draft writing** — creates a separate 600–900 word WordPress draft for editorial review; the live page is not changed

Nothing here requires a Google Cloud project. The Google connection and PageSpeed both run through a free hosted service, so setup is a single sign-in. If you would rather run everything yourself, every hosted convenience has a self-hosted alternative: add your own PageSpeed or AI API key in Settings, and enable the `cpanalyzer_show_byo_oauth_fields` filter to use your own Google OAuth client.

== Installation ==

1. Install and activate the plugin through the 'Plugins' screen in WordPress
2. Go to Content Insights → URL Management and click "Load Pages From Your Site" to import your pages, then start a scan — the content check works with no setup at all
3. To add traffic data, go to Content Insights → Settings and click "Connect with Google," then pick your GA4 property and Search Console site from the dropdowns
4. Optional: add an OpenAI, Groq, or Google Gemini API key for AI recommendations, and toggle on PageSpeed analysis (no key needed)

== Screenshots ==

1. The content audit table — every page flagged for content decay, SEO opportunity, or conversion gap, with the decay-type diagnosis, page age, AI fix summary, and recovery actions in one view
2. A page-level AI fix plan grounded in the page's own GA4 and Search Console data: decay diagnosis, keyword cannibalization, SEO and answer-engine recommendations, and one-click alt text fixes
3. AEO readiness — every page scored 0-100 on how quotable it is for AI search, alongside the classic SEO metrics
4. Connect Google Analytics 4 and Search Console with one click — no Google Cloud project, no API keys, read-only access
5. Import every published page and post with checkboxes instead of pasting URLs, then run the first scan
6. Choose your AI provider — Groq and Google Gemini free tiers or OpenAI — with direct links to create a key
7. Once connected, pick your GA4 property and Search Console site from dropdowns; conversion events are optional

== Upgrade Notice ==

= 1.5.1 =
The plugin now asks for a review once — only after your audit has flagged real pages and written fix plans, never twice, and never outside its own screens.

= 1.5.0 =
Adds the optional Pro workflow and Freemius licensing while keeping content audits, Google data, diagnoses, exports, recovery tracking, and BYOK AI recommendations free. Pro adds no-key hosted AI, page-specific draft assets, and complete WordPress draft writing.

= 1.4.7 =
Recommendations no longer cut off mid-sentence, the sync banner only reports success when data and AI both finished, and new warnings appear when Search Console returns nothing, page content cannot be read, or scheduled work has stalled.

= 1.4.6 =
Closes the loop from "what's broken" to "did my fix work": mark any page as fixed and get a recovery verdict after 28-60 days, create a refresh draft with the fix plan embedded in one click, see your top priority pages on the WordPress dashboard, and spot stale content with the new Age column. All free.

= 1.4.5 =
Records a weekly per-page performance snapshot in a new local database table for upcoming history charts. Data never leaves the site; there are no new settings or workflow changes.

= 1.4.4 =
Analysis is no longer "done" with gaps: pages the AI run could not finish now fill in automatically in the background, one page every couple of minutes. The queue paces itself under free-tier limits, backs off when rate-limited, skips pages that cannot fit, and stops with a clear message on configuration errors.

= 1.4.3 =
Fixes two free-tier AI pain points: oversized requests on content-heavy pages now retry automatically with a slimmer payload instead of failing (Groq's 8k token budget), and the insights page no longer shows an endless "Processing" spinner when an AI run failed — it now says what happened and how to retry.

= 1.4.2 =
Clearer diagnosis when a page's traffic drop is not a search problem. Pages with real visitors but little Google search presence are now told the drop came from another channel — with a pointer to the GA4 channel breakdown — instead of a vague "re-check next run." Homepage and per-page metric fixes from the recent updates are included.

= 1.4.1 =
The decay diagnosis now rules out the three great false alarms before naming a cause: seasonal patterns (compared against the same window last year), technical/indexing problems (impression collapse, noindex tags, foreign canonicals), and GA4 tracking breaks. Seasonal dips are marked expected and never flagged. No action needed.

= 1.4.0 =
The plugin now diagnoses WHY a page is losing traffic — ranking decay, zero-click capture, demand decay, a self-inflicted edit, or a non-search drop — and matches the fix to the cause. Adds keyword cannibalization detection, 6-month click trends, orphan-page detection, and an alert when scans flag new pages. No action needed; run your next analysis to see the new diagnosis.

= 1.3.0 =
Adds AEO tools: answer-engine readiness scores, question gaps from Search Console, one-click FAQ answers, AI referral tracking, and llms.txt. Pick your exact AI model per budget. Includes important rate-limit fixes for free AI tiers — recommended for all Gemini users.

= 1.2.0 =
Connect Google with one click — no more Cloud Console setup. Adds one-click page import, AI alt text fixes, Gemini support, and PageSpeed with no API key. Existing connections and data carry over unchanged.

= 1.1.2 =
Adds a clear reconnect notice when the Google connection expires, so GA4 and Search Console data never silently drop to zero. No action needed unless the notice appears.

= 1.1.1 =
Removes the activation opt-in screen for a cleaner setup. No action needed — your settings and data carry over.

= 1.1.0 =
Every feature is now free, with no URL or upload limits. Google sign-in has moved to OAuth 2.0 — after updating, reconnect your Google account on the Settings page to resume GA4 and Search Console data. Adds competitor gap analysis, key-event conversions, safer interlinking, and security fixes.

== Changelog ==

= 1.5.1 =
* Added a one-time review request that appears only after the audit has delivered real results — at least five pages analyzed and fix plans written — and only on the plugin's own screens. Answering or declining silences it permanently, and it shares its once-only state with the existing post-recovery ask

= 1.5.0 =
* Integrated the current Freemius WordPress SDK for Pro licensing, trials, in-dashboard checkout, and paid updates
* Added optional hosted AI for active Pro licenses, with no OpenAI, Groq, or Gemini key required and a visible monthly allowance
* Added page-specific ready-to-use drafts for titles, meta descriptions, headings, FAQ answers, quotable passages, and internal-link suggestions
* Added complete 600–900 word content generation into a separate WordPress draft; the live page is never overwritten
* Kept problem discovery and clear recommendations free: GA4/GSC analysis, decay diagnosis, AEO checks, question gaps, exports, recovery tracking, and BYOK AI remain available without Pro
* Pro replaces the provider picker and API key fields with a single hosted-AI panel showing the remaining monthly allowance — nothing to configure
* Pro raises the hand-picked PageSpeed selection from 15 pages to 30
* Pro includes competitor gap analysis with no Serper key — 600 searches a month through the hosted service, with a personal key still taking precedence
* Deleting the leftover free copy after upgrading to Pro no longer removes your data — uninstall cleanup now runs through the licensing SDK, which skips it while either copy is still active
* Organized the page-plan modal into tabs, so a long recommendation set is scannable instead of one continuous column
* Reads an existing title and meta description from Rank Math, Yoast, SEO Press, or All in One SEO before reporting either as missing

= 1.4.7 =
* Fixed AI recommendations being cut off mid-word
* The sync banner now reports the whole job and turns green only when data collection and AI have both finished
* Added warnings when Search Console returns no data, page content cannot be read, or scheduled work has stalled
* Flags copy that presents an earlier year as current, while leaving genuine historical references alone
* A page marked as fixed with no recorded traffic now reads "waiting for traffic data" instead of "no lift"
* Recovery verdicts also run on the daily cron, and deactivation clears three previously orphaned scheduled tasks

= 1.4.6 =
* Recovery tracking: mark a page as fixed from the insights table and the plugin records the moment's clicks, views, and pre-decay peak, then judges the fix after 28 days — Recovered (back near its peak), Improving (clearly above the pre-fix level), or No lift (final at day 60). Verdicts average whole weeks from the local snapshot history, so one good day cannot fake a recovery
* One-click refresh drafts: create a draft copy of any page — content, categories, tags, and featured image — with the page's diagnosis and AI fix plan embedded at the top as an editorial note. The live page is never touched, and repeat clicks reopen the same draft instead of stacking duplicates
* Dashboard widget: the top priority pages (worst decay first, ranked by clicks lost) and a summary of how your applied fixes are performing, on the main WordPress dashboard
* New Age column in the insights table shows time since each page's last update, highlighting pages untouched for over 18 months
* Verdict notices: when a fix you marked crosses to Recovered, Improving, or its final no-lift verdict, a dashboard notice tells you — no need to keep checking the table. Opening Content Insights clears it
* A one-time review ask appears with your first Recovered verdict — the moment the plugin has actually proven a fix worked. One click to dismiss forever; it never asks again either way
* The homepage now resolves to an editable post in the insights table when a static front page is set

= 1.4.5 =
* Added a local weekly per-page performance snapshot data layer.
* Captures traffic, flags, decay type, and AEO score after data refreshes, at most once per day.
* Keeps data on the site, retains 78 weeks of history, and removes snapshot data on uninstall; no settings or external calls were added.

= 1.4.4 =
* Analysis is no longer "done" with gaps: flagged pages the AI run could not finish now fill in automatically in the background, one page every couple of minutes
* The queue paces itself under free-tier limits, backs off when rate-limited, skips pages that cannot fit even after compression, and stops with a clear message on configuration errors
* The insights page shows calm automatic progress with the next attempt time while leaving the existing manual retry available

= 1.4.3 =
* Oversized AI requests now recover automatically: when a content-heavy page produces a request bigger than the provider's token budget or context window (for example Groq's free-tier 8,000 tokens per minute), the plugin retries once with a compressed payload — trimmed body text, no competitor excerpts — instead of failing the page. All metrics and the decay diagnosis stay in the request, so recommendations remain grounded
* The insights page no longer shows an endless "Processing…" spinner when nothing is running: the spinner now appears only while work is genuinely in flight, and flagged pages left without AI suggestions after a failed or rate-limited run get an honest notice explaining what happened and pointing to the Retry button
* Sites without an AI key configured now see clear guidance on flagged pages instead of a permanent processing state

= 1.4.2 =
* Clearer non-search diagnosis: when a page had real GA4 traffic but almost no Google search clicks and dropped, the plugin now says the drop came from another channel (direct, email, social, referral, or internal links) and points to the GA4 channel breakdown — instead of the vague "not enough Search Console history, re-check next run"
* Pages with a search footprint but negligible clicks are classified as a non-search drop with a channel-breakdown fix; pages with no search footprint at all get a cautious hypothesis that also suggests confirming the page is indexed
* Reflects a real distinction: GA4 views count every channel, while Search Console clicks count only Google organic search — a page can have high views and near-zero search clicks
* Includes the homepage and per-page metric collection fixes: host-aware Search Console paths so subdomains no longer overwrite the homepage row, GA4 ordering so top pages are never truncated out, and targeted recovery for any analyzed URL the bulk pull missed
* CSV export now includes the full AI recommendation set (SEO, AEO, GEO, engagement, measurement plan), model used, decay type and evidence, AEO readiness score, AI referral sessions, and inbound internal link counts
* Added a link to the plugin privacy policy on the settings screen

= 1.4.1 =
* Seasonality control: every demand-decay call is checked against the same 30-day window one year ago in Search Console. A drop that matches last year's numbers is diagnosed "Seasonal pattern (expected)" — shown in green, never flagged, and the AI is told no action is needed
* Technical/indexing detection: impressions collapsing to near zero is diagnosed as an indexing problem, not demand decay. The live-page scrape confirms it — a noindex meta tag or a canonical pointing at a different URL upgrades the diagnosis to confirmed with the exact cause named
* Tracking-break detection: GA4 views collapsing to near zero while Search Console still records clicks is diagnosed as a broken GA4 tag, not a traffic loss — check the tag before touching the content
* AI Overview confirmation: the live SERP check now detects Google AI Overviews in addition to answer boxes when confirming zero-click capture
* noindex tags and canonical mismatches now appear in every page's content issues list, whether or not traffic dropped
* AI recommendations updated for all three new diagnosis types: technical issues lead with the indexing fix, tracking breaks lead with the tag check, and seasonal dips get no busywork
* Cleaner settings: the legacy OAuth Client ID/Secret fields are hidden now that Connect with Google is one click (they still appear for sites already using their own credentials), and PageSpeed options only show while the feature is enabled

= 1.4.0 =
* Decay-type diagnosis: every traffic drop is classified from real period deltas — ranking decay (position slid), zero-click capture (still ranking, SERP answers before the click), demand decay (topic losing searches), or a non-search drop (organic healthy, look at other channels) — with the evidence and the matching fix shown on each page
* Self-inflicted decay detection: if a page was edited inside the drop window, the diagnosis warns to compare the previous revision before assuming natural decay — only possible from inside WordPress
* 6-month click trends: each page's clicks are tracked across six 28-day periods to expose sustained declines and distance from peak, not just one week-over-week dip
* Keyword cannibalization detection: queries where two or more of your own pages split clicks over the last 90 days, listed per page with positions, so you can consolidate instead of rewriting
* Live SERP confirmation (optional, with a Serper key): confirms zero-click capture when an answer box sits above your result, and flags intent drift when the top 10 shifts to video, forum, or commerce formats
* Orphan-page detection: pages no other content links to are flagged, with an editorial inbound-link count per page (menus and widgets excluded)
* New-issue alerts: after any scan — including the daily automatic one — a dashboard notice lists pages that were healthy last run and are flagged now
* AI recommendations now match the fix to the diagnosed decay type: no more content-refresh advice for pages whose topic lost demand, and non-search drops are never framed as SEO problems
* Previous-period clicks, position, and engagement rate are now collected and shown alongside impressions, completing the period-over-period picture
* Fixed: decay flag compared a page against the wrong page's history in one code path; AI referral session counts could drop out of the insights table after a re-sync

= 1.3.0 =
* AEO readiness score: every page rated 0-100 on answer-engine quotability with a named pass/fail checklist (question headings, direct answers, structured data, lists, freshness)
* Question gaps: Search Console queries you rank for (positions 2-20) that no page heading answers — each a featured-snippet and AI-answer opportunity
* One-click answer blocks: AI writes a concise answer grounded in the page's own content, appends it as a Q&A block, and adds FAQPage schema (skipped if the page already has one)
* AI referral tracking: sessions arriving from ChatGPT, Perplexity, Copilot, Gemini, and Claude shown per page
* Optional llms.txt: a machine-readable site guide for AI crawlers, with automatic conflict detection if one already exists
* Choose your exact AI model per provider from a dropdown with cost hints, or leave it automatic; every AI action now shows which model produced it
* OpenAI automatic mode upgraded to the flagship model with graceful fallbacks; gpt-4o-mini retired
* Requests adapt automatically to newer OpenAI model requirements (max_completion_tokens, fixed temperature) and to restricted-project model allowlists
* Rate-limit resilience: no more retry cascades that burn free-tier quotas, partial results are saved with honest progress messages, and Gemini runs are paced automatically
* AI errors now name every model that failed and why, instead of only the last one
* Sharper recommendations: prompts require citing the page's actual data and concrete deliverables, and SEO/AEO/GEO fields are precisely defined (GEO now means generative-engine visibility, not local SEO)
* Live search on both page pickers; select-all applies to search results; the URL import picker loads automatically
* URL Status table refreshes automatically when background scans finish
* Groq is now the recommended free provider based on output-quality testing; status labels reflect the active provider

= 1.2.0 =
* One-click "Connect with Google" — sign in and pick your account, no Google Cloud project or OAuth credentials needed (your own credentials still work as an advanced option)
* GA4 property and Search Console site selection via dropdowns loaded from your connected account, replacing hand-typed IDs
* One-click page import: load every published page and post with checkboxes and select-all, instead of pasting URLs
* Content-only mode: fresh installs can scan for content issues before connecting anything, with a guided getting-started flow
* AI alt text fixes: see exactly which images lack alt text, then generate and apply alt text in one click — vision-based on OpenAI and Gemini, with library and page content both updated and existing alt text never overwritten
* Google Gemini added as an AI provider with a generous free tier, alongside OpenAI and Groq
* PageSpeed Insights now works without an API key through a free hosted service — the API key field is gone entirely
* Pick exactly which pages get PageSpeed analysis with a checkbox list (up to 15), or leave it automatic
* AI responses now use enforced JSON output for more reliable recommendations across all providers
* API key fields warn when the key format doesn't match the selected provider
* Image counts no longer double-count on sites using lazy-loading plugins

= 1.1.2 =
* Expired or revoked Google connections now show a clear reconnect notice on plugin pages instead of silently reporting zero GA4 and Search Console data
* OAuth failure logs now include Google's error code (for example invalid_grant) for faster diagnosis
* Fixed the analysis waiting banner staying visible indefinitely when pages in good standing were present

= 1.1.1 =
* Removed the Freemius integration and its activation opt-in screen for a simpler, self-contained setup
* Added a standalone uninstall routine that fully cleans up options, scheduled tasks, and plugin data on deletion

= 1.1.0 =
* All features are now fully free — removed license requirement and premium gating
* Data collection, batch processing, AI suggestions, internal links, and smart interlinking work without activation
* Conversions now use GA4 key events by default, with form_submit fallback and an optional custom event list
* PageSpeed analysis is now selective (flagged and high-traffic pages) instead of every URL on every scan
* Daily automatic rescan is now opt-in for new installs to protect your API quotas
* Safer smart interlinking: links are only inserted on exact anchor matches, never inside HTML tags or existing links
* Fixed applied interlinks being dropped on save in some Gutenberg blocks
* Data collection now reports API failures instead of showing success with missing data
* Off-peak scheduling defaults to the site timezone
* Security and cleanup: removed debug endpoints and dead code, hardened CSV export, moved inline scripts and styles to enqueued assets

= 1.0.0 =
* Progressive content analysis - analyzes all pages without artificial limits
* Smart waiting banner with realistic time estimates and auto-refresh
* Priority-based processing - flagged pages analyzed first for faster AI suggestions
* Intelligent AI timing - AI waits for complete content data for optimal recommendations
* Plugin page integration - direct Settings and View Insights links
* 3x performance improvement - reduced from 15.5s to ~3s average per page
* Dynamic batch sizing (6-12 pages) based on priorities and system performance
* Dynamic timeout prediction with 75-second safety buffer prevents all timeouts
* Real-time progress tracking with detailed status updates
* Enhanced user experience with transparent progress communication

= Previous Version =
* Complete rewrite with modular architecture
* Added automatic keyword analysis and optimization suggestions
* Implemented AI suggestion expiry system
* Enhanced dashboard with better UX
* Batch URL upload and retry/rescan features
* WordPress coding standards compliance

== External Services ==

This plugin connects to the external services below. The full privacy policy — covering the plugin and auth.cpanalyzer.com, data handling, security, and deletion requests — is at https://cpanalyzer.com/privacy.

= 1. Content Performance Analyzer Hosted Service (auth.cpanalyzer.com) =

**What it does:** The plugin author's own service. It holds the Google OAuth client so you do not need a Google Cloud project, runs PageSpeed lookups without your own key, and provides the optional hosted AI and competitor search included with a Pro license.

**Data sent:**

* **Registration** — your site's home URL, once, to obtain an installation token
* **Google sign-in** — the WordPress admin URL to return you to, and the one-time handoff code Google issues
* **Token refresh** — your Google refresh token, forwarded to Google for a new access token
* **PageSpeed** — the URL being analyzed, mobile/desktop strategy, and your installation token
* **Hosted AI (Pro)** — your installation token and license key, plus the page URL, performance metrics, search queries, content structure, and page-text excerpts described in section 5. No site visitor personal data is sent
* **Competitor search (Pro)** — your installation token and license key, plus the page's primary keyword, forwarded to Serper.dev (section 6) when no personal Serper key is saved

**What is stored:** Your Google tokens live in your own WordPress database, not on the service. A one-time sign-in handoff entry expires after five minutes. For hosted AI and competitor search, the service stores request counts only — no prompts, page content, metrics, queries, or generated output are retained.

**When:** On "Connect with Google," token refresh, keyless PageSpeed analysis, and Pro hosted AI or competitor search.

**How to avoid it entirely:** Enable the `cpanalyzer_show_byo_oauth_fields` filter and supply your own Google OAuth client, add your own PageSpeed API key, and use OpenAI, Groq, or Gemini with your own key. The plugin then talks to those providers directly and never uses this service.

**Service URL:** https://auth.cpanalyzer.com (endpoints: /auth/start, /api/v1/register, /token/exchange, /token/refresh, /api/v1/pagespeed, /api/v1/ai/chat/completions, /api/v1/serper)

**Terms:** https://cpanalyzer.com/terms — **Privacy:** https://cpanalyzer.com/privacy

= 2. Google Analytics 4 =

**What it does:** Retrieves traffic and engagement metrics for your pages, and lists your GA4 properties for the settings dropdown.

**Data sent:** Your GA4 property ID, date ranges, requested URL paths and metrics, and any custom conversion event names, authenticated with an OAuth 2.0 access token — obtained through the hosted service above by default, or directly from Google if you supply your own OAuth client.

**When:** Manual data collection, the scheduled daily refresh, or URL uploads.

**Service URLs:** https://analyticsdata.googleapis.com/, https://analyticsadmin.googleapis.com/, https://accounts.google.com/o/oauth2/v2/auth, https://oauth2.googleapis.com/, https://www.googleapis.com/oauth2/v3/tokeninfo

**Terms:** https://marketingplatform.google.com/about/analytics/terms/ — **Privacy:** https://policies.google.com/privacy

= 3. Google Search Console =

**What it does:** Retrieves clicks, impressions, CTR, average position, and search queries for your verified site, and lists your sites for the settings dropdown.

**Data sent:** Your verified site URL, date ranges, and performance queries, with the same OAuth token as GA4.

**When:** Manual data collection, the scheduled daily refresh, or URL uploads.

**Service URLs:** https://searchconsole.googleapis.com/, https://www.googleapis.com/webmasters/v3/sites

**Terms:** https://support.google.com/webmasters/answer/4559176 — **Privacy:** https://policies.google.com/privacy

= 4. Google PageSpeed Insights (Optional) =

**What it does:** Fetches performance scores and Core Web Vitals for specific URLs. Off by default.

**Data sent:** The URL being analyzed and the mobile/desktop strategy. By default the request rides the hosted relay (section 1), which supplies the API key; add your own key in Settings and the plugin calls Google directly instead.

**When:** Only when you enable PageSpeed analysis and trigger it.

**Service URLs:** https://www.googleapis.com/pagespeedonline/v5/runPagespeed (own key), https://auth.cpanalyzer.com/api/v1/pagespeed (default relay)

**Terms:** https://developers.google.com/terms — **Privacy:** https://policies.google.com/privacy

= 5. AI Providers — OpenAI, Groq, or Google Gemini (Optional) =

**What it does:** Generates content recommendations, answer blocks, alt text, and interlinking suggestions from your performance data and page content. You choose one provider and supply its key; without a key, no AI requests are made and the plugin runs in content-check-only mode.

**Data sent:** Page URLs, performance metrics (traffic, engagement, search queries and rankings), content structure, excerpts of your page text, and up to a few thousand characters of post text for Smart Interlinking. For AI alt text, the image itself is sent for recognition (OpenAI and Gemini only). Your API key is sent with each request. No site visitor data is ever sent.

**When:** AI analysis of flagged pages (manual, batch, or the background queue), Smart Interlinking, answer blocks, and alt text generation.

**Included AI service (Pro):** With a Pro license you can select "Content Performance AI" instead of supplying a key. Requests go to `https://auth.cpanalyzer.com/api/v1/ai/chat/completions`, which authenticates the request, counts it against your monthly allowance, and forwards it to Kimi K3, an open-weight model the plugin author deploys and runs on Modal, a serverless compute platform, in the United States. No third-party AI company receives your data — Modal supplies servers only. The relay stores request counts only, and nothing sent is used to train any model. Modal terms: https://modal.com/legal/terms — privacy: https://modal.com/legal/privacy

**Service URLs:** https://api.openai.com/v1/chat/completions, https://api.groq.com/openai/v1/chat/completions, https://generativelanguage.googleapis.com/v1beta/openai/chat/completions

**Terms and privacy:** OpenAI https://openai.com/policies/terms-of-use and https://openai.com/policies/privacy-policy — Groq https://groq.com/terms/ and https://groq.com/privacy-policy/ — Gemini https://ai.google.dev/gemini-api/terms and https://policies.google.com/privacy

= 6. Serper.dev (Optional) =

**What it does:** Retrieves the top Google results for your page's primary keyword so the plugin can compare your content against ranking competitors, then fetches the public HTML of those competitor pages to extract headings and structure.

**Data sent:** The search keyword derived for your page, with your Serper API key — or through the hosted relay on Pro.

**When:** Only when a Serper key is saved, or an active Pro license uses the included service. Otherwise no Serper requests or competitor fetches are made.

**Included with Pro:** With no personal key saved, searches are relayed through `https://auth.cpanalyzer.com/api/v1/serper` using the author's Serper account — 600 searches per license per month. The relay forwards only the query, result count, country, and language, and stores request counts only. A personal key always takes precedence and bypasses the relay entirely.

**Service URL:** https://google.serper.dev/search — **Terms:** https://serper.dev/terms — **Privacy:** https://serper.dev/privacy

= Important Notes =

* All communication uses HTTPS. No data is sent without your configuration and action, and no site visitor personal data is ever transmitted to any of these services
* Every hosted convenience has a self-hosted alternative: your own Google OAuth client, PageSpeed key, AI provider key, and Serper key
* Disable any optional service and the plugin still performs content checks

== Frequently Asked Questions ==

= Do I need a Google Cloud project or API keys to start? =
No. Click "Connect with Google," sign in, and pick your GA4 property and Search Console site from dropdowns. There is no Cloud Console setup, no OAuth client to create, and no PageSpeed key to obtain. You can also run the content check with no credentials at all.

= Is it really free? =
The complete audit and recommendation workflow is free, with no URL limits: Google data, decay diagnosis, SEO and conversion flags, AEO checks, question gaps, exports, recovery tracking, and page-level AI recommendations with your own OpenAI, Groq, or Gemini key. Pro is optional and adds hosted AI with no provider key, ready-to-use draft assets, and complete draft writing.

= Do I need to pay for AI? =
Not necessarily. Groq and Google Gemini offer free tiers that handle typical sites, and Groq is the recommended free provider based on output-quality testing. OpenAI is another BYOK option. Pro includes hosted AI if you do not want a provider account or key. Without any AI key or Pro license, the plugin still imports traffic data, flags decaying pages, diagnoses why they dropped, and runs every content check — you just do not get the AI-written output.

= What is content decay? =
Content decay is when a page that used to perform well gradually loses traffic and rankings, usually without anything visibly breaking. It is the most common reason older posts quietly stop earning traffic, and refreshing a decayed page is typically far cheaper than writing a new one. This plugin finds those pages and classifies why each one dropped — ranking slide, zero-click capture, falling demand, a self-inflicted edit, or a drop that was never about search at all.

= Does this work alongside Google Site Kit? =
Yes, and they do different jobs. Site Kit reports your GA4 and Search Console numbers. This plugin joins those numbers to the actual content of each page, works out which pages are losing ground and why, and writes a specific fix for each. Running both is fine — they do not conflict, and each maintains its own Google connection.

= What data leaves my site? =
Page URLs, performance metrics, content structure, and excerpts of page text go to the BYOK AI provider you configure, or to the hosted service when an active Pro user selects hosted AI. Your site URL and PageSpeed test URLs also go to the hosted service for the no-key Google connection and PageSpeed relay. No site visitor personal data is transmitted. The External Services section documents each endpoint and payload category.

= How long does analysis take for large sites? =
Most sites see AI suggestions within roughly 6 to 40 minutes for 200 URLs, depending on your AI provider's rate limits. Progress is shown live and refreshes automatically. If a run hits provider rate limits, the remaining pages fill in on their own in the background, roughly one page every couple of minutes.

= Does this plugin slow down my site? =
No. All heavy processing runs asynchronously in the background through WordPress cron, so visitors are unaffected.

= Will the analysis time out on shared hosting? =
It is built for it. Work is processed in small batches with dynamic timeout prediction and a safety buffer, and processing continues even if you close the browser. Very restrictive hosts can still interrupt a batch — if that happens, the next scheduled run picks up where it stopped.

= Can I use this on multisite? =
Yes, the plugin is multisite compatible.

= How do I access the plugin settings after activation? =
After activation you will see "View Insights" and "Settings" links directly on the WordPress plugins page, or navigate to Content Insights in your admin menu.
