== Full Changelog ==

= 4.3.0 =

**Added**
* Dashboard Command Center: a new "Composer" card on the dashboard shows the exact inputs your next post will use — source (keyword group or Topic), template, model, and draft/publish — and lets you edit any of them inline before generating. One click generates with what's shown; per-post overrides become the new sticky default without modifying your global settings.
* Dashboard capability grid: a compact "Everything you can do" grid surfaces all features (Topics, Bulk Generate, Post from Audio, SEO Refresh, Featured Images, Infographics, Schedule, Providers) with live state and direct links.
* Post from Audio: upload a recording and pick an output mode — "Transcript + AI intro" (keeps your words, adds an AI title and short intro) or "Full rewrite" (AI turns the recording into a polished article). A per-upload selector defaults to a new "Default audio mode" setting. Output honors draft-first; if the full rewrite fails, the post falls back to transcript + intro so the transcription is never lost.
* Bulk SEO Regeneration: a new "Regenerate SEO" bulk action on the Posts list queues one background job per selected post to regenerate the title, meta description, and focus keyword with your chosen model. Per-post failures don't halt the batch. Works with Yoast and Rank Math.
* Onboarding rewrite: a focused, provider-first wizard — connect a provider, choose your draft/publish default, optionally create a first Topic, and discover Post from Audio — with "Skip to settings" on every step.

**Changed**
* AI model lineup updated: added Claude Opus 4.8, OpenAI GPT-5.4 / GPT-5.4 mini / GPT-5.5, Gemini 3.5 Flash, and Perplexity Sonar Deep Research. GPT-4.1 models remain available and are now labeled "(legacy)". New installs default to GPT-5.4 mini (existing installs keep their selected model). Models with highly variable cost (e.g. Sonar Deep Research) now show a cost warning in the model selector.
* The default post-status override now applies per generation through the shared status resolver, so the Composer's "Save as" choice takes effect immediately.

**Fixed**
* OpenAI GPT-5.x models no longer fail with "Unsupported parameter: 'max_tokens'". The OpenAI client now detects reasoning-tier models (GPT-5.x, o-series), sends `max_completion_tokens` instead of `max_tokens`, omits the sampling parameters those models reject (temperature, top_p, penalties), and floors the completion budget so reasoning tokens don't consume small title/SEO requests before any text is produced.
* OpenAI GPT-5.x content generation no longer fails with an empty result: requests now send `reasoning_effort: none` (supported by all GPT-5.x models in the lineup) so the entire token budget goes to visible output instead of hidden reasoning. o-series models, which can't disable reasoning, get a larger completion floor (4,000 tokens) to cover reasoning overhead.
* An HTTP 200 response with an empty completion (the reasoning-burn signature) is now detected for all providers, logged to debug.log with token usage, and reported as a provider error instead of cascading into a generic "Content generation failed" with no trace.
* Generated posts no longer collapse to a single paragraph when the model returns the whole HTML article on one line. The provider response parser now splits content after each closing block-level tag (`</p>`, `</h2>`, etc.) before creating Gutenberg blocks — affects all text providers.
* Post titles are no longer the model's preamble ("Here are some catchy blog post titles…:") when a chatty model answers the title prompt with a list of options — seen with Gemini. The title prompt now demands a single title with no alternatives, and the response parser skips preamble lines and strips list numbering/bullets before picking the title. The audio post title cleaner shares the same logic.
* The WordPress admin footer no longer floats over the dashboard's "At a glance" section: a stray closing `</div>` in the dashboard template closed the admin page's structural containers early, detaching the footer from its bottom anchor. A regression test now verifies every admin tab partial has balanced markup.
* Fixed a PHP 8.1+ deprecation notice (`ltrim(): Passing null`) triggered from the job log and dashboard activity list when a generated post had been deleted: `get_edit_post_link()`/`get_permalink()` can return null and were passed to `esc_url()` unguarded.
* Added missing context-window entries for GPT-5.4 / GPT-5.4 mini / GPT-5.5, Gemini 3.5 Flash, Claude Opus 4.8, and Sonar Deep Research — these models previously fell back to a 4,096-token budget, which capped generated posts far below the configured length.
* Post from Audio now uses the API key for your selected text model when writing the post (it previously reused the OpenAI transcription key, so audio posts failed silently for Claude, Gemini, and Perplexity users).
* Post from Audio now embeds the audio player in the created post, splits the transcript into readable paragraphs, and cleans stray Markdown/heading markers out of the AI-generated title.
* Onboarding now saves your "Publish immediately" / "Save as drafts" choice correctly (it was silently kept on drafts), and the first step now has a "Skip to settings" link so you're never stuck before adding a key.
* Bulk SEO Regeneration now picks the API key from each job's chosen model and skips any selected posts you don't have permission to edit.

