Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 103 of 427)

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

A Few Thoughts on Team-Based Pragmatism and Engineering

When it comes to doing any type of development – I don’t care if it’s for the web, for mobile, or for some other platform – there are plenty of books, online courses, and so on that make it incredibly easy to learn whatever it is you want to learn.

To be clear, I’m not knocking any of the ways that are available to learn, either. After all, we all learn in different ways, right? And who am I say which way is better than any other way especially given the fact I write daily about topics here on and on other sites?

But I can definitively say for me – someone who has enjoyed both learning through formal education, tutorials, courses, and so on – the best way to gain experience in this industry has been two fold:

  • working with other people,
  • breaking things, and learning how to fix them.

Do I mean doing it in this specific order? Nope. Does this mean I’m leaps and bounds ahead of others? That’s laughable.

But as I have had the pleasure of working with others on multiple projects, talking with others via Twitter, conferences, and so on and experienced both the good and the bad, it’s something I think everyone should have the opportunity to do at some point.

If I had to summarize it, I’d say that it’s about finding a balance of team-based pragmatism and engineering. Why, though, if nothing of the above is new (given software companies have existed for decades) am I bothering to write about this now?

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