I am a strong defender of “add as least as possible” to core, and “remove as much as possible” to keep core lean.
I am in the adventure of creating plugins to manage Custom Post Types, Custom Taxonomies and Custom Fields. Have two of those working but I don’t like to store the information in the database.
It would be a great feature to avoid storing that data into the database, and store it in JSON files instead.
Because I may be working on a site in my local environment, create some Fields, CPTs and Taxonomies via those plugins, and the only way to move those changes to production would be to repeat the process on production, or somehow export all that data from my local env to production.
ACF also stores Fields in JSON files, but creates its own JSON API for this.
I think it would be cool to allow plugin developers to store some specific data into JSON files, which can be commited to the repo or just copy/pasted, to gain all those ready to use Fields/Taxonomies/CPTs or whatever else that the plugin may offer. (Many plugins just use “options” for this).
And all of this with a centralized JSON DB API, instead of letting each plugin create its own JSON DB API.
I found this excellent simple yet complete solution: cybrox/crunchdb: A simple JSON based database system written in PHP. Useful for smaller applications. (github.com)
Three relatively short PHP files. It can be adjusted.
So CP Core would end up with two databases:
- The current one, for all the heavy content
- A simple JSON based one that can be commited to the repo, for site settings and simple stuff that needs to be moved from one installation to the other easily, by copy/pasting the files or via Git
If you like this idea let me know. In any other case, I will just add it to the plugins once I get time to work on them. Just posting this now so this can be discussed.
It doesn’t break anything and it provides value to ClassicPress. But of course, this may be seen as bloat from other respectable perspectives.