SPLOTs just won’t go away [from this blog]. I recently celebrated some success in building a new part of the machine, then realizing it’s use case might be narrow.
So while no one needs say a third arm, the process of designing it often has unexpected payoffs later.
It Came About Because I Messed Up My Development Space
This all happened because of my ineptness at managing command line jujitsu somehow I had pretty badly mangled my laptop set up of Varying Vagrant Vagrants the weirdly named system that lets my run WordPress as a local system on my laptop.
The fix ended up being just starting a new directory with a fresh install, but I faced some issue in moving over a fleet of test sites. I’d known this for a while, and thought about maybe once while walking the dog, but I had no means of saving and restoring all of the SPLOT options in one site. The only recourse was old school manually checking a source site and making the same settings in another.
In general the copying of one WordPress site from one place to another is never trivial. Oh there are plugins that offer a copy capability, but there’s always a catch or an upsell that ever makes it clean.
If you are working with a Reclaim Hosting WordPress then you are in luck, as their Installatron tool offers a means to clone one site from say a domain of your own to maybe another subdomains of your own. It deftly does it well, but that’s only if you are within sites you own (I did find out there is an advanced metod if you have FTP access to a source site).
So making a copy of a WordPress site is more than just exporting the content:
- You have to install the same theme and plugins
- The media can be transferred only if the source site is publically still available
- You resort to extra plugins to say import/export Customizer settings and Widget settings.
Someone will reply with some plugin that does it all in one swoop (yes for a while I had success with All in One or Duplicator) and render my arguments useless.
But this is all to day that the SPLOT Theme settings in my stuff are not part of any WordPress export I know of.
I was fairly sure there was someway to save these settings as a JSON file that could then be imported to another site.
All of this to say I got it working and it’s available now in the current version of TRU Writer.
Coding it Up
I looked at a number of posts and Stack Exchange responses, but the one that got me there was Building a settings import and export feature from Pippins Plugins. I’ll save the usual long code blathering, to show that the layout of the SPLOT Options for TRU Writer has a new look and function.

Previously there was a tab for documentation, and I would go through a tedious process to convert the markdown from Github to HTML so to offer a version of the documents right there.
But it seems easier just to link to the documentation, which one day might make use of Paul Hibbitts’s amazingly elegant docsify publishing kit. So now there is a tav for the import/export options for the site’s SPLOT settings.

Nothing terribly impressive visually, but the Export button initiates creation of and download of a JSON file with all the settings, which in all their glory look like:
{"accesscode":"","accesshint":"Name of this site (lower the case, Ace!)","write_page":"5","pub_status":"pending","allow_comments":"1","def_text":"<h2>Introduction<\/h2>\r\nThis is what I have to say, which of course is something important. As you can see we can use headings and other <strong>formatting<\/strong> in our work.","min_words":"10","use_header_image":"2","defheaderimg":"http:\/\/splot.test\/wp-content\/uploads\/2021\/06\/types-738846_1280-1-1.jpg","upload_max":157,"use_header_image_caption":"0","show_cats":"0","def_cat":"4","show_tags":"0","show_email":"0","email_domains":"","comment_notification":"0","require_extra_info":"-1","show_footer":"0","show_tweet_button":"1","hashtags":"#cogdog","notify":"","use_cc":"user","cc_site":"by","splotname":"truwriter"}
Thrilling, ain’t it data? The trickier part was the import … well maybe not. It is just something that parses the json, and changes the values of the settings as displayed. Then it’s on the user to accept and change them.
After the excitement of getting most of it working, I found the shortcomings. One was that things like categories and images are saved as just a database ID. So an mage with an ID of 12 means nothing on another site.
I did figure out a way on the settings save to change that value from an ID to a URL for the image. Then, on the importing end, it downloads a copy of the image, adds to the media library, and now it has a database ID (I ended up learning how to use media_sideload_image()
!)
Shrug
I do not know if anyone really will have a need for this appendix-like appendage, but the real gain was some code banging to figure out saving and importing og settings as JSON data.
I almost feel like I know what I am talking about.
This will find its way to other SPLOT themes in time, so look soon for a feature you may never use.
But I did get my victory dance in when it actually worked.
Featured Image: Lufkin 7R flickr photo by cogdogblog shared under a Creative Commons (BY) license modified by me to feature the SPLOT EXPORT text.

Someday, some where, Alan Levine will have made a librarian or grad student very happy.
I will no doubt use this in the future and just missed having it be very useful by a few months.