Sci-fi, comics, humor, photos…it's all fair game.

Working on a Twitter Tools Filter for #fb Tags

Friday, November 13th, 2009 Posted in Site Updates | No Comments »

Since the normal Twitter/Facebook link stopped working, I’ve switched to Selective Twitter Status. Instead of importing all your Twitter status updates to Facebook, it only pulls in the ones that end with the hashtag #fb. I’ve thrown together a plugin that hooks into Twitter Tools and filters out that tag when building a daily or weekly digest. (It was complicated by the fact that the README didn’t provide any real detail for the relevant API hook.) I tested the function outside of WordPress, then set it up to run on Thursday evening.

Good: It worked! Every instance of the #fb tag was removed, and everything else stayed.
Bad: Twitter Tools posted four copies of the digest.

Well, Twitter Tools does that sometimes. I’ll frequently see it post 2 or even 3 copies, and while I’ve determined it’s not related to WP Super-Cache, I haven’t gotten around to seriously debugging it. So I don’t know if it has anything to do with my plugin. Actually, it probably doesn’t, since it runs within the digest-building code.

For what it’s worth, Friday posted only two copies of the digest. I only found one item worth saving, though. (Well, two, but I expanded the other one into this post.)

I guess it still needs some testing. When I’m sure it’s working properly, I’ll post the code.

WordPress Mobile Validating Patch

Tuesday, February 17th, 2009 Posted in Computers/Internet | No Comments »

I’ve been using Alex King’s WordPress Mobile Edition for a while to provide a mobile-friendly version of this blog, but haven’t really paid much attention to it since my last few phones were extremely limited in web browsing ability. Since I got the G1, I’ve been paying more attention to mobile access, including setting up WPTouch for a high-functioning iPhone– & Android–friendly version of the site. Last week I finally got around to testing the two plugins in combination, and determined that they do seem to work together with the right priorities.

I also ran the main page through the mobile-readiness evaluator at ready.mobi, and noticed that most of the issues it cited with the mobile edition of the site were really simple changes. Some were basics like fixing unbalanced HTML, and others were recommended practices like including a DOCTYPE and making sure that headings were nested properly. So I whipped together a patch for WordPress Mobile Edition 2.1a. (It’s labeled as 2.1.1 in the readme, but it shows up as 2.1a in the list of plugins.)

Changes:

  • Add XHTML Mobile 1.2 Doctype.
  • Fix unbalanced <small> tag.
  • Fix mising <ul> tags around list of recent posts.
  • Avoid empty class attribute on comments.
  • Add type attribute to style element.
  • Change non-standard value attribute on <meta> tag to content attribute.
  • Reassign headings so that h1, h2, h3 appear in order.

Download:

wp-mobile-validation.patch

The patch should be applied to the wp-mobile folder that you place in your themes folder.

Update: This has been completely superseded by more recent versions of the plug-in, which use Carrington Mobile instead.

Comicbook.com Power-Up Plugin for Wordpress

Thursday, February 12th, 2009 Posted in Comics, Computers/Internet | 2 Comments »

I’ve put together a simple plugin for self-hosted WordPress blogs that adds a “Power Up” button to your posts for submission to Comicbook.com (a Digg-like site or comics-related news).

No configuration needed – just install it and activate it.

Yeah, I could have just pasted the code into my theme template, but I like to keep functional changes separate in case I ever decide to switch to another theme.

At present it will only show on individual posts. It won’t show on pages, or the front of the site, or any sort of archive page.

You can see it in action on Speed Force.

Download:
ktv_comicbook_powerup-0.1.zip

Running on WordPress 2.7 Final

Wednesday, December 10th, 2008 Posted in Site Updates | No Comments »

I have now updated this blog (and Speed Force) to WordPress 2.7 Final — using the built-in updater. It takes a while, but it’s entirely automated once I tell it “Install” and enter my FTP info.

The built-in plugin installer is very convenient as well.

The Flash 10 upload bug is fixed!

As with Speed Force, I’ve dropped the plugin I was using for avatars in favor of the built-in feature. It still generates Wavatars for those of you who leave your email address but don’t have Gravatars, but it seems to generate them differently, so you get a new and different monster.

All my plugins work as far as I can tell (official plugin compatibility list), but there are a couple of glitches:

WP-Super-Cache doesn’t seem to be deleting expired pages on schedule. And the spot for the convenient clear-cache-now buttons for that and WP Widget Cache doesn’t exist anymore, so if I do need to clear them out I need to go to the plugin’s settings page — which is what I had to do until a month ago anyway, so no big deal.

Also, Twitter Tools doesn’t seem to be able to pre-check the “Notify Twitter about this post” checkbox. But the important stuff works.

I’m still getting used to the new admin layout, but the only thing that really bugs me is there doesn’t seem to be a quick way to get to scheduled posts from the dashboard.

Other than that, so far so good. As always, let me know if anything seems broken.

Jumped to WordPress 2.7

Friday, December 5th, 2008 Posted in Site Updates | No Comments »

Figured I’d give WordPress 2.7 RC1 a shot. Probably should have waited for the final release, but I figure if they’re confident enough to roll it out on WordPress.com, I might as well try it. Plugin Compatibility seems decent.

As usual, let me know if you see any weirdness.

That Welcome Message (WordPress Greet Box Plugin)

Tuesday, December 2nd, 2008 Posted in Site Updates | 3 Comments »

I’ve been trying out something new here and at Speed Force over the last two weeks: a customized welcome message to readers who come in from certain web services, particularly social networks where I’m also set up. Twitter users see a link to my Twitter profile, for instance, and LiveJournal users see a link to the syndication feed for this blog. In theory, it should only show you the welcome box once (or once a week at the most), depending on whether you allow cookies.

I’d actually tried out a similar idea when I first launched Speed Force this summer, but the implementation I used did all the processing on the server, so it wasn’t compatible with caching. (It also only detected two built-in sites and one custom site, and I didn’t feel like hacking it up to add more.)

So when Weblog Tools Collection mentioned a new plugin called Referrer Detector, I figured I’d give it a whirl. It didn’t quite work right with my setup at the time. I fixed the bugs I could, and reported the issues to the author, then tried out a similar plugin — which, as it turned out, had inspired him to write his own — called WP Greet Box. It also had a few hiccups, and again I reported the issues I’d encountered. Both plugins went into a period of heavy development over the next few days.

I’ve settled on WP Greet Box, which seems to be more flexible than Referrer Detector (though the latter seems to be getting more attention). The author has also been very responsive to both problems and suggestions.

Flash 10 and WordPress File Upload Problems

Thursday, October 16th, 2008 Posted in Computers/Internet, Troubleshooting | 15 Comments »

Well, Flash 10 is out with new features, security updates, and a fix for a Firefox video problem that I never noticed because it only affected Windows, and only sometimes.

It seems a little less stable than version 9 on Linux, at least 64-bit (it’s kind of complicated, because they only have a 32-bit program, so you either need to run a 32-bit version of your web browser, or use a wrapper that will let the 64-bit browser talk to the 32-bit plugin. nspluginwrapper does this for Firefox and other Gecko browsers, while Opera has a wrapper built in). But the annoying part: WordPress’ image upload no longer works.

Current versions of WordPress use SWFUpload to provide an enhanced file uploader. If you don’t have Flash installed, it will just use the standard upload dialog built into your web browser, but then you’re stuck uploading one image at a time — a real pain if you’re making a photo gallery post. Unfortunately for upload libraries, Adobe removed the ability for the Flash API to open a file dialog for security reasons.

So now, you can click on the button, but the dialog never opens. WordPress is tracking the issue in ticket 6979, which mentions that SWFUpload is discussing workarounds, and the YUI Uploader has already released a new version that works with Flash 10.

An update of some sort is likely to happen soon. In the mean time, WordPress users have two choices: hold off on updating Flash, or stick with the browser uploader for now.

Update October 31: SWFUpload has a new version in beta which works with Flash 10, and WordPress is working on integrating the update. It’s targeted for WordPress 2.7, which comes out in a little under two weeks, though the 2.7 writeup lists it as a feature that “didn’t make it” and might be in 2.8. (This seems like something that would affect enough people that I’d hope they would include it, even if it means pushing back the release a few days for more testing.)

There’s also been talk about implementing a file uploader using Gears, which I’d find really appealing if I weren’t 64-bit Linux both at home and at work.

