Support » Plugin: Slim Stat Analytics » Object of class stdClass could not be converted to string error

  • Resolved daviesda

    (@daviesda)


    Hi there,

    I’m getting a lot of PHP errors reported in Bulletproof Security Pro v5.9 that seem to originate from SlimStat. It’s been fine up until now (I’ve used several versions of SlimStat), but since today I’ve had more than a dozen errors, all the same:

    PHP Catchable fatal error: Object of class stdClass could not be converted to string in […]/wp-content/plugins/wp-slimstat/wp-slimstat.php on line 1007

    I’m using SlimStat v3.2.4 and WordPress v3.5.2.

    Any ideas?

    Thanks,

    David.

    http://wordpress.org/extend/plugins/wp-slimstat/

Viewing 15 replies - 1 through 15 (of 16 total)
  • I’ve temporarily disabled ADN in settings as looking wp-slimstat.php on line 1007 it might be related to that. Will monitor whether that stops the PHP errors.

    Change/edit this code…
    echo json_decode($response['body']);

    …to this…
    echo json_decode($response['body'], true);

    When TRUE, returned objects will be converted into associative arrays.
    http://php.net/manual/en/function.json-decode.php

    Thanks Ed!

    I am not real familiar with JSON so this may not be what is needed, but it is logical.

    Probably this should be also be added to the checking conditions.
    is_object($response)

    I don’t understand what this is/means so that throws me off a bit.
    return 0;

    seems like you would want something like this?

    $response = $something->response
    return $something;

    Disabling the link to the ADN seems to have stopped the errors. I’ve not patched the plugin’s code. SlimStat is a good and useful plugin so I’m sure @camu will be on the case.

    Plugin Author Jason Crouse

    (@coolmann)

    Hi David,

    thank you for your note, the next release will include a fix for this problem, sorry for the inconvenience.

    PS: a vote for WP SlimStat would be a nice way to say thank you.
    http://wordpress.org/support/view/plugin-reviews/wp-slimstat

    Voted 🙂

    Plugin Author Jason Crouse

    (@coolmann)

    Version 3.2.5 is out and should fix the issue. Please let me know if it works for you.

    Thanks Camu, it works for me, I’m no longer getting any PHP errors.

    Plugin Author Jason Crouse

    (@coolmann)

    Great, thank you for reporting back.

    Hi, Camu,
    Using 3.2.5 and WP 3.5.2. Still receive this error. Any other ideas?

    Plugin Author Jason Crouse

    (@coolmann)

    Can you please post a screenshot?

    This came up in the error log. It is not showing on the site.

    Full text:
    [28-Jul-2013 23:57:17] PHP Catchable fatal error: Object of class stdClass could not be converted to string in /home/xxxxxxx/public_html/wp-content/plugins/wp-slimstat/wp-slimstat.php on line 1007

    Line 1007 says:
    ‘ip_lookup_service’ => ‘http://www.infosniper.net/?ip_address=’,

    In the settings panel, the IP lookup address is the same.

    Thanks for your help with this. Been receiving the same error since July 7.

    Plugin Author Jason Crouse

    (@coolmann)

    That’s not what I see on line 1007 in my code for version 3.2.5 😉 Could you please check again?

    Just happened to me, (I’m still using an older version.) This is a huge life saver, thanks!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Object of class stdClass could not be converted to string error’ is closed to new replies.