Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 391 of 427)

Release Week for Standard For WordPress.org

This week, my startup – 8BIT – will be releasing the third version of our flagship product, Standard For WordPress.org.

In fact, I’ve been running this site on the previews that we’ve been releasing in order to be actively kicking the tires throughout development (John has shared his thoughts on dogfooding, too).

Release Week of Standard For WordPress.org

Over the course of the time that we’ve been building Standard For WordPress.org, the team has undergone a number of internal changes to help us better manage our project, codebase, deadlines, testing procedures, etc all of which I’ll likely discuss in a future post.

Additionally, we’ve partnered with Automattic as well as a few other notable guys in the WordPress community to make sure this release is as solid as possible. Continue reading

Remove JavaScript Tags From WordPress Input Fields

When building custom functionality into WordPress, it’s important to make sure that you’re properly sanitizing data. WordPress provides an array of utility functions for doing this.

But there are times when completely sanitizing the input may be too much. For example, say you’re working on a widget that has a text field and you’re comfortable with allowing the user to input styles and markup but want to remove any JavaScript. Using strip_tags and strip_slashes is overkill, obviously. These would reduce the input into nothing but the raw text.

Here’s a simple way to removing JavaScript tags from input fields while still supporting inline CSS and HTML markup:

Continue reading

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:

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