Two Rules Of JavaScript Async/Await

Ever wanted to write a JavaScript function that makes a HTTP request and then returns the results? Sounds simple, but the “and then” part of that sentence includes a lot of complexity. That is because when you make an HTTP request — it is performed asynchronously. This applies to jQuery AJAx, fetch, Axios, Nodes’s HTTPS module, etc.

I’m not going to cover callbacks and promises. I want to ask you to forget about all that and learn two rules. With those rules, and a modern JavaScript runtime, you can write a function that solves the requirement I gave before in a few, highly readable lines, using async/ await.

I say highly-readable because what I love about async/ await is that you can read the code and get a much easier sense of what is going on. Instead of understanding then/when/catch/error/whatever, you see the request on one line and on the next line you see what is done with it.

In this post, I’m going to give you two basic rules of async/ await and some practical examples of their use. It’s a hard to explain this concept, but the code is short and readable, so you should be comfortable, when you’re done to start experimenting with this new API.

Rule One Of Aysnc/ Await

You Must Use The await Keyword Only In Closure That Is Declared With The async keyword.

Inside of this closure, we may use awaitbecause the async keyword is used when declaring the function.

The await keyword is the real magic of async/ await. Before you can use it –see rule two — you must know rule one. Rule one shows us how to create closure that can use the await keyword. How? We type the async keyword before a function. 

Got that? That’s rule one, you’ll see examples when I explain rule two under the next heading.

Rule Two

Inside Of An async Closure, If Another async Function Is called With The await Keyword, The Next Line Will Not Run Until That Line’s Promise Has Resolved.

In this example, line 7 will not run until the Promise created on line 6 has been resolved or rejected.

In this example, I’m using the fetch API, which creates a promise. That’s all been made invisible by using await. Instead of using a then() callback, I’m just awaiting the result of the function.

Notice that the before I declare the function I used the async keyword. That’s another example of how rule one works. This function says async in front of it, so I can use await inside of it.

You can use this asynchronous function only inside of another asynchronous function. For example:

Inside of an async function, we can await the results of an async function.

For a more complete example, here is a more abstract version of getMostRecentPost() that works with any site and then another function that calls it twice and after awaiting those results, returns both posts.

One async function calling another async function using await.
fetch API

That’s The Whole API! Use It!

In this post, you learned two rules of async/ await and that’s all you need to know to use this powerful new feature of JavaScript. It will make your code simpler in a lot of cases.

Want to learn more? I’ll leave you with a Wes Bos video:

A List Of Developer-Facing Talks About The New WordPress Gutenberg Block Editor

The new WordPress block-based “Gutenberg” editor is coming to WordPress soon. I’ve given a few talks about developing for Gutenberg. In this post I round up three talks, in three categories, that I think can give you a good overview of developing for Gutenberg.

Don’t forget to read the Gutenberg Handbook, which has a ton of documentation about working with and extending the new WordPress editor. These are talks for developers, I published a list of talks for site-builders and WordPress users yesterday.

This list is part of the resources for my React Boston 2018 talk. You can see those slides here.

Design For Gutenberg

Building Blocks

Advanced Topics In Gutenberg

A List Of Site-Builder Facing Resources For The New WordPress Gutenberg Block Editor

Last week I gave a talk called “Introduction To Gutenberg Block Development” at WordCamp Pittsburgh. It was a developer-facing talk about how to build a custom block type for the new WordPress block-based “Gutenberg” editor, coming very soon to WordPress.

You do not need to create your own blocks to use Gutenberg. I had one slide of links in my talk for those who are looking to learn how to use Gutenberg.

For the developer-facing version of this list, please see this post.

The List

Josh Pollock – WordCamp Pittsburgh 2018 Slides

Create A WordPress Site With Lando

For local WordPress and Laravel development, I tend to use a Docker-based solution, most of the time. Depending on the project, I either use Lando or docker-compose. This post is about Lando.

Lando, is no DesktopServer. DesktopServer gives you a simple GUI for creating WordPress sites. Lando has no user interface, you do everything from the command line. That’s good or bad, depending on what you need.

Here is how I create new sites for local development using Lando.

Create The WordPress

Initialize lando in current directory:

lando init --recipe=wordpress

Add a WordPress:

wp core download
wp config create --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --dbhost=database --skip-check

That downloaded WordPress core and setup wp config to match Lando’s default variables:

wp config create --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --dbhost=database --skip-check

Add xdebug and MailHog and phpunit

Optional step, but it’s best before going further to add phpunit, MailHog and xdebug. MailHog intercepts all emails coming from the application and provides a webmail-like UI for reading the caught emails.

I love xdebug, I can’t imagine PHP development without it.

In order to run tests “The WordPress Way” you need phpunit installed globally. I disagree with this approach, but Lando makes it pretty simple to do, so fuck it. Here is a .lando.yml file that adds all of these things:

name: formcalderas
recipe: wordpress
config:
  env: dev
  xdebug: true
proxy:
  mailhog:
    - mail.formcalderas.lndo.site
services:
  appserver:
    composer:
      phpunit/phpunit: '*'
  mailhog:
      type: mailhog
      hogfrom:
        - appserver
      portforward: true

Build Containers And Start the site

lando start

This builds the new site and then shows URLs for the site.

At that point you have a WordPress at the URL listed for “APPSERVER URLS”. Click the https link and then finish installing WordPress through the UI. Alternatively use wp cli.

Chrome will not trust the SSL certificate. I normally just click the “Advanced” option and then tell Chrome to trust it. There is a better way to handle this documented here.

Path Mappings For xdebug In phpStorm

In phpStrom preferences go to Language & Frameworks > PHP > Servers and select the current server. Map the root directory to /app

Also Great For Pantheon

