By now, we’ve covered a lot of ground as it relates to working with WordPress and debugging. And this is especially true as it relates to working with tools and plugins available within WordPress. If you’re just joining this particular series, please make sure you’re caught up with the following posts:
In the previous post, recall that I said the following:
But if you’re looking to get into the world of professional, practical debugging from within your IDE, then it’s important to understand the what, how, and why.
And we’re finally ready to look at what this requires. To get started, however, means that we need to understand a few things about Xdebug, the terminology, and to have an IDE that’s consistent for everyone reading this particular series.
So this is going to be broken into two parts.
- First, we’re going to look at the terminology required for debugging and make sure that we have a proper IDE setup in our development environment,
- Next, we’re going to look at how to ensure we’ve properly installed Xdebug and then wiring it up to our development environment so we can put it to work.
If you’ve read a variety of content throughout this blog over the past few years, some of this may seem familiar. If not, no big deal. Remember the goal is make sure we’re all on the same level as we proceed forward with the work mentioned above and throughout the rest of the series.
With that said, let’s get started.
As we continue to head towards working with direct debugging with Xdebug, we have a few tools at our disposal that allow us to work within WordPress itself. These aren’t meant to be replacements for any other debugging tool, but compliments to them.
I began by discussing this in the previous part of the last series. Specifically, I wrote:
Now though, we need to turn our attention to the plugins that were discussed a few posts ago. After that, we’ll eventually be working our way up to Xdebug.
But next, we’ll look at the tools available to us from within WordPress itself.
Ultimately, the goal is to look at what’s available for us to use to find problems, test code snippets, and profile our work. And several plugins make this incredibly easy (and are quite powerful) as it relates to doing just that.
Last time, we walked through the following:
- configuring debug constants,
- locating an error log file,
- understanding how to read the log file,
- understanding stack traces
- understanding how to read the stack
As nice as that is, it’s still important to understand how to write data to error log from a programmatic aspect. That is to say; it’s one thing if your work throws errors, warnings, or notices.
It’s another thing if you want to understand how to write information to the file for research and debugging manually.
In this post, we’ll continue doing exactly that to further our understanding WordPress error logs.
As we continue looking at what it means to be an independent WordPress developer, the tools needed, and the various strategies that can improve our skillset, I’ve been talking through the various constants, plugins, and tools to help us.
If you’re just stumbling across this post, then I recommend checking out my guide to native WordPress debugging tools as well as the rest of the posts in the series thus far.
After all, I find it important that we’re all working off of the same foundation – or something closely related – when going through this information.
Ultimately, using a tool like Xdebug is indispensible, but we have to work up to that (for those who are curious, I wrote a brief guide about this a little over a year ago).
For now though, let’s start with the basics. In the previous post, I left with the following statement:
In the next post, we’ll start looking at what’s necessary to examine the error log that’s generated by WordPress and how to understand the information we see.
And that’s what I want to look at today because, if nothing else, it will give you something practical off of which to work.
If you’ve just happened to join up on the membership of the site and are pursuing content specifically for The Independent WordPress Developer, I recommend reading the previous post – at the very least – to prepare for content in this post.
If, however, you’re looking to catch up on the previous article, here’s a short list of everything that’s been written thus far:
- Local Development for the Indie WordPress Developer
- Databases and Tools for the Indie WordPress Developer
- Installing WordPress for Local Development
As we prepare to move into talking about more advanced topics such as debugging and IDEs, it’s first worth noting the tools we have tools available that we can install within WordPress that will help us with debugging issues during development.
So before we look into error logs, IDEs, Xdebug, and so on, we’ll take a look at what we can do within WordPress itself.