Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 81 of 219)

Articles, tips, and resources for WordPress-based development.

IIFE For JavaScript in WordPress Development

IIFE, or an immediately-invoked function expression, is something that’s been a relatively common way of writing code in JavaScript.

It’s something that I think anyone doing any type of client-side development with WordPress should be using, but first I think it’s important to grasp the concept. Wikipedia provides a definition of IIFE:

An immediately-invoked function expression (or IIFE, pronounced “iffy) is a JavaScript programming language idiom which produces a lexical scope using JavaScript’s function scoping.

If you’re new to JavaScript, that just sounds kind of intense, right? So perhaps a better definition might be:

An “iffy” defines how variable names are related to the functions in which they are contained. Inner functions maintain the scope of their parent functions.

And finally, these functions are invoked anonymously because the function that fires literally has no name. It’s fired when the browser loads, parses, and runs the script.

So how does this all relate to WordPress?

Continue reading

VS Code for WordPress Development

VS Code is a new editor from Microsoft (I guess some may insert an obligatory flaming remark here, but I think they’ve done some pretty good stuff as of late) that I’ve only been following off and on since it was first announced.

VS Code

Before working for myself, I was focused on .NET development and to this day, I’ve yet to find an IDE that I like as much as that.

But then, late last week, I saw this tweet:

https://twitter.com/soderlind/status/787003086741143552

Followed by this:

And then this resulted in a good, albeit short conversation.

I’ve never been a fan of switching IDEs in the middle of client projects (for some reasons), so I didn’t plan on giving this particular IDE a try for the foreseeable future.

But given that I’ve got a set of unfinished projects lying around and given that I had some time to myself this weekend, I opted to see how well VS Code worked with a couple of WordPress-based projects.

Continue reading

WordPress Program Architecture on Paper

When it comes to talking about program architecture and terms like that, it always sounds a little bit like we’re taking something a little bit more seriously than it deserves.

This is a bit of a digression of my personal opinion, but I thought it worth sharing before getting into the actual post. Skip to the next heading if you feel so inclined.

When I think of architecture, I think of buildings and vehicles and various other things that, you know, keep humans use to live, to move, to stay alive, and so on. When someone says “architecture,” computer programs are not something that comes to mind.

Secondly, in the last decade or say, there has been this cultural shift in the programming community where compiled languages are “real” programs and anything that’s interpreted or that runs on some type of virtual machine is a script or isn’t a “real” program.

But as far as “architecture” is concerned:

the complex or carefully designed structure of something.

And as far as a “program” is concerned:

provide (a computer or other machine) with coded instructions for the automatic performance of a particular task.

So talking about program architecture isn’t inaccurate at all. It can feel a little weird, I guess, and I don’t know why, but that’s my digression.

But let me bring all of this rambling back around to WordPress.

Continue reading

WordPress Menu Page (And Submenu Pages, Too!)

A WordPress menu page is something that’s easy to introduce thanks to API functions like add_menu_page. On top of that, it’s easy to add submenus using add_submenu_page.

But if you’re working with the plugins_loaded hook or a plugin bootstrap file, then trying to introduce a WordPress menu page (along with any related submenus), you may end up with some unexpected results.

Custom WordPress Menu Page: A reference to plugins_loaded.

The plugins_loaded documentation in the code reference.

Specifically, you may find that your menu and submenus display fine, but they don’t work when you click on them to navigate to the relative page.

Continue reading

Development Tools for WordPress: The Industry’s Ego

Development tools are easy to come by these days. In fact, I think it’s harder to choose what to use than anything else. Never before have we had so many choices especially when it comes to the web.

Development Tools: Programming Languages

Just some of the popular programming languages, let alone tools.

Yesterday, I talked a bit about how there’s a particular breed of developers who love to get on their soapboxes and talk all about their superiority because of the development tools they use. If you haven’t read it, you can, but it’s not necessary for this post.

However, I will state that this is Part 2 of what I wrote yesterday. I even said:

Originally, I had this written as a single post, but it got a little long, so I’ve opted to split it into two pieces.

And I know: Yesterday was less about development and more of a critique of the nature of our industry. I try not to write too much about that, but there are times for exceptions. That was a time.

This one is not.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