Support » Plugins and Hacks » [Resolved] BAstats Error

[Resolved] BAstats Error

  • I get the following code appearing while running the newest bastats:

    <br />
    <b>Warning</b>: in_array(): Wrong datatype for second argument in <b>/home/owner/public_html/wp-content/plugins/BAStats/BAStats_logger.php</b> on line <b>114</b><br />
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- generator="wordpress/" -->
    <rss version="2.0"

    It appears to be loading before the header. Any ideas? the author Owen Winkler does not answer his email.

Viewing 15 replies - 1 through 15 (of 23 total)
  • I figured it out.


    I am having exactly the same error and I guess the author of the plugin doesn’t answer his email and when I tried to question the author of the above post after going to his blog and then finding his contact details – he just said that I had the wrong person.

    I would really appreaciate some help. – I am running 1.5.2 and the error only shows up in firefox to my knowledge …

    Thank you … anything appreciated.

    Moderator James Huff


    Support Team Rep.

    It kind of looks like file corruption. Basically, the plugin is just spitting out some of its PHP code visibly into the header. There really is no error involved. I would suggest deactivating the plugin, deleting the file(s), downloading BAStats again, uploading the new file(s), and activating it. You can find the latest BAStats here: http://www.redalt.com/downloads/

    Thanks … I’ll give that a try …

    I took a look at file corruption but that doesn’t seem to be it. If I open the file … everything seems normal … and it does actually track stats just it won’t graph anything and it puts this error at the top of the page.

    Warning: in_array(): Wrong datatype for second argument in /home/easyv7/www/easy-visa-usa.com/wp-content/plugins/BAStats_logger.php on line 114

    The lines of code in question are the following …
    $options = get_settings(‘bas_options’);
    $settings = get_settings(‘bas_settings’);
    if(in_array(‘log_spam’, $options) && in_array(‘referer_spam’, $settings))


    I’ve also tried deactivating all other plugins and going back to the original theme but none of that was successful.

    anything else I could try …


    I thought I could fix it but I was wrong.


    This is the code in question, it is on line 114 in BAStats_logger.php and is:
    if(in_array('log_spam', $options) && in_array('referer_spam', $settings))

    That calls the code you posted. How it is bad I don’t know.

    I was checking the documentation

    in_array() returns true if the specified sample is found in a specified array.

    It sounds like what the error is saying is that the get_settings() function didn’t return an array for either get_settings(‘bas_options’); or
    get_settings(‘bas_settings’); …. or maybe we need to make it

    in_array(‘log_spam’, $options, true)

    Unfortunately I don’t have the time right now to finish off debugging it but just thought I would post what little info I had … just incase … might be able to get back to it later … or if someone beats me to it … it would be nice if they posted a fix …


    Got the same error here.
    I actually really don’t know why, but the error doesn’t display on Firefox. With IE and Opera I get the error message on the very first line. With Firefox I don’t get it.
    Strange, really!
    This http://asymptomatic.net/wp/2005/02/15/1309/bastats-pre-release/ is the thread for the BAStats Plugin. Maybe someone with deeper knowladge want to post our problem there ;).
    Help! This Plugin roxx ;).

    Posted to the wrong thread. Apologies. 🙂

    i have exactly the same error as andisblogl,, and only in firefox, too!

    Me too: same error, Firefox (Mac) only. Anybody else?

    I have been trying to get bastats to work but I guess the author has stopped supporting it. If you send him a nice email he may answer but I personally have been using stattraq which is a very good stat tracking plugin as well.

    I recommend everyone give it a try.

    Moderator James Huff


    Support Team Rep.

    I am actually working with a programmer on a really good stat program. CG referrer http://www.chait.net/index.php?p=238
    However it is not finished yet. But it still works fine, but all the bells and whistles aren’t complete. Download it and check it out. The author is very responsive.

    P.S. BAStats has been fixed. the version has not changed, but just download it again and install it. the problems above have been addressed and it does not break my RSS validation.

    but I like CG-referrer better.

    Same problem here. Maybe make the error invisible somehow?

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘[Resolved] BAstats Error’ is closed to new replies.