SapphireIT Editorial Workflow

By Md. Readush Shalihin

0+ active installationsVersion 1.2.0

Editorial approval workflow with an enforceable publish gate and a complete audit trail. AI can draft it. A human approves it.

Description

AI can draft it. A human approves it. You can prove who approved what, and
when.

SapphireIT Editorial Workflow puts a real review step between writing content
and publishing it, on the posts, pages and custom post types you already have:

  • Enforceable review. A publish gate for each content type, with three
    modes. Off changes nothing. Log only lets people publish but records
    every publish that skipped approval. Enforce stops content from going live
    until it has been approved in the workflow. Every content type starts at Off.
  • A complete audit trail. Every time managed content is published or
    unpublished, the plugin records who did it, when, and which workflow status
    the content was at in that moment. This happens even with the gate off.
  • Notifications. Opt-in emails when a reviewer is assigned, when content is
    submitted for review, when changes are requested, when content is approved
    and when a workflow comment is added.
  • Governance. Evidence of how content was made and who signed it off:
    • declared AI use on every item (Human-written, AI-assisted or AI-generated),
      set by people in the editor or by agents through the REST API. AI use is
      declared, not detected: the plugin never inspects your text, it records
      who made each declaration and when;
    • optional review attestation: approvers confirm they reviewed the content,
      and the confirmation is stored with the approval;
    • CSV export of the full audit trail;
    • a governance report: how much was published after approval, what went out
      while the gate was off, blocked publishes, declared AI use and overdue
      reviews;
    • an opt-in “Reviewed by” disclosure block and shortcode for published
      content.

Every managed post gets a workflow status, an assigned reviewer, a due date,
workflow comments and a complete activity history, managed from a Gutenberg
sidebar, a classic editor meta box and an admin dashboard.

Six statuses, one clear path: Draft → Writing → Review → Needs Changes →
Approved → Published, with explicit paths for sending content back and for
re-editing something that is already live.

A Getting Started page (the Help link in the plugin’s header, or
Workflow → Getting Started) walks you through the setup steps, explains who can
do what and what each setting does, and links to tutorials, docs and support.
The page makes no external request until you click a link.

What it does

  • A real state machine. Only the moves in the transition graph are possible.
    Nobody jumps a draft straight to approved, whatever their role.
  • Server-side enforcement. Every transition is re-checked in PHP against the
    graph, the capability map and the post’s current stored status. The editor UI
    shows you what you can do; it does not decide it. The publish gate works the
    same way: the editor offers Submit for Review instead of Publish when
    the gate would refuse, and the server refuses by the same rule whatever the
    client sends.
  • Seven dedicated capabilities, granted to roles at activation and editable
    with any capability-management plugin. No hard-coded role checks.
  • Reviewer assignment and due dates, with an “overdue only” filter computed
    in your site’s timezone.
  • Workflow comments that stay in the editorial log and never appear on the
    front end.
  • A complete activity history in a dedicated indexed table: who changed
    what, when, including every publish, unpublish, blocked publish and publish
    without approval.
  • Conflict protection. If two editors act on the same post at once, the
    second one is told the post moved instead of silently overwriting the first.
  • An admin dashboard with server-side search, filtering, sorting and
    pagination, row actions, and bulk actions across up to 100 posts.
  • A documented REST API under sit-cwm/v1. Everything the UI does is an
    endpoint you can call yourself.
  • Works with what you have. Posts, pages and any custom post type, through
    post meta. No custom post type of its own, and nothing to migrate.

What it deliberately does not do

Being straight about this matters more than a longer feature list:

  • It does not publish anything. Reaching the “Published” workflow status
    records that the editorial process finished — it does not touch the
    WordPress post status. Publishing stays a deliberate action by a human. The
    two are separate fields on purpose, so that scheduled posts keep their
    schedule and live content can be re-edited without being unpublished.
  • It does not judge whether AI wrote your text. AI use is declared, not
    detected: people or agents state it, and the plugin records the statement
    and who made it. It records who approved content, not a verdict on who or
    what wrote it.
  • It does not guard database writes made by other code. Code that updates
    post_status in wp_posts directly through $wpdb, without WordPress’s
    publishing functions, is not seen by the publish gate.
  • No Slack, no editorial calendar, no multiple workflows, no rules engine. Those
    are on the roadmap, not hidden behind an upsell in this plugin.

Who can do what

  • Draft, Writing, Review — sit_cwm_change_workflow
  • Needs Changes — sit_cwm_review_content
  • Approved — sit_cwm_approve_content
  • Published — sit_cwm_approve_content plus WordPress publish_post
  • Publish unapproved content while the gate is set to Enforce —
    sit_cwm_bypass_publish_gate (recorded every time it is used)