Update November 1: I’ve tested WordPress 2.7 Beta 1 (not on this blog) and can confirm that the fix is included, as I was able to upload two images in one transaction.

Improving Browser Reliability

Thursday, July 31st, 2008 Posted in Browsers | No Comments »

The IEBlog recently posted about their efforts to improve reliability in Internet Explorer 8, particularly the idea of “loosely-coupled IE” (or LCIE). The short explanation is that each tab runs in its own process, so if a web page causes the browser to crash, only that tab crashes — not the whole thing. (It is a bit more complicated, but that’s the principle.) Combine that with session recovery (load with the same set of web pages, if possible with the form data you hadn’t quite finished typing in), and you massively reduce the pain of browser crashes.

I’d like to see something like this picked up by Firefox and Opera as well. They both have crash recovery already, but it still means restoring the entire session. If you have 20 tabs open, it’s great that you don’t have to hunt them down again. But it also means you have to wait for 20 pages to load simultaneously. It would be much nicer to only have to wait for one (or, if I read the IE8 article correctly, three).

Edited to add:

On a related note, I’ve run into an interesting conflict between crash recovery and WordPress’ auto-save feature. If you start a new post, WordPress will automatically save it as a draft. If the browser crashes, it will bring up the new-post page, but restore most of the form data you filled in. So the title, the text of your post, etc will all be there. But WordPress will see it as a new post, and you’ll end up with a duplicate.

This wasn’t a major problem when I encountered it — I had to reset the categories, tags, and post slug after I hit publish (since I hadn’t noticed that they’d been reset to defaults), and I just deleted the older, partial version of the post — but I can imagine if I’d uploaded an image gallery, I would have been rather annoyed, since there’s no way (that I’ve noticed) to move images from one post to another. Reuse them, sure, but not such that the gallery feature would work.

Bits and Pieces

Tuesday, July 15th, 2008 Posted in Comic Con 2008, Computers/Internet, Strange World | No Comments »

At lunch today, I saw a woman, probably in her 50s, wearing a fitted black T-shirt that said, in sparkly letters, “BOTOX”. Srsly. I couldn’t find any pictures of the design, but a commenter here says it’s a promo handed out to staff at plastic surgery clinics.

Comic-Con has completely sold out. Hmm, let me rephrase that. There are no more memberships available for this year’s Comic-Con International in San Diego.

Spam Karma has gone GPL — After years of support Dr. Dave has decided to stop maintaining his spam plugin and turn it over to the open-source community. The project is now on Google Code.

WP 2.6

Monday, July 14th, 2008 Posted in Site Updates | No Comments »

I just upgraded this site to WordPress 2.6. I probably should have held off a bit, but there were some things I really wanted to be able to use, like the new Gears support, version history on posts, Opera-related fixes (too bad Gears doesn’t work with Opera yet), and improved image management. And the theme and plugin APIs are supposed to be “pretty much identical,” so there wouldn’t be much risk of breaking anything.

Call it an impulse. :-D

Fun facts from the Dashboard: This is the 1,649th post on K-Squared Ramblings. Hard to believe. Also: there are currently 2,744 comments. Admittedly that includes local pingbacks, but still, that’s a heck of a lot of comments!

Judging by the comment IDs, roughly 40,000 spam comments have been deleted since this blog went online. Fortunately, most of those are handled automatically by Spam Karma. And just think, that’s not counting however many Bad Behavior blocks before they even get processed!

WordPress Update & Plugin Request

Friday, April 25th, 2008 Posted in Computers/Internet | No Comments »

WordPress 2.5.1 is out, with a slew of bug fixes and one “very important security fix” which will reportedly be disclosed soon. It’s worth upgrading ASAP. You don’t want your blog hacked.

Highlights are listed at that first link, but for me the most noticeable change was a fix in the new media uploader. When uploading images on Linux, the thumbnail+properties form would display 3 times, none of them actually usable, for each image uploaded. Once I clicked on the gallery and went back, it was fine, so I could still use it, but it was an extra step that shouldn’t have been necessary. I kept meaning to report the bug, but it looks like someone got to it ahead of me. Thanks, someone!