= 4.2.0 =

**Added**
* Topic Library: create reusable topics, each with its own prompt, schedule (hourly to weekly), draft/publish override, and model override. Topics generate posts automatically in the background and can be paused, resumed, edited, or run on demand from the new Topics tab. Topics that fail 5 times in a row pause themselves and tell you why. Existing single-prompt scheduling keeps working unchanged.
* Draft-first mode: generated posts are now saved as drafts by default ("ship it as a draft"). A new Draft/Publish setting replaces the old Draft First checkbox; existing installs keep their previous behavior via automatic migration, and a one-time notice explains the change after upgrading.
* Normalized provider API layer: all text providers (OpenAI, Claude, Gemini, Perplexity) now share one call layer with consistent error handling and truncation detection — foundation for upcoming fallback routing and truncation repair.

**Fixed**
* Duplicate posts from a single generation job (queue race condition between the cron worker and inline processing).
* Provider health dashboard reporting "connected" for keys that were never actually tested.
* Claude API errors (rate limits, server errors) silently swallowed instead of being logged with context.
* Content filter keeping stray `<title>` and `[SEO]` marker lines in generated posts.
* Gemini image endpoint not URL-encoding the API key.
* OpenAI image generation failing with "Unknown parameter: 'response_format'" after OpenAI deprecated DALL-E 3 (May 2026). The plugin now uses the GPT Image models (gpt-image-1, gpt-image-1 Mini, gpt-image-1.5), selectable on the Images settings tab, and saves their base64 output locally. Stored DALL-E 3 sizes/quality are translated automatically, so existing installs recover without re-saving settings.

**Changed**
* Onboarding wizard internals split into step partials (no visible change; groundwork for the 4.3 onboarding rewrite).
* Settings access consolidated through the schema helpers (`abcc_get_setting`) across scheduling, audio, images, and admin code.

**Removed**
* Dead code: unused `abcc_has_stale_queued_jobs()` and `abcc_get_provider_help_url()` helpers, redundant double content-filter pass, duplicated base64 image-save logic.

= 4.1.1 =
* Keyword Groups now pick **one** keyword at random per generated post instead of mashing every keyword into a single article. A "Chemistry" group with ten keywords becomes a queue of ten focused topics rather than one over-broad post.
* New `{keyword}` template placeholder holds the keyword chosen for the current post; `{keywords}` still renders the full comma-separated group for templates that want it. The default template now uses `{keyword}` so existing setups get the focused behavior automatically.
* Generation tracking meta records which keyword was selected; the post-editor meta box now shows the focus keyword alongside the source group.
* Fixed: the Default Template now displays its prompt body in a read-only textarea on the Content settings page instead of an empty placeholder.

= 4.1.0 =
* WP 7.0 Connectors API integration now works correctly (previously broken hook and registry calls removed)
* Admin notice shown when WordPress has AI disabled at site level (WP 7.0)
* Claude models refreshed: Sonnet 4.6 and Opus 4.7 (1M token context window each)
* Connections tab shows read-only legacy key reference when WP Connector is active for a provider
* Contextual "Learn more" links added to API Keys, Scheduling, and Bulk Generate sections
* ~1.9 MB runtime reduction: Gemini SDK replaced with direct wp_remote_post() calls, Composer vendor removed from runtime

