Tag Archives:

plugins

High database load from Ajax Edit Comments…

… and a preliminary solution:

The WordPress plugin “Ajax Edit Comments” from The Reader Appreciation Project1 allows the commenter to edit his comment for a certain time – useful especially for typos and minor corrections. (Admins can do more.) Visitors utilize it here for about every 10th comment, by the way.

Now Pierre notified me yesterday about the high number of database queries (and that the response time could be better, too) – higher than what I always saw when logged in. (See the blue footer line.) Doing a little research, I found that it’s the aforementioned Ajax Edit Comments that uses 4 additional database queries for each comment in order to check if the visitor is allowed to edit it (unles (s)he’s logged in as admin who is always allowed to edit). That can sum up to quite a lot if there are many comments on a single post.

I quickly added a little modification to the plugin2 which check the comment age in advance without database access – in my quick tests, these modifications appear to work fine. If you too don’t see any problems – feel free to test it here or maybe later for the music quiz on 16:00 – I will, of course, send the changes to the plugin’s author, hoping they will be included in future versions. :)

  1. for WordPress 2.5 and higher – old version for 2.1–2.3.x here []
  2. in both the old version I’m still using here and the new in my test environment where I’m preparing the WordPress 2.7 update []

Desperately seeking sh*t

I’m currently testing the WordPress statistics plugin WassUp – it offers a nice chronological list of the recent accesses (including search phrases and result pages), a live view of current activities and more. And all this locally, without relying on external servers.

We’ll see how well WassUp works – and how exactly it counts, because even with hiding bots and spams, there seem to be more views than other tools tell (well, the feed accesses apparently have to be subtracted manually…).

So far, I quite like it – I also noticed that the detection of known bad hosts by comparing the name against a 6700+ lines text file costs quite some server performance; 1.5 instead of 0.7 seconds for a typical page generation ist not much, sure, but a clear difference all the same, which is why I disabled that feature for now.

Why this post title, you ask? Well, while looking at the Visitor Details I came across a few search engine users’ visits worth mentioning (click the screenshots to go to my respective posts):

A US American searching for a certain gross video (Wikipedia) clicks his way through to the 39th results page – is he really so desperately searching?
wassup1

My rebus about certain celebrity escapades made the first page of the German Google image search: :)
wassup2

Lotto dreamers, at least, receive the proper information (well, except for a browser update):
wassup3

WordPress: Comment moderation per post

Not only since great judgments from Hamburg (German), some bloggers might think about having all comments moderated before displaying them – which, of course, means more work, and it would hinder discussion between your commenters.

One solution would be to have comments moderated only for posts that potentially attract problematic comments, which I had already though about for my first Global Scaling lotto prognosis article – so I had searched for a plugin or an option, but found none. Then I had checked the WordPress source code for places to add something, and at first hacked this functionality into wp-includes/comment.php – and now, I’ve turned that into a little plugin.

It’s not very comfortable yet – you have to enter the IDs of the affected posts manually directly into the plugin’s PHP file (what’s still more comfortable than editing the WordPress core files). When needed, I might add an options page for that…

» Go to the plugin page with more info and the download link

Little Stars

Again (after an earlier test phase with only few participants), I installed the plugin WP-PostRatings by Lester ‘GaMerZ’ Chan, which allows you to rate my posts quickly with one to five stars.

You can see it left of each post in the index views, and below the post in single views. I’d appreciate it if you use this function. :)