This article is about setting up local sites for general plugin development. We also use Lando for local development of the Caldera Forms site. CalderaForms.com is hosted on Pantheon. We git commit the Lando config file in the repo for the site. That way we have a shared environment and can pull database and file changes using Lando’s CLI, thanks to their Pantheon integration.

Learn more about Lando + WordPress here.

Top 10 Time-Saving Tips For Writing With Gutenberg

One of my current goals is to write five short blog posts a week using Gutenberg, I want to learn this important new feature of WordPress and be a better contributor. In addition, I want to improve my writing practice by practicing more.

I didn’t set out to write most of my content about Gutenberg, but I should not be shocked that’s what happened. After a few days, I had a few concerns about the experience of authoring content in Gutenberg.  I’m used to writing mainly in Google Docs and Google Keep or Twitter. Sometimes in Simple Note and occasionally WordPress.

Turns out that a lot of these concerns I had are being addressed. The solutions are there, but not obvious. Here are a few tips I’ve learned to improve the content writing experience. When I’m writing, not editing, Gutenberg can feel like it is in the way, but there are good features that exist or are being worked on to solve this.

Slash Commands

One thing that bothered me a lot about writing with Gutenberg In my first week of my new Gutenberg challenge was adding a heading block. I found that having to go to block inserter to add the heading really upset my writing flow.

On Twitter, Kevin pointed out that you can use a slash command to bring up the block inserter. 

To insert a heading block, just start typing /heading brings up a mini block inserter. It’s way faster.

Inserting a heading block into the WordPress Gutenberg post  editor using a slash command
Add blocks quickly to the WordPress editor using a slash command

Code Formatting

I’m using Gutenberg on two sites right now: this site and the CalderaWP handbook site. On the handbook site this week I was documenting setting up local development for CalderaForms.com and needed to use code formatting on some words in a sentence.

There is no obvious way to add <code> or <pre> to selected words in paragraph or list block. This made writing those docs a pain, I had to add the HTML in the code editor. Yes there is a code block, but switching blocks upsets my flow and sometimes I want to put code in a sentence.

Cool feature, not easily discovered. I wish I knew how to make that obvious, as its really cool.

Hide The Sidebar

In the top right menu is a gear icon. Click that to close the Gutenberg sidebar when you’re writing. It’s better that way.

Use The Document Outline Tool

Using the document outline in Gutenberg to see that your 10 items listicle only has 4 items. Also, accept that fact and go back to writing code.

The document outline tool —  i in a circle icon on top right — shows you your heading structure for the document. It makes it easier to see bad heading structure and to jump around a large document.

Another thing that is great about this tool is if you’re writing a listicle that promises ten time-saving tips or whatever, you can use it to count your time-saving tips as you go.

Creating Gutenberg Blocks With WP-CLI

If you’ve never created a Gutenberg block before, or just need to make a quick block, wp-cli — the official command line tool for WordPress — can help. The wp scaffold command can create a plugin and add a block to it. Here is an example:

# create a plugin called books
wp scaffold plugin books
# create a block with the name "book" and the title "Book" in the plugin books
wp scaffold block book --title="Book" --plugin=books

This gives you a plugin with one block. Brian Richards’ section of the WordCamp Miami workshop we gave this year is about creating similar blocks, with or without wp-cli and then adding capabilities to them. The example code from that talk and the slides are likely good next steps if you’re just learning Gutenberg block development.

wp scaffold

This Is Super Basic

I’m a big fan of using ES6 and webpack and yarn and JSX…

If you do not know how to use all of those things and you also do not know how to build a Gutenberg block, I recommend picking one concept to learn at a time. Gutenberg can be your way to level up your JavaScript. But start simple.

Make Something!

In preparation for our Gutenberg-powered future, now that the API is pretty stable,  now is a great time to build your first block. If this helped, @ me on Twitter with the Github link to what you built 🙂

Redux(-like) State Management In And Around WordPress

This post is a companion to my talk for the JavaScript for WordPress conference. The talk is supposed to be titled “State Management with Redux in WP” but I always end up changing the title last minute.

In this case, Zac and I honestly didn’t know enough about Gutenberg when we came up with the topic to know exactly what it would be about. We had some theories when we discussed it in this video a few months ago:

Watch The Talk

Josh Pollock – Redux with WordPress – 2018 JavaScript for WordPress Conference
Screen cap from the talk!

Slides

Here are the slides for my talk:

Helpful Links

Example Code

Because this talk will be streaming, some people may have issues viewing the code. Also, I used Carbon.sh to generate screenshots of example code to ensure they looked good. That means you can’t cut and paste from the examples, or read them with a screen reader, which is sub-optimal.

So, here is an image gallery of the code samples with links to the actual code it is based on. Now you can see the practical, real world application of these concepts.

This example code is based on the Caldera Forms Processor UI library, which is what I’m currently working on andand Caldera Forms’ Gutenberg block.

A Dumb App Component

Presentational Component

See full source code

Component PropTypes

A Dumb Component Nested In App

See full source code

Tests For A Dumb Component

See full source code

Higher Order Components

Example From Gutenberg: With API Data

The Provider Higher Order Component

See full source code

Container Component – withSelect

See full source code

Container Component – withDispatch

See full source code (same as above)

Container Component Wrapped With State

See full source code (same as above)

Actions

Action Function

See full source code

Testing Action Functions

See full source code

Selectors

Selector Functions

See full source code

Testing Selector Functions

See full source code

Reducers

Reducer Functions

See full source code

Testing Reducer Functions

See full source code

Resolvers

Resolver Functions

See full source code

Testing Resolver Functions

See full source code

Registering A Store

Pattern

See full source code

Complete Example

See full source coe

Using @wordpress/data Store In A Gutenberg Block

See full source code

Using @wordpress/data Store In A React App

See full source code (same as above)

Nonces: The Other Problem With WordPress Caching

Cloudy mountain top

Nonces are one of those things that, hopefully, all WordPress developers know they need, but there is still a lot of confusion about. Maybe it’s beacuse “nonce” means a number used once and a WordPress nonce is not a number and it can be used. So it’s closer to a nonce than a nonce word, but it can be used multiple times, but I digress.

The point here isn’t semantics, it’s to discuss some problems nonces present. I run into problems with Caldera Forms + caching plugins that are set with infinite cache lengths as this causes our nonce validation to fail.

This article isn’t about setting up caching plugins or services or which one is best. It’s about understanding one of the gotachas with many caching plugins: caching nonces.

Nonce Problems

I want to talk a bit about what nonces are, why we use them and what can go wrong. I’ll keep it brief, as I’ve written a more detailed article on nonces for Torque already.

What Is  A Nonce?

As I said earlier, “nonce” means “a number used once.” For example, most payment processors, like Stripe issue a one time use token, which is a mix of numbers and letters, for creating a payment. They call it a token, but same concept, technically a nonce word. You request the token with a public API key and then complete the payment with the token and the secret API key.

Nonces are not a security feature by themselves since they become public once printed to the page. Also, in WordPress, nonces can be used more than once.

Nonces help prevent cross-site request forgery, beacuse they can be used to prevent requests from external sources form mimicking intended HTTP request. Also, nonces make up part of your strategy to prevent XSS attacks since they help verify that the request is coming from the intended user.

Nonce Expiration

Snowy mountainAs I said in the last section, nonces can be used more than once. They remain valid for a set period of time. By default this is 12 hours, but can be changed with the nonce_life filter. This design decision means that WordPress doesn’t have to keep a record of nonces created and if they have been used. That probably would have required a new database table.

This is important to keep in mind. As are the other ingredients of a nonce. For example, one of the components that goes into a nonce is user ID, or 0 if the user is not logged in. This prevents nonces from non-logged in users from validating when a user is logged in. This by the way is why you should always send the REST API nonce on every request. If you don’t other nonces might not validate properly.

Forms, Caching And Nonces

Every form in WordPress should use a nonce to prevent cross-site forgery requests. All forms provided by WordPress core do. This includes comment forms. Also, your contact form should. We use a nonce in Caldera Forms.

In the last section I mentioned that nonces can be reused for a period of time, normally up to twelve hours. This is good beacuse it means that you can cache the content of a page with a from and the form will still work, for up to twelve hours.

The “up to twelve hours” part is the rub.

The idea behind a static HTML cache is that you only generate the page output once, and serve the same thing, which should be identical to all other visitors. This makes sense as it prevents running the same database queries and running the same PHP scripts to do the same thing over and over again.

Great, but if you have a nonce in your content, it could get expire and prevent your forms from working. Obviously this is a problem we face with Caldera Forms, when it is used with caching plugins or proxies like CloudFlare. This is also one of the reasons people have moved away from native commenting in WordPress.

What To Do?

One thing not to do is to re-generate nonces from other plugins, before they can be validated. This bypasses the problem, but defeats the purpose of the nonce. I’ve seen plugins do it though 🙁

It’s common practice to bypass the cache for logged in users. One reason is that the content may be unique to the user. The other is that nonces are unique to the user and can’t be shared.

The other thing you really should do is keep your cache times short. Definitely less than 12 hours, but probably even shorter. Also, relying on a non-PHP solution like Varnish or nGinx as a reverse proxy is preferable, but you still need to make sure your cache time is short enough.

By the way, if you’re wondering which caching plugin I recommend, I don’t use one. None of my sites receive thousands of concurrent views. The Caldera Forms site is I’m dealing with few thousand page views a day, not a time and we have it on a small AWS VPS that can handle that easily, especially with all of the assets coming from a CDN.

If they did, I would probably use Varnish and/or nGinx as a reverse-proxy over a plugin. I do use Redis as a persistent object cache whenever possible. A good WordPress host should provide a static HTML cache, powered by a server appliance, with a short cache length.

Nonces Are Important, But Don’t Get Cute

Mountain valleyNonces are important, if you do WordPress development, make sure you read the WordPress developer handbook section on nonces. If you have questions, ask in the comments. Also, be careful not to get cute with nonces, and always use wp_verify_nonce() to verify nonces to avoid issues like I discussed in this post.

 

 

Some Quick Thoughts On LoopConf

I was super lucky to be able to attend LoopConf last week. Ryan Sullivan and his team put on an amazing conference. I’ve never been to a fancy developer conference before, and I had a blast. Thanks Ryan for having me! I just wanted to share a few observations about what made LoopConf special and share my recommended videos playlist.

Before I go on, I should point out that while I don’t usually stay in hotels when I travel — I prefer AirBnB –Me and Roy Sivan being super classy by hotel fireplace– the Little America hotel in Salt Lake City where they put us up was classy AF. I didn’t know what to do with myself in such a big fancy room, but I super enjoyed sitting by the fire in the lobby and being classy.

One side of the fireplace had statues of dogs. The other side had a painting of wolves howling in the snow. Apex Classy.

Our REST API Workshop And Something New

Caldera Learn BannerRoy Sivan and I gave a 6 hour workshop on using AngularJS and the WordPress REST API. Honestly, we were worried we couldn’t fill 6 hours, but we actually ran out of time at the end. We had almost 40 attendees and people seemed to get a lot out of it.

I have embedded our slides below, and we also put all of the example code to Github. There is a ton of practical examples in there, some not finished to provide a start point for your own work. Some examples are running live on CalderaForms.com right now.

If you’re wishing you could attend an in depth workshop about the REST API from Roy and I too, don’t worry. We recently announced Caldera Learn. This new site will offer live webinars, recorded courses and code communities for anyone looking to level up their WordPress development skillset. It’s going to be awesome.

The Main Event

Photo by:  Anna Anikina

Our workshop was the day before the main event. LoopConf was a single track conference with excellent talks. They also did a great job of accommodating the hallway track. The room that meals were served in was open all day with the live stream playing. This was a great way to network and watch the talks. I wish WordCamps would do this.

The talks were a lot more focused on philosophy of code, then code. Not that there were not code examples. I really liked this trend for non-workshops.

For example, KAdam White talked about why the WordPress REST API was important for JavaScript developers and why he built his node.js client for the REST API, before showing code for a React app using both tools. Similarly, Natalie MacLees and Nathan Tyler shared their experiences learning React. They provided tons of React and general JavaScript resources in context of using the WordPress REST API.

John Jacoby Jones (JJJ) didn’t really show any code at all. Instead, he talked about lessons from Unix Philosophy that could be applied to WordPress. Andrew Norcross talked about improving our community by acknowledging and dealing with unacceptable conduct that happens in our community.

All the nerdy talks on how to code something or why to code something a certain way were book-ended by business-focused keynotes. Josh Koening of Pantheon talked about how the web has trended away from open source recently as companies have packaged what we created for the open web  in better experiences. He made an excellent point that most people can’t afford what free software costs — time and education.

Jason Cohen of WPEngine spoke about building a bootstrapped business. While he talked about pricing and product design, the best part of his talk was about managing yourself. This especially rang true for me when he talked about focusing on 2xing revenue over shiny features.

I’ve been working on both, and beating myself up over not delivering all the shiny new features I want for Caldera Forms. Those would be done if I wasn’t also working on a new tool that we’re testing right now. Then again, February is looking like a 1.5-2x growth for us versus January, so yah.

I really appreciated both of their talks and spending time talking with both Jason and Josh during the event. I was imagining LoopConf would be all out nerdy-codefest with out a ton of networking. But I got both.

Next Generation WordPress

Photo by: Alexey TopolyanskiyIn 2014 I went to WordCamp Milwaukee and saw two talks on the future of WordPress. Ryan McCue and Rachel Backer presented the beta of the WordPress REST API and Andrew Nacin talked about the WordPress REST API and the WordPress fields API being the basis for a modernized WordPress.

I was super-excited for the vision they shared, and got on the REST API bandwagon pretty hard. Of course, things turned out a bit differently then we expected then. At LoopConf Ryan gave a talk called “Next Generation WordPress”.

He talked about going from the blog era of WordPress, to the CMS era of WordPress and now the platform era of WordPress. Echoing what Matt Mullenweg said in the State of the Word about what got us here is not going to get us where we are going, Ryan suggested a new direction.

While State of The Word was all about user experience, Ryan talked about developer experience. I loved this obviously, as there is a reason I prefer to develop most things in Laravel than in WordPress these days — the developer experience — there has to be a balance here.

WordPress is a user-centered platform and that should never change. But, for users to get an improved experience, both from core as well as plugins and bespoke sites, we need to make it easier for developers to fit those needs. Ryan is, per usual a man with a plan. Definitely watch his talk, do what you can to contribute and let’s hope he gets a reasonable fraction of what he’s asking for there.

Vegan Food, Also Videos

I didn’t expect their to be such excellent vegan food in Salt Lake City, but I was impressed. If you’re ever in Salt Lake City, which I recommend strongly, check out The Vertical Dinner.

I’m still working my way through videos of talks I missed, but I created a highlights playlist from both LoopConfs for you. Check it out:

 

2016 FTW

 

At last year’s WordCamp Miami, I split an Airbnb with Vova from Freemius. We took an Uber to the speaker sponsor party together and one of the things we discussed on that ride was Caldera’s revenue from plugin sales. I was worried it wasn’t very good. But, I told him it was 3 or 4 times what it was last time I was at WordCamp Miami, so I felt good about it.

I know the time difference between WordCamp Miami 2016 and Miami 2017 or 2015 and 2014 isn’t exactly one year, but time isn’t linear. Nor is progress.

When I go to a WordCamp, I tend to think about where my career and my company where last time I was at that WordCamp. Since I often lack the ability to evaluate things relative to the proper time frame, this can be really helpful for me to see my growth.

By WordCamp Miami 2017  we should be at 4x the revenue from plugin sales as we were at last time I was in town for that event. We’ve also more than quadrupled the active installs for Caldera Forms. Because a new year is a great opportunity to talk about growth and goals, I want to share some of mine for 2016 and 2017.

But before I move on from Miami, I should mention I was also in Miami twice last year because my wife Alicia was performing at Miami Opera Festival last summer. I’m very happy and very proud that her career is also going well, and she will be an apprentice at Des Moines Opera this summer. What I do is hard, but nowhere near as challenging as what she does. I am so lucky to have her as an inspiration. Also, lucky to have her in general.

TL;DR (And This Is A Long One)

Here is this article in short bullet points for those of you who don’t have time to read the whole thing, and it’s real long:

  • Caldera Forms is growing – 4x user growth in 2016 and a lot of love.
  • Caldera matured a ton as a company. Asking Christie Chirinos to run the company was clearly the right decision.
  • I feel a lot better. Stress is way down, hopefulness is up.
  • A lot of fun stuff coming in 2017 from Caldera.
  • I wish I had written more, taught more and contributed to WordPress core more in 2016.
  • Team Caldera is growing. Maybe including you?

I can’t overstate how much happier I was by the end of the year then I was in the early parts of it. I spent a lot of time in early 2016 looking at job postings, considering taking my marketable skills to work for someone else. But, now I feel like powering through has gotten me what I wanted from doing my own thing — constant challenges, lots of fun and less stress. I’m honestly super happy with where I am now.

The Tasty Recurring Revenue

Photo by: Saul CuellarI’m the kind of person who quits a video game because I know I can win and moves on with life. Or I start over on a higher difficulty setting. I like playing, not winning.

The combined Josh + Caldera revenue is in the same order of magnitude for 2015 and 2016, but it has grown by decent amount. What’s more important is that the percentage of the revenue that has come from one off jobs has fallen significantly.

Numbers-minded people like recurring revenue beacuse it is an easier way to project revenue and therefore budget. Also, it tends to be more profitable.

But, I don’t do budgets — we’ll get to that shortly. What I don’t like about one-off jobs is the lack of personal investment. I don’t care for games with final boss battles.

What’s fun about software is it never ends, what’s fun for me, about working on projects I love or with clients I enjoy working with is that it never ends.

When we complete a Caldera Forms release, I don’t get a ton of joy out of that milestone. But my favorite part about the release process is the last step — I fork the master branch into the develop branch and set the version number ahead.

In addition to increased plugin revenue, we also added recurring revenue from maintenance agreements.  The normal play with that type of business is to sell a bunch of low priced maintenance plans that come with scalable and predictable work.

We did the opposite. High price, lots of work. It’s fun and I’m learning a lot form it. It’s not something we advertise, because we don’t have the resources to scale this part of the business, but we’d consider adding another if the client had interesting enough problems — preferably needing help with improving eCommerce performance and  conversions.

Changing The Team: Part 1 🙁

I didn’t create Caldera Forms, I started out as a user.

I originally tried out Caldera Forms, because I was impressed with work David Cramer, who was the original developer of Caldera Forms had done on Pods. I was immediately impressed and wanted my plugins to have that kind of user interface. This was before WordPress people got all excited about JavaScript driven-interfaces and David had basically built his own reactive JavaScript framework on top of jQuery before reactive frameworks were really a thing.

When I said I wanted to start my own WordPress plugin company and started recruiting those I knew, I was super excited David was on board.

The last time I wrote about the progress in our business, was in June. That article was canablized from a 2015 year in review article I never finished. I didn’t finish it in January of 2016, as I was really unsure at the time where we were going and if the company was going to survive as a team, which at the time was me and David.

In that article I wrote about struggles I had been having with David Cramer, who was the original developer of Caldera Forms, but how I felt we had patched those up and things were going better.

Unfortunately, that didn’t last. David is super-talented and he’s working on some really exciting new stuff right now, but he’s no longer working with us. In the end, we had a different vision for how to develop and manage Caldera Forms. David wanted to build new things, and so did I, but Caldera Forms has taken of to the point that it has to be priority number one.

I look forward to helping promote his new business when it launches. Please check out his new plugin DB Post Types. It’s a tool for organizing WordPress data into useful, and editable reports. A super useful tool that I’ve been excited to try out since I saw the first prototype for it.

When CalderaWP started, I had David keep control of the CalderaForms.com domain name and the WordPress.org repository so he had leverage over me, since I owned the company. When he left, we bought those assets from him. Seriously, I wish him the best and with that it hadn’t ended this way, but it was the right call.

Changing The Team Part 2 🙂

Photo by: Marcin CzerwinskiAt a dinner after WordCamp Pittsburgh I asked Devin Walker, lead developer for WordImpress of Give fame, if he could imagine doing his job as lead developer and doing the math on their budget and physically making sure the bills were paid. He laughed politely at me when I told him that’s what I was doing until recently.

It’s well known that I do too much and I enjoy working on a lot of things. But I also know that too many decisions in a day is mentally fatiguing and it is essential to stick to what you’re good at and find someone who can handle what you’re not good at.

In that post, I also announced that we had merged all of our operations under one umbrella, called Caldera Labs, and that it would be managed by Christie Chirinos. This has gone incredibly well.

Until May of this year, I never received a regular paycheck. Previously, I was living month to month and so was the business. Neither had a reasonable idea of what next month had. This had a pretty strong affect on my stress level.

Now I get a paycheck, the business’ books are in order and we have a budget. These things lead to not just less stress, but the ability to effectively manage the ups and downs in month to month revenue.

At WordCamp US when Christie and I sat down to discuss goals for early 2016, she made me start with not just what I wanted to do, but why I couldn’t do it. She’s been working since on removing the barriers that are surmountable and reminding me to be patient with what can’t be changed yet.

At that point I began to suspect that Christie is doing, on a higher level, is going through the business and identifying inefficiencies and systemic problems and addressing them when solutions are possible.

That goes hand in hand with being strategic about what we do and what we plan to do next. My biggest goal for this year was to stop running a business based on putting out fires and building shit just beacuse it would be fun.

Look, I think that being crazy is in my job description. “Let’s build a WordPress form builder, there are tons of well-loved competitors that are established and years ahead of us” is a crazy pitch for a business. What we’re doing is hard AF, but that’s what makes it fun for me. Also, it’s what sets us up for where we are going.

My strength is seeing how to put things together and what’s wrong with how systems are assembled. It’s a great skill set for a programmer and a product designer. Not a great skill set for running a business.

This part of me is why I’m good at what I do, but it can create bad feedback loops if I’m not patient. My personal growth this year, has been about getting better at focusing on changing the things I can change, accept the things I can not, and find the wisdom to know the difference between the two.

Becoming more strategic and intentional about the business has taught me, as a developer about dealing with technical debt. You don’t just start with the problems that are easiest to fix or those that have the biggest ROI in terms of getting them fixed. You have to evaluate what systems that are badly in debt touch which systems and what their technical debt it. That’s where you start. I learned this from watching Christie add prioritization and structure to our business, which in of itself was independently useful.

I know have a strategic partner who believes in this plan, and sees many ways to get to some version of the goal. That’s super important. I’m lucky to have so many people to call on for help, and to talk things through with, but having someone focused on co-developing that strategy and executing it is huge for me.

When I read Pippin’s year in reviews and he talks about how much better AffilateWP is doing, in less time, than anything else he did, I’m not just happy for Pippin and looking to see what lessons he learned can apply to us. I’m also reminding myself that he couldn’t have had that success without years of developing his team and his process.

So I’m learning to be patient, but I also have a ton more time to work on things. It’s seriously amazing to me that contracts can get negotiated, signed and invoices sent with little involvement from me.

These changes have taken longer than I wanted, and took a lot more work then I can imagine.  But, the percentage of time I spend doing what I want to do (and having that align with the company’s goals) vs doing what I don’t want to do, but have to do, because it’s necessary for the company has also improved dramatically.

Growing The Team In 2017 Part 3: Maybe You

When Christie started, Jason from Postmatic told me to be patient. He reminded me that I was better at running our business than her, by virtue of experience. But, my belief was that by nature of her skills, she could get better at it then me if I was patient and supportive.

Jason was right, and it was an important reminder, because patience isn’t one of my virtues. I’m trying to keep this in mind, as a major goal for 2017 is to grow the team even more. Right now that doesn’t mean partner-level or even leadership-type positions, though we will probably be looking for a lead UI developer and a marketing director later on in the year.

Bringing Christie on was like getting a new developer as it greatly increased the amount of time I could spend writing code. We got through last year with me handling almost all support and development and contracting out development work.

We specifically contracted out development work that required skills I don’t have. This was great as it reduced my stress-level and increased the quality of the work.

But, we’ve been relying on short-term agreements per project from friends who are talented, but busy. We’re currently working through the interview, trial and hire process for a few jobs. It’s not an easy process.

Training and evaluating new people is way harder then just doing their jobs myself. But that’s a long term investment, as I can’t keep doing everything and the more other people handle support and bug fixes, the more I can work on Caldera Forms and the larger Caldera/ Ingot road-map (spoiler alert, its the same roadmap.)

If you’re interested in working with us, we’re going to be very interested in talking with people who are interested in starting with us as a junior developer and support person. That’s where I started at Pods, and it was the most amazing learning experience. And I literally wouldn’t be here today with out that.

If helping our users out, while improving our product and learning from me sounds fun — get in touch.

Growing Beyond My Brain

Photo by: petradrAt WordCamp US we had a running joke about being a “grown up company.” The fact of the matter is this year we really did grow up. Even if part of that was acting sillier than we ever did.

On one hand we know have our books in order, a formal budget as well as an accountant and lawyer. On the other hand, DMing my friend Michal and asking him to put our logo on a taco was a real business man thing I did this year.

After WCUS Taco Club and the WordCamp US, I was waiting for an Uber to take me and my friend Steve to the airport, Christie and I talked about car accidents we’d been in. On the plane ride home I started thinking about what happens to my grown up company if I get hit by a truck again. Because, that’s a thing that happened to me at time, I couldn’t use a computer for 2 months while my shattered collarbone healed.

The point here isn’t that you need emergency plans for your business. But that is a thing we have now. The point is that by necessity our business started out as being mainly run by me, and me alone. As a result so much of the knowledge necessary to work for Caldera is in my head.

For 2017, we’re growing the team and the product and that’s going to require getting more of that knowledge into documentation and other people’s minds. That’s hard AF. This is an incredible challenge that I only recently realized the scope of.

Whenever someone asks us a question, it’s faster for me to answer it then train someone to answer those kinds of questions. It’s faster for me to keep using some hack to fix a problem then to fix it for real in away anyone can use.

I see Marc Benzakein from ServerPress a few times a year at WordCamps and we talk a lot about growing my business. One thing that always comes up is getting more people to associate Josh with Caldera. This goal goes hand in had with getting people to see Caldera as more than just Josh. While that second part is true, to make it efficient, we need to work on documenting our processes better, and better team member onboarding.

In July I presented at WPCampus, the same weekend that Christie presented at WordCamp NYC. Caldera had never been in two places at the same time like that and it was something I was intensely excited about and proud of. Also a little jealous beacuse she got to speak at the UN…

No one should be as obsessed with this business as I am. It’s an intense level of obsession, and I hope that passion shows in everything we do. Not to say Christie isn’t obsessed with this too, but she didn’t build it and people we hire to help out with development and support sure didn’t.

Our next challenge is making sure that the passion for the product shows in every other team member and is backed by knowledge of the product.

Branding

CalderaWP WapuuWhen Caldera started, I didn’t think of Caldera Forms as a big part of our plans. I felt like it was a part of what we would create. For example, one of our launch products Easy Pods, uses Caldera Forms to create search forms for Pods content.

We’ve made a lot of different things, but nothing has taken off like Caldera Forms. We started the year at 10,000+ active installs of Caldera Forms and ended it  at 40,000+.

Passing 40,000 installs in late November was huge milestone and it happened right before we pulled the trigger on a site relaunch. The old site was at CalderaWP dot com and tried to present multiple product lines equally. That site was built for a different company than we ended up having. The more I hacked on it to make Caldera Forms more prevelant the weirder it got.

So, last fall I through it out and started over from scratch. In December, we relaunched the site as Caldera Forms dot com. It’s now way more focused. We also added a new build your own bundle feature at the end of the year to respond to concerns from users that they wanted to choose which add-ons went into our lowest priced bundle, instead of the 5 we chose form them.

Building the new site was super time consuming, and we saw a short term drop in sales as we ironed out bugs, and dealt with some problems in search results. But it seems to have picked back up and complaints about the usability of the site or problems finding add-ons or documentation have dropped significantly.

Adding that bundle builder, is the first step of moving towards a Caldera Forms driven eCommerce interface on the site. The content management for products and software licensing will still be managed by Easy Digital Downloads, but the interface will more and more be Caldera Forms.

In addition, we will be making use new tools built on top of Caldera Forms, Ingot and Easy Digital Downloads that I are being developed first for site and then will be externalized as products. I’m really excited about what we’re budiling to improve selling digital products and look forward to showing them off soon.

