Like most people in the WordPress world, I have no formal training with programming. My educational background is explicitly transdisciplinary. As a result, I learned a lot about how to learn things. This has helped me a lot with educating myself in web development. I’ve written before about how teaching is part of my learning process. But, I have not written about the earlier part of that process — actually acquiring and practicing the skill. This article is more about process than anything. This is something important to me because I had a lot of trouble learning to read when […]
Logging WordPress Bugs with Wonolog
All developers spend a lot of time debugging code. The thing that makes this frustrating is that it isn’t always obvious what the exact problem is, and people are left guessing. As someone who provides support for WordPress users for all experience levels, I hate saying “something is wrong, we’re going to have to do some work to find out what something means” but too often that’s what I have to do. This has put me on a mission to find better ways to discover these problems fast. In this article I want to share some cool stuff we built […]
Using Pimple as a Service Container in WordPress Development
In my last article for Torque, I talked about the advantages of using a container in your WordPress plugin or app. I walked through the process of designing a container from scratch to manage three classes Twitter – Feed, Account, and Client. This week I’m going to go over very similar concepts, but I will talk more about structuring a plugin around the container. Also, we will use Pimple – an excellent, and fairly standard composer package — for the container instead of rolling our own. A Look At What We Are Improving Here is where we left off last […]
Using A Service Container To Improve Your WordPress Code
In this article, the first in a series, I will introduce the concept of a container and show you how to build and implement a very simple, but limited container. This article illustrates the concept using a singleton, which is not optimal but is simple. Note, this example code will start with using a singleton. I know this isn’t the best practice but it will make it easy to teach about containers. In the end, I will remove the singleton pattern from the container class as a way of explaining the true problem with singletons. Getting Started With Containers Think […]
Embracing the Microservice Architecture Pattern With WordPress
As WordPress has matured, more people are using it as an application platform. As we move towards Matt Mullenweg’s vision of WordPress as the open source OS of the web I think it’s important to question some of our conceptions of the way we tend to use WordPress. Traditionally a WordPress site is executed as a single monolithic unit. This is counter to a growing trend in web development towards microservices — many small single-purpose applications configured to act as one unit. For example, consider static HTML caching. If you are following the monolithic approach you would add a plugin […]
How, Not When, Blockchain Technology Will Change WordPress
Bitcoin — the first decentralized currency — has been around for over eight years now. In the past, I was dismissive of it and other cryptocurrencies. The fact that cryptocurrency like Bitcoin has the potential to radically reform banking is not lost on me but is way outside of the scope of this article. Yes, that’s exciting to me. No, I don’t think crypto is a magical cure for what is wrong with global capitalism, but that’s really not the point here. When I started looking into things further, and I’m super excited about the technology behind Bitcoin, blockchain. What […]
A Guide to Async HTTP Requests for WordPress
One thing that makes working with PHP simple is that it is serial — each line of code is executed in order. This is also a limitation when we need to build a program that interacts with multiple APIs or other services since HTTP requests take time and can block page rendering. I discussed this problem in my article on combining data from multiple REST API endpoints using PHP. My best advice for avoiding this problem is using caching or JavaScript instead. One great thing about JavaScript is that there are many simple ways to do asynchronous HTTP requests, such […]
How Wapuu Created A Cultural Center for WordPress
The first time I went to a WordCamp I knew absolutely no one there and that made me a bit nervous, to say the least. I didn’t really know what to expect. I’d been to a few really big tradeshows and some educational conferences, and expected some hybrid of that, which isn’t too far off, but what I didn’t expect was the community. I’ve been to a lot of WordCamps since that first one and while the basic format has stayed the same, one change I’ve loved is how Wapuu, the mascot for WordPress has become a part of pretty […]
How To Query Multiple Post Types With One Request To The WordPress REST API
One controversial design decision in the WordPress REST API was to have a separate route for each post type. Some people disagreed as combining multiple post types in one route would have been very useful. As a result, you can’t query for posts of the same post type in the same request. This makes sense in terms of following the REST standard, also, the WordPress REST API is super extensible, so you can change that behavior. I’ll show you how in this article. In this article, I’ll show you how to make the default posts route of the WordPress REST […]
Using VueJS and ES6 In the WordPress Admin
One big opportunity for using JavaScript interfaces with the WordPress REST API is improving WordPress admin and settings screens. I wrote a post for Torque recently on using the REST API and jQuery to build settings screens. It was a good introduction but normally, I would use VueJS. In the future, I’ll write more specifically about how to do that with VueJS, but I’d like to cover two important pain points I’ve dealt with getting to the point where this is my go to approach — compiling ES6 and template creation. I’m a big fan of VueJS for a lot […]
No Comments