Shortcode Tracking in WP Core: Support & Use Cases

In his ‘WordPress Core Proposal: Shortcode Tracking’ yesterday, Eric proposed what I think would be an incredibly useful feature for WordPress core.

Adding better visibility for shortcodes to core is useful beyond just being a developer feature. It will allow us to build simple, usable interfaces for site owners. This will enable them to maintain their sites better in the long-term without needing as much developer support for plugin maintenance or swaps.

It’s also a time-saver for clients and devs. Manually removing shortcodes is something I’ve done manually in the past, and it’s somewhat error-prone due to the use of regexes. A shortcode taxonomy would also allow some interesting combinations of shortcodes with post meta structures once those are enhanced.

I think the overhead of an additional taxonomy like this is negligible for typical/traditional blog sites and a positive shift for larger sites with dedicated admin servers and read/write split DBs.

Use-Case #1 – Fragment Caching

Writing to the DB may be heavier than pure reads, but since this would only happen on ‘save’ it’s a relatively rare event. In particular, by updating this taxonomy during saves the work shifts from every-time frontend requests to one-time backend events.

This is a positive shift for site users and improves our ability to move to fragment caches. For example, the shortcode taxonomy would offer an easily-cached flag for has_shortcode( $code ). Caches could then have additional caching rules specific to content containing shortcodes. Or, the results of shortcode parsing could be implemented in a worker/scheduled event and cached separately from the post content*. Then on post generation the cached shortcode results could be imported instead of parsing the code.

(*I’m aware this could be done with transients at present, but that’s implementation-specific and not easy to pass to a worker process. This taxonomy would abstract implementation from the theme files and make things easier to pass to workers.)

Use-Case #2 – UX for User-Updates to Shortcodes

As plugins are updated their shortcodes are often extended with new attributes or options for existing attributes. The shortcodes saved to content, however, must be manually updated in order to take advantage of the new content.

Even worse is being forced to delete shortcodes when a plugin is uninstalled or isn’t updated to support a new version of WP.

These manual updates to shortcodes in content are a tedious task, and might even bring a site down. While developers will generally be able to perform these updates quickly with a few queries and a regex or three, typical site-owners can’t do this on their own. They currently rely on plugins that perform long-running queries (sometimes on their live DBs) and run regexes that occasionally partially or over-cut.

Having a shortcode taxonomy would make it easy to have a general-purpose shortcode editing/search/replace plugin. Or, every plugin that offers shortcodes could provide their own update & management interfaces or automate upgrades with narrower regexes.

Use-Case #3 – UX for Editing & Reporting on Shortcodes

How do users know how much they rely on a plugin’s shortcodes? Would they pay for a premium version if they realized 75% of their posts used a single plugin?

With a shortcode taxonomy plugins could easily offer analytics and reporting on their own usage (without crashing the DB). This might help drive purchases of premium plugins, or just help site owners know what plugins to move to ‘mu-plugins’ so their sites won’t break.

Use-Case #4 – Improving Related Posts

Related post interfaces are some of the more common and valuable plugins for publishers. Not all of them index shortcode content though. And those that do don’t have great ways of detecting when it’s changed.

Adding a shortcode taxonomy would enable related post plugins to offer options (included/excluded) for the indexing of shortcode content. Performance of relationships could also be improved and full re-indexes reduced by using this taxonomy.

If Only GoDaddy Knows to Listen

The news about GoDaddy acquiring Media Temple is filling my social feeds today. Not surprising since it’s hard to be a developer or digital consultant and not have at least one client on Media Temple (and not have had at least one bad experience with GoDaddy). The sentiment generally isn’t good.

I’m hopeful though. Media Temple has always had skilled, professional support when I’ve worked with them. Even better, contacting their support is rare since they have few outages and no odd server config.

Here’s to hoping GoDaddy learns those things from the team at Media Temple instead of the other way around. It would be a huge positive for a lot of small businesses getting online if so.

Ever-simpler WordPress contact forms

Just a month ago I posted a long summary of WordPress contact form plugins and noted there might be better options within a few month … I think that list is already outdated.

Last weekend I found a great Javascript plugin from Squaresend that converts 'mailto:' links into contact forms — with no programming needed at all. And this weekend I put it together into a WordPress plugin. Introducing Contact Blaster, the easiest contact form plugin for WordPress that I know of.

…you will need a Squaresend account and the plugin requires Javascript. So, it's not a one-size-fits-all plugin. But for the right users I think this solves a long-standing problem without any developer-time at all.

Add help-text to WP’s Featured Image metabox

I’ve avoided using the built-in Featured Image metabox due to its simplicity. Because there’s no way to add help text or note image dimensions, I’ll often build a custom metabox or use an ACF uploader field instead.

It turns out customizing the built-in metabox isn’t that tough:

Thanks to Amanda Blum for pushing me to get comfortable with all-the-features, and a hook hint from an old Michael Fields post.

SaaS and Pricing for Techies

@aaronpk BYO tech options are wish list items, but generally earn SaaS platforms big points from me:

