![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F10%2Fshutterstock_394746307.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F10%2Fshutterstock_479578177.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F10%2Fshutterstock_402767335.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F09%2Fshutterstock_533760538.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F09%2Fshutterstock_154716275.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F09%2Fshutterstock_566918326.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F09%2Fshutterstock_571012525.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F08%2FScreen-Shot-2017-08-31-at-10.png&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F08%2Fshutterstock_246906484.jpg&w=1080&q=75)
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 […]
![[object Object]](/_next/image?url=https%3A%2F%2Ftorquemag.io%2Fwp-content%2Fuploads%2F2017%2F08%2Fshutterstock_603923945.jpg&w=1080&q=75)
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 […]