Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 176 of 219)

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

The Paralyzing Fear of Committing To Open Source Code

One of the things that I think scares people off from committing to open source projects is the fear of “I don’t know where to start.”

Sure, there are other reasons as well:

  • “I can’t make the IRC/chat/AOL/whatever meetings.”
  • “I don’t understand half of what the others are talking about.”
  • “I only know how to work with [any given language].”
  • “I don’t think that I have enough experience.”
  • …and so on.

Honestly, you can rationalize your way out of anything that you’re afraid to do with a reason for which most people can’t fault you.

But if you’re even mildly interested in committing to an open source project – or, more specifically – helping out with WordPress, then I highly urge you do so.

Continue reading

Setting Up Grunt For WordPress

With the WordPress 3.8 development cycle underway, I thought it might be worth sharing how you can go about setting up Grunt for WordPress development on your local machine.

The reason for this is because WordPress is now using Grunt, JSHint, and a number of other utilities to help automate tasks, and if you’re looking to contribute to certain parts (not all, mind you) core, then these are the tools that you’re going to need – especially if you’re working on any tickets under the Build Tools component.

Continue reading

Magic Quotes and PHP: Parsing Automagically Escaped Data

As far as building projects on or for WordPress is concerned, one of the things that we have to keep in mind is the minimum version of PHP required to run WordPress itself. And at the time of this writing, the minimum required version of 5.2.4.

Of course, if you know your project is going to run on a newer version of PHP, and you have control over that environment, then obviously you have the freedom to write code against that version; however, if you’re building something that’s going to be used across the board for any of the many hosting environments, then you’ve got to take that into consideration.

I mention this, because there have been a number of times when I’ve been working on a particular feature of a project, and I’ve had to reference the PHP manual to see if the given feature of the language is supported by the minimum current version.

Continue reading

Parsing CSV Files in PHP: Checking The File Type

When it comes to parsing CSV files, the way you go about doing it is relatively the same (hence the need for the standard format, right?):

  1. Read the file
  2. Break each line into an entry into a collection
  3. Iterate through the collection
  4. Create an object or element with attributes based on the data in the current given line

Sure, this is a high-level view of how it’s done, and your specific implementation may have finer nuances, but – as I mentioned – I think its safe to say that the way we go about parsing a file is the same regarding of what we do with the data once we start reading it.

When you’re working on an implementation of CSV parser and you’re accepting data from an upload, then there are several things that need to be checked such as the validity of the file type.

For example: If a person uploads an image, you don’t want to proceed with parsing it; however, if they upload an actual CSV, you obviously want to process the file.

But this can be tricky depending on the operating system.

Continue reading

Updating The The WordPress JavaScript Coding Standards

Comments are closed on this post. Let's keep the discussion on the Make WordPress blog.

Earlier this year, I drafted the first version of the WordPress JavaScript Coding Standards (and I discuss it more in-depth in this post).

When I contributed the first version of the standard, the conventions were based largely on writing vanilla JavaScript, and on the existing WordPress PHP Coding Standards; however, there has recently been a surge of interest in continuing to develop the JavaScript Coding Standards.

Because I obviously have a strong interest in this, because I believe that more and more sites and applications are doing more work on the client-side, and because I want there to continue to improve the existing WordPress codebase, I wanted to make sure that there is about to be a major update to the JavaScript coding standards.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