Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 103 of 427

Using WP-CLI on Your Host (Regardless of Your Host)

At this point, I think most people who develop solutions WordPress on a regular basis are familiar with using WP-CLI. Installing it locally on your system is one thing, using it on your host is another (but it’s all the same once you’re connected).

Case in point: Lately, I’ve been spending a few evenings and times during the weekends working on this site and trying to get it ready for the upcoming redesign. Part of doing that includes using WP-CLI.

If you’re someone on SiteGround (or any host that support WP-CLI, really) and are looking for how to get started using WP-CLI on your host, here’s a quick primer that should provide you everything you need to know to get up and running.

Continue reading

What’s Too Much For Passing Data via Dependency Injection?

The topic of dependency injection is one that’s been around for some time in object-oriented programming circles. Sometimes we see it in WordPress; sometimes we don’t.

I’m a fan of it but, honestly, though, I’m not always sure how much information to inject into a class. I mean, let’s say that we’re given two classes, and one holds information the other needs.

  • Do we inject no class into another class?
  • Do we inject only a piece of information (be it a string, integer, data structure, or whatever) into the other class?

I don’t think there’s a hard and fast rule for this, but it’s probably safe to say that it’s better to inject just the data you need. But then this raises a question of how do prepare the data to inject into a given class?

  • Do you create a method in one class and pass it into another?
  • Do you pass a piece of private or protected information into it?

Then again, I think it depends on if anything has to happen to the information before it’s passed into a class.

Anyway, I could go back and forth on this for the rest of the post and never come to a conclusion so why not work through some source code until there’s something reasonable.

Continue reading

Preparing For Memberships and More

For the better half of at least a couple of years, I’ve blogged nearly every day of something related to WordPress. This may be something dealing with blogging, speaking, resources, programming, notes, or other various articles.

To say that writing is something I enjoy doing is an understatement, and being able to do it using software I like and on which we build solutions for others is something that isn’t something I don’t take for granted.

For those who read every day, you’ve likely recognized that I’ve not been posting as frequently as I normally do. Part of this is simply because life has gotten extremely busy. The other part of it has to do with what I’m planning to do with this site in the coming weeks.

Continue reading

WordPress Admin Notice Plugins (And Why Options Are Good)

A couple of days ago, someone shot me a link to Dobby (no the house-elf, but sorta – and it would’ve been just a bit cooler, right? :). In short, it’s one of the various WordPress admin notice plugins that I think is worth checking out.

WordPress Admin Notices

It’s written by Thorsten Frommen (who inspired this post, to be honest) and a developer for whom I have a lot of respect.

The plugin’s description is as follows:

Dobby, the friendly Admin Elf, takes care of all your (unwanted) admin notices.

The emphasis added is mine, but it sounds a little familiar, doesn’t itThe drama.

Or not. 🙂

Continue reading

Debugging WordPress with Valet Error Logs

I’ve written a number of posts about Valet (here and here) and why I think it’s a solid option when it comes to working as a local web server for WordPress-based development.

Valet Error Logs

It’s easy to setup, it’s got built-in support for WordPress, it uses Nginx (which is often faster than Apache is my experience), and it provides a great way to allow others to tunnel into your machine for testing if that’s something you’re into doing.

But if you’re someone who spends time debugging both through Xdebug and through reading through error logs, then you may be interested in reviewing the Valet error logs (if you can find where they are kept) when debugging your projects.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