This kind of dog fooding has been great. I’m trying to take an Amazon-like approach to building everything as a service that can be turned into a product as needed. It’s a bit of a tough balancing act as when I build stuff for our site, I don’t need a UI, and I don’t have a ton of time.

But this forces me to build software with proper architecture from the start. If I can write code that can take its configuration as a dependency, it doesn’t matter if that configuration starts hard-coded. If and when the internal tools I’m building now become products, I can easily add Caldera Forms processors, REST API endpoints, and/ or a CLI for end-users to configure them.

Missed Goal: Teach More

I love to teach. Caldera has from day one, had a goal of providing WordPress plugins and WordPress. One of my huge goals for 2016 was to write more, teach more and contribute to WordPress core more. I wanted to release several new courses.

I released a REST API course in January and thought it would be the first of many I’d do in the year. We held some workshops in September, which were recorded. I loved teaching those and want to do more. BTW fun fact — for a reasonable fee I will come to your city and teach WordPress development workshops to your company or meetup group. For an extra fee, I’ll bring Carl.

The workshop video is edited and I’m going to do some re-recording this month to fill some gaps. I’m really excited to get this course out there and to really make Caldera Learn a great resource for those looking to level up their WordPress development and satisfy my need to teach others. Also, it should be another good revenue source, that will help us grow our team further.

I want to say a special thanks to Ryan Sullivan. He made the workshops possible by sponsoring them in the name of his company WPSiteCare and the conference he organizes LoopConf. We needed sponsorship money and Ryan is super generous and I’m sure he sees a good ROI in having me say nice things about WPSiteCare, which I don’t mind doing as they have an awesome product, that we recommend all the time.

I was a contributor to all three major releases of WordPress in 2016, which felt good. I didn’t do a ton of work on core. I wish I had done more. A patch or two per release is not particularly time consuming. I hope to do more in 2017, and I think that as we work to create more margin in the business that will be great.

Caldera Forms

Caldera Forms Globe LogoThe website project I discussed earlier was long-overdue, our old site was terrible. I was OK with that for awhile, as I was actually trying to slow down our growth in early 2016. In later 2015 people started to really use Caldera Forms. In 2016 we had 180,000 downloads. We have slightly over 230,000 downloads total as of now. That gives you an idea of how big 2016 was for us.

That’s awesome, but going from 1,000 to 10,000 active installs exposed a lot of problems with Caldera Forms. We spent a ton of time in late 2015 and early 2016 fixing the kind of problems you don’t find until you get a real user base. We stopped adding new features and just focused on making what we had be more reliable.

Getting through that wasn’t easy, but I grew a ton as a developer, and the product was well postioned for the rest of 2016 as we went from 10,000 to 40,000 installs while decreasing the number of support tickets and solved most email related issues.

Serious pro tip: setup DKIM and SPF records for your domain and use a transactional email service. If your contact form submissions are going to spam, your DNS is probably not setup right. You can fix it in 10 minutes.

I got into WordPress while I was in grad school at Goddard College, a small hippie college in Plainfield, Vermont. Plainfield, Vermont also happens to be — until recently — the home of Jason from Postmatic. This is purely coincidental, Chris Lema introduced us.

In May of this year, I spent part of a week working out of Jason’s offices in Plainfield, which was a great time. We talked a lot about Caldera Forms.  At the time I was really excited that we had a solid plugin that worked. But Jason opened up a WordPress site and showed me what my next “what’s wrong” was: new user experience.

We call Caldera Forms “A Different Kind Of WordPress Form Builder.” Many of our users are new to WordPress, but others are trying us out after using other form builders. Last time I checked the stats, Contact Form 7 was the 3th most common plugin to be installed on a site using Caldera Forms — that’s behind Aksimet and Yoast SEO. Getting people passed their existing expectations of what a form builder can do is not easy.

Caldera Forms 1.4 started with that talk with Jason and running his feedback by other developers and users. In that release, we emphasized form templates over creating forms from scratch, changed a lot of our verbiage, and added a lot of context clues to the form layout builder.

Getting users to start from a template helped the form builder teach itself to users. No amount of documentation, which we also improved, including a new getting started guide, can beat that. Still some, users will start with a blan

In his Caldera Forms webinar for iThemes Training, Benjamin Bradley said he appreciated that the Add Field button was blinking when the form had no fields. This was pretty great vindication for me, as making that button “pulsate in order to draw the user in” was one of my wackier ideas I had, but like Taco Club, it worked out pretty well I think.

It was very liberating to refine things that worked, but could be better instead of just putting out fires.

While Caldera Forms 1.4 was our only major release in 2016, we did add a lot of new incremental improvements to Caldera Forms, and some new features. These include magic sync for fields, SendGrid integration, improvements to conditional logic as well as hidden fields, better file upload fields, field duplication, and a ton of new features as well as better infrastructure for add-ons.

Most exciting new features came in add-ons. We released recurring payments via BrainTree and Authorize.net. We added ConvertKit and Aweber add-ons for email marketing. We also added a form translations add-on and several other cool new add-ons.

Our Form to PDF service is our first SaaS product, and my first time launching a customer-facing app in Laravel, which I’m loving working with. In 2016 look for Caldera Space — we’re too cool for the cloud, we went to space — to grow even more cool new features to make Caldera Forms better.

After 1.4 came out, we split our Git development between a 1.4.x branch and 1.5.x branch. The idea was new features went in the 1.5.x branch and bug fixes went into 1.4.x. On one hand this has been great as we put out a minor update for Caldera Forms roughly once a month with small bug fixes and occasional small new features.

On the other hand, version 1.5 is full of big, exciting new features. Some of them are interdependent on others and it makes sense to work on them in isolation without worrying about breaking the branch we count on for bug fixes.

