Removing Standard Image Sizes from WordPress

I ran across an issue today where I needed to specify which image sizes were generated within WordPress. I didn’t need the stock sizes (thumbnail, medium, large) but I did need a few custom sizes. Adding custom sizes is the easy part but removing others threw me for a loop.

The quick and dirty solution would be to set the sizes in Settings > Media to 0 so that nothing would be generated. While this works on a single site, its not the best solution for something that would be deployed on multiple sites. After all, who wants to remember to change individual settings on each new site?

Best solution, filtering intermediate_image_sizes. Basically all you need to do is return an array of what sizes you want generated. In the example below, I had already used add_image_size() to generate 3 new sizes: theme-small, theme-medium, and theme-large.

Here’s the code:

add_filter( 'intermediate_image_sizes', 'rcd_remove_stock_image_sizes' );

function rcd_remove_stock_image_sizes( $sizes ) {
    return array( 'theme-small', 'theme-medium', 'theme-large' );
}

Basically what this does is define only our 3 new image sizes in the array eliminating the stock sizes of thumbnail, medium, and large.

Thanks to @Otto42 for the tip!

Capital “P”s, Communities, and Conspiracy Theories

I’m sure you’ve heard about the debate with WordPress vs WordPress. There was a patch committed to WordPress 3.0 that automatically converts it to include an uppercase P and follow the WordPress branding. This was added as as an easter egg of sorts to help the WordPress brand, and while I don’t have an issue with it, I do have an issue with the way some in the community reacted to it.

The problem with easter eggs is they’re supposed to be found by those in the community and they’re supposed to be fun. Of course, there was no hiding this one. The revision was committed in the public eye, but without a ticket. I don’t think there was much need for a ticket and public discussion because this has been in play on WordPress.com for a few years now. Of course, some argue that there was no community input because there was no trac ticket.

The one legitimate issue I could find with this patch was the fact that because the way it corrects text, it can possibly break image links and directories. I’m sure this is only in a minor percentage of cases, because as most have learned, their hosting environment is case sensitive and they use all lowercase directory and file names. This has since been fixed for trunk and 3.0.1 in revisions 15377 and 15378.

This begs the question, if this patch worked properly and didn’t break links, would we even be in this situation? Would the few squeaky wheels be complaining about Matt and Automattic doing their will and not respecting the community? Would this issue have been blown out of proportion? Would anything have even been said about it?

As usual, some in the community to complained. I’ve heard all sorts of excuses from editing user’s content (albeit just a spelling correction), to the capital P caused the BP oil spill. Yes, I’m not joking. Conspiracy theories breed conspiracy theories. There have even been parody sites made– capitalp.org and lowercasep.org

This brings about another point– I recently had a discussion with Aaron Brazell regarding the WordPress community and complaining. The point he made was that if it doesn’t affect your bottom line (income) stop complaining about it. All you do is waste your breath, waste your time, and don’t make as much money as you could. By directing your resources to other places, such as your business or contributing patches to WordPress, you can further better yourself and the WordPress community.

As usual though, there’s always a few that want to complain, and while I won’t mention them by name (they know who they are), I hope they take one thing away from this post– focus your time on making WordPress and the WordPress community better instead of complaining about this or that. PleaseĀ  stop coming up with conspiracy theories about Matt, WordPress and Automattic; they’re rarely true. Its not an issue of principal, Matt, or Automattic; its an issue of making things better. Focus your time on creating a patch to fix the filter and fix the bug. That helps improve the community.

Upgrading Multiple Subversion Copies of WordPress With a Script

I run all my WordPress installs as Subversion checkouts. This makes it easier to upgrade since there’s no FTP involved and I can choose when to upgrade as well as to what version. Since I have multiple blogs, I created a script to facilitate an easy upgrade all of them at once when a new version is released.

As a Christmas present to the WordPress community I’m making my script available to the public.

The only requirement is that you’re using subversion to manage your WordPress installs already. Other than that, the script is pretty simple to use, there’s just one line of paths that needs to be updated.

To use this script, start by creating a new bash script on your server:

vi wpupdate.sh

Press “I” to turn insert mode in vim and paste in the following:

#! /bin/bash
# Copyright (c) 2009 Ryan Duff <http://ryanduff.net>
# This script is licensed under GNU GPL version 2.0 or above
#
# This script upgrades (switches) a subversion copy of WordPress to a tagged version of your choice
# List of Current WordPress tag versions can be found at <http://core.trac.wordpress.org/browser/tags>

# Set your paths
paths=(/path/to/install/1/ /path/to/install/2/)

clear

echo WordPress Update Script
echo ------------------------
echo
echo -n "Please enter version number and press [ENTER]: "
read version

for path in ${paths[@]}
do
cd $path
svn sw http://core.svn.wordpress.org/tags/$version/ .
done

Move your cursor up to the paths line and change to match the full paths to your WordPress installs.

Save the file. (Press Esc to exit insert mode. Type :wq and press Enter to save the file and quit vim)

Make the file executable:

chmod +x wpupdate.sh

To run the script type:

./wpupdate.sh

When prompted, enter the version tag you want to update to and press Enter. Current WordPress version tags can be found here.

If you have any questions or problems, feel free to leave them in the comments.

On Domain Trademarks in the Open Source Community