= 4.0.1 =
* Fixes to "Validate" button for API keys
* Adding documentation URL to the dashboard

= 4.0.0 =
The biggest settings redesign since launch. Everything is easier to find, the dashboard tells you what's happening without digging, and settings that used to feel buried now live exactly where you'd look for them.

**A real dashboard, finally.**
The plugin now opens to a dashboard instead of a blank settings form. You can see your scheduling status at a glance, check the last few generation jobs without leaving the page, and get to common actions in one click. Provider health is summarized right there — green/yellow/red, with timestamps so you know if a key was last verified today or a week ago.

**Settings that make sense.**
The old flat tab layout is gone. Settings are now split into five focused sections: Content (keywords, templates, writing style), Media (images, audio, infographics), Connections (API keys and scheduling), Settings (post types, permissions, advanced), and the Dashboard. Everything that previously required hunting through a long page now has its own tab.

**Changes that save themselves.**
Toggles and sliders across the settings pages now save automatically as you adjust them, with a small "Saved" confirmation. No more scrolling to the bottom to hit a save button after every change. Fields that affect scheduling still require an explicit save (and warn you if you leave without saving).

**Per-role access control.**
You can now control which WordPress roles can access AI generation tools. Authors, editors, or just administrators — your call. Administrators are always enabled and can't be unchecked.

**Provider health checks run daily.**
The plugin now runs a background health check on your connected providers once a day and caches the result. The dashboard shows the freshness of each check so you know whether a "connected" status is from this morning or three days ago.

**Debug mode and settings export.**
The Advanced tab now has a one-click debug logging toggle (no more editing wp-config.php for basic troubleshooting) and a JSON export button so you can back up or migrate your settings.

= 3.8.0 =
Upgrades used to feel like a gamble — would your API keys survive? Would your keyword groups vanish? Not anymore.

Settings now follow a versioned migration path. When you update the plugin, it checks your current settings, upgrades what needs upgrading, and shows you a confirmation notice when it's done. Your API keys, keyword groups, content templates, and selected models all carry over cleanly.

All five AI providers (OpenAI, Claude, Gemini, Perplexity, Stability AI) are now defined in a single registry. Adding or changing providers no longer requires touching five different parts of the code — everything cascades from one source of truth.

= 3.7.0 =
Generation used to freeze the browser while it ran. Now it queues in the background and you can watch it happen.

Every content job — manual, bulk, scheduled, or regenerated — runs through a background queue. A live log shows status, the model used, keywords, how long it took, and a direct link to the post when it's done. If something fails, you get the error message and a one-click link to report it.

= 3.6.0 =
Two things that SaaS tools charge extra for, now built in.

WordPress 7.0 Connectors support: if your site already has API keys set up through the new WordPress Connectors screen, the plugin finds and uses them automatically. No re-entry. On WordPress 6.x, everything works the same as before.

Bulk generation: paste a list of keywords (or upload a .txt file), pick a template and model, and the plugin generates all the posts sequentially as drafts. Progress updates live. The kind of workflow most autoblogging SaaS platforms charge $99/month for.

= 3.5.0 =
RankMath SEO integration. Keyword groups with per-group categories and templates. A content template system with placeholders (`{keywords}`, `{title}`, `{tone}`, and more). One-click regeneration from the content history. All post-editor AI tools consolidated into a single meta box.

= 3.4.0 =
* Added:
  - **Inline API Key Validation**: Real-time verification for all AI providers directly from Advanced Settings. Displays "Verified" or "Failed" status and stores last validation result.
  - **Model Cost Transparency**: Each AI model now displays an estimated cost per post based on current token rates. Includes a new `abcc_model_cost_estimate` filter for advanced users.
  - **Advanced Image Controls**: Expanded size and quality options for OpenAI (DALL-E 3) and resolution presets for Stability AI.
  - **Automatic Image SEO**: Featured images now automatically receive SEO-optimized alt text in the format `{post title} - {primary keyword}`.
