Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 367 of 423)

Comment Tweets For WordPress

Comment Tweets For WordPress

For the past couple of weeks, I’ve been recording a premium screencast for Envato in which I share how to build a WordPress plugin from the ground up using professional development techniques such as object-oriented programming, proper use of Actions and Filters, LESS, CodeKit, and more.

While working on the screencast, one of the things that I wanted to do was to showcase exactly what it’s like to build something from the ground up, release it, and then experience the various comments, support issues, and so on. After all, that is the norm for releasing projects to the public.

The result of all of this is Comment Tweets For WordPress.

Continue reading

My Thoughts on Building Web Applications with WordPress

I’ve talked quite a bit about my thoughts on using WordPress for web application development. Specifically, I’ve shared:

During the State of the Word 2012, Matt discussed the past, present, and future of WordPress which included WordPress being an “app engine” of sorts. Some time ago, I stumbled across an article by Matthew Eppelsheimer in which he discusses his team using WordPress as just that.

Specifically, he says:

The WordPress platform essentially manages content and authentication for us, gives us frameworks to build custom UI and our own functionality, and offers extra features in the form of plugins developed by a large community. It gives us everything we need to rapidly build our own custom tools that fit our own process, style, and needs.

Interesting, isn’t it?

Obviously, I’ve been a fan of treating WordPress as such for some time, but I’ve never really shared how I’ve viewed various features and parts of the API for actually building applications.

Since I’ve recently wrapped up a project where we did just this, and since I’m currently in the middle of building one that’s following suit, I thought I’d share a few notes on my approach for building web applications with WordPress.

Continue reading

Quick Tip: Disable Comments Programmatically

If you're an experienced WordPress Developer, then skip down to the code.

I’ve been working on small site that’s serving as a digital storefront for a company. The requirements have called for the homepage to feature a variety of featured projects, a news feed, and similar features all of which are obviously custom queries.

There’s a unique feature to this particular project around the newsfeed that’s a bit atypical for other blogs. That is, the project calls for comments and pings to be disabled.

If you find yourself in a similar situation, here’s a quick tip for how you can disable comments programmatically and how you can disable pings programmatically.

Continue reading

A WordPress Database Index Reference

When it comes to building web applications, all of the major components can be reduced to the following pieces:

  • Frontend
  • Middleware
  • Database

Yes, there are a lot of moving pieces in each of these layers, and there are even layers within layers, but this is generally the architecture that you’re going to find 99% of the time.

And WordPress is no different.

One of the most important aspects of working with web applications that’s often over looked by both beginner and advanced developers alike is the significance of indexes on the underlying database (and I’m certainly not exempt from this).

For any middleware that provides an API for retrieving data from the database, the API is translating the server-side code into database queries. Assuming that the database schema is properly organized, and assuming that you’re leveraging the API properly, you should see very little performance issues.

But if you treat the database as a black box and rely solely on the API, you could be inadvertently affecting the performance of your theme, plugin, or application by constructing poor queries.

I typically keep a short reference of the WordPress Database Index and thought I’d share it here just as much for myself as for you guys.

Continue reading

Using WP_User_Query To Retrieve Users Across Multiple Roles

I’ve covered WP_User_Query in a previous post. In short, WP_User_Query is the preferred method for retrieving user information from the database when working with custom queries.

One of the shortcomings of this API method is that it doesn’t allow you to query across multiple roles. So, for example, if you want to retrieve users that meet a certain criteria but may span across multiple roles – say editors and administrators – the API doesn’t support it.

That said, there is a simple strategy that can be used with WP_User_Query to retrieve users across multiple roles.

Continue reading

« Older posts Newer posts »

© 2024 Tom McFarlin

Theme by Anders NorenUp ↑