One response on “Tom McFarlin: Namespaces, Autoloading, and Improving Plugin Architecture

  1. gardenguymsp's avatar yogaman5020

    Good talk about important features available in later versions of PHP. Relevant for WP plugin & theme devs as WP moves to PHP 7+ in 2019. Hopefully, plugin developers can move away from prefixing function & method names and use namespacing instead. Makes code so much more readable.

Leave a reply to yogaman5020 Cancel reply

Published

March 24, 2017

Imagine, for a moment, the ability to add a new class to your WordPress plugin and not have to worry about adding a new include statement and having the ability to organize the class into a pre-defined package structure.

Sounds nice, right?

Unfortunately, one of the problems that WordPress plugins developers face is having to work with older versions of PHP. But it’s really not as bad as you may think.

Although we sometimes, we sometimes have the ability to use newer versions of PHP (and that’s great), it doesn’t mean we have to forgo poor development practices.

See, depending on the paradigm with which we build our projects (namely, object-oriented programming), we have the ability to take a lot of redundant code out of our plugins.

Furthermore, we have the ability to more easily organize our code at both a conceptual level and at a virtual level.

In this presentation, I walk everyone through namespaces and autoloading, explain how they work, why they are beneficial, and then will show sample example code on how it works. I’ll also provide a downloadable plugin that they can use to study.

Presentation Slides »

Rate this:

Event

WordCamp Atlanta 2017 43

Speakers

Tom McFarlin 7

Tags

Autoloading 1
Namespaces 1
Plugin Architecture 3

Language

English 11401

Download
MP4: Low, Med, High, Original
OGG: Low
Subtitles
Subtitle this video →