But, there are some really cool new features that were relatively simple, that could have already been in user’s hands like conditional recipients and scroll to top after submit. I think I’ll revamp this approach once 1.5 is done, and it is almost done. I like having a safe space to break stuff and rebuild it while developing internal APIs for multiple features, but I also with I had finished 1.5 already.

More importantly Caldera Forms 1.5 is going to be hella awesome. It’s got a 9 new field types, a new front-end entry viewer powered by the WordPress REST API, new default processors and more. I also removed all the inline JavaScript rendered in post content. This will reduce bugs with themes that do strange things to post content, and also allowed me to improve the efficiency of our front-end JavaScript a bit. We’re also loading less front-end JavaScript and CSS, so performance will be better.

Last time I searched the source  for “@since 1.5.0” I got over 220 results. For everyone of these new features I approached the work with a “no new technical debt perspective.” This meant new internal APIs and formalizing conventions into programmatic rules. As result the time spent developing new features was also time spent improving the quality of the code and therefore stability of the system.

Pricing Changes

strawberriesAt WordCamp San Diego I sat down with Pippin to talk about our growth and what we could do to improve it. He asked me what our average cost per sale was. I didn’t know, but he told me it was a safe guess that it wasn’t great.

I wrote a quick plugin to do the math and he was totally right. Increasing our average cost per sale has been a huge focus. BTW I later found Scott Bollinger’s EDD Metrics plugin which is great for tracking these types of numbers.

Soon after we launched bundles, which has gone well, but we’re still seeing too many single add-on purchases. When we launched bundles, the single add-on pages on our old site were made to highlight single site licenses or bundles.

That didn’t go well as it hid multi-site licenses making our add-ons seem way more expensive. For example, it wasn’t obvious that you could get a $89 five site licnese for our MailChimp license, it seemed like you would need $250 worth of single site licenses, which if true wouldn’t be fair.

In December we launched our 3 add-ons for $79, 5 add-ons for $139 bundle builder. This required building a cool new Caldera Forms integration for Easy Digital Downloads. I also modified the site to make the options more clear. It’s too early to say if this is working, but early numbers for January look good.

Taco Club

WordCamp US Taco Club Caldera Forms LogoOK, this is getting really long, but I have to mention WordCamp US Taco Club, beacuse that’s a very real thing that happened this year the night before WordCamp US. We had more than 30 people over to our AirBnB for a taco party.

This event was great, we got to meet Caldera Forms users, make new friends, see old friends and enjoy a taco bar together. It was great fun, and on a suggestion from our friend Kyle, we made an epic WordCamp Mannequin Challenge.

I look forward to having more fun, and non-exclusive events around WordCamps this year. They might not all be Taco-flavored, but I hope their corresponding limited edition stickers are as cool.

Personal Life

One thing I strived for this year was to get out of bed earlier and limit my work hours a bit. Working 100 hour weeks definitely took a bit of a toll on my health and ability to relate to other human beings.

That said, I’ve also come to peace with the fact that my work is my life, beacuse I love what I do. I know I’m supposed to strive for better work/ life balance. I definitely spent more time reading and otherwise indulging in my passion for science-fiction. But, I’m OK with the long hours and I’ve never found anything more fulfilling than what I’m doing now.

In sadder news, my cat Shy died in 2016. She had been with my wife and I since we moved in together in 2001. When we moved to Florida she claimed my office in our new office as her own. I spent most of those long work hours with her sleeping on my lap, on my desk or on the futon behind me.

It was definitely her time, but I miss her.

On a happier note, our other cat Gus has really thrived as an only cat. He’s closer with us and he’s actually made friends with our dog Josie. They cuddle together sometimes, which is super cute.

Josie is doing great and was even selected as our vet’s pet of the month for December. I’ve never been prouder of her. She’s a great doggo.

As I said earlier, this was the first year that I got a regular paycheck for an extended period of time. I also turned 34 this year, so it shouldn’t come as shock that my personal finances are not great. Nothing too terrible, but my wife and I spent a lot of money this year on paying down debts, which is annoying, but important.

At the end of last year my wife bought me a Chemex for Christmas. Coffee optimization has become a big passion of mine. Thanks to having a great way to brew coffee — you’re not still using a machine are you? — and the fine work that the people of Lucky Goat Coffee do, I’m drinking better coffee and coffee has become a shared experience — this thing takes awhile, but it’s worth it — we do most days together.

2017 Goals

Photo by: Ales KrivecOK, so now I need to stop before this turns into a book, though I do wish I could tell some more stories. I have so many great stories, like the time Rich Robinkoff talked me into going to WordCamp NEO to talk about the importance of stories.

I haven’t talked about everything. I’ve barely touched the 10 or so WordCamps (I’m counting WPCampus) that I attended. Nor have I talked about some of the cool projects I’ve been a part of — for example I got to work on Cookbook a very cool new recipe plugin from WPSiteCare. I’ve glossed over Ingot, beacuse I’m annoyed I didn’t get to work on the core plugin this year, but I’m excited for the evolution of that product line, which is underway.

But it’s time to go, so here’s what I want to do in 2017:

  • Triple user base and revenue from Caldera Forms
  • Convert all checkout and license management forms on our wsbsite to Caldera Forms and externalize that as products.
  • Improve the analytics and marketing automation tools we use for Caldera Forms and externalize those as products. I gave a preview of some of that at WordCamp US and am pretty excited about what come next.
  • Release the course we’re working on now, create shorter content to use for lead generation to help sell the course and test new tools discussed above.
  • Grow the team.

wordpress-logo-simplified-rgbOk, that was a lot, but it was a huge year. If you’re reading to the end — or just skipped here — the shortest version is I’m a lot happier with my professional life now then this time last year. That’s awesome. A ton of people have had a lot to do with that and I hope that everyone of them and everyone in the WordPress community knows how much I appreciate them for being so awesome.