Software Engineering in Web Development, Backend Services, and More

Category: Articles (Page 96 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

Find The Difference in Dates Using PHP (and WordPress)

Working with dates in PHP is one of those things that you either have a good handle on, you’re working on understanding, or you’re stuck in the rabbit hole of the documentation that’s in the manual.

Difference in Dates Using PHP: The PHP Manual

If you’re working with WordPress, though, the chance that you’re going to need to work with dates is quite high. Nearly everything that we publish has at least one date associated with it.

This includes post, pages, custom post types, revisions, drafts, and so on.

Furthermore, there’s a chance that custom work that you need to develop with require that you find the difference in two dates using PHP. And though there are multiple ways of doing this, there’s a process that I’ve been following for something.

Continue reading

Programmatically Create Recurring Events with Event Calendar

Modern Tribe’s Event Calendar is likely the most popular calendar plugin available for WordPress. I’ve talked about querying events using WP_Query in a previous post but that’s applicable to both the free and premium versions.

Programmatically Create Recurring Events with Event Calendar Pro

The premium version offers a lot of great features, but if you’re looking to programmatically manipulate the calendar, it’s a little more difficult to work with it.

  • there isn’t clear documentation on how to take advantage of certain features from a developer’s perspective
  • the places where people have asked how to do so occasionally leave something to be desired.

Case in point: When we need to programmatically create recurring events.

Continue reading

Domain Rules (Or What Are We Codifying, Again?)

When it comes to building software for other people – regardless of if it’s a WordPress plugin, a mobile app, a desktop app, or something else – one of the most important things we can do is to test the project.

And I know: Talking about testing is boring. It seems to be disconnected from the act of implementing a solution and being able to say “Hey, look what I did!”

Testing, on the other hand, is sitting there making sure our code works. But, please, our code definitely works because we can see it happening, right? The truth is, we know this isn’t the case.

And so we’ve got all of these various tools to help us write unit tests, acceptance tests, behavioral tests, we grab groups of people and have them perform usability testing, and all of that’s important.

But before doing any of that, I think it’s important that we actually understand the rules of the problem that we’re aiming to solve. Sometimes we see this referred to as domain rules; sometimes, we don’t see it mentioned at all.

Continue reading

Multiple Objects Writing Data: How to Avoid This

You know those times when you’re working on a program, and there are some places in your code that, depending on the requirements or a bug that manifests itself in some way, is directly related to the fact that you have multiple objects writing data to the same data store? That’s not a good thing.

That’s a terrible way to start a post. Let me try that again.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