WP Origin: expose WordPress as a Git remote for Markdown content#238
Open
WP Origin: expose WordPress as a Git remote for Markdown content#238
Conversation
Adds the WP Origin plugin, which makes WordPress posts and pages available as a Git remote. Users and coding agents can clone, pull, and push Markdown files using standard Git tooling, with WordPress as the source of truth. The plugin exposes a Git Smart HTTP endpoint at /wp-json/git/v1/md.git, backed by HTTP Basic Auth with application passwords. Posts and pages are serialized as Markdown with YAML front matter. Pushes validate staleness before applying changes and move deleted files to trash rather than destroying content. This commit also renames the Markdown fenced-code block language from `block` to `gutenberg` (the old name is still accepted on import), and adds a real end-to-end test script that boots a WordPress Playground instance, clones the repo, edits and pushes a post, and verifies that a stale push is rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WordPress as a Git remote. Clone, pull, and push posts and pages as Markdown files using standard Git tooling — no new infrastructure, no external services.
The plugin exposes a Git Smart HTTP endpoint at
/wp-json/git/v1/md.git. Posts and pages are exported as Markdown with YAML front matter containingid,type,slug,status,title,date_gmt, andmodified_gmt. HTTP Basic Auth with WordPress application passwords handles authentication.On push the plugin checks staleness using
modified_gmtfrom the front matter: if WordPress content changed since the last pull, the push is rejected with a clear error. Deleted files move content to trash. All writes create WordPress revisions through normal post update behavior.This commit also renames the Markdown fenced-block language from
blocktogutenberg(the old name stays accepted on import), and ships an end-to-end smoke test script (bin/test-wp-origin-git-actions.sh) that boots a WordPress Playground instance, clones the repo, edits and pushes a post, verifies the WordPress content updated, then verifies that a stale push is rejected.Closes the work tracked in the PRD at
plugins/wp-origin/docs/prd.md.