We built DEV3 AI Auto Blogger & Content Calendar as a PHP plugin with a React admin app and a block editor panel. The calendar, backlog and workflow work without AI; the AI writes drafts that wait for people.
Key design decisions
- A stage machine on top of post statuses. Outline, writing, review, changes requested, approved, scheduled and published, mapped onto WordPress's draft, pending, future and publish statuses, with a history log of who did what.
- A publish guard at the data layer. A
wp_insert_post_data filter at priority 99 checks every save. An unapproved, plugin-managed post heading for publish or future is quietly saved as pending instead, whatever code path sent it.
- Approvers count, authors don't. Approval needs
edit_others_posts by default (filterable). An editor who publishes in person is recorded as the approver; an author with publish rights is downgraded to pending.
- A scoped bypass for autopilot. Scheduled AI runs submit drafts for review. Only a schedule with "Auto-publish without review" switched on (off by default) can schedule posts, inside a counter-based bypass that ends when the callback returns.
- Native blocks, not pasted HTML. Drafts come back as typed block objects that PHP turns into core paragraph, heading, list, quote, table and details blocks. A test checks the markup survives a
parse_blocks → serialize_blocks round trip unchanged.
- Duplicate detection by meaning. Research ideas are embedded and compared with the site's posts and backlog (cosine threshold 0.82); a keyword-overlap check takes over when AI is off.
Architecture
The calendar has month and week views, drag and drop with pointer, touch and keyboard (Space to pick up, arrow keys to move, Enter to drop, with live announcements), and an agenda list on phones. The Studio takes an item from topic to outline, draft, review and schedule. Drafts are written section by section as a background job and only reach the post when someone clicks Accept draft into post. In the block editor, a pre-publish panel locks the Publish button until "I have reviewed this AI-assisted draft" is ticked. Brand voices, e-mail notifications and a daily digest round it out. The API client, jobs, embeddings store and settings come from a shared core used across DEV3's plugins.