Every change also requires WordPress’ own permission to edit that specific post.
By default administrators get everything, editors can review and approve,
authors and contributors can move their own content up to Review, and
subscribers get nothing. Only administrators can publish past the gate.

Developers

The plugin is built as a thin React client over a PHP workflow engine, and fires
actions and filters at every lifecycle point (sit_cwm_status_changed,
sit_cwm_can_transition, sit_cwm_transition_map,
sit_cwm_publish_gate_passes, sit_cwm_notification_recipients and more) so
it can be extended without editing its files.

Privacy

The plugin stores, in your own database: the user ID of whoever makes each
workflow change, the user ID of the assigned reviewer, the text of workflow
comments and the time of each action. It also stores the user ID of whoever
publishes or unpublishes managed content, or tries to publish it while the
publish gate blocks them. This information is visible to users who have the
sit_cwm_view_activity capability. None of it is sent off your site.

When email notifications are turned on, the plugin sends email to the
registered email addresses of your site’s users, through WordPress’s own
wp_mail(). Mail is delivered however your site already sends email.

Usage data (opt-in). The plugin uses the Freemius SDK. On first activation
an administrator is asked whether to share usage data with Freemius; nothing
is sent unless they opt in, and Skip leaves every feature working. Opting
in shares:

  • your WordPress user’s first and last name and email address;
  • the site’s homepage URL and title, WordPress and PHP versions and site
    language;
  • the plugin and SDK versions, and whether the plugin is active or uninstalled;
  • the names, slugs and versions of your installed plugins and themes, and
    whether each is active (this item can be switched off on the opt-in screen).

You can opt out at any time from the Opt Out link under the plugin on the
Plugins screen, or from Workflow → Account.

When you deactivate the plugin you may be offered a short, optional feedback
form. If you answer it, your answer is sent to Freemius, anonymously unless
you choose otherwise, even if you never opted in.

If you buy the Pro add-on and activate its licence, that connects the site to
Freemius and also registers this plugin there, even if you clicked Skip.
The usage data listed above is then shared, as if you had opted in.

Hints about Pro. The plugin’s links about Pro go to the author’s site and
send nothing from yours. When a manager dismisses one of the plugin’s hints
about Pro, the choice is stored in that user’s profile (user meta
sit_cwm_dismissed_hints) on your site and is never sent anywhere.

Freemius’s privacy policy: https://freemius.com/privacy/

Installation

  1. Upload the plugin to /wp-content/plugins/sapphireit-editorial-workflow/, or
    install it through Plugins → Add New → Upload Plugin.
  2. Activate it through the Plugins menu. Activation creates the activity
    table and grants the workflow capabilities to your existing roles.
  3. Go to Editorial Workflow → Settings and choose which post types the
    workflow applies to. Posts and pages are enabled by default.
  4. Open any post in the block editor and click the Editorial Workflow icon in
    the top-right toolbar. In the classic editor, use the Editorial Workflow
    box in the sidebar column instead.

Deactivating or deleting the plugin keeps your workflow data by default. To
remove everything when the plugin is deleted, tick Delete all workflow data
when the plugin is deleted
under Editorial Workflow → Settings first;
deleting the plugin then removes the activity table, the plugin’s post meta, its
options and its capabilities.

FAQ

Does reaching “Published” publish my post?

No, and that is deliberate. The workflow status and the WordPress post status
are separate fields. Marking a post as Published in the workflow records that
the editorial process is complete; a human still hits Publish.

Keeping them apart is what lets a scheduled post keep its schedule while it is
being approved, and lets an already-live article go back through a round of
edits without disappearing from your site.

With the publish gate on, it works the other way round too: content has to
reach Approved before WordPress will publish it.

Can it stop unapproved content from being published?

Yes, once you turn it on. Under Editorial Workflow → Settings → Publish
gate
, each content type has one of three modes:

  • Off: publishing works as it always has. Publishing and unpublishing are
    still recorded in the activity history.
  • Log only: anyone allowed to publish still can, but publishing content
    that has not been approved is recorded as a publish without approval.
  • Enforce: content cannot be published or scheduled until it has reached
    Approved in the workflow. The editor offers Submit for Review instead of
    Publish, and blocked attempts on existing content are recorded.

Administrators can still publish, and that is recorded.

The gate covers the block editor, the classic editor, Quick Edit, Bulk Edit,
the REST API, WP-CLI, scheduled posts, and other plugins that publish through
WordPress’s own publishing functions. A scheduled post is checked again when
its time comes, so content sent back for changes after it was scheduled does
not go live.

Code that writes post_status straight to the database is not covered. Imports
run from WP-CLI need --user=<an administrator> when the gate is set to
Enforce. Making content private is not gated.

Will turning on the gate unpublish anything?

