peptiderepo 52a8ffbd9e feat(images): collapse Image Provider + Image Model into a single dropdown
Until now, Image Provider and Image Model were two independent selects
in the admin UI. That let the CEO set Model=flux-1-schnell while
Provider was still openrouter — OpenRouter has no such model so every
image gen on posts 650/657 on 2026-04-20 returned HTTP 400, and the
article published without a featured image.

v0.8.0 removes the Image Provider field from the admin UI entirely.
The provider is now derived from the model's entry in the registry
every time the model is saved. A new
PRAutoBlogger_Image_Model_Registry::provider_for() helper centralises
the mapping, so admin save, the on-upgrade migration, and future
callers all read from one place.

On save, PRAutoBlogger_Admin_Page::sanitize_image_model() validates
the submitted slug against the registry:
- Known slug: persist it, and update `prautoblogger_image_provider` to
  the paired provider as a side-effect.
- Unknown slug: add_settings_error with a clear message, and return
  the previously-saved value so the site stays on a working model.

A one-shot v0.8.0 migration in
PRAutoBlogger::on_check_db_version() derives the provider from the
currently-saved model on first admin_init after the plugin is updated.
This auto-heals sites that were running mismatched pairs before the
upgrade, without requiring the admin to re-open settings.

`prautoblogger_image_provider` option key is preserved — all existing
reads in the pipeline, cost tracker, and validators continue to work
unchanged.

Tests (Services/ImageModelRegistryTest):

- Every registry entry has an id and a provider in {openrouter, cloudflare}.
- provider_for() returns the paired provider for a known slug.
- provider_for() returns '' for unknown/empty slugs.

Cost impact: none.

Migration idempotent via the `prautoblogger_migrated_image_provider_v080`
flag. Uninstall sweeps it along with every other plugin option.

Part of the v0.8.0 image bundle (thread image-mime-bug, Issue 1).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 01:16:30 +07:00
2026-04-10 16:10:27 +07:00

=== PRAutoBlogger ===
Contributors: peptiderepo
Tags: ai, content generation, blogging, seo, automation
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 0.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically researches trending topics from social media and generates SEO-friendly blog posts using AI.

== Description ==

PRAutoBlogger monitors social media platforms (starting with Reddit) for recurring questions, complaints, and product comparisons in your niche. It uses AI to analyze these patterns, generate well-structured blog articles, run them through an editorial review agent, and publish them on a configurable daily schedule.

**Key Features:**

* Reddit integration for topic research (TikTok, Instagram, YouTube planned)
* Configurable AI-powered writing pipeline (single-pass or multi-step)
* Chief editor agent reviews content before publishing
* Full cost tracking with monthly budget limits
* Google Analytics 4 integration for performance metrics
* Self-improvement loop: learns from high-performing content
* Encrypted API key storage

**Supported LLM Providers:**

Uses OpenRouter for access to models from Anthropic, OpenAI, Google, Meta, and more.

== Installation ==

1. Upload the `prautoblogger` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to PRAutoBlogger > Settings to configure your API key and preferences.
4. Add your OpenRouter API key.
5. Configure your target subreddits and content preferences.
6. Click "Test Connections" to verify setup (Reddit sources use RSS — no API key needed).
7. Click "Generate Now" for your first article, or wait for the daily schedule.

== Frequently Asked Questions ==

= How much does it cost to run? =

Costs depend on your chosen models and article volume. With default settings (Claude Haiku for analysis, Claude Sonnet for writing, 1 article/day), expect roughly $0.05-0.15 per article. The plugin includes a monthly budget hard-stop to prevent overspending.

= Can I review articles before they publish? =

By default, articles go through the chief editor agent. Articles that pass review are auto-published. Articles that fail review are saved as drafts for manual review.

= Do I need a Reddit API key? =

No. PRAutoBlogger uses Reddit RSS feeds as its primary data source, with Reddit .json endpoints as a fallback. Both are free and require no authentication. You only need an OpenRouter API key for the AI models.

== Changelog ==

= 0.2.0 =
* Reddit data source uses RSS feeds (primary) with .json endpoints as fallback — no API key needed.
* Removed Reddit Client ID/Secret fields from admin settings.
* Added source status indicator showing RSS and .json fallback availability.
* Added configurable research cache TTL, time window, and posts-per-subreddit settings.
* Updated Test Connections to show which Reddit source is active.
* Fixed deployment pipeline to purge LiteSpeed cache after deploy.

= 0.1.0 =
* Initial release with Reddit source, OpenRouter LLM, and full content pipeline.
Description
No description provided
Readme 2.2 MiB
Languages
PHP 91.9%
JavaScript 4%
CSS 3.8%
Shell 0.3%