23 February 2005

Progress Report on WordPress-pg 1.5


Here’s some SQL

SELECT meta_key, meta_id FROM wp_postmeta GROUP BY meta_id ORDER BY meta_id DESC LIMIT 10;

This is just one of the many issues I’ve been working through in porting this code. Initial table creation is now successful and the sample post is populated and at least partially displayed. Editing is not working, new posts aren’t working, new pages aren’t working, new comments aren’t… well, you get the idea. At least I’m making forward progress though…

Let’s get back to that snippet at the top. Apparently in the latest revision of WordPress the authors decided that adding lots of “GROUP BY some-primary-key” statements would make things better. Now in ordinary database land, if you are “grouping by” some field, you have to give the database instructions on how to aggregate the other fields that you want displayed. In the above example, there may be 3 or 4 rows of meta_keys to choose from. As you can see above the database is given no instructions on which one of those 3 or 4 rows to use. PostgreSQL treats this as a malformed query and returns an error. MySQL in fairly typical fashion for it, just picks an arbitrary row to use. I think it’s using the first row in the table that it happens to come across during your query, but I could be wrong. The point is that it is not well-defined, and in ordinary database land, not well-defined behavior is considered harmful.

So, to make progress I basically have to strip all these GROUP BY statements back out again. And honestly, I’m unable to see what these statements accomplish. The code is “grouping by” a primary key sequence on a given table in all the cases I’ve happened across so far. By definition there should only be one row with a given primary key. But perhaps that’s only true in ordinary database land…


19 February 2005

WordPress-Pg 1.2.2 in CVS


The WordPress-Pg project source code in CVS is up to date with WordPress 1.2.2 as of last Saturday. This is going to be of little consolation to people that want the latest WordPress release (1.5) which arrived during this week.

Given the larger scope of changes for the 1.5 release it may take a little longer to get things together. I’m also going to have to continue to fight the temptation to make improvements in the places where WordPress’s performance is lackluster. It isn’t clear to me from the release notes if they actually managed to do something about the volume of queries needed to render a page or not. A lot of it may be a result of being crippled by MySQL’s limitations as well (for instance, it can only use one index per table in each query), so they may not be able to do anything to help it.

In any case, if you’re interested in WordPress-pg 1.2.2 you can check it out from the Sourceforge anonymous CVS by following the directions at Sourceforge and adding -r WPPG_1_2_1 right after “co” in the checkout command.


03 January 2005

New Pictures in the Gallery


We have some new pictures online in the gallery this evening. A month of pictures have built up and I’ve finally gotten them all online. The pictures include a New Year’s Day trip to the Mercer Slough in Bellevue, flood waters in the Snoqualmie Valley (including some nice pictures of Snoqualmie Falls with flood waters) and some interesting pictures that resulted from me fooling around with a new 50mm lens I got for Christmas.

As with everything else in the gallery, these were shot by either Eileen or I and we haven’t done any post-processing to clean the images up at all. There’ll be problems with levels and white balance and other such technical minutæ, but we hope you won’t hold it against us and enjoy the pictures as much as we do.


02 January 2005

Errant Comments


In the past 24 hours we’ve had several dozen pornography links pasted into the comments of the various articles advertising one particular site. Thankfully that, combined with some other attributes has made it fairly easy to filter the bad guy to a special page just for him (or her, as the case may be).

It seems kind of ridiculous that someone would bother with this sort of thing nowadays. Google already has filtering in place to prevent such postings from impacting their search results, or at least so they say.

In this case the spamming is by some Russian guy advertising a site with various pornography. I don’t really expect their upstream to do anything about the “spamvertised” site. Maybe it is just the Russian mob looking for some hard currency to help with laundering. Throw in the KGB, a rogue CIA agent with amnesia and lots of black Mercedes sedans racing around St. Petersburg and you might have the makings of a good action movie.

The blog spamming itself was being done by a rather unsophisticated tool being run from some number of compromised Windows machines on cable modem networks. Again, I don’t expect the cable modem internet providers will actually bother doing anything to get infected boxes off their network. It’s not like they perceive these costs at all. And I’m quite sure none of those end users know their machines are compromised. Just do us all a favor and remember the following: a computer running Windows will be infected by a virus within 16 minutes of being connected to the Internet if measures (like never ever using MSIE) aren’t taken to protect it, even with countermeasures it’s a crap shoot. You can help by using something else.

For now, he/she/it is blocked and all comments are forced through moderator approval, at least until I’m satisfied that the threat has passed for the time being. Having to waste a few hours on this was annoying. The naughty person in question (and perhaps a few others running ancient Windows) get to see this friendly message for every request they make to this website now:


Hi there!


Someone with a similar browser as you has been spamming the comments with
pornography ads hoping to trick Google into thinking that my site’s good
ranking is some how associated with porn from this guy (probably not real)
in Russia:


Morozov, Alexander se-traf@mail.ru
Tverskaya 13-123
Moscow, Moscow 123456
RU


I’m sick of deleting this garbage out of the pending comment queue, so you’re
seeing this page instead. If you’re a legitimate reader, you have my utmost
apologies, but you shouldn’t be running Windows 98 nowadays anyway unless you
want your computer cracked…


Feel free to direct complaints to…


This person’s host: abuse@atrivo.com
This person’s upstream transit: abuse@nlayer.net
This person’s further upstream transit: abuse@gblx.net


Really, you can stop trying to spam the site now. Go bother someone else
with all the poor Windows cable modem machines you’ve cracked.