fb1451c4dcaecde7d3645b356e84fba503890bc2
Cloudflare's Workers AI FLUX.1 schnell content filter sometimes rejects peptide-comic prompts as NSFW (HTTP 400, errors[].code === 3030). On 2026-04-20 this produced a silent publish-without-featured-image for post #650 ("Semaglutide vs Tirzepatide") — the LLM-rewritten scene tripped the filter and we had no recovery path. New behaviour: on a 3030 response, the Cloudflare provider throws a typed PRAutoBlogger_Image_NSFW_Blocked exception. The batch wrapper catches it and tags the per-slot result with `error_type: nsfw_blocked`. Image_Pipeline hands the results to a new PRAutoBlogger_Image_NSFW_Retry helper, which reruns the blocked slot once with a sanitized fallback prompt (title + style suffix, no LLM rewrite). On success the retry result replaces the error entry; on a second block, a WARNING is logged and the pipeline publishes without that image — same terminal behaviour we had before, just explicit. Files: - New providers/class-image-nsfw-blocked.php — typed exception. - providers/class-cloudflare-image-support.php — is_nsfw_error() + throw_if_nsfw() helpers. - providers/class-cloudflare-image-provider.php — calls throw_if_nsfw inside the 4xx branch; batch catches the typed exception and marks the result with error_type. - core/class-image-prompt-builder.php — new public build_fallback_prompt shim so the retry layer can reach the rule-based fallback without going through the LLM path. - New core/class-image-nsfw-retry.php — single-shot retry helper. - core/class-image-pipeline.php — invokes the retry between batch completion and per-slot processing. - admin/class-settings-fields-extended.php — new toggle `prautoblogger_image_nsfw_retry` (default on) in the Images section. Tests: - CloudflareImageProviderTest — 3030 response throws NSFW exception; batch tags the per-slot result with `error_type: nsfw_blocked`. - ImagePipelineTest — retry succeeds when provider returns a good result on the second call; retry is skipped when the setting is off. Cost impact: worst-case an extra Cloudflare call per NSFW-blocked slot (~$0.000834). Current incidence ~2% of generations; ~+$0.00002 per generation amortized. Immaterial. Uninstall: new option covered by the existing prautoblogger_% LIKE sweep in uninstall.php. Part of the v0.8.0 image bundle (issues from thread image-mime-bug). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
=== 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%