Enabling the Flash Uploader in WordPress on your Password Protected Dev Sites

If you post the sites your working on so that your clients can show of your progress, no doubt you are password protecting it with .htpasswd. There is one drawback to this approach, the Flash Uploader will throw an HTTP Error when HTTP Basic Authentication is used. Put the following snippet in your VirtualHost file to fix that error.

<Files async-upload.php>
Order deny,allow
Allow from all
Satisfy Any
</Files>

Image/Attachment Templates for WordPress

Ever since about WordPress v2.6 or so, images you uploaded and inserted into a WordPress post were created as attachments, a sub-post type that belongs to the post or page they are attached to. These attachment posts can be given their own template, and indeed they look for one when you visit the attachment’s permalink. The K2 theme ships with image and attachment templates (named image.php and attachment.php in the theme template hierachy) and displays the file along with some meta data and, if the image is a part of a gallery (or there is more than one attachment on the post), navigation aids to move from one attachment to the next. For many sites this is ideal, but if you want to just give people the file, and avoid having to create these attachment templates, then here’s a neat trick I cooked up on a recent project.
Continue reading

You got GPL in my peanut butter

It has never been a more exciting time to be a developer. Numerous open platforms exist in which to ply your trade and make a good living doing it. A platform’s user base grows as it matures, and inevitably gives birth to a thriving developer ecosystem supporting that platform, selling services into it, and when the platform is any good that ecosystem will turn into a marketplace. There has been an explosion of these ecosystems as evidenced by the success of the Apple App Store, Facebook, Twitter, Sales Force and Google Apps. In the last few years, WordPress has come into its own and has generated its own cottage industry for themes, plugins, and other add-on services.

What makes WordPress unique is that the platform itself is open sourced under the GNU General Public License v2. This license imposes itself on derivative works by insisting that they in turn be licensed under the GPLv2 if and when they are distributed to others. Generally, this poses no issues, and everyone releasing plugins and themes on the WordPress.org Extensions db has chosen to release their code under the GPL.
Continue reading

Rough Guide to upgrading WordPress MU 2.9.x to WordPress 3.0 Multi-Site

** Update** Skip to the comments. One Assumption on my part led to a lot more work than is needed. This guide does work, but as Ron (@wpmuguru) pointed out, I went around the block to just go next door. Even smart people are dumb sometimes ;)

The WordPress 3.0 betas are kicking around and for projects still in development, upgrading now will save you the trouble later after the site is in production. Upgrading Single Site WordPress installs to 3.0.x is as easy as ever, but now that WordPress ยต has been rolled into the main WordPress code base it takes a bit more work to “cross-grade” to the new WordPress 3.0 Multi-Site features.

This is a rough guide to upgrading WordPress MU 2.9.x to WordPress 3.0 Multi-Site. That means that I’m largely pulling this from recent memory and may skip a step or state something inaccurately. Feel free to heckle correct me in the comments.

Continue reading

Nginx Virtual Host Recipe for WordPress MU / BuddyPress

More than one person has asked me for my Nginx Virtual Host recipe for WordPress Multi-User and BuddyPress, so I’m posting it here. The attached virtual host definition is feature complete and works for me on a number of production sites.

Be sure to change domain.tld to your actual domain name. The wildcard record will allow your site to respond to ANY sudomain request, which may not be something you want.

You’ll also need to change the path to your log files, as well as the path to your public webroot folder. Finally, up the client_max_body_size to match your upload_max_filesize and post_max_size settings in php.ini.

Finally, this assumes you are running your PHP fast cgi process on port 9000.

This is the recipe for WordPress MU / BuddyPress. I’ve also posted one for WordPress (single site) and Drupal.

Download Nginx vhost Recipe for WordPress Mu and BuddyPress

Please post ways to improve this in the comments. I use this on a number of production sites, but there is always more one can do. Thanks to all of the blogs and articles that I ripped off helped me understand Nginx and got me started.

Nginx Virtual Host Recipe for WordPress

Since more than one person has asked me for my Nginx Virtual Host recipe for WordPress sites, I’m posting it here. Be sure to change domain.tld to your actual domain name. The wildcard record will allow your site to respond to ANY sudomain request, which may not be something you want.

You’ll also need to change the path to your log files, as well as the path to your public webroot folder. Finally, up the client_max_body_size to match your upload_max_filesize and post_max_size settings in php.ini.

Finally, this assumes you are running your PHP fast cgi process on port 9000.

This is the recipe for WordPress (single site). I’ve also posted one for Drupal and WordPress MU / BuddyPress.

Download Nginx vhost Recipe for WordPress

Please post ways to improve this in the comments. I use this on a number of production sites, but there is always more one can do. Thanks to all of the blogs and articles that I ripped off helped me understand Nginx and got me started.

Implementing the WordPress Shared Users Table Trick

Or how to create a blog network with out WordPress Multi-User.

Almost 2 years ago, I was charged with the duty of building an integrated Blog network with WordPress, for the Parents Everywhere Network. WordPress MU wasn’t quite ready for prime time, as most plugins hadn’t been ported over, and documentation was sparse, and only the bravest of souls wanted to tangle with it. Remember, this was back before WP and MU development were in sync. So I had to come up with another way.
Continue reading

One working copy to rule them all (Git + SVN)

I started moving my open source code over to GitHub, since it supports working with contributors in a natural, but controlled manner. However, for many of my WordPress plugins I already have a local working copy, since they are hosted in the WordPress plugin repository to support auto-update. I didn’t want to disrupt my svn working copy, nor did I want to start fresh in github.
Continue reading