Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 198 of 427

Custom CSS in WordPress (Does It Conflict with Child Theming?)

From a developer’s standpoint, I have mixed feelings about having a built-in editor for editing custom CSS in WordPress. On one hand…

  • It’s a really easy way to make quick changes to the theme you have installed so you get the changes you want.
  • Then again, it also completely bypasses and defeats the entire child theme process.

As I’ve tried to think this through, I realize each serves a different purpose I’ll try to explain in a moment, but sometimes I can’t help but wonder if it makes things for difficult for users or more difficult for other developers than necessary.

Sounds weird, I know. But hear me out.

Continue reading

Maybe I’m Over Commenting Code (Are You?)

A couple of weeks ago, I was talking with a friend and a fellow developer about code, clarity, and generally over commenting code (how meta, I know).

The following statement was made about some of the code I write – and before I share it, I take no offense to this whatsoever. I dig these kind of discussions between peers.

Truth be told, I kind of agree with it.

I’m definitely less comment-y than you

When it comes to commenting code, I’m pretty verbose. This means I try to DocBlock everything from the server-side code to the the JavaScript and even add code blocks to my Sass (or even vanilla CSS) code.

Furthermore, I’ll comment on blocks of code that are used throughout my functions even though they may be only, say, 15 – 20 lines long.

This used to be something I constantly debated about myself, but I’ve stopped with it and accepted this is how I write code.

Continue reading

Importing A Large Database in MAMP

When working with WordPress databases, we’re pretty fortunate to have tools like WP Migrate DB Pro, phpMyAdmin, Sequel Pro, and so on. But there are times when importing a large database is a bit more demanding than the front-end utilities we have.

Perhaps we have to change up our PHP configuration, perhaps we’re dealing with hundreds of megabytes worth of data, perhaps we don’t have the kind of control on the environment that we need.

Whatever the case, we always have the command line. And if you’re working with WordPress, MAMP, and you’re faced with importing large databases, then you may need to stop tweaking your PHP settings and simply import the file via the command-line.

Continue reading

The WordPress Developers Club

For anyone who is involved in WordPress – be it running a business, contributing to plugins or to core, blogging about it or generally doing something really cool with the application – is bound to receive the following question:

How do I become an expert in WordPress?

Isn’t that a hard question to answer? Maybe not for some, but I always end up having to think through where to start the conversation.

I mean…

  • Do you want to get into design? If so, then perhaps themes are for you.
  • Do you want to get into extending the core program? Then maybe plugins are for you.
  • Maybe you should try both to see where your interest lies most and then follow that trail.

If a person has a background in software development, then that leads to an entirely different conversation than if the person hasn’t really written a lot of – or any – code up to this point.

Sure, there are some great resources out there and there are places in which we can refer people but I think it all depends on where they want to go and/or what they want to do based on their level of experience.

But if you’re looking for something that will lead a person from the ground up into WordPress development, then I recommend checking out the WordPress Developers Club.

Continue reading

Ajax in WordPress: A Strategy For Error Codes

If you're reading this post in an RSS reader, don't forget to click on the "gist" link to see the code for the post.

In the previous post, I talked through the basics of setting of Ajax in WordPress on both the server-side and the client-side and how we can echo statements back to the client-side and why this is useful.

Ajax in WordPress: Error Codes

What I didn’t cover, though, was why this is important and how we can take advantage of it for gracefully handling any errors that occur throughout our code.

Whenever you’re dealing with a number of different variables such as user input, values of input fields, talking to the database, and network connections, there are a number of places in which the request and/or the response can fail.

And in those cases, we need to be able to make sure our project handles the situation well so we’re able to diagnose the problem and so our users aren’t left wondering what went wrong.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