Creating Admin Notices From a WordPress Plugin

I just threw a couple small PHP classes up on GitHub that I use in almost every WordPress plugin I write. The first is IDAdminNotices, which is a clean and easy way for plugins and themes to send messages/errors to the user within the Administration Panels. The second is IDDescribeVar, which will outputs the type, length and contents of […]

Continue reading...

Including External View Files in WordPress Widgets

I ran into a problem today while cleaning up and modifying some widgets. I moved all of the markup inside widget() to an external view file, and then included it via require_once(), which worked fine. I then tried to do the same thing inside form(), but didn’t get any output. It turns out that you […]

Continue reading...

Comparing WordPress, Drupal and Joomla in 2011

Ok, so it’s already 2012, but I just came across an article comparing the three from last year and it was a good read. Like a lot of articles, though, the real value is in the comments more than the article itself. Going into it I had the impression that Joomla was a stagnant mess, but […]

Continue reading...

Scaling WordPress Installations

TJ Stein gave a really good presentation at WordCamp Chicago 2011 about scaling and performance issues with WordPress installations. He focuses a lot on using ngnix instead of Apache, but also covers PHP object caching, Varnish, CDNs, benchmarking, etc. It’s a good overview of current practices, but there’s also a lot of specific tips throughout.

Different Approaches to Building a Theme-based Site

Mark Root-Wiley wrote a great article on the pros and cons of using premium themes, writing child themes and writing themes from scratch. It’s discussed in the context of WordPress themes, but most of it is applicable to other CMSs as well. I think it’s a good introduction to give clients when discussing which method […]

Continue reading...

Re-Abolish Slavery Ribbon

I just released a new WordPress plugin into the repository that raises awareness about modern-day slavery by adding a “Re-Abolish Slavery” ribbon to WordPress sites. It’s running on this site, so  you can see a live example by looking in the upper-right hand corner. The ribbon links to the Not For Sale campaign, which is […]

Continue reading...

Unit Testing WordPress Plugins

Nikolay Bachiyski gave a good talk at this year’s WordCamp San Francisco about unit testing WordPress plugins. His method uses PHPUnit, which is an additional PEAR package you have to install on the server. You can then use MockPress to simulate WordPress in the tests. Another option is the SimpleTest for WordPress plugin, which uses SimpleTest […]

Continue reading...

Performance Improvements for Dedicated WordPress Servers

Mark Maunder benchmarked several performance tuning measures with a WordPress installation on a VPS server to show which are most effective. The biggest improvements were from installing PHP-APC, setting up Nginx to proxy concurrent connections for Apache, and using MySQL’s query cache.

Passing Multi-Dimensional Arrays from WordPress to JavaScript

On its own wp_localize_script() can’t handle multi-dimensional arrays, but you can get around that by encoding the child arrays in JSON. That doesn’t handle HTML content very well, though, so another way to do it is to use the l10n_print_after parameter. That’s kind of ugly, but it seems like the best way available right now. It […]

Continue reading...

Conditionally Loading JavaScript and CSS in WordPress Plugins

Update 1/2/2013: As of WordPress 3.3, it’s now possible to call wp_enqueue_script() directly inside a shortcode callback, and the JavaScript file will be called within the document’s footer. That’s technically possible for CSS files as well, but should be considered a bad practice because outputting CSS outside the <head> tag violates W3C specs, can case FOUC, and may […]

Continue reading...