No. Live content is never taken down: a published post that goes back through
review stays published while it is edited. Content already scheduled is
checked when its time comes; if it is not approved by then, it is put back to
draft and its author sees a notice explaining why.

Does it send email?

Only if you turn it on. Under Editorial Workflow → Settings → Email
notifications
you can switch on email for five events. All five are off until
you turn them on.

  • A reviewer is assigned: sent to the reviewer.
  • Content is submitted for review: sent to the assigned reviewer, or to nobody
    if no reviewer is assigned.
  • Changes are requested: sent to the author.
  • Content is approved: sent to the author.
  • A workflow comment is added: sent to the author and the reviewer.

Nobody is emailed about their own action, and nobody is emailed about content
they are not allowed to read. The text of a workflow comment is only included
for people allowed to read the workflow activity; everyone else is told that a
comment was added, with a link to the content. Each email is written in the
recipient’s own language.

Who can approve content?

By default, Administrators and Editors. Authors and Contributors cannot.

Approving is the WordPress capability sit_cwm_approve_content, so a
role-editor plugin (for example Members or User Role Editor) can give it to, or
take it from, any role. For finer rules (“only the assigned reviewer may
approve”, say), the sit_cwm_can_transition filter has the final word on every
decision. Choosing roles from this plugin’s own settings is not part of the free
plugin.

Can someone approve their own content?

Not when “Prevent people from approving their own content” is ticked under
Settings → Publish gate. Then nobody can move content they wrote to Approved,
administrators included, and the author is not offered as its reviewer.
Someone else with approval rights has to approve it. With the gate set to
Enforce, administrators can still publish unapproved content, and that is
recorded.

“Own” means the author set on the post. Someone who rewrote a post they are not
the author of can still approve it.

The setting is off until you turn it on.

Can I change the statuses or the order they go in?

The sit_cwm_statuses and sit_cwm_transition_map filters replace the status
registry and the transition graph. Both results are validated, so a mistake in
your code cannot leave the plugin in a broken state. There is no settings screen
for editing statuses or building multiple workflows in version 1.0.

Does it work with custom post types?

Yes. Any editorial content type (one with an admin UI, REST API support and the
editor feature) can be enabled in the settings. Back-office types such as shop
orders and coupons are not offered; developers can change the list with the
sit_cwm_available_post_types filter. The plugin uses post meta, so there is
nothing to migrate and nothing to convert.

Does it work with the classic editor?

Yes. In the classic editor the workflow controls appear in an Editorial
Workflow
box in the sidebar column. Changes there save immediately,
independently of the Update button.

What happens to my data if I deactivate it?

Deactivating changes nothing — your statuses, reviewers, due dates and history
stay. Deleting the plugin keeps them too, unless you have ticked Delete all
workflow data when the plugin is deleted
under Editorial Workflow →
Settings
. With that option on, deleting the plugin permanently removes the
activity table, workflow post meta, settings and capabilities.

Where are the workflow comments?

In the plugin’s own activity table, shown in the timeline in the sidebar (or
the classic editor box). They are editorial notes, so they never appear on the front end and are not mixed in
with your readers’ comments.

Is there an API?

Yes, at /wp-json/sit-cwm/v1/. Nine documented endpoints, all authenticated,
all with JSON schemas, and usable with application passwords.

Does the plugin detect whether content was written by AI?

No. AI use is declared, not detected. Whoever works on the content (a person
in the editor, or an agent through the REST API) declares it as
Human-written, AI-assisted or AI-generated. The plugin never inspects the
text. It records each declaration in the activity log with the user who made
it, and records the declared value again when the content is published. You
can also set a default per content type in Workflow → Settings.

Can an AI agent submit content for review?

Yes. Give the agent its own WordPress user with the Author role and an
application password. It creates a draft through the WordPress REST API,
declares its AI use, and moves the draft to Review through
/wp-json/sit-cwm/v1/posts/{id}/workflow. An Author cannot approve, and with
the publish gate set to Enforce it cannot publish either, so a person always
signs off. The step-by-step recipe, with curl, n8n and MCP examples, is in
docs/AGENTS.md in the source repository at
https://github.com/rshalihin/sapphireit-editorial-workflow.

Who can export the activity log?

Users who can both view the activity history and manage workflows
(sit_cwm_view_activity and sit_cwm_manage_workflows), which by default
means administrators only. The same users can open the governance report. The
export is a CSV of the whole log, with spreadsheet formulas neutralised.

Does the plugin contact any external service?

Only if you choose to. Your workflow data (statuses, reviewers, comments,
history) always stays in your WordPress database. The plugin loads nothing from
a CDN and sets no cookies of its own.

