WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 144)]
SELECT ID, COUNT( comment_ID ) AS ccount FROM wp_posts LEFT JOIN wp_comments ON ( comment_post_ID = ID AND comment_approved = '1') WHERE ID IN (68) GROUP BY ID

Curioso! » Blog Archive » Awstats plugin

Awstats plugin

This is a simple plugin that retrieves information from Awstats log files, currently only popular pages, search phrases, referrers and browser statistics. It provides template functions for including this information on your WordPress site.

Awstats is a web server statistics package that maintains a set of monthly statistics summaries (default in /var/lib/awstats). These files are used by this plugin to extract information that can be included in your web pages.


  1. Download the zip file.
  2. Drop the awstats.php file in your plugin directory.
  3. If necessary change the few lines at the top of the file to reflect the location of your awstats log files and the site string in the log filenames.
  4. Activate the plugin.


Insert something like

 <li id=\"popular\">Popular:
        <?php awstats_popular(); ?>

in your template where you would like to have an overview of popular pages.

Insert something like

 <li id=\"searchwords\">Search words:
        <?php awstats_searchwords(); ?>

in your template where you would like to have a search phrase overview.

Insert something like

 <li id=\"referrers\">Referrers:
        <?php awstats_referrers(); ?>

in your template where you would like to have an overview of referrers.

Insert something like

 <li id=\"browsers\">Browsers:
        <?php awstats_browsers(); ?>

in your template where you would like to have browser statistics.

The month for which the information is retrieved is the same as the month used in the get_calendar template function.

Update (12 May 2005)

I bumped the version to 1.0.

You can also add the heading string as parameter and omit the <li>-headers, e.g.

       <?php awstats_popular(10, 'Popular'); ?>
       <?php awstats_searchwords(10, 'Search phrases'); ?>
       <?php awstats_browsers('Browsers'); ?>
       <?php awstats_referrers(10, 'Referrers'); ?>

where 10 is the maximum number of items to be shown.

And you can invoke the template functions via do_action like:

       <?php do_action('awstats_popular', 10, 'Popular'); ?>
       <?php do_action('awstats_searchwords', 10, 'Search phrases'); ?>
       <?php do_action('awstats_browsers', 'Browsers'); ?>
       <?php do_action('awstats_referrers', 10, 'Referrers'); ?>

The extra parameters only work in WordPress 1.5.1 and higher.

WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 144)]
SELECT * FROM wp_comments WHERE comment_post_ID = '68' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply