Skip to content

Year: 2008

Gravatars in WordPress, or What the %$#@ is a Gravatar?!?

The other day Mike from 10000 Birds left a comment here. What startled me was the fact that there was a picture of him next to his comment in my admin interface. How the devil did he do that? I thought.

I checked the image properties and found that it was served by gravatar.com, a site that allows you to upload a picture and associate it with an email address. Then whenever you use that address to log into a forum or blog that supports gravatars, your picture comes up by your name.

The latest WordPress versions support this, and so I studied the default theme and adjusted my comments.php file to show gravatars. A little CSS styling to tweak and there it was.

If you comment here, consider visiting gravatar.com and signing up for a gravatar, then leave a comment and your gravatar will appear alongside your comment.

If you don’t have one, WordPress will just generate a little pattern. I can also set it to display cartoon monsters for each commenter. Should I do that? Hopefully nobody would be offended.

Want to add gravatars to your WordPress theme? Here’s how:

Simply open your theme’s comments.php file and add the following code (the 40 gives the size of the image in pixels):

< ?php echo get_avatar( $comment, 40 ); ?>

Before this line (assuming your comments.php is based on the default theme):

< ?php comment_author_link() ?> says:

You’ll probably need to make a few adjustments to your CSS as well. I just lifted these lines from the default theme’s style.css and adjusted them to suit my theme:

.commentlist li .avatar {
	float: right;
	border: 1px solid #eee;
	padding: 2px;
	background: #fff;
	}

Easy as can be.

For more, visit the WordPress codex.

Drain You

It’s weird that I’ve walked past this drain on the way down to the pond countless times and never looked at it twice.

For whatever reason, last weekend it finally struck me that it’s actually kind of cool. The three blocks remind me of some kind of ancient structure, aligned for some unknown reason, and when captured in black-and-white, it somehow becomes mysterious and foreboding.

(By the way, click on the picture, or any of the pictures over the past two weeks. I’ve finally figured out how to show larger images on pages without sidebars.)

The Moon, Venus and Jupiter

The Moon, Venus and Jupiter
The Moon, Venus and Jupiter

My dad called on Monday evening to say that my brother had called to tell him to check this cool alignment out.

I could see it to the west, above my house as I stood in the driveway. Venus is the one in the lower middle, and Jupiter is on the right. Through my binoculars, I could see the Galilean Moons.

I love when these kind of things happen out there. It’s a nice surprise to see these transitory patterns appear, forcing a second look. I wonder what, if anything, this might have signified in more primitive times.

In these times it is a nice reminder of the wonders one can see by doing nothing more difficult than looking up on a crisp autumn night.

Project FeederWatch Week 3

Week 3 of Project FeederWatch was cool and overcast with occasional showers. It was a good weekend for staying in and staring out the windows.

A Black-crested Titmouse eyes the suet feeder
A Black-crested Titmouse eyes the suet feeder

The birds and the numbers:

  • House Finch (1)
  • House Sparrow (10)
  • Blue Jay (2)
  • Bewick’s Wren (1)
  • Carolina Wren (2)
  • White-winged Dove (17)
  • Black-crested Titmouse (1)
  • Chipping Sparrow (3)
  • Carolina Chickadee (1)

I didn’t see our cardinal this weekend, but all the others have made appearances in my previous counts.

What’s really interesting to me is how the birds’ behavior has changed slightly since the summer. The Blue Jays, for instance, are no longer interested in the suet feeder. They hogged it all summer and now they’ve all but surrendered it to the wrens and chickadees.

A Blue Jay watches the feeders
A Blue Jay watches the feeders

They have not lost their taste for peanuts, though, and they swoop in, grab a nut and are gone before I know it.

Unless this guy is in the way…

I’m pretty sure there were more Chipping Sparrows, but they like to poke around behind the sage bush.

The 3 Chipping Sparrows I counted
The 3 Chipping Sparrows I counted

Bewick’s Wrens come each summer to nest in our boxes, but this time of year, I see more of their larger cousins, the Carolina Wrens.

A Carolina Wren on the worm feeder
A Carolina Wren on the worm feeder

Hacked Off

Last week, while trying to fix a plugin that had stopped working after the last WordPress upgrade, I noticed an odd bit of code. Upon further investigation with the use of Google’s text-only feature on their cached page search, I found that my blog had been hacked and turned into a spam blog.

Didn’t notice did you? Neither did I. I think it happened back in April. Basically, the hackers get in and hide hundreds of links in your header or footer that are then rendered invisible by some kind of CSS trick, all accomplished through the use of an invisible plugin.

Then your blog looks and works like it always did, but the Googlebots see hundreds of links to sites selling porn, gambling, and various pharmaceutical delights.

This appears to have happened back in April at exactly the time I quit blogging regularly so I never noticed. It seems hundreds of WordPress blogs were affected and so there is plenty of info out there about fixing this hack, both on the WordPress support forums and elsewhere.

Here’s what I discovered:

  • a hidden user account on my blog that couldn’t be deleted through the admin interface
  • a plugin that didn’t show up on my plugin screen
  • several files in my directory and various subdirectories that were not placed there by me or WordPress

After reading up on this, I deleted everything from my directories that was not put there by me. I also deleted all the old subdirectories left over from my site’s first pre-blogging incarnation (while rediscovering the cool sky you now see in the background) and a very old test blog I created and never upgraded.

