For the last few years many people, including me, have been talking about how WordPress has evolved to where it can power applications, including SaaS platforms. One of the reasons for this is the WordPress REST API. And while I completely agree with this, one of the reasons I think it’s a great choice is that we have several full-featured eCommerce solutions. I wrote about implementing my own subscription billing system using Laravel Cashier and comparing it to working with a WordPress eCommerce platform a while ago. Since then I’ve thought alot about what an eCommerce system like WooCommerce or […]
Common WordPress Form Mistakes That Are Hurting Your Conversions
This week I was a guest on the Press This! Podcast to talk about improving contact forms. I’ve spent the last two years building a WordPress form builder plugin, Caldera Forms, and talking with users about their forms, so this is something I think about a lot. In our discussion, we talked about keeping forms simple, what questions people should ask themselves but don’t, and the importance of planning. You can listen to the full episode here. I wanted to share some things that stood out for me in the conversation that will help you improve the conversion rate of your WordPress […]
Implementing the Repository Pattern in WordPress
One of the many advantages of object-oriented programing is that it allows us to write more descriptive code — code that by design has to be used a specific way. This helps move us from conventions to programmed rules in our code. That’s good, but it can complicate things. Arrays and standard class objects can hold any data, which is super-flexible but also leads to poorly-formed systems. The repository pattern gives us a way to have objects that can contain arbitrary data, but also enforce rules. I’ve written about other design patterns before. Like any other software design principle, following […]
How to use The Decorator Pattern in PHP
As we progress in learning object-oriented programming (OOP) as PHP developers, the uses of certain established patterns become more important, such as one that I’v been using lately, the decorator pattern. On a textbook level, the decorator pattern lets us change a class when it runs, while extending a class allows us to change it when it is designed. That difference seems trivial, but it has important consequences on the readability and scalability of your applications. The decorator pattern is a different way of adding functionality to a class. Instead of extending it using inheritance — class A extends class B […]
Four Strategies for Adding Custom Endpoints to your WordPress Site
In the last 14 years, WordPress has grown into a fully flexible content management system. However, with that growth comes the need to add non-standard endpoints to our workflow. Because these endpoints aren’t covered by the theme template hierarchy, wp-admin, or the default notes of the WordPress REST API, they have to be created from scratch. In this article, I will cover common strategies for dealing with these situations such as adding custom rewrite rules, custom REST API endpoints to give an idea of the variety of methods that exist. Then I will look at how you can use the […]
Questions & Concerns From My First Impression of the WordPress Gutenberg Editor
The new Gutenberg Editor, which is slated for inclusion in WordPress 5.0, aims to dramatically improve the editor experience in WordPress by adding easy-to-use, dynamic content blocks. While beautiful, and definitely something I could see myself creating content in, I worry about what the new editor could mean for the future of WordPress. WordPress as a Content Management System (CMS) originated as a blogging platform but has grown far beyond that, today dominating 28 percent of the entire internet. In a post sharing his first experience with the Gutenberg Editor, Chris Lema asks an important question: “Didn’t we want to […]
Creating A WordPress Settings Page Using the WordPress REST API
One of the many great uses for the WordPress REST API is improving your plugin or theme settings screens. Once you add custom REST API endpoints, getting saved settings via AJAX and saving it via AJAX — IE with no additional page loads — is simpler. Using the WordPress REST API instead of admin-ajax is not only more performant but also lets WordPress core do most of the heavy lifting in terms of sanitization and validation. In this article, we will walk through each of the steps to create a settings form page and process that form using the WordPress […]
Where Should You Put WordPress Hooks? It Depends
For as long as I’ve been a WordPress developer, I’ve had a lot of people ask “where should I add my WordPress hooks?” Yes, this is a sign I need more friends who are not WordPress developers, but that’s not the point of this article. Of course, there is no right answer. While ultimately, the answer depends on a variety of things, I want to share a few different patterns and discuss pros and cons of each. That said, I think that these discussions miss an important point: The WordPress Plugins API — aka hooks — is an API that […]
There’s No Excuse For Bad Site Accessibility
Recently Automattic hosted an online conference on design and exclusion. Instead of calling it a conference on inclusive design, they flipped the idea around to focus on what conscious and unconscious decisions lead to the systematic exclusion of people. Inclusive design is about a lot more than the web and it’s about a lot more than accessibility. But, as web developers, accessibility – making sure that the HTML we generate can be used by everyone properly – is an important topic. So, I wanted to share four attitudes I think leads to us skipping over this important part of our […]
WordPress Apps In The WordPress Platform Era
About three years ago, I wrote a post for Torque titled “Yes, You Really Can Use WordPress To Build Apps.” In 2014, this was an emerging idea, but now it’s done quite often. The WordPress REST API, as well as a shift in how we think about WordPress, has contributed to this change. At LoopConf this year, Ryan McCue, the co-lead developer of the WordPress REST API gave a talk called “Next Generation WordPress.” He said that we’ve gone from the WordPress as a blog, to the WordPress as a CMS, to the WordPress as a platform era. It’s a […]
No Comments