Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 149 of 219)

Articles, tips, and resources for WordPress-based development.

Debugging WordPress Projects with Log Files

There are a number of different ways that you can setup a debugging WordPress projects. It may be in the form of an IDE, it may be in the form of another application like MacGDBp, or it may be in the form of using something that fits your workflow.

Whatever the case, when a project reaches production, you normally don’t have access to any of the above. Instead, you’ve access to error logs. Obviously, they’re really useful when needing to, say, follow a stack trace for any given warning or error.

Sure, it sucks not being able to attach a debugger to your code on the server-side and then trace where the problem is, but given log files and pouring over enough information, you should be able to (well, at least hopefully) reproduce the error in both development and staging.

As such, I think it’s valuable not only to have quick access to error logs for WordPress in your staging environment but in your development environment, as well.

Continue reading

Resolving PHP Timeouts in WordPress

When it comes to working with long running scripts and WordPress, you’re usually at the mercy of one of two things:

  1. PHP configuration file
  2. The server’s PHP configuration

Granted, the case could be made that these are one and the same, and in a sense they are, but if you’re working with PHP on your local machine, you clearly have more control over the environment than when you’re working on a web server.

Technically, if you’re working on a dedicated server, you should have full control over the configuration of the environment.

If that’s not the case, this is article won’t be of much use; however, if you’re in the business of working with PHP scripts on your local machine and a shared server, and you’ve hit the maximum execution timeout message, then there are a few of ways to go about handling the problem.

Continue reading

Upload Files to the WordPress Media Library

Programmatically uploading files to WordPress is really just the same as uploading files from any source location to a destination.

That is to say, there are a number of PHP functions all of which make it pretty easy to deal with file-level operations, grabbing files from one location, and moving them to the next.

And yes, there are some nuances that can come with PHP’s configuration such that you may not be able to write to certain directories, perform certain options via HTTP, and so on. All of these can be managed by either changing up the configuration or by changing the way in which files are handled by the code.

The WordPress Media Library

One thing that WordPress offers that manual uploads don’t manage is adding files – specifically media types – to the Media Library after uploading a file. This is relatively easy to do given media_sideload_image.

But let’s say the situation is a little more complex.

Continue reading

Testing in WordPress: Scenarios and Spreadsheets

Testing software is one of those topics that people often talk about, write about (books even), and evangelize during conferences, meet ups, and so on. And rightly so – testing is one of the most important aspects of building something that’s going to be used by others.

Sometimes though, I wonder if we don’t do more talking about testing than actual testing.

By that, I mean we all understand its importance and I’d venture to say that we’re relatively familiar with the tools that are available for testing, but the act of testing in and of itself is kind of a beast:

  • It requires that you install additional software on to your computer
  • It requires that you learn how to write tests using the above software
  • It introduces more code thus more time into a project which doesn’t always translate well for stake holders
  • …and more

In short, there’s a lot working against it. I get it. Even more so, we talk about all kinds of testing – anything from unit tests to beta tests to release candidates and so on. All of these are important and they all have their place, and testing in WordPress is no different.

That said, there’s at least one method of testing that I think is applicable but rarely employed when it comes to creating themes or plugins. It’s an intermediate step of testing that I would say fits between user testing and beta testing: Use case testing (perhaps there’s a better title for it, but that’s what I have for this post).

Continue reading

Pragmatism in WordPress: On Agility

Dave Thomas, for those who aren’t familiar, is a notable programmer for both co-authoring The Pragmatic Programmer and for running the The Pragmatic Bookshelf company. In my opinion, he’s a fantastic person to follow if you’re into programming of any kind.

A few months ago, I stumbled across an article that he had written (that many of you have read) entitled Agile is Dead (Long Live Agility). It’s a great read for anyone who’s interested, and though I’m not particularly interested in talking about all of the things his article hits on, there are two specific things that I found relevant to anyone who is just getting started writing WordPress code, or who has been writing WordPress code for sometime and may need a refresher.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