Then, I had to go into the mysql database, which forced me to learn a lot more about both mysql and phpmyadmin than I had ever known previously. Messing with the database is risky. As the warning says on the WordPress site, “with great power comes great responsibility.”

I figured it out, though. I was able to go into the database and delete the phantom user, turn off the phantom plugin and delete a mysterious table that shouldn’t have been there.

Had it not been for the following sites, I would not have had the foggiest idea how to do these things so big shout-outs to: BlogBuildingU.com, WordPress Philippines, Marketing.com, Ms. Adventures in Italy, and especially to Get Rich Slowly for their detailed instructions on dealing with the database cleanup. (How odd that 2 of these sites are from The Philippines and Italy, both countries in which I’ve lived).

The WordPress support forums were also helpful as always.

Once the database was cleaned up and the directories cleaned, I reinstalled the latest WordPress and changed every password associated with my web host and this blog. Probably a good thing to do from time to time anyway.

Now that the site is cleaned out and the hidden links are gone, I have to get back into Mr. Google’s good graces. The Googlebots have apparently determined that my site is a spam links blog and so my site no longer shows up in Google searches. I had noticed that my traffic dropped tremendously back in April, but I had assumed it was because I had slowed down on posting. Fortunately, Google has a tool in Google Webmasters to have a site reevaluated, so hopefully, my traffic will come back.

This wasn’t an awful experience. I was lucky and I managed to learn alot.

I am no longer afraid of phpMyAdmin and the mysql database (even if I don’t totally get them yet).

I was reminded of the importance of regular upgrades.

I was reminded of the importance of keeping my directories neat and clean.

I learned to periodically check over the code in my theme files and look at cached pages for anything that might be awry.

I learned about Google Webmaster Tools and the Firefox Web Developer Toolbar, both very useful for anyone running a website.

I wrote a few months ago that one of the things I like about running a self-hosted WordPress is that I’m running more than just a blog, I’m running a website. That still holds true even if I have to spend a week dealing with the mess created by some worthless waste of skin who decided to use my blog as a tool in their nefarious link scheme.

For those who may be wondering about the missing comments issue this week, that was a totally unrelated thing. Two days after cleaning up the hack mess, my host had a problem with their mysql server that temporarily ate the comments and caused a few other problems, which they have happily fixed. Thanks to Kevin Dewalt and whooami for their help in figuring out that issue.

And, now, everything seems right with the cyberworld and hopefully, Mr. Google will come back too.

Day Before Thanksgiving Birds

But, not turkeys for which, I’m certain, these birds at least are thankful.

Great Egret by the pond
Great Egret by the pond

Yesterday, I walked down to the little pond at the end of our street to check out the ducks.

A Great Egret was hunting along the far shore and I saw at least 15 Gadwalls. You can see one in the above picture above the word ‘great’ in the caption.

I also saw one Ring-necked Duck. Lesser Scaup. I only ever saw one last winter so I wonder if it’s the same one.

Lesser Scaup
Ring-necked Duck

A Great Blue Heron flew overhead out of the reeds behind me and I saw a few vultures, but that was it.

The Great Egret again
The Great Egret again

Update: Ted pointed out that the Ring-necked Duck had been mis-ID’d as a Lesser Scaup. I have corrected the post accordingly.

Cat Blogging that Would Have Been on Friday

If the image uploader hadn’t stopped working.

Doing what he does best
Doing what he does best

My web host said the problem was on their end and is related to the comments disappearing along with another database problem. It looks like its getting fixed so hopefully the comments will be back soon.

Simon, on the other hand, sees no problems except that I’m blog blogging when I should be cat blogging.

He’s right of course, and so here he is, lounging on his blue chair where his white fur really stands out long after he’s left the scene.

Project Feederwatch Week 2

Since we left town for a quick trip to Orange, my feederwatching only lasted about an hour or so on Saturday morning before we left. Still, I saw a good variety if not large numbers:

  • Bewick’s Wren (1)
  • Chipping Sparrows (2)
  • Northern Mockingbirds (2)
  • Carolina Wren (1)
  • Black-crested Titmouse (1)
  • House Sparrows (4)
  • Blue Jay (1)
  • White-winged Dove (1)

The weather was cool (low 50s) and the sky was overcast. No rain.

Watching the Feeders

Thanks to BirdingGirl, I discovered The Cornell Lab of Ornithology’s very cool citizen science project, Project FeederWatch.

I picked Saturday and Sunday as my count days as those are the days I’m home. The idea is to count the highest number of individuals seen at one time that show up to partake of the delights provided for their enjoyment.

I have a dinner bell with meal worms, a platform feeder, a suet feeder, and a couple of tube feeders as well as a birdbath and a good variety of native plants.

This weekend, most of the usual suspects showed up, though not in great numbers:

  • Bewick’s Wren (1)
  • House Finch (1)
  • Blue Jay (2)
  • Northern Mockingbird (2)
  • Northern Cardinal (1)
  • Carolina Chickadee (1)
  • White-winged Dove (7)
  • Carolina Wren (1)
  • House Sparrow (6)
  • Chipping Sparrow (4)
  • Black-crested Titmouse (2)

The project runs from November up to sometime in April so I’ll be posting my counts here. Maybe I’ll think to take some pictures next time too.