Install Stattraq on Wordpress

Stattraq is one of the better statistics plugins for Wordpress. Unfortunately due to the changes made in recent versions of Wordpress, the installation link in the plugin description gives a permissions error.

You do not have sufficient permissions to access this page.

This happens because the stattraq-install.php is not included in the $_registered_pages[] array, so user_can_access_admin_page() in wp-admin\includes\plugin.php doesnt allow access to the install code.

To fix it, you can either add the stattraq-install.php hook to $_registered_pages[], or simply add another menu item. To add another menu, edit the stattraq_menu() function near line 170 in wp-content\qp-stattraq\stattraq.php

function stattraq_menu()
{
    if (function_exists(‘add_menu_page’))
  {
    // add_menu_page(‘Stat Traq’, ‘Stat Traq’, 8, ‘../wp-stattraq/’);
    // add_menu_page(‘Stat Traq’, ‘Stat Traq’, 8, ‘../wp-content/plugins/wp-stattraq/index.php’);
    add_menu_page(‘Stat Traq’, ‘Stat Traq’, 8, ‘wp-stattraq/index.php’);
    add_menu_page(‘Stat Traq’, ‘Install Stat Traq’, 8, ‘wp-stattraq/stattraq-install.php’);
    add_action(‘admin_head’, ’stattraq_admin_css’);
    }
}

  • Share/Bookmark

Leave a Comment