=== Postloom - AI Post Generator and Publisher | Autonomous Post Publishing Engine ===
Contributors: wpazleen
Tags: ai post generator, auto blogging, social auto publish, schedulepress alternative, automated content
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Autonomously researches, drafts, SEO-optimizes, illustrates, schedules, and broadcasts WordPress articles and social updates to 10+ networks using AI.

== Description ==

**Postloom - AI Post Generator and Publisher** is the leading **Autonomous Post Publishing Engine** and editorial scheduling powerhouse built specifically for WordPress. It transforms your website into an autonomous, enterprise-grade content studio that researches, writes, illustrates, categorizes, schedules, and cross-publishes high-ranking blog posts and multi-channel social media campaigns completely on autopilot.

Whether you run a high-volume media publication, an affiliate marketing site, a SaaS product knowledge base, or an e-commerce storefront, **Postloom - AI Post Generator and Publisher** orchestrates the entire publication lifecycle. From knowledge base ingestion and multi-model AI synthesis to Gutenberg block formatting, featured image generation, drag-and-drop editorial calendar scheduling, and automated broadcasting across 10+ social networks, this **Autonomous Post Publishing Engine** handles it all without burning out your editorial team.

### Auto Schedule and Publish on Social Media
Postloom isn't just an article writer—it is an end-to-end **Social Media Auto Schedule & Publishing Engine**. When you schedule an article on the interactive Editorial Calendar or publish a post live, Postloom automatically formats, queues, and broadcasts tailored social updates to **X (Twitter), Facebook Pages, LinkedIn, Bluesky, Mastodon, Pinterest, Instagram Business, Meta Threads, Medium, and Google Business Profile**. Each platform receives optimized character counts, custom templates, dynamic tags, and attached editorial graphics automatically.

= What Makes Postloom the Ultimate Autonomous Post Publishing Engine? =

1. **AI Post Generator and Publisher Workflow**: Generate complete, human-grade, SEO-optimized articles in seconds with native Gutenberg block conversion, FAQ schema, and focus keyphrases.
2. **Interactive Drag-and-Drop Editorial Calendar**: A unified visual calendar to view, schedule, and drag-and-drop WordPress posts (Scheduled, Published, Draft, Pending) alongside automated AI generation pipelines.
3. **Dedicated Social Media Scheduler**: Select target social platforms, apply custom copy templates, and auto-schedule multi-platform broadcasts directly from post cards or the calendar sidebar.
4. **Step-by-Step Interactive User Guide**: Built-in interactive checkbox guides with real-time progress tracking to walk you through AI generation, auto-scheduling, and collecting API credentials for each social network.
5. **Editorial Review Queue with Direct Calendar Scheduling**: Safely inspect drafts before publication. One click approves and publishes immediately, moves to trash, or schedules for an exact future date and time on the Editorial Calendar.
6. **Smart Weekly Slot Auto-Scheduler**: Configure 7-day recurring publication slots (e.g., Monday 9:00 AM, Wednesday 2:00 PM) to ensure predictable, consistent publishing rhythms without manual intervention.
7. **Missed Schedule Watchdog**: Never lose traffic to WordPress WP-Cron failures. Postloom's background watchdog automatically detects and rescues missed scheduled posts within minutes.
8. **Product & Knowledge Base Grounding**: Ground your AI generation with domain knowledge. Upload PDF, DOCX, Markdown, or TXT documentation to ensure 100% factual accuracy with zero hallucinations.
9. **Multi-AI Connectors with Native WordPress Core Bridge**: Connect Google Gemini, OpenAI (GPT-4o), Anthropic Claude, DeepSeek, X.AI Grok, or OpenRouter. On WordPress 7.0+, natively hooks into WordPress core AI Connectors with custom direct API overrides.
10. **Custom Platform Social Templates**: Tailor message structures for each social network with dynamic placeholders like `{title}`, `{content}`, `{url}`, and `{tags}`.

== Complete Tour of Plugin Tabs & Features ==

### 1. Dashboard (Postloom Automation Dashboard)
* **Real-time Pipeline Telemetry**: Live countdown timers for upcoming scheduled jobs.
* **Granular Action Controls**: Run jobs immediately ("Start Now"), change execution time ("Reschedule"), inspect multi-step pipeline telemetry, open social promotional drafts, open media studio, retry failed jobs, or delete jobs.
* **System Health Cards**: Immediate visual check of connected AI models, queued drafts, active social connections, and auto-scheduler status.

### 2. Editorial & Publishing Calendar
* **Monthly Visual Grid**: Full overview of published articles, future scheduled posts, review queue drafts, and automated AI generation jobs.
* **Smart Event Cards**: Clearly displays execution time (e.g. `9:00 am`), post title, taxonomy tag/product badge, and draft/publish mode.
* **Action Menu**: View post/editor, reschedule execution date and time via modal, or delete/trash schedule.
* **Drag-and-Drop Rescheduling**: Drag any post to a new date to automatically update its WordPress publication time and cron schedule.
* **Unscheduled Drafts Drawer**: Slide-out drawer with unpublished drafts ready to be dragged onto any calendar date.
* **Quick-Create Modal**: Click the `+` icon on any calendar date to quickly draft or schedule a new post with product relations and target social channels.

### 3. Instant Creator Studio
* **On-Demand AI Synthesis**: Enter any focus keyword, topic headline, or paste raw notes to instantly synthesize a comprehensive article.
* **Flexible Publication Modes**:
  - *Save as Draft*: Sends article to the Editorial Review Queue for human oversight.
  - *Publish Immediately*: Builds and publishes the post live to your site with immediate social sharing.
  - *Schedule on Calendar*: Select an exact date and time. Dynamically transforms the action button into **"Instant Generate and Schedule Post"**, enqueuing the job and placing it on the Editorial Calendar.
* **Knowledge Ingestion**: Select product knowledge base or upload documents (.pdf, .md, .txt, .docx) on the fly.
* **Taxonomy & Author Mapping**: Assign categories, tags, custom new tags, and specific post authors.

### 4. Editorial Review Queue
* **Draft Articles Awaiting Approval**: Table of AI-generated articles awaiting editorial sign-off.
* **One-Click Gutenberg Editor**: Direct link to inspect and refine content in the WordPress Gutenberg block editor.
* **Approve & Publish**: Instantly transition draft to live published post and trigger connected social broadcasting.
* **Schedule Post**: Pick a future date and time to automatically schedule the draft on the Editorial Calendar and register WordPress future cron hooks.
* **Reject & Trash**: Safely delete unwanted drafts.

### 5. Schedule & Auto-Scheduler Studio
* **Product-Centric Scheduling**: Set automated recurring article generation per product with specific publication frequencies and daily limits.
* **Weekly Time Slots Matrix**: Define preferred publishing time slots for each day of the week (Monday through Sunday).
* **Missed Schedule Watchdog**: Displays missed schedule diagnostics and provides a one-click "Rescue Missed Schedules Now" action.

### 6. Social Publishing & Auto-Scheduler Studio
* **10+ Multi-Platform Network Connections**: Connect X (Twitter), Facebook Pages, LinkedIn, Bluesky (AT Protocol), Mastodon, Pinterest, Instagram Business, Threads, Medium, and Google Business Profile.
* **Custom Social Templates**: Create platform-tailored post templates with dynamic tags (`{title}`, `{content}`, `{url}`, `{tags}`).
* **Publish Queue**: Monitor scheduled and completed social broadcasts, inspect platform post IDs and URLs, and retry failed posts.
* **Instant Social Media Share**: Broadcast any WordPress post to connected social networks immediately with custom commentary.
* **Automated Schedule Execution**: When any scheduled post publishes on its target date, Postloom automatically publishes to all connected social networks.

### 7. Products & Knowledge Base Studio
* **Product Relations**: Associate products with target categories, tags, author IDs, and publication defaults.
* **Knowledge Base Ingestion**: Upload product manuals, release notes, and documentation (.pdf, .docx, .md, .txt) used to ground AI generation in factual truth.

### 8. Sources Studio
* **Research Grounding**: Configure external knowledge feeds, RSS sources, documentation URLs, and web search integrations to keep content fresh and relevant.

### 9. Skills Studio
* **Modular AI Prompts & Instructions**: Configure system instructions, style guides, tone parameters, and task-specific prompt bundles.
* **Default Bundled Skills**: Pre-seeded with professional skills for Technical Writing, Product Reviews, SEO Listicles, Case Studies, and Social Snippets.

### 10. AI Connectors Studio
* **Supported Providers**: Google Gemini, OpenAI, Anthropic Claude, DeepSeek, X.AI Grok, OpenRouter.
* **Key Validation & Model Selection**: Test API keys with instant latency diagnostics and select preferred text models.
* **WordPress 7.0+ AI Client Native Bridge**: Automatically detects and uses core WordPress AI connectors, with optional direct API overrides.
* **Direct Provider Links**: Quick-access links beneath every key field to create provider API keys.

### 11. SEO Studio
* **Search Engine Optimization**: Automatically generate meta titles, meta descriptions, and focus keyphrases.
* **Plugin Compatibility**: Direct integration with Yoast SEO, Rank Math, and All in One SEO metadata fields.
* **Heading & Readability Controls**: Enforce proper H2/H3 hierarchy, bulleted lists, and FAQ schema blocks.

### 12. Image & Media Studio
* **Automatic Featured Images**: Automatically generate featured images using AI (DALL-E 3) or fetch royalty-free stock photography from Pexels and Pixabay.
* **Midjourney & DALL-E Prompt Studio**: Generates optimized prompts saved directly to post metadata for external image tools.
* **Media Library Integration**: Full support for existing WordPress media attachments.

### 13. Logs & Diagnostics Studio
* **Pipeline Telemetry**: Detailed step-by-step logs of keyword research, outline drafting, article synthesis, Gutenberg block conversion, image generation, and social publishing.
* **Error Tracking & Recovery**: Inspect raw API errors, rate-limit backoffs, and token usage metrics. Clear logs with a single click.

### 14. Global Settings Studio
* **Default Generation Defaults**: Set fallback post status (Draft vs. Publish), default post author, default language, and safety guardrails.
* **Email Notification Dispatch**: Receive automated alerts when articles are scheduled, approved, published, or encounter pipeline errors.

### 15. Documentation & Interactive User Guide Studio
* **Interactive Step-by-Step User Guide**: Complete checklist-style walkthrough covering full post generation, calendar scheduling, social auto-sharing, and network setup with saved progress checkmarks.
* **Social Network Setup Guides**: Direct step-by-step instructions on collecting API keys and access tokens for each supported network.
* **In-App Cheatsheets & Architecture Docs**: Full REST API endpoints, hook references, and prompt engineering instructions.

== Benefits of Postloom ==

* **For Content Creators & Bloggers**: Publish 10x more high-ranking content and cross-post to social media without burning out or spending hours in the WordPress editor.
* **For Agencies & Site Networks**: Manage 50+ client blogs with centralized AI connectors, brand voice skills, automated editorial calendars, and multi-network social broadcasting.
* **For SaaS & Product Companies**: Upload product documentation (.pdf, .docx, .md) to generate factually grounded release articles, feature announcements, and auto-scheduled social campaigns.
* **For E-commerce Store Owners**: Automatically publish product buying guides, comparison posts, and seasonal roundups mapped to WooCommerce categories.

== Privacy and Security ==

All scheduled jobs and knowledge base options are stored locally in your own WordPress database. Third-party AI providers are contacted only when you supply your API key and trigger content generation.

== External Services ==

This plugin connects to external services only for the features you configure.

When the WordPress AI Client is available (WordPress 7.0+), Claude, OpenAI, and Gemini use it natively via WordPress Connectors (Settings > Connectors) with zero direct plugin-level API calls. Direct API keys are only used as a fallback when the WordPress AI Client is not detected, or when the user explicitly opts to provide their own key as an override. DeepSeek, Grok, and OpenRouter remain as direct integrations since they are not natively covered in WordPress core Connectors.

**Google Gemini**
* Purpose: Generates article content and image prompts when Gemini is selected as active provider.
* Data sent: Topic keyword, document knowledge context, and prompt parameters.
* Service URL: https://generativelanguage.googleapis.com/
* Privacy Policy: https://policies.google.com/privacy

**OpenAI**
* Purpose: Generates article content and images when OpenAI is selected as active provider.
* Data sent: Topic keyword and prompt parameters.
* Service URL: https://api.openai.com/v1/
* Privacy Policy: https://openai.com/privacy/

**Anthropic Claude**
* Purpose: Generates article content when Claude is selected as active provider.
* Data sent: Topic keyword and prompt parameters.
* Service URL: https://api.anthropic.com/
* Privacy Policy: https://www.anthropic.com/legal/privacy

**DeepSeek**
* Purpose: Generates article content when DeepSeek is selected as active provider.
* Data sent: Topic keyword and prompt parameters.
* Service URL: https://api.deepseek.com/v1/
* Privacy Policy: https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html

**X.AI Grok**
* Purpose: Generates article content when Grok is selected as active provider.
* Data sent: Topic keyword and prompt parameters.
* Service URL: https://api.x.ai/
* Privacy Policy: https://x.ai/legal/privacy-policy

**OpenRouter**
* Purpose: Routes text generation requests to selected AI models via OpenRouter.
* Data sent: Topic keyword and prompt parameters.
* Service URL: https://openrouter.ai/api/
* Privacy Policy: https://openrouter.ai/privacy

**Pexels**
* Purpose: Provides royalty-free stock photos for generated posts when Pexels is selected.
* Data sent: Search query keywords.
* Service URL: https://www.pexels.com/api/
* Terms of Service: https://www.pexels.com/terms-of-service/
* Privacy Policy: https://www.pexels.com/privacy-policy/

**Pixabay**
* Purpose: Provides royalty-free stock photos for generated posts when Pixabay is selected.
* Data sent: Search query keywords.
* Service URL: https://pixabay.com/api/docs/
* Terms of Service: https://pixabay.com/service/terms/
* Privacy Policy: https://pixabay.com/service/privacy/

**Note on Third-Party Libraries:**
The admin panel uses React Router for in-app navigation. React Router embeds documentation URLs (reactrouter.com) in its library source code for developer reference. These are static strings — no HTTP requests are made to those URLs at runtime.

== Source Code ==

All source files used to build the compiled admin panel assets are included in this plugin and are publicly available.

* `build/index.js` — Compiled from `admin/src/` (React components, pages, and hooks)
* Build tool: `@wordpress/scripts` (standard WordPress React build toolchain)
* To rebuild: run `npm install` then `npm run build` from the plugin root

Full source code is also available on GitHub:
https://github.com/wpazleen/postloom-ai-post-generator-and-publisher

== Installation ==

= Automatic Installation =
1. Log into your WordPress admin dashboard.
2. Go to Plugins > Add New and search for "Postloom AI Post Generator and Publisher".
3. Click Install Now, then Activate.