After reading an article on Weblog Tools Collection in regards to the WordPress trademark, and reviewing the information on WordPress.org, I got to thinking about how this affects the open source community.

In the commercial realm, it is very important for a company to protect their trademark. If they fail to do so, somebody might sell a similar product using the same name which could confuse consumers. In the open source realm, the software and code base is community based. Because of the community involvement, other related websites crop up to extend the original software.

In the case of WordPress, the code is maintained by a commercial entity, Automattic. As a commercial company, Automattic has an interest in protecting the name “WordPress,” especially since they run a hosted service at WordPress.com. At the same time, there are also plugins and themes developed for the software, as well as meetups and “WordCamps” which are a WordPress un-conference.

Naturally, people extending WordPress, would use “WordPress” in the name of their project or website, but unfortunately, this is a no-no based on the information on WordPress.org. Because of their legal advice, they recommend that you use “wp” instead of “WordPress” in the domain name of any related project– unless, of course, you want to be sued for trademark infringement. On the flip side of this, the WordPress logo, which has also been trademarked, is allowed to be used, as long as you use the “official” logo. They’re granting full use to the logo trademark, but not the name trademark.

The problem arises with making money off WordPress in a way that Automattic and/or WordPress already gains income from. In essence, you would be taking from profits not rightfully yours since you’re not the trademark owner. But what if you are just contributing to the community? Giving back, as in charity to the community with nothing to gain? Shouldn’t you be allowed to use “WordPress” in the clear? Common sense would agree.

This puts everybody– Automattic and the WordPress community in a catch-22. How can you effectively use WordPress in a domain name without degrading to “wp” or facing legal action. Is it just an issue with US Trademark law, or is there a better way to handle the issue and allow the use of “WordPress” in a domain name while keeping the trademark protected?

There may be a fix. Mozilla has allowed the use of their trademarked names in domains, as long as you have permission. They have a fairly straightforward application that you can fill out and send along to the Mozilla Foundation. Pending approval, you can use the trademark as long as you don’t do anything to confuse your website and the trademarked product. Something similar out of the Automattic/WordPress camp would allow common sense, non infringing uses of “WordPress” without worrying somebody might steal their business. And since it’s permission based, it can be denied if things start to go awry.

Since I’m not a lawyer, this is just my opinion. What are your thoughts on the whole situation?

WordCamp NYC Wrap-up

I had the privilege of attending WordCamp NYC this past weekend. It was an amazing event with over 700 attendees. I’d like to thank @janeforshort and @sbruner for putting on an awesome event.

Saturday consisted of conference sessions with a set schedule. Due to the awesome session topics, the unconference sessions were pushed back to Sunday morning. Following the unconference sessions, we gathered at Mason Hall at Baruch College to check out the plugin and theme competition. We continued on with three rounds of 5 ignite-style presentations, an overview of WordPress 2.9 features by Mark Jaquith, and a town-hall with Matt Mullenweg.

It was sweet to be back in New York again and meet up with some old friends, as well as meet plenty of new people. I actually met so many people, I can’t even list them all off here. So after a long weekend of excitement, it took me a few days to process everything so I could even post this!

Calling All Central PA WordPress Users

I’m looking to organize a WordPress Meetup of sorts for all users in Central PA. I don’t care if you’re a developer, designer, or just a user… please, come on out and join the fun. It will be a great resource for everybody to learn and network. If you’re just a user and have a need, somebody should be there that can fill it for you.

As far as location, I was thinking the Abbey Bar at Appalachian Brewing Company in Harrisburg. For a time, lets say the 2nd Wednesday of the month at 7PM?

If anybody has other preferences for time and venue, please let me know and we can adjust as necessary.

With that being said… I’ll see you at the first WordPress Harrisburg Meetup on Wednesday June 10th, at 7PM at the Abbey Bar at ABC.

P.S. As an added bonus, I’ll pick up the drink tab for the first meetup.

WordCamp Mid-Atlantic Wrap-up

I made it down to WordCamp Mid-Atlantic in Baltimore, MD yesterday to meet some old friends (Mark Jaquith and Aaron Brazell) as well as make a bunch of new contacts. As some of you already know, or learned yesterday, I was pretty involved in WordPress back in the day. I had stepped out for a bit due to personal reasons and am now trying to get re-involved in the community as well play catch-up with all the changes.

Fact Check: I was having a rough time yesterday trying to remember exactly which version I started with. According to the earliest ryanduff.net page on archive.org dated Feb 4, 2005, I had posts in September 2004. Cross referencing with WordPress Versions, that would mean I started with WordPress version 1.2 since 1.2.1 was not released until October 6, 2004. Now that that’s out of the way…

Overall, there was a TON of energy and the turnout was excellent. The presentations, despite a lack of much choice were also good. And like any unconference, if you didn’t like what somebody was presenting, you can walk out and go to another session or start your own. There was even a genius bar for anybody with questions. I stopped for a while to mingle with some of the more technical people there like @sivel @onefinejay and @ericskiff. We got to reminisce over old times as well as talk about the general direction of WordPress.

I’m still waiting for my MingleStick email to come through so I can access the contact info for the people I met. I like to keep on top of that before I start to forget things.

Don’t forget, if you’re looking for things on the net, make sure to search for the #wordcampmidatl hashtag. We have @technosailor to thank for that one! :P