Description
PraisonAI Git Posts is a revolutionary WordPress plugin that enables file-based content management with Git version control integration. Store your posts, pages, and custom post types as Markdown files while maintaining full WordPress compatibility.
Key Features
- File-Based Content Management – Store all content as Markdown files
- No Database Writes – Pure read-only approach for content
- Git Version Control – Track changes with full Git integration
- Dynamic Post Type Discovery – Automatically registers post types from directory structure
- Custom URL Routing – Beautiful URLs for any post type (e.g.,
/recipes/song-name) - YAML Front Matter – Rich metadata support
- Caching System – Built-in performance optimization
- Auto-Update Detection – Content updates automatically when files change
- WordPress Compatible – Works with themes, plugins, and filters
- Developer Friendly – Clean, extensible architecture
Perfect For
- Developers who prefer Git workflows
- Teams collaborating on content
- Sites requiring version control
- Static site generators transitioning to WordPress
- Content stored in version control repositories
How It Works
- Create a
content/directory at your WordPress root - Add Markdown files with YAML front matter
- Plugin automatically discovers and loads content
- Create new post types by simply adding directories
Example Post
`markdown
title: “My Post Title”
slug: “my-post-slug”
author: “admin”
date: “2024-10-31 12:00:00”
status: “publish”
categories:
– “General”
tags:
– “example”
Your content here
Write your content in Markdown format.
`
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Git (optional, for version control features)
External Services
This plugin connects to external services for certain features:
GitHub API
What it is: GitHub’s REST API (https://api.github.com) is used for version control and collaboration features.
When it’s used: The plugin connects to GitHub API when you:
– Enable GitHub OAuth authentication
– Create or manage pull requests
– Sync content with a GitHub repository
– View pull request details and changes
What data is sent:
– Repository information (owner, name)
– Authentication tokens (OAuth)
– Commit messages and file changes
– Pull request data
User consent: GitHub features are optional and only activated when you configure GitHub integration in the plugin settings. No data is sent to GitHub unless you explicitly enable and configure GitHub features.
Service information:
– Service provider: GitHub, Inc.
– Terms of service: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service
– Privacy policy: https://docs.github.com/en/site-policy/privacy-policies/github-privacy-statement
Development
- GitHub Repository: https://github.com/MervinPraison/PraisonAI-Git-Posts
- Report Issues: https://github.com/MervinPraison/PraisonAI-Git-Posts/issues
- Author Website: https://mer.vin
Credits
Developed by MervinPraison
Installation
Automatic Installation
- Go to Plugins > Add New
- Search for “PraisonAI Git Posts”
- Click “Install Now”
- Activate the plugin
Manual Installation
- Download the plugin ZIP file
- Go to Plugins > Add New > Upload Plugin
- Choose the downloaded ZIP file
- Click “Install Now”
- Activate the plugin
After Installation
- Create a
content/directory at your WordPress root level - Create subdirectories for post types (e.g.,
content/posts/,content/pages/) - Add Markdown files with YAML front matter
- View your content on the frontend
Configuration
The plugin works out of the box with default settings. To customize the content directory location, add to wp-config.php:
define('PRAISON_CONTENT_DIR', '/custom/path/to/content');
Or use a filter:
add_filter('praison_content_dir', function($dir) {
return '/custom/path/to/content';
});
FAQ
-
Does this replace the WordPress database?
-
No. The WordPress database is still required for WordPress core functionality, user management, settings, etc. This plugin only replaces content storage (posts, pages) with file-based content.
-
Can I use this with my existing WordPress site?
-
Yes! The plugin works alongside existing database-based content. You can mix file-based and database-based content.
-
What file formats are supported?
-
Currently, Markdown (.md) files with YAML front matter are supported.
-
How do I create a custom post type?
-
Simply create a new directory in your content folder. For example, creating
content/recipes/automatically registers a “recipes” post type. -
Does it work with WordPress themes?
-
Yes! File-based posts work exactly like regular WordPress posts with all template tags and filters.
-
Can I use WordPress plugins with this?
-
Yes! The content is loaded as proper WP_Post objects, so plugins that modify content (like SEO plugins) work normally.
-
How does caching work?
-
The plugin uses WordPress transients for caching. Cache automatically invalidates when files are modified.
-
How do I clear the cache?
-
Go to PraisonAI Git Posts Clear Cache in the WordPress admin, or use the top admin bar menu.
-
Is Git required?
-
No, Git is optional. The plugin works without Git, but version control features require Git to be installed.
-
How do I track version history?
-
The plugin includes Git integration. If Git is installed, file changes are automatically tracked. View history in PraisonAI Git Posts Version History.
-
Can I rollback to previous versions?
-
Yes, if Git is available, you can rollback any file to a previous version from the Version History page.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“PraisonAI Git Posts” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “PraisonAI Git Posts” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.7.0
- NEW: Getting Started guide on Settings page with content directory path, sample format, and directory structure
- NEW: Sample “Hello from PraisonPress!” post created on activation so users see it working immediately
- NEW: Synchronous index rebuild on settings save (no WP-Cron dependency)
- NEW: Cache TTL as human-friendly dropdown (5 min to 24 hours)
- NEW: Post type checkboxes show file counts, directory names, and sync status
- NEW: Index status table shows entry counts and sync indicators
- IMPROVED: Generic defaults (post, page) instead of project-specific types
- IMPROVED: Better empty state messaging and onboarding
1.6.1
- CRITICAL FIX: Archive safeguard – refuses to scan >500 files without _index.json, preventing OOM
- Added WordPress Settings page admin notice for index rebuild feedback
- Removed disconnected content_dir settings field
- Fixed duplicate docblock on loadSinglePost
1.6.0
- NEW: WordPress Settings page for user-friendly configuration
- NEW: Index Status table with “Rebuild Index Now” button
- All settings stored in wp_options – no ini files or CLI needed
- Auto-generates _index.json on plugin activation
1.5.0
- PERFORMANCE: Lazy constructor – zero filesystem I/O at plugin load
- PERFORMANCE: loadFromIndex() creates WP_Post from index metadata only
- PERFORMANCE: loadSinglePost() direct slug lookup – 1 file read (was: full scan)
- NEW: content.enabled safety check – plugin does nothing unless enabled
- NEW: Cache stampede protection with wp_cache_add lock
1.0.9
- HOTFIX: FrontMatterParser – Added inline YAML array support ([a, b, c]), boolean coercion (true/false PHP bool), numeric coercion, and null coercion
- HOTFIX: MarkdownParser – Removed str_replace(‘\n’,’
‘) that was injecting
tags inside block-level HTML elements (h1, ul, li, pre), causing invalid HTML - HOTFIX: PostLoader – Fixed guid from query-string format to proper permalink format
- HOTFIX: PostLoader::loadFromIndex() – Fixed field name inconsistency (custom vs custom_fields)
- HOTFIX: SmartCacheInvalidator – Fixed transient key pattern to match keys actually generated by CacheManager
1.0.8
- HOTFIX: Draft posts now correctly excluded by default from archives, feeds, and taxonomy pages (default to publish-only)
- HOTFIX: Category and tag archives now filter file-based posts by declared front-matter categories/tags — prevents all posts appearing on every taxonomy archive
- HOTFIX: Cache keys now include category_name and tag query vars to prevent taxonomy archive cache collisions
1.8.1
- CRITICAL FIX: loadSinglePost() — direct .md file lookup first, eliminates 49.5 MB peak memory spike per cache-miss request
- CRITICAL FIX: registerPostsMeta() — reads meta from post object properties instead of re-loading full _index.json (eliminates double-registration, saves 34 MB)
- FIX: Date-prefixed filename support in direct lookup (e.g. 2024-01-15-my-song.md via glob fallback)
- FIX: PRAISON_VERSION constant now matches plugin header version (was stuck at 1.7.0)
- PERF: Single-page cache-miss peak memory reduced from 187.5 MB to ~138 MB
- PERF: Archive page requests no longer load _index.json twice
1.8.0
- NEW: Bidirectional Git sync — dashboard edits auto-export to Git, Git pushes auto-import to WordPress
- NEW: Incremental index updates (O(1) per post, ~10ms) — no more full-rescan rebuilds
- NEW: IndexManager class with atomic file operations and flock() concurrency safety
- NEW: Deletion handling — trashing/deleting posts auto-removes .md files and updates _index.json
- NEW: Virtual post meta via get_post_meta() — headless posts serve custom fields from frontmatter
- NEW: registerPostsMeta() reads _index.json by slug for cache-safe meta registration
- FIX: WordPress absint() compatibility — negative virtual IDs stored under both negative and positive keys
- FIX: CacheManager serialization — meta registration survives Redis cache round-trips
- FIX: AutoExporter uses git add -A to stage deletions, not just additions
- FIX: SyncManager detects Added/Modified/Deleted/Renamed files via git diff –name-status after pull
1.0.9
- HOTFIX: CacheManager::getContentKey() – Replaced O(n) glob()+filemtime() with O(1) filemtime($dir) — critical for 100k+ file deployments
- HOTFIX: PostLoader – Added _index.json fast path for single-slug queries (O(1) lookup vs full directory scan)
- HOTFIX: Bootstrap::injectFilePosts() – Added is_dir() early bail to skip post types with no content directory
- HOTFIX: Bootstrap::injectFilePosts() – Fixed is_dir() alias resolution (praison_post maps to posts/ directory)
- Added WP-CLI command: wp praison index [–type=] [–verbose] to generate _index.json manifest
1.0.6
- Added .distignore file for WP-CLI wp dist-archive command
- Updated create-zip.sh to exclude all .ini and .ini.example files
- Ensures no configuration example files are included in WordPress.org distribution
1.0.5
- SECURITY FIX: Properly blocked direct file access in scripts/export-to-markdown.php and create-my-submissions-page.php
- These files were attempting to load WordPress before checking ABSPATH, which defeated the security check
- All PHP files now immediately exit if accessed directly, as required by WordPress.org guidelines
1.0.4
- Fixed WordPress coding standards – prefixed all global variables with plugin prefix
- Resolved NonPrefixedVariableFound issue in export-to-markdown.php
1.0.3
- Fixed all WordPress.org plugin review issues
- Removed not permitted .ini.example files
- Moved all inline CSS/JS to properly enqueued external files
- Added comprehensive external service documentation for GitHub API
- Fixed file/directory location references to use WordPress-approved methods
- Added ABSPATH security checks to all PHP files
- Ready for WordPress.org approval
1.0.2
- Changed plugin name from “PraisonPressGit” to “PraisonAI Git Posts” to comply with WordPress trademark guidelines
- Updated text domain from ‘praisonpressgit’ to ‘praison-file-content-git’
- Updated all internal references and cache keys
- No functional changes – maintains full backward compatibility
1.0.1
- Fixed all WordPress coding standards compliance issues
- Added proper output escaping throughout the plugin
- Implemented nonce verification for all GET parameters
- Fixed text domain consistency (changed to ‘praisonpressgit’)
- Added proper global variable prefixes
- Replaced deprecated functions (strip_tags wp_strip_all_tags, mkdir wp_mkdir_p)
- Improved database query security with proper prepared statements
- Added phpcs ignore comments for unavoidable false positives
- Plugin now passes WordPress.org plugin check with 0 warnings
- Ready for WordPress.org directory submission
1.0.0
- Initial release
- File-based content management with Markdown support
- Git version control integration
- GitHub OAuth and pull request management
- Custom post type support
- Built-in caching system