Using Coding Standards with WordPress

I write a fair amount about coding standards with WordPress and the importance that I believe they have for individuals, teams, and with working with the core application, that being WordPress itself.

Coding Standards with WordPress: The WordPress Coding Standards

In the last year or so, I’ve moved away from working primarily with the WordPress Coding Standards and have begun to use PHP Standard Recommendations for coding.

Coding Standards with WordPress: PSR

Note that I did not say I abandoned the WordPress Coding Standards nor that I elevate the PSR recommendations above them, but I have reasons for when I use each. And for anyone working with WordPress-based projects, I think it’s important to recognize when it’s appropriate to use each.

And that’s the purposes of this post.

Read More

WordPress Widgets: An Object-Oriented Approach

Years ago, I created the WordPress Widget Boilerplate aiming to be the following:

An organized, maintainable boilerplate for building widgets using WordPress best practices.

Since then, not much has changed regarding the Widgets API (which we’ll look at later in this post), but what I consider to be “best practices” has changed. Further, the degree to which I think this API is a solid example of introductory object-oriented programming in WordPress is high.

WordPress Widgets: The Widgets Boilerplate

It’s not because it uses a lot of object-oriented principles, it’s not because it uses modern standards (at least as far as modern PHP is concerned), but because it does use a few things that help us to recognize a few, say, signals regarding object-oriented programming in WordPress.

And this is something that shouldn’t be understated: If you’re looking for examples of object-oriented programming in WordPress, look for APIs that employ it.

Further, if you’re looking for ways to gauge you’re own level of evaluating a piece of code (let alone a code base) for the use of classes and some of the more advanced features of OOP, then why not have some sort of a litmus test to see how you’re doing?

WordPress Widgets: The Widgets API

And the Widgets API does just that.

Read More

What Content is Next for Site Members?

When I set out to create a members-only section of my website, it was to do two things:

  1. provide members with access to high-quality articles for how to approach object-oriented programming in WordPress,
  2. grants discounts to other products and services that I found useful via friends, acquaintances and other services.

Periodically, I do get questions about the content that I’ve produced thus far. If you’re interested in reading the full, detailed list, you can see them here.

Content for Site Members: Members Only Content

But the gist of what I have so far is here:

And that’s the content that I have for site members thus far. But that doesn’t answer the question of what’s next (nor does it answer the question as to why I’ve laid things out the way that I have), so I thought I’d take a post to do that.

Read More

An Example of Retrieving Namespaced Properties in PHP

When you write enough code that communicates with third-party APIs, you’re more than likely going to find yourself communicating with an XML-based API.

And say what you will about it: Some like it, some don’t. But they exist, and they are thus going to be a necessary part of your development at some point.

If the API is well-designed, it will likely use namespaces for different types of requests and responses. And when you’re writing the client for said API, then you’re likely going to need to go about retrieving namespaced properties.

It’s easy to do it, but it’s not immediately obvious. So in this post, I’m going to walk through an example of how to do just that.

Read More

A Look at We’ve Got Your Back by Freemius

As someone who continues to participate in the WordPress economy, specifically in developing custom solutions for others, and as someone with many friends and acquaintances who are also developers, I know that one of the hardest things that we can do (aside from naming things) is branding and marketing a product or business.

I’ve written about Freemius a few times in the past (with the most visited post being All About Freemius for WordPress).

We've Got Your Back by Freemius

As such, I’m a fan of keeping up with what they are doing. Recently, they released a We Got Your Back program that aims to provide a solution to the problem marketing, branding, and so on of products those of us in WordPress build and strive to provide in WordPress.

Read More