Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 141 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

What is WordPress kses?

Work with WordPress long enough and you’re bound to come across something called “kses” or the wp_kses function. Perhaps this comes with writing your own code, or it comes with reading someone else’s source. Or maybe in reading core.

kses

Whatever the case, the function has a weird name, right?

I mean, a lot of the WordPress API functions have clear names so it’s easy to know what you’re doing. This one is more of the exception than the rule. That doesn’t change anything, does it? I mean, it still raises the questions:

  • What’s the purpose of the function,
  • Why does it matter,
  • Why should we use it,
  • And what purpose do its variations serve?

We should be asking these questions for all functions with which we work. But when the name isn’t clear, the answers aren’t as easy to deduce.

Continue reading

Priority of Ajax in WordPress

Let’s say that you’re working with Ajax in WordPress. And let’s say that, whatever you’re building, is using object-oriented programming.

Depending on the complexity of your work, you may find that how you’ve implemented your Ajax functionality doesn’t work.

That is:

  • You’ve implemented the proper hooks
  • You’ve got the callbacks defined
  • You’re `echo`ing the data properly
  • You’ve got the `wp_die()` call at the end of each request
  • And you’ve setup `console.log()` or other debugging statements in your Development environment

But you’re still seeing the request return 0 for everything you’ve implemented.

What gives?

Continue reading

Improved Ajax in WordPress: Object-Oriented Programming

A couple of weeks ago, I shared a post on Improved Ajax in WordPress. It provides a link to a tutorial that I wrote for Envato that shows how to incorporate Ajax into your WordPress project using procedural programming.

But not everyone who write solutions on WordPress uses procedural programming. Or you may prefer to write code using object-oriented techniques.

Whatever the case, including Ajax in WordPress is not limited to procedural programming.

To follow-up, I also wrote how to do the same thing in object-oriented programming.

Continue reading

The Responsibility of Understanding Your IDE

Everyone has their favorite IDE, right? Sometimes it comes from trying out the available options. Other times it comes from the advice of others.

Regardless, you’ve stumbled across your favorite utility for writing code. To that, I think one thing is critically important:

You have to invest time in understanding your IDE and all that it offers.

I bring this up because I see blog posts and tweets in which people promote their favorite editor. Great! Share the love and evangelize. Why not?

At the same time, I’ll see the same people talking about features they didn’t know exist in their editor.

No big deal – these are powerful pieces of software that help us do a lot. Sometimes, features aren’t easy to find.

Then again, we do have manuals and reference material.

And to that, I think it’s important that we, have a responsibility to fully understand our IDE. Especially if we’re going to be as proficient as we’d like with the tools we use.

Continue reading

Eisenhower: Is It Important or Is It Urgent?

One of the most common struggles, frustrations, or challenges that you’re going to face when working for someone or for yourself is trying to decide how to best juggle your workload.

Granted, what’s considered a “workload” may vary from person-to-person, from job-to-job. But for the purposes of this post, I’ll reduce it to a simple definition that I use on a daily basis:

A workload is the amount of work that you set out to achieve each day.

How you go about doing this will vary on your personality types. Some people, like me, are extremely Type-A. We calendar, schedule, and note everything.

And if something comes along to disrupt that schedule we:

  • Get frustrated,
  • Try to make it work,
  • Or find a place during the week in which it will work.

But this only works for so long. The more work that comes your way, the more demands you have on your time.

This is a good problem to have.

But the method outlined above does not work. That is, as they say, “it doesn’t scale.” Sure, it may work at first and it may work for a little while. But when you’re faced with increasing demands on your time, you have to reprioritize what it is that you’re doing.

How do you go about doing that, though? I don’t care if you’re just starting in a career, if you’re employed, if you’re self-employed, if you’re freelancing, or whatever.

Inevitably, assuming that you find some sort of success, this isn’t going to work forever.

So what are we supposed to do?

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