In the last article, I walked you through the problem of letting “no go” conditions flow through your code. I showed you how to refactor the code to solve the problem and make the code more readable. In this article, you and I will continue doing a code review and refactoring of the FilterWPQuery in Josh Pollock’s plugin. In Part 3 of Advanced OOP for WordPress, Josh walks you through how he refactored the FilterWPQuery class to make it more testable. Let’s use his latest version of the class for our code review process. <?php namespace CalderaLearn\RestSearch; /** * Class FilterWPQuery * […]
Code Review Part 1: Fixing Design Flaw with the “Return Early” Strategy
While reading Josh Pollock’s first article in his Advanced OOP for WordPress series, I noticed opportunities to improve his code’s quality and performance. So I reached out to him. As a fellow educator, he suggested that I do a code review and then publish my insights in a series of articles here on Torque as a companion to his series. In this Code Quality Review series, I will present one or more code quality opportunities and provide details and insights to help you improve your code. Let’s start with the posts_pre_query method in his FilterWPQuery class: <?php class FilterWPQuery { […]
What is the Optimal Content Length? – Here’s What the Science Says
What is the optimal content length? How long should your blog posts be? What is the ideal word count for SEO? These are questions many would-be bloggers and marketers ask themselves. Obviously many things go into successful content marketing. From choosing the right keywords, to learning to write well, to image optimization. All these are factors in the success of your content. However, content length remains a critical topic, not least because it determines a lot about your overall strategy. Should you write a lot of shorter articles or concentrate on pushing out one massive article per month? Or is […]
Why and How to Increase Dwell Time on Your WordPress Website
Dwell time and how to increase dwell time are often neglected elements of search engine optimization. You, too, probably mostly concentrate on how to get visitors on your site and rarely give a thought about how to keep them there. However, dwell time, the amount of time visitors spend on your site, is an important indicator. Longer dwell time usually indicates a positive user experience. It’s also something search engines take notice of. For that reason, in this post we will dive into the topic of how to increase dwell time on your WordPress site. For that, we will first […]
The Beginner WordPress Developer’s Guide to wp_enqueue
While WordPress is powerful, there are plenty of under-the-hood features that can help you maximize its efficiency. In fact, overlooking inherent functions such as wp_enqueue could even impact your site’s overall effectiveness. If you optimize your themes and plugins correctly, you can improve your site’s performance while enhancing user experience. The wp_enqueue function is a great place to start. This simple integration can prevent issues with your theme when used with other WordPress plugins. In this article, you’ll learn exactly what wp_enqueue is all about, and how it can be used to improve your WordPress projects. Let’s get started! Introducing WordPress’ […]
Why Your eCommerce Store Needs AMPs ASAP
As you probably already know, mobile usage is on the rise. From checking the news to online shopping, mobile has become the easiest and most accessible way to get things done—partly because users can rely on their mobile devices to be available anytime and anywhere, which makes it convenient with our on-the-go lifestyles. People are not only getting more comfortable using their smartphones to do things like shopping, they are also spending more time using them. Just from 2016 to 2017, time spent per day on mobile has reportedly increased by seven minutes, reaching a total 3 hours and 15 […]
Things You Should Know As A Freelancer WordPress Developer In 2018
There are many ways to improve freelance web developer revenue. The holy grail may be hidden somewhere between sales process improvements, creating better proposals, and changing the pitch. Sometimes the key is actually to offer products that do not require pitching at all. Let’s go through a few ways to get noticed and start making money. Drive Toward The Need Changing the way web developers position themselves is an excellent first step on the journey to making more money. The crucial part here is to understand what’s driving customers to purchase. Why do they even want to have a website? […]
How To Create Killer Content And Get Noticed
Quality content is incredibly important for any website whether you’re a travel blogger or a large enterprise company. To grow your brand, you need a way to connect with your audience on a deeper level. This is where a blog comes in. If you don’t have a blog, you are doing something wrong. In order to create a complete digital experience for your viewers, you’ll need to create many touch points by which to reach them. However, once someone comes to your blog they better be reached with really good, quality content, otherwise, they may not take you seriously as […]
How to Reduce HTTP Requests in WordPress (Make Your Website Faster!)
Learning how to reduce HTTP requests in WordPress sounds like a thing only developers need to deal with. However, in reality it concerns anyone who has a website powered by the CMS. Here on Torque, we have written extensively on how to speed up your WordPress website: A Guide to WordPress Speed & the Importance of Cache 14 Ways To Speed Up WordPress And Decrease Page Load Time Simple Yet Proven Ways To Boost Your WordPress Website Speed Reducing HTTP requests is just one piece of that puzzle, yet a very important one. For that reason, this article will deal […]
The Hidden Gems Of WordPress
One of the most frustrating things about WordPress is that parts of the WP Admin are difficult to find – if not outright hidden. That makes getting things done not so easy or intuitive. But as with any application, some elements of the User Interface need to be hidden or obscure for various reasons. Usually, it is because a function or feature is not frequently needed until it is. That’s when the hair pulling begins. Don’t end up hunting around for that WP Admin element as if you’re looking for lost treasure. Here are the most common hidden gems of […]
2 Comments
Join the conversation