* Updated:
  - **Scheduling Clarity**: Raw timestamps replaced with human-friendly text (e.g., "Next post in 6 hours") and a direct link to scheduling settings.
  - **Contextual Help**: Added Dashicon-based tooltips for Keywords, Tone, Models, and API keys to explain settings without cluttering the UI.
  - **SEO Reliability**: Refactored the title and metadata generator to use structured JSON parsing and site-specific context (`site_info`).
  - **RankMath Integration**: Enhanced support with initial field mapping for Social Excerpts and focus keywords.
* Fixed:
  - Fixed minor bugs and improved overall stability.

= 3.3.0 =
* Added:
  - **Perplexity AI Integration**: Full support for web-grounded content generation with source citations. Three new models: Sonar, Sonar Pro, and Sonar Reasoning Pro. Configurable citation styles (inline, references section, or both) and source recency filters.
  - **Draft-First Workflow**: New option to always save generated content as drafts for review before publishing.
  - **Content History Log**: Track generated posts, models used, and publish status directly from Content Settings.
* Updated:
  - Keywords input is now a textarea supporting one topic per line.
  - Renamed "Max Token Limit" to "Content Length" with explanatory tooltip; updated writing tone labels.
  - Rebuilt "About" tab — focused on plugin philosophy and professional consulting services.
* Fixed:
  - Fixed several internal bugs and onboarding improvements.

= 3.2.0 =
* Added:
  - **Gemini Nano Banana Image Generation**: Native Google image generation with configurable sizes (1K, 2K, 4K) and smart fallback chain.
  - **OpenAI o-series Reasoning Models**: Support for o4-mini and proper routing for non-"gpt-" model names.
* Updated:
  - All models updated to latest versions: GPT-4.1 family, Claude 4.5 family, Gemini 2.5 family.
  - Added 1M token context window support for GPT-4.1 models.
* Fixed:
  - Fixed several internal bugs affecting Gemini model routing and image generation.

= 3.1.0 =
* Added:
  - **Complete Onboarding Experience**: 3-step setup with goal-based configuration, visual model selection, interactive API key testing, and automated first post generation.
* Fixed:
  - Fixed several internal bugs.

= 3.0.0 =
* Added:
 - Complete Admin Interface Redesign: New tabbed interface with dedicated sections for Content Settings, Advanced Settings, AI Models, Audio Transcription, and About
 - Audio Transcription Feature: Full OpenAI Whisper integration for converting audio files to blog posts
   - Support for multiple audio formats (MP3, WAV, M4A, WebM, FLAC, MP4)
   - Language selection for transcription
   - Two-step process: transcribe-only or transcribe-and-create-post
   - Audio player embedded in generated posts
 - AI Infographic Generation: Create visual infographics from blog post content using AI
   - Analyzes post content to generate visual descriptions
   - Creates professional infographics using DALL-E or Stability AI
   - Saves directly to WordPress Media Library
 - Enhanced Model Selection Interface: Visual model cards with cost indicators
   - Interactive card-based selection instead of dropdown
   - Clear cost tier indicators (Economy/Standard/Premium)
 - Smart Post Type Selection: Configure which post types show AI content tools
 - Advanced Admin Buttons:
   - "Create AI Post" button on post list screens
   - "Rewrite with AI" button in post editor
   - "Create Infographic" button for existing posts
 - Enhanced Error Handling: More detailed error messages and logging throughout

