W09

After Comments In Progressmany moons of bickering and looking around, I decided to take up the gloves and do it myself. Currently I’m using a slightly altered script that ‘automatically’ folds and closes comments after 10 days. This generally works good and has stopped the flow of sapm directed at the comments. However, I’m lacking precise control, that is, I’d like to have some posts to keep their comments available for a longer time.

You’ll find some of these plugins in the WordPress repository, but most of them make no sense and work rather not really good1.

I also noticed something funny in queries of existing plugins where in the code roundabout attempts are made to make a selection first and then pass the resultset to an ‘update’ statement: hey rookies, the following statement is ‘legal’ SQL:

update wp_posts
set ping_status = 'closed'
where post_date < DATE_ADD( DATE_SUB(CURDATE(), INTERVAL 4 month), INTERVAL 1 DAY);

On the other hand, using subselects in MySQL should generally be avoided. There's no real consensus around which MySQL version supports subselects. 4.xx maybe. 3.23 maybe. Who knows!

On a related note, I see that there's a new WP version out.

1 That is an understatement.

2 thoughts on “W09

Comments are closed.