Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 221 of 255)

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

Understanding The WordPress defaults Array

Earlier this week, I received an email from someone who was asking about the Settings API. Specifically, he was curious as to how the WordPress defaults array works.

For those of who may have worked with theme development, plugin development, or the Settings API in general, then you may be familiar with functions that look like this:

/**
 * Provides a default value for the theme layout setting.
 *
 * @since    1.0.0
 */
function get_theme_default_layout_options() {

	$defaults = array(
	    'layout'                         => 'right_sidebar_layout',
	    'display_featured_images'        => 'always'
	);

	return apply_filters ( 'theme_default_layout_options', $defaults );

}

But if you’re not familiar with the Settings API or with how to `apply_filters` call works, then this particular function can be confusing especially when it comes to understanding the serialization lifecycle of saving options to the database.

Continue reading

Software Milestones: Keeping Track of All The Things

One of the challenges that comes with managing any software project is making sure that milestones and deliverables are handled on time. The thing is, it’s hard – from the project outset – to always to predict some of the things that will crop up within each milestone.

If you’re using source control, this can make it difficult to keep your source control in sync with what milestone on which you’re working.

For example, I typically like to work on a milestone, then tag it, and release it. After that, I may do something like `milestone-1.1` or `milestone-1.2` as changes arise, but the more work that arises with each future milestone, and the various impacts it has on previous milestones, the more difficult it can be to truly track each milestone.

So what are we to do?

Continue reading

The Danger of Third Party APIs

Generally speaking, the majority of the work that I do with third party APIs is done so in the context of WordPress, but the truth is that what I’m about to say is subject to whatever platform you’re work with – be it .NET, Rails, COBOL, or whatever you or your dad maybe using :).

But a feature in Standard recently quit working because of an underlying change in a third party API. Now, to our credit, we normally do a good job with following blogs and release notes when an API is going to change.

In this case, there was no documentation on any of this – something just stopped working, so we needed to dig in and fix it. The fix is under testing and will be released later, but the point that I’m trying to make is that there is always a danger in working with third party APIs.

Continue reading

WordPress Directories: inc and lib

In the previous post, I spoke briefly about WordPress directories. Specifically, I talked about placing files in an `inc` directory whenever building a theme. This lead to a comment by Richard that I thought was worth covering here:

In the theme folder, sometimes I see people use “lib” to include theme assets and other times I see them use “inc”, as you’ve done here. Is there a reason for one vs the other?

I gave a short response in the comments, but thought that this warranted a longer form explanation to share my perspective, and to hear what you guys have to say, as well.

Continue reading

Not Everything Can Be a WordPress Plugin

One of the things that I – and most developers, designers, and implementors – love about WordPress is how easy to is to implement new functionality through the use of plugins.

Yes, I’ve shared at length my thoughts on the plugin economy and it’s not coming from a point of disdain. Of course not. It’s coming from a place of appreciating something, wanting to see it being made better, and simply sharing gaps in experience.

But a second thing that I’ve begun to notice is that people want plugins for everything – even things that I believe should remain core business logic.

Continue reading

« Older posts Newer posts »

© 2024 Tom McFarlin

Theme by Anders NorenUp ↑