The MU forums have moved to WordPress.org

BAStats Plugin (17 posts)

  1. NetAndif
    Inactive
    Posted 18 years ago #

    Has anyone tried the BAStats Plugin in the latest wpmu snapshots?
    It gives me an error, missing a function.
    Anyone yet?

  2. lissyx
    Inactive
    Posted 18 years ago #

    No. I tried on my old snapshot, and just get nothing working I think ...

  3. NetAndif
    Inactive
    Posted 18 years ago #

    Hm. The BaStats Plugin does work on my older wpmu's.
    Ok, i had to modify the BaStats.php a little, so it fits into the admin panel.
    But in 2005-05-03 and all later snaps, it doesn't work at all.
    I have found out, that there are two functions missing in the file functions.php:

    if ( !function_exists('get_currentuserinfo') ) {
    function get_currentuserinfo() { // a bit like get_userdata(), on steroids
    global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5, $user_identity;
    // *** retrieving user's data from cookies and db - no spoofing

    if (isset($_COOKIE['wordpressuser_' . COOKIEHASH]))
    $user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
    $userdata = get_userdatabylogin($user_login);
    $user_level = $userdata->user_level;
    $user_ID = $userdata->ID;
    $user_nickname = $userdata->user_nickname;
    $user_email = $userdata->user_email;
    $user_url = $userdata->user_url;
    $user_pass_md5 = md5($userdata->user_pass);

    $idmode = $userdata->user_idmode;
    if ($idmode == 'nickname') $user_identity = $userdata->user_nickname;
    if ($idmode == 'login') $user_identity = $userdata->user_login;
    if ($idmode == 'firstname') $user_identity = $userdata->user_firstname;
    if ($idmode == 'lastname') $user_identity = $userdata->user_lastname;
    if ($idmode == 'namefl') $user_identity = $userdata->user_firstname.' '.$userdata->user_lastname;
    if ($idmode == 'namelf') $user_identity = $userdata->user_lastname.' '.$userdata->user_firstname;
    if (!$idmode) $user_identity = $userdata->user_nickname;
    }
    }

    if ( !function_exists('get_userdatabylogin') ) {
    function get_userdatabylogin($user_login) {
    global $cache_userdata, $wpdb;
    if ( !empty($user_login) && empty($cache_userdata[$user_login]) ) {
    $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$user_login'"); /* todo: get rid of this intermediate var */
    $cache_userdata[$user->ID] = $user;
    $cache_userdata[$user_login] =& $cache_userdata[$user->ID];
    } else {
    $user = $cache_userdata[$user_login];
    }
    return $user;
    }
    }

    I really don't know why these functions did have gone.
    Get them from wpmu-2005-03-15 and the plugin will work.
    Strange...
    I would submit this bug as a trac ticket, but i could not find the post where Matt explained how to do this.

  4. matt
    Key Master
    Posted 18 years ago #

    These have been moved to pluggable-functions.php to allow for plugins to modify them, BAstats will need to be updated to work for this.

    http://trac.mu.wordpress.org/changeset/58 and
    http://trac.mu.wordpress.org/changeset/59

    actually break this core WordPress feature and should be rolled back. It seems like the WP files should be changed as little as possible in order to make tracking development easier, but I'm seeing things like changes to the admin font size? If you think it should be changed, file a bug on Mosquito for the core.

  5. NetAndif
    Inactive
    Posted 18 years ago #

    Matt,
    i dont't think something in the wp core should be changed,
    but because i had found several bugs in wpmu, like the one with BAStats, i tried to fix them. If plugins are included, i think they should work.
    About the admin-fontsize: it is a new modified admin style, i had putten there.
    I will remove the changes i made to functions.php
    But unfortunately i don't know how to modify the BAStats plugin so it will work with the new pluggable functions.

  6. revbob
    Inactive
    Posted 18 years ago #

    This works (inside BAPath.php), right after the first include:

    require (ABSPATH . WPINC . '/pluggable-functions.php');

  7. gnukerman
    Inactive
    Posted 18 years ago #

    This is somewhat relevent for the current thread, but not totally.

    I installed last night's snap (2005-05-19) and unless I completely delete the BAStats directory the whole WPMU site goes blank.

    Doesn't even have to be active. Once the directory is removed from the plugins/ there are no problems, site works fine.

    Just so everyone knows, I'm referring to the basic install, and have yet to test new blog creation. Will be doing that tonite.

    Once I get everything working, I'll be using wpmudev.org for our testing ground for all future snaps of WPMU and will post links for those wishing to use it as a testing ground with us.

    Until then, we have disabled new blog sites from our main site using WPMU.

  8. donncha
    Key Master
    Posted 18 years ago #

    Revbob - I've applied that change to BAStats/BAStats.php so hopefully things will work in the new snapshot tomorrow!

  9. gnukerman
    Inactive
    Posted 18 years ago #

    yoo-whoooo.

    no answer to my question?

  10. donncha
    Key Master
    Posted 18 years ago #

    Gnukerman - does it work now? It was probably a PHP fatal error because the function was missing.
    Did you check the error logs?

  11. gnukerman
    Inactive
    Posted 18 years ago #

    Just uploading the directory still causes the site to go blank.

    I will snag the latest snap and try again.

  12. gnukerman
    Inactive
    Posted 18 years ago #

    this may be related to mod_security as with our other discussion. BAStats still doesn't work.

    ??

  13. nscott
    Inactive
    Posted 18 years ago #

    Hi all,

    I loved BAstats, but I can't get it to work. Does anyone have a suggestion of the best substitute until the problem is solved?

    thanks, neil

  14. donncha
    Key Master
    Posted 18 years ago #

    Use manage->referers until it works again.

  15. donncha
    Key Master
    Posted 18 years ago #

    There's another reason to rely on the referers page - the aggressive caching used in WPMU means that the WordPress engine isn't always loaded.
    This uses PEAR Cache so if you don't have it installed, don't worry, it won't be used. I enabled BAstats on my test box and it didn't cause the world to stop. It didn't record any stats either but if anyone knows the internals of BAstats feel free to fix it and mail me the patch!

  16. NetAndif
    Inactive
    Posted 18 years ago #

    Hm. BAStats does work fine here. I can't guess what has gone wrong with it for anyone.
    There's another reason for not using the referers:
    They seem to be pushed into one table for all blogs.
    At every blog install, the upgrade script tries to re-create the referer tables.
    That's another bug in the blog creation process.
    However, only one table for ALL referers - impossible mission.
    The BAStats tables only get created id the blog owner enables the plugin - so that's way better.

  17. donncha
    Key Master
    Posted 18 years ago #

    Yes, that's a simple change that would make wpmu blog sites more scalable. As it is, large installations can have *very* large referer tables. If I get around to it I'll make that change.

About this Topic

  • Started 2025 years ago by NetAndif
  • Latest reply from donncha