I have grand SPLOT plans for the holidays.

Huh?

I hope to spend some time cleaning up a number of relatively minor issues with existing SPLOTs, maybe add a new one or two (I did say grand), update the Instant SPLOT recipes (and test them out more to troubleshoot some reported issues). It’s not too late to phone in some requests.

But there’s been two problem areas I’ve wanted to get to, certainly not deal breakers that have to do with recommended plugins which are causing some problems.

One is The Customizer Social Iconz plugin used on the WP-Dimension and WP-Big Picture calling card themes. Any site using that plugin will continue to work, but a bug in the plugin is causing the WordPress Customizer to not load. The developer is not responding to my bug report but I have an idea for a different plugin. That issue will go on the lift later.

A simpler one to fix (and has been done) is the one I use in the TRU Writer SPLOT to add estimated reading times to archives and single published items.

Estimated reading time as it appears in the home and archives

Reading Time also appears above the title in a single post

And the reading time is also in the meta data in the footer of a single post

The plugin I recommended and built a connection in the theme was the Estimated Reading Time plugin which is no longer available for installation.

For a while I kept the last working version I had as a download link, but that’s a bit short sighted. So I spent a few clicks of time integrating the newer and available Reading Time WP plugin.

Functionally they are not all that different; they generate a string of the estimate based on a setting of words per minute an can be called as I do, from my templates via a shortcode. My code will just skip this feature if the right plugin is not installed.

If you have a site with the older plugin running with the latest version of TRU writer, the reading times will not appear, and in the options, it will notify you (as it will in a new site where the plugin is not available).

The TRU Options will let you know that it is missing the newer Reading Time Plugin.

I thought my code was pretty clever, it searches for the shortcode this plugin should enable:

Once you install the The Reading Time WP plugin there is one setting to change, under Settings -> Reading Time WP.

All you need to do is uncheck the options at the bottom:

This prevents the plugin from inserting it into the content of post (the TRU Writer theme takes care of putting the output in the right place).

The only other setting you might change is if you want to change the calculation from 300 words per minute (the first three settings are ignored on this theme).

I realized I had set this up well, because the way the plugin is referenced in the template (in three places) is via a helper function, so I did not have to edit them at all. For example, the two places it is used in the single post template is for the header:

and in the info at the bottom:

The first parameter is what comes before the reading time number; the second parameter is what comes after.

So to change the plugin, I just needed to rewrite the helper function, from calling the shortcode for the previously used plugin:

and now using the shortcode for the newer plugin:

I was rather impressed with my approach here, it made implementing a new shortcode pretty easy.

To most people this is obscure noodling but this is the under the hood stuff I love doing (well, when it works). The next plugin swap will take a bit more work, but it’s on the list.

FYI these are new SPLOTs I am considering, mostly extensions or riffs of existing ones:

  • Expanding the function of the Sound Collector to also include video (via embeds of YouTube, vimeo links). This might get a new name, like Jukeboxer (or please if you have a better idea, let me know)
  • The HTML5 UP Highlights theme would make for another nice calling card.

It’s gonna be SPLOTTY around my house.


Featured Image: Pixabay Image by geraldoswald62 shared into the public domain using Creative Commons CC0

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *