Quick Tip: WP Cron on HTTP Basic Protected Site

Today I ran into a situation where I needed the default WP Cron processing to work while a site was protected behind HTTP Basic authentication. If you’re not familiar with the way WP Cron works by default, it spawns an HTTP request to example.com/wp-cron.php on page load (given a certain set of conditions) and allows that request to sit and process whatever jobs have been registered.

When HTTP Basic authentication is active on the site root, though, the request never gets through to wp-cron.php because it gets intercepted by the web server and blocked (because the request isn’t authenticated). To get around that, add the following code into your wp-config.php file:

if(!defined('WP_CRON_CUSTOM_HTTP_BASIC_USERNAME')) {
    define('WP_CRON_CUSTOM_HTTP_BASIC_USERNAME', 'YOUR_USERNAME_HERE');
}

if(!defined('WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD')) {
    define('WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD', 'YOUR_PASSWORD_HERE');
}

Then, download this gist and put it inside of the mu-plugins directory.

That’s it!

Better Links & Better Links Pro

I haven’t been writing as much lately because I’ve been hard at work building new products for the customers over at BoostWP. In the last two months we’ve released two awesome new products and I wanted to take the opportunity to talk a little bit about one of them today, including benefits it brings our customers, the ways in which it compares to a similar product, and the technical challenges I faced during implementation.

Better Links – a feature complete, free plugin for everyone

There are a variety of link shortening plugins on the market, with the 800 pound gorilla in the room being Pretty Link and its paid add-on, Pretty Link Pro. It was obvious there was demand for a high-quality product in the space and I saw some pretty immediate deficiencies in Pretty Link, so Better Links was born.

Better Links – what is it and why is it valuable?

Better Links, which you can download for free from the WordPress plugin repository, has all the standard features you’d expect from a link shortening plugin. The most important, of course, is the ability to define a redirect to a specified URL from a specific suffix on your WordPress installation’s site URL.

What does this mean? Well, essentially you can tell Better Links that any time someone visits mysite.com/best-black-library-book/ they should be redirected to www.amazon.com/Eisenhorn-Warhammer-40-000-Omnibus/dp/1844161560/ref=sr_1_1?ie=UTF8&qid=1404223645&sr=8-1&keywords=eisenhorn immediately and it just works. Here’s how that looks in the plugin:

Better Links Core - Edit Link

It looks so easy, right? I guess the next question is, why in the world would you want to do this? There are a couple of important use cases for Better Links (or other link shorteners).

First, you can change the destination URL for this particular link at any point in the future, even after you’ve used it in post or page (or other, I suppose) content. If I change my mind in the future about what the best Black Library book is (perhaps to something like the Salamanders Omnibus), then I can update the destination once and all my links automatically point to the right place.

Second, you can make your URLs cleaner for your site’s visitors. Some URLs (like the Amazon one I showed above) are fairly messy, containing a lot of extraneous information and query arguments. This can scare some visitors to your site away from clicking on links; this is especially true for affiliate or other links where a myriad of tracking information is added to an otherwise clean URL. By showing the user that they’ll be visiting mysite.com/pretty-slug/ instead of something with 15 query variables, they’ll be more likely to click on it.

Third, you can easily specify a link once and then use it in your site’s content without having to remember some long, complicated URL each time. Better Links makes it easy to insert links as long as you have some idea what you’re looking for. How? Well, let me show you:

That’s it! You can also search for your links by name or slug once you have more than can be shown on one page. You can insert your links using a shortcode (which guarantees appropriate linking and tracking) or you can insert “raw” where a simple a tag is inserted into the appropriate place in your content.

With the free Better Links plugin you also get some rudimentary click tracking and the ability to import your links from Pretty Link if you decide to switch over (which I wholeheartedly recommend).

Better Links – how is it better than Pretty Link?

There’s a couple of big ways that Better Links differentiates itself from Pretty Link. First, it does things the WordPress way. In Better Links, we don’t create separate database tables to hold data about your links, link categories, and clicks like Pretty Link does. We use the standard data storage structure of WordPress thoughtfully to save information the way WordPress is designed to do.

Second, (and this may be a bit of hubris, but forgive me for a moment) the interface for Better Links in all areas of operation is superior to that of Pretty Link. Compare the two side by side and think about which one you’d like to use:

Comparison of Link Adding Interfaces

Finally, Pretty Link doesn’t even offer you the ability to insert your links into your post or page content with any ease unless you upgrade to Pretty Link Pro. Better Links gives you the easy insert and editing features in the base version. I understand the reasoning behind that decision, but if I’m going to release something as FOSS, I’m not going to pull core features just to prompt someone to pay me money.

Better Links Pro – more features for the advanced user

If you’re an entrepreneur and serious about using a link shortener as a tool for your business, then you’ll probably want to take a look at Better Links Pro. Better Links Pro is an add on to the Better Links plugin that adds some features that can be useful for those looking to take their link strategies to the next level. Here’s what the insert link screen looks if you have Better Links Pro activated:

better-links-add-pro

As you can probably tell, there’s a bit more there than with the base Better Links plugin – these new features are specifically targeted at use cases that our customers have identified as important to them.

Destination types

First, you’ll see there are three different ways to redirect URLs with Better Links Pro:

  1. Single destination – the same as Better Links
  2. Multiple destinations – redirects for this link (for different visitors) are split evenly between multiple URLs
  3. Geographic destinations – redirects for this link are split based on the visitor’s country (or sent to a default location if one isn’t specified for a particular country)

We already talked about the first option, but why might you want to use one of the others?

Multiple destinations

Let’s say you have multiple variations of a landing or sales page at myshop.com/landing-1, myshop.com/landing-2, and myshop.com/landing-3. You want to drive traffic to each of them and evaluate the conversions (lead capture, sale, etc) that are realized for each variation. Obviously, you need to try to drive roughly equal traffic to each page so that you can fairly compare the results.

That’s where the multiple destinations destination type comes in. In this example, you’d specify your link as mysite.com/sales-page and Better Links Pro would automatically rotate new visitors through each of the variations. One important thing to note: if a user has already clicked the link and been redirected to a particular URL, they will always be redirected to that URL so a single individual doesn’t see more than one variation on accident.

Given this functionality, you’d be able to drive traffic through a single gate (mysite.com/sales-page) and then evaluate the results for each variation appropriately without any extra work on your end. Pretty great, right?

Geographic destinations

This is where things get really interesting! As you can see in the above screenshot, you can specify where a user should go based on their detected country. There are multiple reasons why this could be valuable. Off the top of my head, here’s two important ones:

  1. Several affiliate marketing companies allow you to specify different URLs for different countries so you can get appropriate commissions (but won’t pay commissions if the visitor goes to the wrong country affiliated site)
  2. You need to block or otherwise restrict citizens of particular countries from directly accessing content you provide (this may be because of terrorism, morality, or other statutes in those countries)

Country based redirection has long been one of the best features of EasyAzon Pro, so I was excited to use some of the same implementation techniques here.

Keyword replacement

This feature has been hugely important to many of our customers since we released Better Links Pro. Why? Because it lets our customers automatically derive new revenue from existing content on their websites. They put in a trivial amount of new work and can benefit from everything they’ve done in the past. How does that work?

Say you write a lot about hosting and you often mention various hosting companies by name in your posts: HostGator, BlueHost, WP Engine, SiteGround, etc. With Better Links Pro, each of those names can automatically be assigned a Better Link without you having to manually add links around the hosting companies’ names. That’s pretty great, right?

Better Links Pro is even smart enough to exclude links from headers if you want it to! That means you won’t have a big honking blue link right in the middle of h2 or h3 in your post content.

This is just another example of my philosophy of plugin development. Make things easier for end users by making technology do the hard work.

Advanced tracking – leveraging Google Analytics for fun and profit

The final piece of the puzzle is really where you can make a lot of money and leverage your insights to better serve your site’s visitors. Better Links Pro includes integration with Google Analytics that tracks a variety of things:

  • When is a Better Link shown on the frontend of the site?
  • Where is that Better Link located (single page / post content)?
  • How often is that Better Link clicked in that location?

Using this data, you can see which links are performing the best and where, leading to potential optimizations in terms of making link text more attractive, reusing well-performing link contexts, and more. Better Links Pro gives you the ability to dig deep and really dial in your link performance with very little extra effort on your part.

Oh, and did I mention that all this data is displayed right on your Better Link and Post edit screens? That’s right! You don’t have to head over to Google Analytics and decipher event tracking streams to get the information you want because it is all there for you to use, right in your WordPress backend.

Go buy Better Links Pro

I honestly believe that Better Links Pro is worth every penny (although I may be a tad bit biased) so I recommend you go buy it now, either as a one-time purchase or, to your benefit, as a part of a BoostWP subscription.

Better Links and Better Links Pro – some implementation challenges

On to the geeky stuff!

Building Better Links and Better Links Pro wasn’t as simple and straightforward as I had first imagined as there were a lot of edge cases that I had to capture and work around.

First, and most importantly, I had to make sure people weren’t creating and activating links that were going to conflict with existing links on their site. This meant detecting the slug that a user specified, comparing it against the existing active link slugs in the database, and saving / displaying an error to the user while disallowing activation of that link. Here’s what a user sees if they try to save a link that conflicts with another:

link-conflict-in-post

link-conflict-dashboard

A similar error message is displayed if the user tries to specify an invalid destination URL (or empty destination URL) when saving a link.

Second, working with keyword replacement is tricky when you’re modifying a potentially invalid DOM and dealing with markup that is wholly unknown. I used the native PHP DOM handling functionality with a minor facade added on top to properly insert link nodes without invalidating the remainder of the structure. Doing some clever XPath detection, I was able to detect when keyword text was inside of a header tag and restrict placement there if appropriate.

Finally, working with the Google Analytics API was not the enjoyable experience I thought it would be. API responses come back as a set of dimensions and metrics “table rows” which then have to be transformed into something that is actually useful. It definitely wasn’t the hardest API integration I’ve ever done, but it was certainly an interesting one.

The future of Better Links and Better Links Pro

Right now I have some bug fixes and feature upgrades prepared and being tested for both the core Better Links plugin (again, free on the WordPress.org plugin repository) and Better Links Pro. I’m excited about taking the next steps with the plugin and continuing to improve it for users. If you’ve used either the base or pro version, I’d love to hear from you in the comments!

Future Insights Live 2014 Recap

I attended Future Insights Live last week and had a great time. The workshop I attended was educational and full of awesome tips, the sessions were uniformly good, and the people (as usual) were awesome.

Workshop

On Monday, I attended the Ember.js workshop taught by Jesse Cravens. It was truly a delight and I felt like I learned a lot in the workshop setting that I wouldn’t have learned otherwise. There were a few things that I particularly enjoyed about this day long session.

First, Jesse was ridiculously prepared. He had a lesson plan that he followed with estimated time for each section and a desired workflow as the day progressed. Each lesson had code samples online as a standalone JSFiddle, which made it super easy to play along.

Second, the morning session focused almost completely on the concepts that lie at the core of Ember before building into the more practical / utilitarian aspects of application building with the framework in the afternoon. I appreciated this because Ember is full of framework magic and it was nice to see where things fall into place. Some people in the workshop felt that the morning session glossed over things too quickly, but I felt the pacing was appropriate and didn’t have any trouble keeping up.

Finally, Jesse encouraged experimentation and a certain degree of competition. He stated at the beginning of the workshop that we should each be playing with the concepts, either by forking the JSFiddle examples he had prepared or coming up with our own, and that the “best” app at the end of the workshop would win a copy of his new book.

Given my love of competition, I jumped right in (as soon as I could anyways, I had to repair a corrupted drive the first hour of the workshop) and built a small roster management application that included a multi-level master/detail view with editing functionality. I used static JavaScript objects (so there was no persistence) but it wasn’t bad for never having used / played with a JavaScript MVC/MVVM framework like Backbone, Ember, or Angular. I was proud of myself and ended up winning the book (although that may have been by default as I think I was the only one who built anything).

Anyways, the workshop was fantastic and I felt energize and excited after the first day.

Sessions

The quality of the sessions this year was fairly high overall. There were some misses that I just didn’t enjoy, but I don’t want to dwell on those. Instead, I want to talk about a few of the speakers that I really learned from.

Carl Smith – Lessons From the Lemonade Stand

If you have a chance to meet Carl, you should absolutely take advantage of it. He is one of the most positive individuals I have ever met in my life and he has been a keynote speaker the last two years at FILive.

It is hard to explain what you get with Carl’s talks so I won’t really try. That being said, I can tell you that his words have had a meaningful and positive effect on my life.

Kirsten Hunter

Kirsten’s talk was entitled Designing Irresistible APIs and it was excellent. She gave a great high-level overview of why you might build an API, how you should treat your API (spoiler alert: as a first class product) and the things you can and should do to promote adoption / usage.

I really enjoyed this session because Kirsten stayed at a relatively high level. The session was more about the “why” of APIs rather than the “how” and I feel like that’s a harder question to address. Everyone in the audience could probably build a little Node + Express app to serve JSON from URL endpoints, but not everyone could justify doing so from a business standpoint and that’s what this session was designed to help us do.

Another reason I liked this session was purely selfish. Kirsten pointed out multiple times that your API should serve your customer (whoever they are) and their use case rather than blindly and slavishly adhering to a strict REST / RESTful paradigm. I thought that was a powerful statement from someone with so much experience and it made me feel better about the APIs I’ve built in the past.

As an additional note, I spent about an hour talking with Kirsten after her session and over lunch and she is just a fantastic person with a lot of real-world experience and some interesting opinions on the tech industry. I really enjoyed my time with her.

Other Speakers

There were three other sessions that I feel deserve to be mentioned specifically. First, Developing in Public by Daniel Hengeveld was a terrific overview of the many artifacts of software development that aren’t code. He pointed out that the things around the code you write, including decisions you made, the reasons why, the documentation for the code itself, etc, is probably just as important a the code itself. I think this is an important point and one that Daniel made quite convincingly.

Second, Logs & Metrics by Thijs Feryn was a great look into log aggregation and querying, the tools you can use to perform those tasks, and why you might want to. I know I mentioned earlier in this post that I enjoy high-level talks more than implementation centric ones, but Thijs really knocked this out of the park. His examples were great and he provided just enough information to whet the appetite.

Finally, Pete Hunt’s React: Secrets of the Virtual DOM was a good look into the current tools available to bind data to views in the browser. It covered each of the major players and then, unsurprisingly, made the case for why Facebook’s React is better than all of them. I wasn’t totally convinced, but it’s always exciting to see Big O notation used in a conference presentation, so I was at least intrigued. I also liked that alternatives were presented, even if they were dismissed along the way.

People

While I love the workshop and the sessions, I really attend FILive for the variety of people that I get the chance to meet. It is such an eclectic conference that you end up chatting with people from almost every discipline in tech. I met a ton of great individuals over the course of the week:

  • A Flash and ActionScript developer trying to transition to rich Single Page Apps
  • A sole proprietor from Sweden who flew all the way to Las Vegas to learn from his peers in he industry
  • A Norwegian frontend developer who I had a great lunch with and hope to continue corresponding with
  • Several individuals who I preached the gospel of freelance to – we’ll see if any of them convert
  • Max, a former music manager (living on the road, etc) and now Phonegap developer – what an awesome guy
  • Ankit, whose card read Ninja-Wizard Extraordinaire (no joke, and that is awesome)
  • A pair of developers from Aruba who were super friendly
  • A designer and developer pair from Brazil (the first people I talked to – coincidentally the first people I talked to last year were from South America as well)
  • Many more people who I had a ton of fun talking to and learning from

The experience of talking to all of these people is mentally and emotionally exhausting for me (I’m somewhat of an introvert) but I’m so glad I put myself out there and approached more people this year. I felt so lucky to be in a room with my peers, each with their own opinions and expertise. It was amazing.

Exhibitors

The show couldn’t go on without sponsor help and I actually enjoyed talking to all of them this year:

  • The Internet Explorer team was there showing off some of the features in their new developer channel build of IE11 (some of which are really neat)
  • SiteGround promoted their hosting with a cool creative contest and also gave away a free year to attendees looking to take advantage of the power of their platform
  • Traitify demoed their personality testing software with a cool app that basically boiled down to What Superhero are You? and it was a great experience – I really liked this team
  • Firebase had two developers showing off their real time platform with a few cool demos and they were more than happy to answer questions (which I had plenty of)

The exhibitors collectively put on a great show and I was happy to talk to all of them!

tl;dr;

FILive is a great conference. If you can attend, I highly encourage you to do so. I’m very much looking forward to attending again next year and very much hoping that it will be in Las Vegas again.

Multiple Featured Images on the WordPress Repository

In September of last year I spent some time building a small utility plugin that allows for the registration and use of arbitrary image pickers for any WordPress content type. Since then, the plugin has been sitting on Github because I’ve been too lazy to get it into the repository.

That changed today! I submitted a request for inclusion and just deployed MFI Reloaded to the WP.org repository. I’m hoping that more people will use the plugin now that it is in a place that more WordPress developers go to look for things. It is really handy for custom site builds, especially for image heavy sites.

Goals for 2014

I should have posted these at the beginning of the year but I didn’t even have time to think about them until last week. Here’s a list of things I’m trying to accomplish this year (in and around my business).

Gross a Large Amount of Money

It is always nice to have a number to shoot for so I picked a big round one that I know is achievable but I’ll need to push myself to hit. Between my contract work and other sources, I expect to reach this number, assuming my projects go smoother this year than last.

$200 per Month from Affiliate / Niche Site (by end of year)

BoostWP, a business that I recently launched with my former client and now partner Chris, provides high quality products for people using WordPress as a marketing tool. I figure it is probably a good idea to actually use the products I build so that I can become intimately familiar with the challenges that our customers will face.

What better way to do that than to dogfood the products I’m building and use them to their intended ends? I essentially know nothing about internet marketing so I’m hoping $200 per month isn’t a crazy goal. I guess we’ll see!

Generate 25% of Revenue from Product / Subscription Sales

Did I mention that BoostWP launched recently? I really believe in its potential and am setting the bar high in terms of calling it a success. By the end of the year I want to be generating at least a quarter of my income from non-hourly work (e.g. product or subscription sales) and I expect BoostWP to make that a possibility. There might be other products (keep reading this post for more info) but BoostWP is where it’s at.

Write 90 Blog Posts

Did you notice that I’ve been writing a lot more recently? I did 30 days of writing back in September of last year but since then I’ve written almost nothing on this blog. I’m aiming to change that for two reasons. One, I love writing (especially teaching through writing). It is a good release for me and allows me to express myself in a way that I normally don’t get to. Second, I want to continue to build a voice (as was my intention with the 30 days of writing mentioned previously).

I plan to publish 90 posts this year. I’m not sure what they’re going to be about or how long they’re going to be, but I’m hoping you’ll read at least some of them.

Write Another Book

I wrote a book in 2010 and I didn’t have the best experience. When I finished the book (with the help of a co-author), I was proud of the fact that a published piece bore my name, but I wasn’t proud of the contents. It was out of date as soon as it hit the market and I hated that. On top of all that, I made almost $0 from the book considering all the time I invested in it. It has been a good marketing tool for years, but it’s time to write another one.

This year I’m going to self-publish a book. I’ve been watching as a lot of people I follow and respect have released pieces covering topics that reflect their expertise. I firmly believe I can do the same. I’ll talk more about this in upcoming posts, but I’ve written an outline that I believe will lead to the proper amount of content and will deliver a large amount of value to both businesses and individuals.

These are my business goals for 2014. I’d love to hear yours if you’re willing to share in the comments or on your blog!

Simple Dribbble Shot Embed Plugin

I was sitting around today thinking about some parts of WordPress that I hadn’t got a chance to play with and I realized that I’d never touched the embedding framework built into core. Most people think of the embed framework in terms of the ability to immediately include oEmbed enabled resources into WordPress. oEmbed enabled resources include things like YouTube videos and Instagram media. If you’ve never taken a look at it, the oEmbed framework is neatly tucked into its own class which is really easy to read through.

Unfortunately, the resource I wanted to embed doesn’t conform to the oEmbed spec, so I was left with the manual method. Again, WordPress has a special class for dealing with these types of scenarios. Once I read through that class, I knew exactly how to do what I wanted.

I’m a big fan of the Dribbble API. It covers all of the main functionality of the website (at least in terms of data exposure) and is ridiculously clean in terms of resource representation. I thought it would be neat if a user could embed a Dribbble shot into a post or page (or any piece of content, really) just by copying and pasting the URL to that shot. I can think of several scenarios where this might be useful, including project profiles, discussions of WIP, or examination of design trends (colors, shapes, textures, etc.).

So that’s what I built. All told, it took me about twenty minutes to find the hooks I needed in WordPress and build the very small plugin that provided the functionality I desired. The plugin includes some basic caching so that the Dribbble API isn’t hit every time content is viewed. You can see the finished Dribbble Shot Embed plugin on GitHub.

If you’re interested in me developing this idea further, I’d love to hear from you. Alternatively, let me know if you use this as a starting point to develop your own WordPress embed system plugin. I think it is a good base and should be easy to build upon.

Blogging for Beginners

In 2006 I moved to Louisville to intern at General Electric’s appliance division. I didn’t like it that much and I was really lonely and bored most of the time. To combat this, I started a blog named Abandon Nest that was all about living on your own for the first time. I found a long lost backup of the site a few days ago and am still sorting through all the content, trying to figure out what to do with it.

For me, that blog was the start of my career as a web developer. It ran on WordPress 2.0.4 and I wanted to modify it so I bought a book about PHP and taught myself how to do things with it. I thought it was so interesting that I decided to switch majors when I got back to school, going from Mechanical Engineering to Computer Science.

But that’s not what this is about. The second thing that blog got me to do was interact with other people around me. In fact, I was so confident after blogging for all of three months, that I decided that I’d go give a presentation at the library about blogging for beginners. I found that presentation and thought I’d share it.

To me, it is amazing how relevant almost everything I presented on 8 years ago is. Some of the tools have changed and some businesses have failed, but the main messages are all the same as the ones you’d hear about blogging today.

So, if you’re interested, I’d like you to take a look at Blogging for Beginners and let me know what you think. I think that I need to follow some of the advice proffered by my 2006 self, but that’s just me.

Multiple Rich Editors in the Plugin Repository

The WordPress plugin that I built last week has been added to the official repository.

I’m fairly happy with this plugin. It solves a small problem in a way that makes sense. It is well documented (for the most part) and should prove useful to other developers. It serves a need that I know exists (because someone asked a question) and shouldn’t need to change much in the future.

If you decide to use Multiple Rich Editors, please let me know. I’m interested in the various uses that people come up with.

Using Computers to Create

I am enamored by the state of technology in 2014. I look around and see the computing power that permeates society and it blows me away. It seems like everyone has a smartphone or tablet that they can use to message someone on the other side of the planet, watch an awesome video of a baby and dachshunds, or just chill out and read their subreddit of choice. It is easier to communicate with others and consume content than ever before.

What I really love about all this computing power, though, is the freedom it gives for everyone to create. The democratization of powerful technology in the developed world has made it possible for almost everyone to be a photographer, videographer, or writer. We can share our creations and get feedback from our peers in no time at all.

When I look back to my childhood, some of my fondest memories are creating things on my computer and sharing them with the world. One instance in particular really stands out to me.

In middle school and early high school I was obsessed with a game called Empire Earth. This was the first game I ever played online and I would sneak up to our family computer to play it late at night with friends.

Eventually, I noticed that there was a scenario editor option in the menu and clicked on it. After that, my entire worldview about what you could do with a computer changed. I spent hours and hours building scenarios and teaching myself the tips and tricks of the editor. In a way, this was my first real introduction to programming (even though I didn’t think of it as such).

Eventually, I released my scenarios for Empire Earth and got some really positive feedback (the web was a much more positive place in 2002-2003). I eventually lost interest in favor of being a football player, but those experiences continue to stick with me. In fact, I still have the scenarios that I created:

Going forward, I hope to continue to create and I invite all content consumers to use the technology at their fingertips to put their mark on the world. Write, draw, photograph, record, or whatever else you can think of and share it with the world. Be a creator, not just a consumer, and you’ll feel more fulfilled. And maybe, just maybe, 10 years from now you’ll look back with pride at what you created and the paths it led you down.

Recent Open Source Work

I recently did some work on two open source plugins that I’d like to talk a little bit about. They’re very different, both in function and purpose, and I think that disparity gives a good glimpse into the variety of work I do in my professional life.

WP ConvertKit

If you haven’t heard of Nathan Barry by now, you should probably click on his name and go read a little bit about him. Nathan seems to really have it together, starting and growing a product business based on the concept that teaching sells. I spent a few days last year reading through his blog and bought one of his books, Authority, because I thought it was a great product.

Anyways, Nathan runs a SaaS called ConvertKit. It’s an interesting product because it recommends and guides you through a particular workflow that Nathan believes (and has somewhat proven) helps you sell digital products. I saw that there was an existing WordPress plugin for the service, but it was lacking in a few ways. Implementation details aside, I felt like there was a better solution and more “WordPress”-y way to solve the problems the plugin presented. Also, I felt like I learned so much from Nathan’s blog, it would probably be a good thing to give a little back. I took the opportunity to write a new plugin for ConvertKit, put the code on GitHub, and emailed Nathan about it.

A few months later (he’s a busy guy, so I didn’t mind) I got an email asking if the plugin I wrote could be the canonical plugin for ConvertKit and wondering if I’d add a few features. I added them and finalized the plugin a few weeks ago. I’ve heard from Nathan that it has worked pretty well so I’m happy about that. It is always nice to know that people are using the things you built.

Anyways, the final version of the plugin lives here and you can go grab it if you want to either take a look at the code or use ConvertKit and want to integrate it more easily into your WordPress site.

Multiple Rich Editors

Erik Ford, who seems to inspire open source work and blog posts on my part, posted a question on Twitter regarding the best way to add multiple editors to a custom post type:

I hate the thought of bundling or requiring a third-party plugin with your theme, especially if it includes a lot of functionality that you probably don’t need. Advanced Custom Fields is a great plugin for a lot of people, but if you’re just looking to add some WYSIWYG editors, there’s no reason to use it. I told Erik I’d look into it and get him some sample code.

The next day I worked up about 25 lines of code that you could throw into a file and you’d add an editor and save its contents for a custom post type. It was short and sweet, but it didn’t really fit with the style that I tend to build things in. Taking a cue from a previous plugin that I developed and blogged about here, I decided to make use of the theme support API that WordPress provides to allow quick and easy implementation of multiple content editors on any registered post type.

The result was a plugin I call Multiple Rich Editors. It allows a developer to specify and multiple editors per post type that should appear on the edit screen. It handles saving the data for each editor and provides template tags and guidance for outputting the information the user has entered. On top of all that, it is simple enough that Erik can drop it into his theme and save the effort of building something himself.

There are a lot of different use cases for a plugin like this. Perhaps a content type requires different sections of rich content (intro, body, conclusion, perhaps?) or you have a complex layout where a user of your theme needs a fine-grained level of control over what appears where. Regardless, if you stumble upon this and end up using the plugin I’d love to hear what you like and what you don’t and how I can make it better.