Archive for the 'WordPress' Category

Despaminated?

Thursday, January 6th, 2005

I was considering This Chick’s anti-spam checkbox solution to fight my continuing spam problems, but I decided to go with Gene Shepherd’s step-by-step solution. Jeff Barr has a similar approach.

They all work the same way: add a new required field to the comment form, and spambots designed for the average blog comment form can’t fill it in right. Manual spammers can still type in their spam, but they don’t send 100-200 spam comments a day. I also noticed that I hadn’t renamed wp-comments-popup.php, so I changed that, too.

I’ll be backing down on my moderation requirements to see how well the new despamination works, so you can say “incest” in my comments again (for the time being). Now to post a test comment…

[Update] The test worked, but I think the spam is still coming in. I wonder if they’re scraping each HTML form. I may need to use This Chick’s trick after all, since it has the added human-interaction barrier.

[Update II] Note the snazzy new checkbox.

Missing Blog, Missing Categories

Tuesday, January 4th, 2005

Quote of the day: a /. commenter says The BSD license is free as in “Working for Apple for free”

The management apologizes for the recent blog outage. I’m not sure exactly what happened or how it got fixed, but it wasn’t the spammers. I suspect it was a problem with the host’s upgrade to PHP 4.3.10. As an added bonus, the 406 error also seems to be better now.

On the other hand, the Tech categories missing from the category list in the sidebar were entirely my (and WordPress’s) fault. I had no posts in the parent Tech category, so WordPress and company were bumped off the list. I added an arbitrary post to the Tech category and now all is well in WP 1.2-land.

We await WP 1.3 eagerly, or maybe they’ve upped the next release to 1.5.

Spammers Strike Again

Sunday, January 2nd, 2005

The management apologizes to anyone who stumbled across some particularly nasty comment spam in the blog recently. I’ve deleted it all and banned the obvious words, but I think I may be in for a new round of comment spamming. I could install all sorts of anti-spam plugins, but instead I’ll wait and see how much my recent changes help.

And wait impatiently for WordPress 1.3.

Die Spam Die

Sunday, December 26th, 2004

Mac link of the day: free icons for OS X developers

Due to an unexpected snowstorm, I’m prematurely back in Boston—almost, but not quite, ahead of the snow. When I checked my email, I found that the comment spammers had been at my sample color-rotation blog. All comments were held up for moderation, but it’s a pain to delete them all.

Since I don’t expect real live people to comment in a demo blog that’s all in fake Lorem Ipsum Latin, I took the easy way out of WordPress comment spam: I deleted the wp-comments-post.php file. Anyone who tries to comment will get a 404 error.

Cygwin and Emacs

Friday, December 17th, 2004

Warning: Geeking ahead!

So I’ve been trying to reproduce a real operating system on Windows. The very first thing I did, of course, was install Emacs. Today I noticed that Emacs wasn’t finding RCS (my favorite version control system) even though I have Cygwin installed. I found the answer in noniq’s .emacs file:

(more…)

WP Line Breaks in Comments

Sunday, November 14th, 2004

Rocky left me a poem in my comments, which revealed that my WP line-break fix was fixing a bit too much. I still need the fix for weird old Blogger and MT entries, but I didn’t want it “fixing” the linebreaks in comments.

So the line break fix is just replacing br=1 with br=0 in the wpautop function in wp-includes/formatting-functions.php. The trouble came up when my altered wpautop was loaded as a filter in wp-includes/template-functions-comment.php. I needed the old one there. If I really understood the functions, maybe I could have stuck a br=something into wp-includes/template-functions-comment.php, but I was just there to hack. So instead I made a copy of wpautop in wp-includes/formatting-functions.php, called it wpautopp, and changed the filter name in wp-includes/template-functions-comment.php to wpautopp.

It works, but upgrading to WP 1.3 is going to be a nightmare for me.

Comment Spam

Sunday, October 24th, 2004

I’ve been suffering from the latest epidemic of WordPress comment spam. Most of the spam was stopped for moderation, but it’s still annoying to have to go in and reject them all. I decided to skip most of the usual advice and move directly to
renaminng the wp-comment-post.php file.

Once the file is renamed, you just need to go in and replace the old filename with the new one in a few other WP files. The files I edited were:

wp-comments.php
wp-comments-popup.php
wp-comments-reply.php

I apologize in advance if anything breaks

Update: Well, it worked for one spammer, but now I seem to have picked up a new spammer, though this one isn’t quite as active.

Update: I’m also trying this hack to mass-delete comments, while I wait for the new, more spam-proof version of WordPress to come out.

Category Feeds

Saturday, August 7th, 2004

Joseph Scott has instructions for linking your WordPress category feeds. Mine weren’t working at first, until I realized that I needed to update my .htaccess file. The instructions are in the WP admin interface, under Options | Permalinks. I may hack the WP source for slightly nicer display of category feed links.

[Update:] There you go, category feed links, with an image. I changed the line in index.php that produces the category list to:

<?php wp_list_cats("sort_order=asc&sort_column=name
&feed=feed&feed_image=/jemimap/gifs/rss.gif"); ?>

(Note: The line is broken for display purposes only.) I think “feed” produces the RSS2 feed, though you can change it to get atom or a few other choices. The path is the url of the image, which is adapted from the graphicpush XML and RSS icons.

I also fixed my feeds to be full text. Apparently WP doesn’t generate both full text and summary feeds (although a full-text rss2 feed includes summaries anyway). The setting is under Options | Reading in the admin interface.

Spam Uncanned

Tuesday, June 29th, 2004

I’ve had my first comment spam in WordPress - insidious comments that look relevant, and only the URL field is used for spam purposes. I recognized it as spam since it all came from the same IP, though the URLs varied. (I didn’t visit them.)

So I’m trying out the built-in spam blocking. In WordPress 1.2, just go to Options | Discussion and add IP addresses, URLs, or keywords to the textbox at the bottom of the page, and hit Update.

Spam in a Can

Thursday, June 10th, 2004

WP plugin of the day: Belongs to Cat - I haven’t tried it, but it looks handy.

I’ve added a WordPress custom field for entry freshness, which so far I’ve used only on the canned entries. Custom fields are easy to add on the editing page, but getting them to display is another matter. The documentation is obscure as usual. What you have to do is put a the_meta() command into your template (index.php), and then style ul.post-meta, .post-meta li, and, optionally, span.post-meta-key.

What I did was add <?php the_meta(); ?> to the end of my feedback div in index.php, right after the line with the comments_popup_link command. To style the meta output, I added the following to my stylesheet:

ul.post-meta {
	display: inline;
	margin: 0;
	padding: 0;
	list-style: none;}
.post-meta li {display: inline;}
.post-meta li:before {content: ' | ';}

So now instead of saying this entry was spam in a can, I can do it automatically and the meta data will appear at the end of the post. (Wait for it…)