Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 388 of 423)

Introduction To WordPress Unit Testing

WordPress Unit Testing

Unit Testing (or other testing methodologies) is one of those things that’s often relegated to larger software applications or enterprise-level projects and seems to be often overlooked in the context of WordPress.

Why is that?

WordPress is a web application and the tools, themes, plugins, and extensions that we build are software that run on top of said platform and the platform as well as the certain themes and/or plugins can be used anywhere from just a few hundred people up to several million people.

In some cases, I think this qualifies it as enterprise-grade. Regardless, WordPress should not be excluded from the best practices in software development. As such, I’m contributing a series of articles on Envato that is meant to help you get started with WordPress unit testing.

It’s targeted at beginners but aims to lay a foundation on which more experienced developers can build. Additionally, I’m providing working examples of plugins and themes both of which have been built using unit tests:

  1. What Is Unit Testing?
  2. Building a Testable Plugin
  3. Building Testable Themes

Throughout the series, I walk you through how to setup your local development environment to include both PHPUnit and the WordPress Testing framework along with giving a background of unit testing, what it is, why it matters, how it can improve plugin architecture and theme development.

All of the code is also available on my GitHub page:

Configure Coda 2 To Connect MySQL

If you’ve recently installed or upgraded to Coda 2, are using MAMP to manage your development stack, and are looking to use the built-in MySQL frontend, here’s what you need to do in order to connect to MySQL in Coda 2.

Coda 2 and MAMP MySQL Socket

Setting up a connection between your project and its database is easy. It really only takes a single step though it assumes you know the username and password to your local database (which I can’t imagine why you wouldn’t know it :).

Continue reading

WordPress Ajax API Example

This plugin is no longer maintained; however, you can still view the source on GitHub.

As a developer, one of the challenges of working with WordPress as a platform is that finding information isn’t always easy. Sure, the Codex is a fantastic resource, but it lacks in a few areas.

On the other hand, it’s relatively easy to google for examples on how to do almost anything you’d like with WordPress, but these examples can often be of poor quality – just because something works doesn’t mean that it’s done correctly.

As I begin to shift my focus to talking more about WordPress development, I hope to be able to share a few thoughts on how to achieve certain tasks using the best practices with the WordPress API.

In recent weeks, I’ve been doing a fair amount of work using the WordPress Ajax API, so that seemed like a good place to start.

Continue reading

PHPUnit, WordPress, and MAMP

I’ve begun using PHPUnit, WordPress, and MAMP to introduce unit testing to my theme and plugin development. Obviously, this requires an installation of PHPUnit and the WordPress testing framework. Because I use MAMP for local development, I had to do some additional customization to get the frameworks setup.

Here are the steps necessary to install PHPUnit and the WordPress Tests on Mac OS X using MAMP:

Continue reading

My Career, Software Engineering, and WordPress

When I graduated school, I had one objective in mind: obtain a development position where I could apply software engineering principles in the context of web application development.

Then I made the jump to self-employment at the end of 2010 and was dividing my time between two things: serving as lead developer at 8BIT and developing and sites and software for others out of my own business.

Initially, I was doing work ranging anything from vanilla PHP projects, Ruby on Rails projects, some typical client-side projects, and custom JavaScript work.

Achievement Unlocked

As time as passed, I’ve ended up spending more and more time working exclusively with WordPress so much so that I’m currently doing nothing but WordPress-based projects (save for a single Rails application).

Continue reading

« Older posts Newer posts »

© 2024 Tom McFarlin

Theme by Anders NorenUp ↑