Tom McFarlin
Tuts+ Editor, Owner and Lead Developer at Pressware
Tom is a self-employed developer who loves writing, building, and sharing WordPress-based projects. He runs Pressware where he provides WordPress goods and services. You can follow him on Twitter.
  • Code
    Professional WordPress Development: Environments02 environments preview
    In this series, we're taking a look at the various practices that are used in professional WordPress development. In the previous article, we reviewed a set of strategies and reference material that are useful when building themes, plugins, and WordPress-based applications. In this article, we'll take a look at version control and environmental configurations that make it easy to develop, test, and deploy our work to minimize the amount of errors that find their way into final versions of our work.Read More…
  • Code
    Professional WordPress Development: Strategies01 strategies preview
    Working in the WordPress community is both a blessing and a curse. Because of its open source nature, we have a fantastic platform on which to build websites, themes, plugins, and even applications. It's got a smart community around it, rich documentation, and standards that aim to provide the way to write code for it and the way to build tools around it. At the same time, the open source nature of WordPress as well as the languages with which it's built allow anyone to ship their work regardless of if it is up to any kind of standard or uses any kind of best practice. For many users, they're none-the-wiser about what's going on under the hood. If the product works, they're happy. As people who are serious about their craft, we absolutely cannot settle for "just getting it to work." We have to care about what's under the hood. If you're a serious WordPress developer, then you likely already have a method to how you work, but if you're just getting started or are looking to define yourself as a professional WordPress developer, then there are strategies, environments, and tools that you can utilize that can help. In this three article series, we're going to look at exactly what those are and how they apply in our project work. First, we'll start with strategies.Read More…
  • Code
    How to Include and Require Files and Templates in WordPressPreview
    When it comes to PHP, a lot of developers love the language, a lot of the developers hate the language, and a lot of developers generally just use it to get their work done. For what it's worth, I'm of the latter camp. I think PHP is fine. Like anything, it's not without it's problems, but I enjoy working with it well enough and see it as a way to get work done versus some pie-in-the-sky language for some time of utopia of development. The thing is, one of the things that developer's love about PHP - its features and flexibilities - are the very things that often trip us up. The list is long, but in the WordPress world, one of the most common points of confusion is the proper way to include external files. PHP offers four(!) ways to do this and WordPress even offers its own variation thereof. In this article, we'll survey the four ways that PHP offers to include files, guidelines for when to use each, and we'll review WordPress' features for including files.Read More…
  • Code
    A Primer on Ajax in the WordPress Dashboard - Requesting and RespondingThumb 3
    In this two part series, we're taking a look at how to properly introduce Ajax-specific functionality into the WordPress Dashboard. In the first article in the series, we began working on a plugin that displays a notification as soon as it's activated ... but that's it. In this article, we'll add Ajax-enabled functionality that will allow users to dismiss the message and we'll finish up with a working version of the plugin. Specifically, we're going to cover all of the things necessary on both the server-side and the client-side that are necessary to process an Ajax request and respond appropriately. Finally, we'll review a checklist of items that all Ajax-based WordPress functionality should have to make sure that you properly employ the API in future projects.Read More…
  • Code
    A Primer on Ajax in the WordPress Dashboard - Laying the FoundationThumb 1
    Not long ago, Ajax was all the rage - the idea of updating part of a page without actually needing to reload the entire page was awesome, remember? But it's been a few years and now it's practically the standard - it's hard to think about your favorite web application reloading an entire page to complete a task, isn't it? Depending on your background, there are a number of different ways to implement Ajax. In this series, we're going to do a very brief overview of what Ajax is, how it works, and then how to properly use it within the WordPress administration dashboard.Read More…
  • Code
    The Theory of Unit Testing, Part 3Part3 thumbnail
    In the past two articles, we've taken a close look at the theory behind unit testing and how it can help us in our WordPress development efforts. We've defined unit testing and examined various ways that it can help us throughout our projects. But we still have more to cover. In this final article, we'll review why we should even bother doing unit testing and we'll summarize the advantages and disadvantages of doing it. Next, we'll look at how we can retrofit testing into our existing projects. And to wrap up, we'll summarize a list of resources that are available specifically to us WordPress developers that will aid in beginning to unit test our themes.Read More…
  • Code
    The Theory of Unit Testing, Part 2Part2 thumbnail
    In the last article, we began talking about the theory of unit testing in WordPress. Specifically, we reviewed our work on unit testing themes and plugins then began to discuss units of code, how this impacts our testing, and we reviewed unit testing in the larger world of software development.Read More…
  • Code
    The Theory of Unit Testing, Part 1Part1 thumbnail
    We've been looking at unit testing for WordPress development. Through the use of practical examples, we've reviewed what unit testing looks like for both plugins and for themes; however, we haven't really talked about the the theory behind unit testing.Read More…
  • Code
    The Beginner’s Guide to Unit Testing: Building Testable ThemesThumbnail
    In the first two articles in this series, we took a high-level look at what unit testing is and how to apply it in the context of plugin development. Of course, there's more to WordPress than writing plugins, isn't there? A significant part of a WordPress developers job – for some it's the most significant part – is theme development. So in this article, we're going to take a look at how to develop testable themes. Specifically, we're going to take a look at how themes are different than plugins and then we're going to write an extremely simple theme that will be used to demonstrate the principles of unit testing and that can be applied in future development.Read More…
  • Code
    The Beginner’s Guide to Unit Testing: Building a Testable PluginThumbnail
    In the first part of this series, we took a high-level look at testing methodologies and gave some cases as to why it's beneficial for us to begin doing in our WordPress projects. We also took time to setup PHPUnit and the WordPress Tests in order to begin building our first testable plugin.Read More…
  • Code
    The Beginner’s Guide to Unit Testing: What Is Unit Testing?Thumbnail
    Depending on your background, you may or may not have heard of unit testing, test-driven development, behavior-driven development, or some other type of testing methodology. Often times, these methodologies are applied in the context of larger software systems or applications and less in the context of WordPress-based projects (though it is getting better!)Read More…
  • Code
    The Complete Guide To The WordPress Settings API, Part 8: Validation, Sanitisation, and Input IIWp api 8
    We've reached the final article of the series. In the last post, we took a look at introducing validation, sanitization, and a couple of basic input elements that we can take advantage of when building option pages. In this article, we're going to take a look at the final set of three options and how to hook them up to the front-end of the theme.Read More…