11108b3bb54d77a867cacf7aee2c38962155cbf3
First commit of the image + Instagram A/B pipeline workstream. Ships the Cloudflare Workers AI image provider, its pricing + validator helpers, four new settings fields in a new "Images" admin section, and unit tests with mocked HTTP. Nothing calls the provider yet from the article pipeline — integration lands in commit 1b. Why: CEO-approved on 2026-04-15 (see convo/prautoblogger/threads/2026-04-image-pipeline/01-cto-handoff.md). Style is locked to the 90s infomercial pastiche; default model is FLUX.1 [schnell] at ~$0.0011/MP (~$0.01/article for 8 images across 4 placements x 2 variants). Risk flags: - Direct call to Cloudflare Workers AI bypassing AI Gateway (decision D-001, documented in convo/prautoblogger/decisions/). Gateway route to Workers AI currently 403s; OpenRouter gateway path unaffected. - prab_event_log structured writes deferred to commit 1b when the table lands (decision D-002). Logger-based logging is in place now. - No schema changes. No existing code paths touched outside settings. - Backward compatible: provider is instantiable but not wired to any consumer yet. Test plan: - CI runs PHPUnit including the new CloudflareImageProviderTest. - After merge: verify the new Images section appears on the settings page, the style-suffix textarea pre-fills with the infomercial prompt, and entering the existing CLOUDFLARE_AI_TOKEN + account UUID lets a future "Test Connection" button return OK (button ships in a later commit; the underlying validate_credentials_detailed() works today). Files: - includes/providers/interface-image-provider.php (adopted from CTO draft) - includes/providers/class-cloudflare-image-provider.php (283 lines) - includes/providers/class-cloudflare-image-pricing.php (78 lines) - includes/providers/class-cloudflare-image-validator.php (107 lines) - includes/admin/class-settings-fields.php (+ Images section, 4 fields) - prautoblogger.php (+ PRAUTOBLOGGER_DEFAULT_IMAGE_MODEL, _STYLE_SUFFIX) - tests/unit/Providers/CloudflareImageProviderTest.php - ARCHITECTURE.md (file tree, integrations table, options table, decision #16) - CONVENTIONS.md (How To: Add a New Image Provider) - CHANGELOG.md (Unreleased section) Agent-Session: cowork-2026-04-15-image-pipeline-commit-1a
=== 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
Languages
PHP
91.9%
JavaScript
4%
CSS
3.8%
Shell
0.3%