Recently, I experienced a highly annoying problem in Mac OS X Mavericks: any application (including Finder) would crash whenever the Dropbox folder was opened. This resulted in me losing a lot of work in Adobe Illustrator, for instance, simply because I was trying to open a Save dialog, and the default folder was Dropbox. The whole application crashed.

I then noticed that Finder would crash (the window would close and reopen in the Home folder) whenever I tried to switch to the Dropbox folder.

After a little Googling, I found a solution, but only because I managed to interpret verbose forum posts correctly. Let me give you a clearer thing to try, instead.

  1. Open Terminal.
  2. Type the command below in Terminal, replacing [yourusername] with your user name (the name of your home folder).
  3. Press enter.
rm /Users/[yourusername]/Dropbox/.DS_Store

If you’re like me, that fixes it right up! No more crashing.

July 23, 2014 — 7 Comments — In Dropbox, Resources, Tutorial

Sometimes, sites can get overloaded with spam comments—thousands per day. Whether this is the case, or you’ve just never emptied out your spam comments on a big site, you can end up with too many to trash. This is due to some restrictions to the amount of data that can be sent along with a request.

You can clean things up with some simple SQL queries—it’s much more efficient than trying to use the WordPress admin area when you need to remove spam comments in bulk.

Before you do anything, get a full backup of your database. Seriously.

Querying the Database

Depending on your hosting environment and your level of expertise, you’ll run these queries

  • using phpMyAdmin, in the SQL tab
  • using a database management GUI, like Sequel Pro
  • using the MySQL command-line tool

To check the output of any of these queries before actually deleting anything, replace DELETE FROM with SELECT * FROM. You’ll see all the rows that will be deleted when you run the real query.

As well, note that these queries assume your database table prefix is wp_. You might need to change it.

Spam Removal Queries

To delete all comments marked as spam, run:

DELETE FROM wp_comments WHERE comment_approved = 'spam';

That should clear out your spam comments area in the admin. You should see about as many rows affected as you had spam comments.

Meta Data Cleanup

Even after you delete all those comments, you’ll still be left with all their metadata cluttering your database.

If you use Akismet, you can run this to get rid of everything:

DELETE FROM wp_commentmeta WHERE meta_key LIKE '%akismet%';

This query will attempt to delete any comment that no longer exists. It’s a little more complex, so double check the output before deleting—hopefully, the previous query will do the hard work first.

DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments);

After all is said and done, optimize both the wp_comments and wp_commentmeta tables.

Now, go figure out how to stop that spam from ever getting to you in the first place. 🙂

July 9, 2014 — Leave a comment — In Blog, Development, Resources, WordPress

On a frequent basis, we all try to complete a task online and get horribly frustrated. Forms are unintuitive, important pages are hidden, instructions are wrong—sites can be plain unhelpful.

When you have to force yourself through a task that’s valuable, but you have an unnecessarily difficult time, your bad experience can also give value to the people behind that website or service. As a UX Designer, I can tell you that clear, honest communication about what task was being worked on and why it was considered difficult is extraordinarily helpful and helps me make things better faster.

So, allow me to give you a boilerplate email that you can send that stands the best chance of creating change. Send it through a contact form for the company, or hunt down the best email you can find that might relate.

Not everyone will care, but I can promise you that this tone and level of detail will give your feedback the best chance of being heard and accepted.

Hello!

Please forward this message to your design/UX department responsible for [website/service].

Today, I was using [website/service], and I was trying to [task you were trying to complete]. I had more trouble than I think I should have. I hope this feedback might help you improve!

When I tried to [specific part of task], I was expecting to [define ideal experience for this part], but I ended up having trouble because [describe specific problem you noticed].

[Repeat the sentence above as many times as is needed. Try to be specific, but also try not to list more than 3-5 in this email.]

I [was/was not] able to complete all of what I came to do, but I believe some changes could make [task you were trying to complete] much easier for people like me.

If you have any questions, please feel free to reply to this email. I’m happy to help.

Thank you!

[Your Name]

This is a helpful format for two main reasons.

First, most people responsible for design/UX are interested in the dissonance between what someone expects to be able to do with ease and what they’re actually able to do. This can, oftentimes, be hard to measure without feedback. Structuring your feedback in a way that contrasts your expectations with reality helps a designer understand the situation quickly. It also lets them focus on your desired outcome, which is truly the most important thing to design for.

Second, a clear, but generally nice tone invites conversation. Quick, angry emails about how awful something was might get heard, but will lack the potential for true engagement and empowerment to make things better.

My hope is that having a boilerplate for you to come back to will help you avoid angry emails (or no email at all), so that you can send helpful ones instead. I encourage you to save this as a template in your email program and channel your frustration into feedback the next time your online experience is lacking.

June 6, 2014 — 2 Comments — In Blog, CX, Email, Research, Resources, UX

Here’s a quick tip for WordPress theme developers that seems to be a bit buried in the Codex.

If you wanted to add a class to the <body> element based on the page template being used, you can’t just go straight for the (usually helpful) is_page_template() function. It can’t be used inside The Loop.

Instead, we see a workaround at the bottom of that article that tells us to use get_page_template_slug().

In my case, I wanted to add a ‘bg-dark’ class to the <body> if mytemplate.php is the page template being used. Here’s how I was able to do it:

function prefix_conditional_body_class($classes) {
	if ( get_page_template_slug(get_the_ID()) === 'mytemplate.php' ) {
		$classes[] = 'bg-dark';
	}
	return $classes;
}

add_filter( 'body_class', 'prefix_conditional_body_class' );

You can run that code in any theme file being called, including functions.php.

May 27, 2014 — Leave a comment — In Blog, Development, Resources, WordPress

View Slides

We’ll cover the basics of the Transients API, see basic examples, and then discuss common places where this method can be most helpful, like large, complex queries or pulling from an external API. We’ll also discuss how this type of caching is unique, when to use it, and how to scale it for big bursts of traffic.

Follow Along

I’ve got all the working code samples in a plugin that you can look through while we talk. View it in GitHub, or download the repo and apply it to a local WordPress installation to see the code at work. To do that:

  1. Clone the repo to your plugins directory or download the .zip file.
  2. Activate the plugin.
  3. Import the contained .xml file, which will import five posts with shortcodes that execute the functions.

If you use MAMP and want to spin up an installation quickly, I’ve got a shell script for you to do just that.