And now, a request to WordPress Plugin Developers. When you release a new version, please tell me what has changed. Some plugin authors are good about this, including announcements on their web pages. Some even include a changelog with the download. But some don’t do either, and the only way to find out is to download the new files and compare them to the old ones using a tool like diff.

Now that I think about it, putting a “release notes” section in each entry in the Plugin Directory would go a long way toward making this work. It would put the information right there in the directory, and it would encourage plugin authors to compile the information int he first place.

Avatars!

Wednesday, April 16th, 2008 Posted in Computers/Internet, Site Updates | 6 Comments »

Since Gravatar was bought by Automattic, the service has been a lot more stable. I had already re-enabled them on this blog before WordPress 2.5 came out with built-in Gravatar* support.

Not everyone has a Gravatar, though, so many comment threads just show the default icon, over and over. Not only does this look boring, but it misses out on the whole point of using an avatar: providing an easy at-a-glance visual distinction between each author.

When I first used Gravatars on this site, I set it up to use a giant first initial as a fallback. Now, I’ve been trying out two plugins that will automatically generate avatars for people who don’t have their own:

  • Wavatars builds up cartoony faces using geometric shapes. Interestingly, it’s by Shamus Young, author of the screencap-based webcomic DM of the Rings and writer of Chainmail Bikini.
  • WP_Identicon sounds like a Transformers faction, but produces a geometric pattern as inspired by Don Park’s Identicon, which built a similar image based on a visitor’s IP address. The same author also has one that generates cartoon monsters, which appears to be one of the earliest implementations of this concept.

These plugins will use a Gravatar if available, or else generate an image based on the commenter’s email address (if supplied). That means each comment by the same person should use the same image. Other blogs using the same plugins at default settings will come up with the same avatar for each commenter, as well. The images are stored in a cache, so each only has to be generated once.

6 Wavatars to the left, 6 Identicons to the right

Once I made sure both plugins worked, I showed the results to Katie. We ended up settling on Wavatars, since faces are easier to recognize than patterns. (Though the patterns are really cool!)

You can try out the automatic avatar by leaving a (relevant, please!) comment on any post. Or you can run over to Gravatar and set up an icon of your choice!

*What’s a Gravatar? The intent is to be a Globally Recognized Avatar. You upload an image to Gravatar and associate it with your email address. Then any site with Gravatar support will be able to display your image next to your posts. Right now it’s mostly used in blog comments, but it could easily be worked into forums, wikis, etc. The Gravatar Blog mentions other uses they’ve seen people apply it to, such as plugins for Thunderbird and the Mac OS X Address Book

Note: I did notice one important drawback to the WP_Identicon plugin: it’s very inefficient at generating the images. When I first visited posts with long comment threads, like Another One Bites the Dust (174 comments) and Songs Not to Play at a Wedding (87 comments), WP_Identicon took over a minute to generate all the icons and maxed out the server’s CPU. Sure, the images are cached, so it’s only really an issue when you first install the plugin (unless you get a lot more people commenting at once than we do here), but to compare, Wavatar on an empty cache finished the same posts in just 4 seconds and 2 seconds, respectively.

Upgraded to WordPress 2.5

Saturday, March 29th, 2008 Posted in Site Updates | 4 Comments »

I’ve upgraded to the just-released WordPress 2.5. The new admin interface is very nice, especially the ability to upload more than one image at a time (though I think they might want to test uploading a single picture a bit more [edit: Maybe it's specific to Firefox 3 beta 4---on uploading one image, it shows the control panel three times instead of just once.] [edit2: Maybe it's on the Firefox beta, but the Linux version of Flash Player. It works just fine on the same version of Firefox on the Mac.] [edit3: It's definitely the Linux Flash Player; I tried it with Opera on Linux and had the same problem.]).

I’ve adapted my theme to use new built-in support for Gravatar and optimal titles instead of the plugins I was using before.

All the stuff you’ll see appears to be working just fine so far. A couple of minor glitches with some admin plugins (WP-Amazon takes two clicks to show or hide instead of just one), but no biggie.

There was one issue during the upgrade. I’ve been using XCache for WordPress to improve site performance. I was asked for the XCache admin login & password during the database upgrade. I couldn’t remember them, so I renamed object-cache.php and hit “cancel” on the password prompt, but it seems to have upgraded everything fine.

The one really annoying thing is that the Bad Behavior anti-spam plugin conflicts with the new media uploader (it’s already on the WordPress 2.5 Plugin Compatibility list). There are two issues. First, “Shockwave Flash” is apparently used by spambots, so it was listed in blacklist.php (code 17f4e8c8). Second, it seems Flash is mixing and matching HTTP 1.0 and HTTP 1.1. If I remove it from the blacklist, it trips condition a0105122, which indicates an Expect header appearing in an HTTP 1.0 request. Removing that test allows it to upload, but the test catches a lot of spam…

Edit: I tried out the visual editor again, as it was billed as “it doesn’t mess with your code anymore.” Sadly, it does mess with your code. It disappeared an image in one post, and it still replaces semantically-neutral <i> tags with <em> tags, even when you’ve entered them manually. <em> is for emphasis. When you italicize a book title, you are not emphasizing it. By replacing one tag with the other, it adds inaccurate semantic meaning. This is just as incorrect as using <h5> to get small text instead of using it for a level-5 heading.

Spam Switch

Thursday, February 7th, 2008 Posted in Site Updates | 1 Comment »

With the recent rash of Trackback spam, I finally bit the bullet and am now experimenting with Akismet in addition to Spam Karma. I’m not sure how well they work together, or, at this point, which plugin processes the comment first. Update: I’m trying Akismet on its own for now. Or, more precisely, Akismet as the sole second line of defense. Bad Behavior is still holding the front line.

Update (Feb 14): I’m now back to using Spam Karma 2, but with a plugin that uses Akismet as one of the score components. This seems to be working well, as SK is able to block the ridiculous stuff (100 porn links in one comment, etc.), and Akismet is able to catch the trackback spam that’s been passing SK2 by temporarily including an inbound link.

The big problem I had with Akismet was that aside from the age of the target post, the blocked comments weren’t sorted or filtered in the admin interface. I was having to look through ~30 comments a day for false positives. Spam Karma will show only the borderline comments by default, and uses a table structure that makes it easier to skim.

This way, though, I get the proverbial best of both worlds.

Random Tech Bits

Friday, October 26th, 2007 Posted in Apple, Browsers, Opera, Spam | No Comments »

Taking a break from the fire commentary:

Mac OS X LeopardApple: Finally pre-ordered Mac OS X Leopard, removing the temptation to run out to an Apple store or Fry’s this weekend (though I’ve been meaning to put some more RAM in the Windows box). Saved a few bucks by ordering from Amazon ($10 off the family pack, would’ve been $20 off the standard box), and picked the free shipping so that I won’t be tempted to install it until there’ve been a few days’ worth of bug reports.

Meanwhile, I’m wondering when Safari 3 comes out for Windows and Tiger. Tonight at 6:00? Monday? I’m looking forward to this putting some of the new CSS3 capabilities into the hands of potentially 5% of the web audience.

[Opera Logo]Opera: Speaking of web browsers, Opera 9.5 beta came out yesterday. In addition to lots of work on rendering & site compatibility (as seen through the last few weeks’ worth of alpha releases), they’ve launched a new service called Opera Link. It’s primarily a bookmarks sync service, plus a web-accessible interface. So you can automatically sync multiple copies of Opera—including Opera Mini—and also be able to access those bookmarks from Firefox, IE, or a computer where you’re a guest (friend, computer lab, cafe, etc.). I think the biggest impact here is going to be syncing between the desktop and phone, like Safari on the desktop and the iPhone.

On the other hand, imagine adding a bookmarklet or Firefox extension to more easily update from—or even fully sync with—other browsers. Or better yet, a way to synchronize Opera Link with, say, del.icio.us, which can integrate fully with both Firefox (via an extension) and Flock.

Spam: I’m astonished that, with the amount of comment spam that hits this blog (many thanks to Bad Behavior and Spam Karma for helping stem the tide!), I’ve only netted 7 comment spammers for Project Honeypot since they started tracking comment spam 6 months ago. I guess the software is smart enough to only hit the real forms?

Wordpress: Just released version 2.3.1 with a bunch of bugfixes and (of course) a security fix. Updated.