Tuning WordPress Plugin – Visitor Maps and Who’s Online
I think this is one of the top 10 wordpress plugin that a lot of people using now – Visitor Maps and Who’s Online.
You can download in here
If you have a lot of visitor visit your blog / website that using this plugin, this plugin may slow down your MySQL.
MySQL will show that some query that SELECT from wp_visitor_maps_wo is not using indexes.
For more information about How MySQL Uses Indexes click here.
Here is the way to trace out that your query is not using index.
# vi /etc/my.cnf
log_slow_queries = /var/log/mysql/log-slow-queries.log
long_query_time = 10
# service mysqld restart
Try to load your wordpress site with Visitor Maps and Who’s Online plugin installed and activated.
# tail /var/log/mysql/log-slow-queries.log
You may see this code. This may slow down your MySQL performance.
SELECT count(*) FR0M wp_visitor_maps_wo
WHERE (name = 'Guest' AND time_last_click > '1284278942')
0R (user_id > '0' AND time_last_click > '1284278942');
Because we know that SELECT count(*) always use up a lot of MySQL resources.
So, we should add index to the table field.
# mysql -u -p
mysql > alter table wp_visitor_maps_wo add index(time_last_click);
or you can add the INDEX using phpMyAdmin to the field time_last_click in table wp_visitor_maps_wo
After this, try to reload your website for few times, and check the /var/log/mysql/log-slow-queries.log appear the SQL again or not. Remember to turn off the slow_query_log from slow_query_log=1 to slow_query_log=0 after the tuning.