= Manual Installation =
1. Upload the `postloom-ai-post-generator-and-publisher` folder to your `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **Postloom > Settings** to configure your AI provider API key and social connections.

== Frequently Asked Questions ==

= What is Postloom - AI Post Generator and Publisher? =
Postloom is an Autonomous Post Publishing Engine for WordPress that automates content research, article drafting, SEO optimization, editorial calendar scheduling, and cross-platform social media distribution.

= Do scheduled posts automatically share to social media? =
Yes! When any scheduled post (whether scheduled from the Review Queue, Instant Creator, or Auto-Scheduler) publishes on its target date, Postloom detects publication and automatically broadcasts to all active connected social accounts using your configured templates.

= Can I auto schedule and publish on social media directly from the calendar? =
Yes. The Editorial Calendar features a built-in Social Scheduler sidebar. You can select any existing WordPress article, choose target social networks, customize message templates, and schedule social media broadcasts for an exact date and time.

= Can I reschedule posts on the Editorial Calendar? =
Yes. You can drag and drop any post card to a new date, or click the three-dot (`...`) menu on any card and select **Edit** to pick an exact new execution time.

= What happens if WordPress WP-Cron fails and misses a schedule? =
Postloom includes an active **Missed Schedule Watchdog** that monitors future posts and automatically rescues and publishes missed schedules.

= Does Postloom require a paid API key? =
You can use free tier API keys (such as Google Gemini free tier) or pay-as-you-go keys from OpenAI, Anthropic, DeepSeek, or OpenRouter.

= Can I approve posts before they go live? =
Yes. You can set the publication output mode to "Draft" to review generated posts in the Editorial Review Queue before publishing.

= Does Postloom overwrite my existing posts? =
No. Postloom creates new posts as drafts, future scheduled posts, or published posts. It never modifies existing manual posts unless explicitly directed.

== Screenshots ==

1. Dashboard showing pipeline generation status, countdown timers, and issue diagnostics.
2. Editorial Calendar with Drag-and-Drop scheduling and Social Scheduler sidebar.
3. Instant AI Post Creation Studio for on-demand article generation.
4. Multi-Product Management & Knowledge Base Document Ingestion panel.
5. Interactive Step-by-Step User Guide with checklist progress tracking.

== Changelog ==

= 1.2.2 =
* **Enhancement:** Prevention of Duplicate Focus Keywords & URL Slugs.
* **Enhancement:** Add filters and search to Logs tab.
* **Enhancement:** Add Clear Filters button to Logs tab.
* **Enhancement:** Prompt & Skill Hardening
* **Enhancement:** Instant AI Editor & Preview

= 1.2.1 =
* **Fix:** Multi-select checkboxes and bulk action toolbar to the Dashboard
* **Fix:** Resolved missing Schema class import in JobRunner preventing scheduler fatal errors.
* **Fix:** Refined batch deduplication so manual "Run Batch Now" executes immediately without blocking scheduled daily runs.
* **Fix:** Dynamic AI provider resolution in SourceEngine eliminating hardcoded provider exceptions and static fallbacks.
* **Fix:** Resolved 503 timeouts and 15 RPM rate limits by consolidating social media drafts into single-call batch prompts.
* **Fix:** Made Article Topic optional in Instant Creator and Generate Now modal with automatic product-grounded topic ideation.
* **Fix:** Persisted and connected Content Sources toggles to the topic generation engine.
* **Fix:** Added live searchable post selection by title or ID for Instant Social Media Sharing.
* **Fix:** Respected global telemetry logging toggle and added missing lifecycle audit logs.
* **Fix:** Updated uninstall.php to cleanly drop all 11 plugin database tables upon complete wipe.

= 1.2.0 =
* **New:** Instant AI Post Editor Studio" with Pagination with Batch Mode
* **New:** Full WYSIWYG Formatting Toolbar
* **New:** Gutenberg ⇄ Visual HTML Bidirectional Sync
* **New:** Simplified All Social Connection Modal 
* **Enhancement:** Upgraded Developer Portals & Token Directory
* **Enhancement:** Backend Driver Verifications & Resilience Enhancements

= 1.1.1 =
* **Enhancement:** Gutenberg Post Preview & Live SEO Editor in Dashboard Table
* **Enhancement:** Added content length options for generated posts

= 1.1.0 =
* **New:** Added Social Media Auto Schedule & Multi-Platform Publishing with target platform selection.
* **New:** Built-in Social Scheduler sidebar on the Editorial Calendar for scheduling posts to 10+ social networks.
* **New:** Added an interactive step-by-step user guide with checkbox progress tracking for complete operational mastery.
* **New:** Added platform credential setup guides for all supported social networks.
* **Fix:** Fixed missing social queue events and enhanced queue audit logs.
* **Fix:** Improved feature functionality and ensured complete operational coverage.
* **Fix:** Improved the auto scheduler's date, product, and category selection.

= 1.0.1 =
* **Fix:** Calendar data now auto refreshes while the calendar is open.
* **Fix:** Fixed optimistic update issues when rescheduling generation jobs.
* **Fix:** Quick created calendar posts now correctly include platform selection.
* **Fix:** Added social visibility and channel controls to the calendar.
* **Fix:** Fixed social publishing for scheduled posts and restored the dead rescue hook.
* **Fix:** SocialEngine API failures are now properly surfaced.
* **Fix:** Fixed silent failures during social profile validation.

= 1.0.0 =
* Initial public release of Postloom - AI Post Generator and Publisher.