Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 105 of 219)

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

Detecting Copy and Paste in JavaScript

Detecting copy and paste in JavaScript is not something that’s new to web development. How you do it may vary, though, depending on the set of tools you’re using.

Cut and Paste in JavaScript

Cut and paste, not cut and tape. And not like this.

Given I focus primarily on WordPress, the majority of the JavaScript I write uses jQuery. And though there are a number of ways you can go about doing this (which I’ll talk about later), some of them are deprecated (though they still work).

Anyway, so I was specifically looking for a way to handle the case where a user pastes content into a field using keyboard shortcuts.

Continue reading

The Right Hook To Initialize WordPress Plugins

When I first started working on WordPress plugin development, I used to obsess over the right hook to initialize WordPress plugins. That is, I thought there was one hook that would sit above all other hooks and prevent me from needing to go looking through the Codex or other source code to find the right one.

But that’s not the case.

To be clear, this isn’t to say that there aren’t some strategies and some hooks that work better than others in many, many cases, but there are times where whatever you’re used to using isn’t going to work. This depends on how you’re structuring your plugin, and I’ll talk more about that in a moment, but there’s isn’t one hook to rule them all when you want to initialize your WordPress plugins.

Initialize WordPress Plugins

By now, you likely know the whole deal about the one ring, right?

Instead, you’ve got to find the one that suits your needs best for the functionality you’re introducing.

Continue reading

Running Nginx on OS X for WordPress Development

Running Nginx on OS X is becoming a more attractive alternative to running some of the standard stacks that developers use to set up their environments.

That is, I think many of us are used to running something like this following:

  • Apache
  • MySQL
  • PHP
  • WordPress

That works because the majority of our hosts have these configurations, and it’s a good practice to have our development environment mirror our staging and production environments.

But Nginx is becoming a popular alternative to Apache and other web servers, so we need to update our local machines accordingly.Getting it set up on OS X takes a little more work.

Getting it set up on OS X takes a little work.

Continue reading

Building Quality into WordPress Projects: A Practical Example

Building quality into WordPress projects is a topic that sounds a little subjective or maybe even a bit esoteric.

To be honest, I think it certainly helps to have a level of experience in general software development as well as with the way WordPress does things, but it’s something that anyone can learn.

I’d go as far as to say that many people who care about building quality into WordPress projects are people who are consistently learning new ways to go about doing so.

Anyway, in a recent article for Envato, I cover exactly this.

Continue reading

Quality Code and Bloat in WordPress Projects

Quality Code and Bloat are two topics that I see a lot of developers either discussing and/or mentioning on the landing pages of their project pages.

I think the conversation around quality code is something that should always be happening. We should always be aiming to get better at what we’re doing, there is always someone who can help us, and there is always someone we can help.

It’s not that I think bloat is something we should accept, nor is it something that I think we should settle for in our projects (or those to which we contribute for that matter). But does it have as an objective definition as quality code?

It’s important to define clearly quality code and bloat as it relates to you, your team, and the solutions you’re providing for others. And I think this is true if you’re working for yourself, in a shop, for an agency, or even as a hobby and you’re building solutions for other people.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