It includes the Freemius SDK. When an administrator first activates the
plugin, it asks whether to share some usage data with Freemius; you can click
Skip and the plugin works exactly the same. Nothing is sent unless an
administrator opts in, chooses to fill in the optional feedback form when
deactivating, or activates a licence for the paid Pro add-on. See Privacy
below for exactly what is shared.

Email notifications, when you turn them on, go out through WordPress’s own
wp_mail(), the same way your site sends password-reset emails.

Is there a Pro version?

Yes. SapphireIT Editorial Workflow Pro is a separate, paid add-on for teams
that coordinate many reviews: multi-stage approval, several workflows per
content type or category, reviewer groups, checklist and sign-off gating,
reminders and escalation, Slack and Microsoft Teams, per-user notification
preferences and digests, and compliance exports with a tamper-evident log.
This plugin is complete without it.

Managers see a plain Pro link in the plugin’s header and a few one-line
hints on the plugin’s own screens, each of which can be dismissed for good.
They open https://sapphireitlabs.com/editorial-workflow/ in a new tab, where
Pro is sold; nothing is bought inside WordPress. Nothing about Pro appears in
the editor, in site-wide notices or on your site’s front end, and none of it
shows once Pro is active. This plugin never downloads or installs Pro: after
buying, you get the Pro zip from the purchase email or your Freemius account
and upload it under Plugins → Add New → Upload Plugin.

Where is the source code for the JavaScript?

The editor sidebar, classic editor box and dashboard ship as compiled files in
assets/build/. The human-readable React source is in the src/ directory of
the public repository at
https://github.com/rshalihin/sapphireit-editorial-workflow. Run npm install
and then npm run build to rebuild the compiled files.

Screenshots

Changelog

1.2.0

  • New: declare how AI was used on each post (human-written, AI-assisted or
    AI-generated), from the editor, the classic editor or the REST API, with an
    optional default per content type. Declared by people, never detected.
  • New: optional review confirmation an approver ticks before approving,
    stored with the approval in the activity history.
  • New: optional review disclosure block and shortcode showing who approved
    the content, when, and the declared AI use.
  • New: governance report showing how much was published after approval,
    publishing the publish gate blocked or let through, declared AI use and
    overdue content.
  • New: export the full activity history as CSV.
  • New: approvals record a fingerprint of the approved content, and edits made
    after review started are written to the activity history.
  • New: summary tiles on the dashboard (in review, needs changes, overdue,
    approved), and dashboard filters kept in the URL so a view can be shared.
  • New: Getting Started page and a refreshed look on every plugin screen.
  • New: optional, admin-only usage-data opt-in (Freemius) on new installs.
    Sites that update are not asked.
  • New: the paid Pro add-on is available. It is bought on
    sapphireitlabs.com, never inside WordPress, and this plugin never installs
    it. Managers see a Pro link and a few dismissible hints on the plugin’s own
    screens only, never in the editor or on your site.
  • Change: the Editorial Workflow menu now sits right after Comments.
  • Developer: per-post workflows, veto reasons that reach the editor, a
    dashboard query filter, an add-on bootstrap hook, and a frozen public API.
    See ARCHITECTURE.md.

1.1.0

  • New: publish gate per content type (Off, Log only, Enforce). In Enforce mode,
    content has to be approved in the workflow before it can be published or
    scheduled, from the block editor, classic editor, Quick Edit, Bulk Edit, the
    REST API, WP-CLI or the scheduler.
  • New: administrators can still publish unapproved content in Enforce mode, and
    every such publish is recorded as a bypass.
  • New: every publication and unpublication is logged in the activity history,
    with who did it, when, and the workflow status at the time, even with the
    gate off.
  • New: optional email notifications when a reviewer is assigned, content is
    submitted for review, changes are requested, content is approved, or a
    workflow comment is added.
  • New: optional setting to stop people approving their own content.
  • New: Settings link on the Plugins screen.
  • Fix: clicks on the due date, reviewer, comment and workflow buttons are no
    longer lost while another workflow change is still saving.
  • Developer: new filters and actions for the publish gate, notifications and
    self-approval. See ARCHITECTURE.md.

1.0.0

  • Initial release.
  • Six-status editorial workflow with a validated transition graph and rollback
    paths.
  • Server-side transition and permission enforcement; the UI never decides.
  • Six dedicated capabilities with sensible default role grants.
  • Reviewer assignment, due dates and an overdue filter.
  • Workflow comments and a full activity history in a dedicated indexed table.
  • Optimistic concurrency: conflicting edits are rejected, not silently merged.
  • Gutenberg sidebar with an activity timeline.
  • Classic editor support: the same workflow controls in an Editorial Workflow
    meta box.
  • Admin dashboard with server-side filtering, sorting, pagination, row actions
    and bulk actions.
  • Settings screen for choosing workflow-enabled post types.
  • REST API under sit-cwm/v1, with actions and filters for extending the
    plugin.