WordPress

MySQL MYD and TMD files

Posted in Backup, WordPress on April 8th, 2008 by Johan Huysmans – 2 Comments

I just recovered from a database issue.

While running a mysqldump of my databases I received an error. Running a check on that specific database told me that the comments.MYD file was not found.

Investigating on the system showed me that due to an error the filesystem containing /var/lib/mysql was mounted read-only. Running a fsck on that specific filesystem solved that error but didn’t fix my corrupted table.

phpMyAdmin showed that the table was in use and while performing a check or repair it complained about the missing file.

The comments.MYD file was indeed missing, but there was a comments.TMD file, which wasn’t there for all the other tables.

Moving this TMD file to MYD solved the issue. I could repair the table and the check is again successful.

During this problem wordpress didn’t complain but it just didn’t show my comments. But I have no clue what caused this problem.

FireFox plugins

Posted in Linux SysAdmin, WordPress on December 15th, 2006 by Johan Huysmans – Be the first to comment

In my last post I listed my WordPress plugins. Now I will give you an overview of the firefox plugins I’m currently using.

Nagios Checker will show you the status of your nagios instance(s). It will flash and/or make some noice when a service of host changes it’s state.
AdBlock Plus will block all the annoying banners. I noticed it really improved the loading speed of some pages.
SwitchProxy makes it able to easily switch the proxy configuration without going to the preferences screen.

counterize and other wordpress plugins

Posted in WordPress on December 10th, 2006 by Johan Huysmans – Be the first to comment

Some time ago Anders Holte Nielsen announced that he would stop developping counterize. He suggested to use Firestats, which is an other wordpress plugin, launched out of Counterize.

I installed and tested Firestats. It has some nice features but also some downsides, it’s missing graphs. It’s all text, text, text with a nice ajax layout. I’m not happy enough to completely move to Firestats, at the moment I’m still using both Counterize and Firestats.

A couple of weeks after the previous mentioned post Anders Holte posted already 2 patches submitted by some Counterize-lovers. This showed that counterize wasn’t ready to die. And indeed Counterize II was born. It moved from Denmark to Germany in the hands of Steffen Forkmann.
I updated my old Counterize version to version 2.0.3 and noticed that there were already some added features.
Counterize shows some graphs but imho it shows the wrong information. I don’t want to know how many people visited my site on the 5th of every month. I want to see how many visitors have visisted yesterday, the day before,… This way I can see if the number of visitors is increasing or decreasing. The graph showing only this months hits is a good thing, it would even be better if it was showing the last 30 days.

Keep up the good work, Steffen!

Meanwhile I activated Akismet (an anti-spam plugin). It will check every posted comment with the central database. You need to register to wordpress.com to receive an API-key, but it is worth the effort.
I also installed DB-Manager which allows you to manage the wordpress database from inside the controll panel. You can backup the database, drop some tables, optimize all tables or execute any query and many more.

New version of counterize

Posted in WordPress on April 12th, 2006 by Johan Huysmans – Be the first to comment

This morning the new version of counterize has been released by Anders.
You can find the releasenotes a.k.a. blog entry here.
As you can see, the changelog is my patch, nice hé ;)

I also added Anders’ blog to my blogroll (it’s one of those bloks at the right)

counterize patch 3: excluding users with an admin webinterface

Posted in WordPress on April 7th, 2006 by Johan Huysmans – Be the first to comment

Last weekend I created the biggest part of the patch.
I coded the webinterface that allows you to select one or multiple users that may not be counted. These users are saved into the database and compared to when someone hits a page.

During this week I created 3 extra buttons for the webinterface.
One that allows you the select every users, one that allows you to select no users, and another one that resets the form.

Screenshot

You can find the patch here, enjoy!
I didn’t spent much time debugging it, so if you find an error, please let me know.

counterize patch 2: excluding users, the first step

Posted in WordPress on March 31st, 2006 by Johan Huysmans – 1 Comment

Adding a counter on your site is great. But if you want to get the real number of visitors you may not count your own pagehits.
In the counterize plugin is an excludelist where you can add your own ip. But I’m always on different locations and what if someone else from the same network visits your website… it doesn’t get counted.

I know 1 thing… If I visit my blog, I’m already logged in (he remembers my login). So what I made is an extra check before the page-hit get logged. If I’m logged in, it doesn’t need to be counted.

Adding these simple lines does the trick (added them at line 631)

# let's check it is a logged in user.
# If he's logged in, we don't count him.
if ($checkval == 0) {
     global $user_ID;
     get_currentuserinfo();
     if('' == $user_ID)
     $checkval=0;
} else {
     $checkval=1;
}

This is hard coded, but I will add an option to the admin webinterface of counterize that can enable or disable this option and maybe add an textfield so you can decide which user doesn’t need to be logged.

Enjoy ! You can find the patchfile here.

counterize patch

Posted in WordPress on March 29th, 2006 by Johan Huysmans – Be the first to comment

I have been using counterize for a while. This is a wordpress plugin that counts the page-hits of your blog. It comes with a nice admin interface containing detailed information.

This plugin is designed to be located directly in the wp-plugins directory together with its images. I wanted to have all files of the counterize plugin located in the counterize directory (a subdirectory of plugins), so i needed to change the paths of the images and links to the .php file in the counterize.php.

It isn’t a lot of work to update all the paths, there are only 8 instances that needs to be changed located on line 135, 188, 240, 678, 731, 790, 853 and 1224. For the lazy guys that have version 0.50 of counterize I created a patch file, you can find that file here.

Here is a manual for applying that patch:

$ cd /path/to/wp-content/plugins/
$ mkdir counterize
$ mv counterize.php counterize_blue.png counterize_green.png counterize_red.png counterize_yellow.png counterize
$ patch counterize/counterize.php /path/to/downloaded/patch1

Wordpress behind a proxy

Posted in WordPress on February 5th, 2006 by Johan Huysmans – Be the first to comment

After installing this wordpress blog, I noticed that the loading of the “Dashboard” page takes ages. Reading the code showed me that it wants to fetch some rss-feeds. Because this server is behind a proxy this is normal, I just have to define a proxy somewhere.
Google pointed me to this wordpress forum.

This is what you need to edit in wp-includes/class-snoopy.php:

var $proxy_host = "";
// proxy host to use
var $proxy_port = "";
// proxy port to use