Tag Archives: WordPress

Saving WordPress custom post types using an interface

Custom post types are a powerful WordPress functionality. Everyone that works with WordPress long enough ends up using them. A custom post type can be anything. That flexibility is the source of much of its power. When using custom post type, you’re only limited by your imagination (trademark pending).

This flexibility also makes it a great use case for designing an interface. This article will put you in the interface creator seat. Exciting, I know!

As the interface creator, you’re in charge of designing the interface contract. This means that you get to dictate how someone use your interface (insert evil laughter here). It’s not all (evil) roses though.

The job gives you quite a lot of responsibility. This can make it hard for you to know where to start or what to do. Lucky for you, that’s what this article will help you with.

Continue reading Saving WordPress custom post types using an interface

Keeping Your WordPress Safe

The Montr√©al WordPress community held an event this month on¬†WordPress security. The event had a talk followed by a “show and tell” segment. This is the companion article for that talk.

This is an important topic for everyone. Not just for WordPress experts. So it’s great to have a chance to teach the community about it.

The goal of the talk was to give everyone an overview of WordPress security. That includes basic concepts and some recommendations. The recommendations themselves target WordPress users of all skill levels. If you’re an advanced WordPress user, you might not learn as much.

Continue reading Keeping Your WordPress Safe

WordPress for the adventurous: Loading

I’m sure you woke up thinking “I wish I knew more about WordPress loading.”. Ok… maybe not (it’s just me isn’t it?). It’s just not something you deal with every day.

No, plugins and themes make up your days. That’s what you use to build your custom WordPress solutions. There’s no need to know about the internal process that starts up WordPress.

Yet you can’t ignore it once you start building complex WordPress solutions. Or if you plan on distributing a plugin or theme. That changes the dynamic of things.

Your little world with the plugins and themes you know is gone. You’re in the larger (and messier) WordPress world now. That means you have to play nice with everyone else (damn).

Continue reading WordPress for the adventurous: Loading

On becoming a WordPress expert

This all started with a thought experiment about WordPress recruiting. Something I’ve done a fair amount of in the past.

Let’s say I’m looking to hire a WordPress expert. What defines that person as a top tier WordPress developer? What knowledge or characteristics am I looking for?

WordPress powers a large part of the web. It’s also the livelihood for thousands of developers. Those are amazing things, but it also creates problems. One of them is that it’s hard to evaluate your or someone else’s skill level.

So we’re going to look into that. It’s worth noting that there’s no definitive or objective answer to that question. We’re all biased. We have our own opinions on what it means to be an expert.

Continue reading On becoming a WordPress expert

Helping WordPress make friends with the decorator pattern

In some plugin circles (also know as the “cool kids club”), the coolest kid on the block is the wpdb class. Plugins go out of their way to be his friend. Lucky guy (or class)!

One plugin that has to be friends with wpdb is HyperDB. If plugins could talk, it would sound a lot like a scene from kindergarden.

Continue reading Helping WordPress make friends with the decorator pattern

Spying on WordPress with the proxy pattern

In a not so distant future, you’ve grown to be quite the WordPress expert. You work for WSIS (WordPress Security Intelligence Service) as an analyst. You’re given your first field mission.

You have to get in deep with WordPress. You need to get intimate information about a WordPress object. Information even WordPress doesn’t want to give you. You need to gain access without detection. The last thing you need is WordPress to know you’re listening to things.

How would your future self do it? Well, he’d use the proxy pattern (good thing you’re reading this article). The proxy pattern is the equivalent of object-oriented tapping. It’s one way to solve the problem of interacting with a class without it being aware of it.

Let’s look at how it works.

Continue reading Spying on WordPress with the proxy pattern

WordPress for the adventurous: Entry points

To master WordPress, you have to be able to look at it from unusual perspectives. It’s exploring these perspectives that gives you that next level understanding. You’re able to view problems from another angle. This can give you unique insights that affect how you approach problems and design solutions for WordPress.

The angle we’re going to explore in this article is the concept of the entry point. Let’s take a look at how WordPress handles it.

Continue reading WordPress for the adventurous: Entry points

Designing a class: WordPress AJAX handler

Learning object-oriented programming has its fair share of challenges. One of them is the large variety of problems and their solutions. That’s why a lot of solutions revolve around using design patterns.

Sometimes a problem has a clear solution like the WordPress API client. Other times it’s more abstract like how to interact with the plugin API. These abstract problems are a lot harder to define and solve.

Continue reading Designing a class: WordPress AJAX handler

Singletons and their use in WordPress

Today is one of those WordPress days. You’re sitting down at your computer. You’ve got a plugin you want to write. You’ve heard that object-oriented programming is pretty awesome so you want to use it (obviously).

You create your plugin folder. You add your empty “index.php” (right?). You create your “WP_Kickass_Plugin” class in “kickass-plugin.php”. Sweet, you’re in business. Time to get into the meat of things.

Continue reading Singletons and their use in WordPress