=== CloudScale SEO AI Optimizer === Contributors: andrewjbaker Tags: seo, meta description, ai, opengraph, schema Requires at least: 6.0 Tested up to: 6.9 Stable tag: 4.19.64 Requires PHP: 8.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html AI-powered SEO & AEO: meta descriptions, auto linking, category management, ALT text. Bring your own Claude or Gemini API key. Free, open source. == Description == CloudScale SEO AI Optimizer is a completely free SEO plugin built for technical bloggers and site owners who want full control without the overhead of Yoast or RankMath. There is no Pro version, no upsells, no feature gates, and no licence keys. It handles the essentials cleanly and adds an AI Meta Writer that uses either the Anthropic Claude API or the Google Gemini API to generate, fix, and bulk process meta descriptions and ALT text across your entire site directly from WP Admin. = Core SEO Features = * Custom meta title and description per post and page * Canonical URL output on every page * OpenGraph tags (title, description, image, type, locale) * Twitter/X Card tags * JSON-LD structured data: Person schema for author pages, Article/BlogPosting schema for posts, WebSite schema for the homepage, Breadcrumb schema * Configurable site name, locale, Twitter handle, and default OG image * XML sitemap generation with configurable post types and taxonomy support * Custom robots.txt editor with AI bot blocking (GPTBot, CCBot, Claude-Web, anthropic-ai and others) * llms.txt support for AI crawler guidance * noindex controls for search results, 404 pages, attachment pages, author archives, and tag archives * UTM parameter stripping in canonical URLs = AI Summary Box = * AI generated article summary box automatically prepended to post content * Three fields generated per post: What it is, Why it matters, Key takeaway * Bulk generation panel with progress tracking, stop button, and paginated post list * Force regenerate option to overwrite all existing summaries * Summary fields written to Article JSON-LD schema: description, abstract, and disambiguatingDescription * Collapsible display with modern card styling including gradient header and drop shadow * Toggle to show or hide the summary box globally without deleting generated content = AI Meta Writer = * Choose your AI provider: Anthropic Claude or Google Gemini * Model selector: Claude Sonnet, Claude Haiku, Gemini Flash, or Gemini Pro * Generate meta descriptions for individual posts or in bulk across your entire site * Fix existing descriptions that are too short or too long * Fix titles that are outside the optimal 50 to 60 character range * Configurable character range (min/max) injected into the prompt automatically * Automatic retry if the AI returns a description outside your target range * Rate limit handling with automatic backoff on HTTP 429 responses * Fully editable system prompt with reset to default * Live progress log with timestamps during bulk runs * Stop button for interrupting bulk runs * Scheduled batch generation via WP Cron with per day scheduling * Test Key button to verify your API key before running = ALT Text Generator = * Audit all images across your posts for missing ALT text * Generate ALT text using AI with article context for better relevance * Configurable article excerpt length sent to the AI (100 to 2000 characters) * Bulk generation with progress tracking * Show All toggle to display images that already have ALT text = Performance Features = * Font display optimization with font-display: swap to eliminate Flash of Invisible Text (FOIT) * Font metric overrides (size-adjust, ascent-override, descent-override) to reduce Cumulative Layout Shift (CLS) * Defer font CSS loading using media="print" swap technique * Auto-download CDN fonts (Google Fonts) to local server for faster loading and GDPR compliance * Font CSS file scanner with terminal style console output * Auto-Fix All with backup and undo capability * Defer render-blocking JavaScript with configurable exclusions * HTML, CSS, and JS minification (5 to 15 percent page size reduction) * HTTPS mixed content scanner and one click fixer across posts, pages, metadata, options, and comments = Dashboard Integration = * WordPress dashboard widget with SEO status overview * Post editor metabox with custom title, description, OG image, and inline AI generation * Gutenberg sidebar panel (CloudScale Meta Boxes) with custom title, description, OG image, AI summary fields, and one click generation without leaving the editor * Per post status badges showing description length and health = Category Fixer = * Scans all published posts and suggests improved category assignments using AI * Uses Claude to analyse post title, slug, tags, and AI summary box against your full category list * Proposes up to four categories per post — only from categories that already exist in WordPress * Never assigns Uncategorized * Colour coded review table: green for additions, red for removals, grey for kept categories * Per post Apply and Skip buttons, plus bulk Apply All Changed * Filter bar: All, Changed, Unchanged, Low Confidence, Missing * Reload button re-analyses all posts with fresh AI calls * Per row re-analyse button for individual posts * AI analysis badge shows confidence score * No categories are changed until you explicitly click Apply = What This Plugin Does Not Do = * No redirect management * No keyword analysis or readability scoring * No paid tiers, no upsells, no tracking == External Services == This plugin connects to external AI APIs to generate meta descriptions and ALT text. Connections are made when you use the AI Meta Writer or ALT Text Generator buttons in WP Admin, and optionally on a scheduled basis via WP Cron. = Anthropic Claude API = **Service:** Anthropic PBC **Website:** https://anthropic.com **Endpoint:** https://api.anthropic.com/v1/messages **Data sent:** Post title and post content (up to 6,000 characters), plus your configured system prompt **When data is sent:** Only when you click Generate, Fix, or the Generate with Claude button in the post editor, when the scheduled batch runs for posts without a meta description, or automatically on post publish/update when Auto Pipeline is enabled in AI Tools settings. **API key:** You must supply your own Anthropic API key. The key is stored in your WordPress database and is never transmitted anywhere except directly to api.anthropic.com. Anthropic Privacy Policy: https://www.anthropic.com/privacy Anthropic Terms of Service: https://www.anthropic.com/terms Anthropic API documentation: https://docs.anthropic.com = Google Gemini API = **Service:** Google LLC **Website:** https://ai.google.dev **Endpoint:** https://generativelanguage.googleapis.com/v1beta/models/ **Data sent:** Post title and post content (up to 6,000 characters), plus your configured system prompt **When data is sent:** Only when you click Generate, Fix, or the scheduled batch runs, when Gemini is selected as your AI provider, or automatically on post publish/update when Auto Pipeline is enabled in AI Tools settings. **API key:** You must supply your own Google AI API key. The key is stored in your WordPress database and is never transmitted anywhere except directly to Google. Google Privacy Policy: https://policies.google.com/privacy Google Terms of Service: https://policies.google.com/terms Gemini API documentation: https://ai.google.dev/docs = Google Fonts CDN = **Service:** Google LLC **Websites:** https://fonts.googleapis.com, https://fonts.gstatic.com **When contacted:** Only when you use the Font Display Optimizer's "Download Fonts" feature in WP Admin (Performance tab). This feature downloads Google Fonts files to your server so they can be served locally. **Data sent:** The URL of the Google Font stylesheet registered on your site. No personal data or post content is transmitted. **Purpose:** To copy font files from Google's CDN to your own server, eliminating the external Google Fonts request from your frontend pages (improves GDPR compliance and Core Web Vitals). Google Privacy Policy: https://policies.google.com/privacy Google Terms of Service: https://policies.google.com/terms == Installation == 1. Upload the plugin zip via Plugins > Add New > Upload Plugin, or extract to wp-content/plugins/cloudscale-seo-ai-optimizer/ 2. Activate the plugin through the Plugins menu 3. Go to Settings > CloudScale SEO to configure your site name, OG image, and Person schema 4. To use the AI Meta Writer, go to the Optimise SEO tab and enter your API key for either Anthropic Claude or Google Gemini 5. Click Test Key to verify your key, then Load Posts to see your site description status 6. Use Generate Missing to create descriptions for posts that have none, or Fix Descriptions to correct any that are outside your configured character range 7. Visit the Performance tab to enable font optimization, JavaScript deferral, and HTML minification **Important:** Deactivate any other SEO plugins (Yoast, RankMath, All in One SEO) before using this plugin to avoid duplicate meta tags in your page output. == Frequently Asked Questions == = Do I need an API key? = Only if you want to use the AI Meta Writer or ALT Text Generator features. The core SEO functionality (canonical URLs, OpenGraph, Twitter Cards, structured data, custom titles and descriptions) works without any API key. = Which AI provider should I choose? = Both work well. Anthropic Claude tends to produce slightly more nuanced descriptions. Google Gemini Flash is extremely fast and cost effective for large sites. You can switch providers at any time without losing any generated content. = How much does the API cost? = Generating descriptions for a typical 200 post blog costs approximately $1.20 to $1.50 using Claude Sonnet, or under $0.50 using Gemini Flash. Both providers charge per token. You control your own API key and billing directly with each provider. = Will this conflict with Yoast or RankMath? = Yes. Running two SEO plugins simultaneously produces duplicate meta tags. Deactivate your existing SEO plugin before activating this one. = Where are my meta descriptions stored? = In WordPress post meta, using the key _cs_seo_desc. Titles use _cs_seo_title. OG images use _cs_seo_ogimg. These are standard post meta fields that persist if you deactivate the plugin. = Can I use a custom system prompt? = Yes. The AI Meta Writer section includes a fully editable system prompt. The character range you configure in the min/max fields is injected automatically at call time. = What happens if the generated description is the wrong length? = The plugin measures the returned description before saving it. If it is outside your configured range, it automatically sends a correction request to the AI with the exact character count and direction. The corrected version is what gets saved. = How does font display optimization work? = The plugin scans your theme and plugin CSS files for @font-face rules and injects font-display: swap to prevent fonts from blocking page rendering. It also adds metric overrides to reduce layout shift when fonts load. All changes create a backup that you can undo with one click. Enable these features in the Performance tab. = How does JavaScript deferral work? = Adding the defer attribute to script tags allows them to download in parallel with HTML parsing and execute only after the document is ready. jQuery and other commonly problematic scripts are excluded automatically. You can add additional exclusions by script handle or URL substring. = Can I schedule automatic description generation? = Yes. The Scheduled Batch tab lets you select which days of the week to run automatic generation. The batch runs at midnight server time and only processes posts that do not yet have a meta description. It never overwrites existing ones. == Screenshots == 1. SEO Settings tab showing site identity, OG tags, and schema configuration 2. AI Meta Writer with provider selection, API key, model chooser, and system prompt 3. Generate Descriptions panel with summary cards, bulk action buttons, and live log 4. Post table showing per post description status badges and individual Generate buttons 5. Post editor metabox with custom title, description field, and Generate with AI button 6. Performance tab with font optimization, JavaScript deferral, and minification settings 7. ALT Text Generator with image audit table and bulk generation 8. Scheduled Batch configuration with day selector and last run status == Changelog == = 4.19.64 = * Update: version bump = 4.19.50 = * Add: "Automatic" model option — new default that always resolves to the current recommended model per provider (claude-sonnet-4-6 / gemini-2.0-flash); existing users with a pinned model are unaffected = 4.19.11 = * Add: sitemap.txt endpoint — plain-text sitemap (one URL per line) served at /sitemap.txt alongside the existing XML sitemap = 4.19.4 = * Fix: debug_log() method added to main class — font optimizer and OG letterbox AJAX handlers threw fatal errors in production; now delegates to Utils::log() for a single logging code path * Fix: orphaned duplicate DocBlocks removed from trait-ai-meta-writer.php * Fix: missing DocBlocks added across main class, trait-ai-meta-writer.php, and trait-settings-assets.php * Fix: @package tag added to trait-settings-assets.php file DocBlock = 4.19.3 = * PCP: moved phpcs:ignore for post__not_in to same line as violation in trait-auto-pipeline.php, trait-ai-meta-writer.php, and trait-sitemap.php — inline suppression is required for PHPCS to recognise it = 4.19.2 = * PCP fix: echoed