* Updated:
 - Model Offerings Updated:
   - OpenAI: Added GPT-4 Turbo Preview, updated model descriptions
   - Claude: Updated to Claude 3.5 Haiku, Claude 3.7 Sonnet, and Claude Sonnet 4
   - Gemini: Added Gemini 2.0 Flash, Gemini 1.5 Pro Latest, and Gemini 2.5 Pro Preview
 - Content Generation Flow: Improved prompt engineering for better content structure
 - Token Handling: Enhanced token calculation and management across all AI models
 - Admin Scripts: Completely refactored JavaScript for better user experience
 - CSS Styling: Modern, responsive design with improved visual hierarchy

* Fixed:
 - Model Compatibility: Better backward compatibility for existing model selections
 - Content Formatting: Better HTML structure and block generation
 - SEO Integration: Enhanced metadata generation and validation
 - Performance: Optimized AJAX calls and reduced redundant API requests

* Technical Improvements:
 - Code Organization: Better file structure and separation of concerns
 - WordPress Standards: Improved adherence to WordPress coding standards
 - Documentation: Enhanced PHPDoc comments and inline documentation
 - Accessibility: Better keyboard navigation and screen reader support
 - Internationalization: Improved translation readiness throughout the plugin

= 2.1 =
* Added:
  - Advanced Token Management: Better control over content length with intelligent token allocation across different AI models
  - SEO Integration: Automatic generation of SEO metadata with direct Yoast SEO plugin support
  - Improved Content Structure: Enhanced HTML output with proper heading hierarchy
  - Real-time Token Feedback: See estimated token usage before generating content
  - More Reliable AI Integration: Better error handling and model compatibility

* Changed:
  - Refactored content generation for better HTML structure
  - Improved model context window handling for each AI service
  - Enhanced error handling and logging system
  - Better prompt management for consistent output
  - Updated admin interface with token usage indicators

* Fixed:
  - Content formatting issues with HTML tags
  - Token limit calculation accuracy
  - Model selection and API handling edge cases
  - SEO metadata integration reliability
  - HTML structure validation and sanitization

= 2.0 =
* Added:
  - Claude 3 AI model integration (Haiku, Sonnet, and Opus)
  - Enhanced image generation with DALL-E 3
  - Stability AI integration as fallback
  - Cost-aware model selection interface
  - Better security features

* Changed:
  - Refactored code for better maintainability
  - Improved API handling architecture
  - Enhanced content generation quality

* Fixed:
  - Various bug fixes and improvements
  - Better error handling
  - Enhanced stability

= 1.9 =
* Added:
  - Support for selecting GPT-3.5, GPT-4 and GPT-4o models for content generation
  - Users of the old GPT-3.5 won't be affected by the change as there is backwards compatibility
  - Enhanced plugin settings UI for better user experience and clearer model selection

* Fixed:
  - Code refinements for better modularity and maintainability
  - Comprehensive error handling and logging
  - Updated documentation to guide users through new features and configurations

= 1.6 =
* Fixed:
  - Select2 integration
  - Tone Select keeping custom value saved

* Added:
  - Minor description of some options

= 1.5 =
* Changed:
  - Code linting and cleanup
  - Better form usability
  - Minor quality of life changes

= 1.4 =
* Added:
  - Gemini API — Now you can use Google AI to create your posts!
  - A tone selector so you can define how the post should be written

* Changed:
  - Now it's possible to use wp-config variables to store the OpenAI and GeminiAI API keys
  - The admin menu and form was remade for easier navigation
  - Minor changes for better usage

= 1.0 =
* Added:
  - Implemented image generation using OpenAI's DALL-E model
  - Option to select categories for posts
  - Email notifications when a new post is created automatically

* Changed:
  - Refactored code for better readability and maintainability
  - Updated UI/UX for the settings page
  - Better scheduled post generation (hourly, daily, weekly)
  - Revised error handling and logging

* Fixed:
  - Resolved issues related to API key validation and error handling
  - Fixed bugs reported by users in the previous version

= 0.9 =
- Bug fixes and quality of life updates

= 0.8 =
- WordPress Review Guidelines fixes

= 0.5 =
- Initial release