I don’t currently have a big team to warrant it, but the option to extend !done reports with something I use already (like my own SES account) appeals to me. And, while few SaaS providers offer those type of options, I think doing so would help convince skilled techies to buy. It would also help SaaS providers to offer less-expensive plans without losing $, by offloading some of the tech & infrastructure to subscribers who have existing tools and/or the skills to set them up.

The theory being that many SaaS tools answer tech problems, but those are the same users most-likely to setup or outright build an OSS clone. SaaS tools with enough revenue to hire support staff and build redundancy are probably better than self-hosting, but their plan pricing is generally based on taking on all the tech (& risk).

I’d prefer if a hosted PM-system would stop highly technical users more to upgrade project count, storage, and emails/month. And instead charge a base fee for the core function but allow me to connect it to SES, S3, Dropbox, Google Apps, etc. That way I could still use the tools that I would have used for my OSS system, but have a paid, polished & supported product. …and users who don’t have the skills, time or existing investment in those tools would still subscribe to higher-cost plans that bundle the features.

WordPress Contact Form Plugins — Late 2013

UPDATE: I released an even-simpler contact form plugin in October, 2013: It uses a 3rd-party mailer-service (Sendsquare) to convert mailto: links into editable forms.

One question that comes up regularly in talking to WordPress builders is what plugin to use for contact forms. While there are dozens of ways to build contact forms: self-coding, Plugins, 3rd-party services … The comment form question is hard because form plugins are hard to build.

It’s not the frontend form part that’s difficult either. Most comment form plugins have several times more code devoted to anti-spam and XSRF-filtering than to the form-processing part of things. Spammers and site crackers change tactics constantly, so the best contact form plugin that-also-blocks-spam-and-site-hacks changes constantly too.

…as of late-2013 here are my preferences for WordPress contact / form-builder plugins. If you’re reading this in 2014 or later, it’s time to evaluate other options again:

  • mailto: — As Aaron mentioned on a friend’s Facebook page: “Just do <a href=””> and call it good. It’s cross-browser, fully standards compliant, and is not vulnerable to sql injections!”
    br />(As @ceeweb pointed out, there is no anti-spam here. Only what your mail client offers … but I don’t think that’s all that bad. Since it gets to filter on real sender email/IP’s instead of just your server’s info this is often better anti-spam than what’s in plugins. Though as Cee also pionted out, then the spammers also have your email address.)
  • Gravity Forms — This is the best form-builder plugin available at the moment, and since it’s commercial and well-supported it’ should keep up with spammers and site-hackers very well. The downside is the cost, since many WordPress projects don’t budget for buying 3rd-party tools/support. I still think it’s worth using even as a PHP-heavy developer, the speed & flexibilty of this plugin should save you time & prevent client headaches.
  • Wufoo’s Shortcode plugin — It’s simple and inserts a form that’s run from Wufoo’s servers. Wufoo it top-notch in UX and anti-spam/security. Their downside vs. Gravity Forms is they can be slower to customize and the shortcode placement isn’t as intuitive as other plugins here.
  • Slim Jetpack — The stripped-down version of Jetpack without the .com connections and no auto-activation. The form-builder tool is incredibly simple and it has Akismet-level spam prevention (ie: not 100%). This is a great, free option right now.

    Cee pointed out that Jetpack and child plugins like this leave the destination email in the the HTML in plaintext, again, allowing harvesting.
  • Fast Secure Contact Form — Another free option, this one excels at anti-spam. It has a good (not quite great) form-builder and easily-styled CSS tags, but the anti-spam options are excellent and nearly bulletproof. The downside to this being a free plugin is the ads (not smappy ones though) for mailing services on the admin page and the occasional unreadable captcha.

WordPress Developers: Are you delivering a Platform or Services?

Great post Jake, WordPress as an App Platform? It deserves an big response, but rather than parroting much of your thinking I’ll just point out that John Eckman’s team at ISITE is having massive successes *not* selling a specific platform. In my own strategist & architecture work I’ve seen very much the same thing; selling WordPress invites a very specific set of questions from IT, business or marketing buyers.

Spurring questions and concerns isn’t a phenomena exclusive to WordPress. Selling “X” will always open the need to address customer knowledge or biases. This tends to be harder to overcome for many WordPress teams because the project iterates more often than something like CQ5 or Spring, and our teams tend to be much smaller (…have you ever seen a Saleforce or even Acquia sales team working to get corporate IT approval? They both have more staffers in the account & *sales* engineering team than 10up has staff).

Given those team-sizes and the sales investment from those enterprise-focused platforms, WordPress still wins frequently. For me that’s indicative of the answer to yours & the community’s concerns — if WordPress is being used for so many projects it means *a lot* is already being done right. And, it means that in the future our ecosystem of plugins, APIs, framework-like tools and *developer skills* will be even richer.

So, while WordPress still might never solve all the problems realted to a specific businesses’ content/framework/functionality/digital-xyz needs, the people building with it have ever-better tools and are getting phenomenally good at solving business problems. Isn’t that what WordPress-focused companies like 10up are selling too — smart engineering & efficient problem-solving? In the long run smart, focused service-providers who pick good tools will be far more effective for clients than a big sales team.

Always Searching —