WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] BAstats Error (24 posts)

  1. brianbonner
    Member
    Posted 9 years ago #

    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/1.5.1.3" -->
    <rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"

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

  2. brianbonner
    Member
    Posted 9 years ago #

    I figured it out.

  3. arctork
    Member
    Posted 9 years ago #

    Hi,

    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.

  4. 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/

  5. arctork
    Member
    Posted 9 years ago #

    Thanks ... I'll give that a try ...

  6. arctork
    Member
    Posted 9 years ago #

    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 ...

    Thanks

  7. brianbonner
    Member
    Posted 9 years ago #

    I thought I could fix it but I was wrong.

    Arctork,

    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.

  8. arctork
    Member
    Posted 9 years ago #

    I was checking the documentation
    http://ca3.php.net/manual/en/function.in-array.php

    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 ...

    Thanks

  9. andisblog
    Member
    Posted 9 years ago #

    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 ;).

  10. RaHarakhte
    Member
    Posted 9 years ago #

    Posted to the wrong thread. Apologies. :-)

  11. myeviltwin
    Member
    Posted 9 years ago #

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

  12. RobJ25
    Member
    Posted 9 years ago #

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

  13. arctork
    Member
    Posted 9 years ago #

    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.

  14. brianbonner
    Member
    Posted 9 years ago #

    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.

  15. ch0de
    Member
    Posted 9 years ago #

    Same problem here. Maybe make the error invisible somehow?

  16. Chode, please read Brianbonner's post, starting at the second paragraph, "P.S. BAStats has been fixed ..."

  17. sirpreme
    Member
    Posted 9 years ago #

    Sorry,
    downloaded BaStats yesterday from Red Alt. And still have this problem..

  18. sirpreme
    Member
    Posted 9 years ago #

    add this :c)

    version is 1.0β build 8

  19. andisblog
    Member
    Posted 9 years ago #

    I also downloaded the BAStats.zip-Package from Asymptomatic.net and RedAlt and get the same Error.
    No fixing!
    (The Filedate in the Zip Archive is still 05-05-10 & 05-05-15!)

    Maybe brianbonner can point out, where he downloaded the 'fixed' file?

    BTW: I was running BAStats besides StatTraq because it was much smaller and gave me good and quick overview about all needed information.

  20. Razorhide
    Member
    Posted 8 years ago #

    I'm getting this error as well, it's not occuring on my old website, but any new ones using the 1.5.2 code is popping up this error.

  21. IsaacSchlueter
    Member
    Posted 8 years ago #

    Here's a bit of a hack/patch that will make the problem go away:

    Open up BAStats_logger.php and go to line 114. It should be this:

    if(in_array('log_spam', $options) && in_array('referer_spam', $settings))
    {

    Change that to this:

    if(!is_array($options))$options = array();
    if(!is_array($settings))$settings = array();
    if(in_array('log_spam', $options) && in_array('referer_spam', $settings))
    {

    Still have the problem?

  22. andisblog
    Member
    Posted 8 years ago #

    It seems to have worked!
    I don't get the error anymore. Have to test a little to confirm it 100%, but I reckon it's fixed!
    Thanks Isaac!!!

  23. alsosara
    Member
    Posted 8 years ago #

    Isaac you are amazing. Fixed it for me too!!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags