WordPress.org

Ready to get started?Download WordPress

Forums

WP SlimStat
[resolved] Object of class stdClass could not be converted to string error (17 posts)

  1. daviesda
    Member
    Posted 1 year ago #

    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/

  2. daviesda
    Member
    Posted 1 year ago #

    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.

  3. AITpro
    Member
    Posted 1 year ago #

    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

  4. daviesda
    Member
    Posted 1 year ago #

    Thanks Ed!

  5. AITpro
    Member
    Posted 1 year ago #

    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;
  6. daviesda
    Member
    Posted 1 year ago #

    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.

  7. camu
    Member
    Plugin Author

    Posted 1 year ago #

    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

  8. daviesda
    Member
    Posted 1 year ago #

    Voted :)

  9. camu
    Member
    Plugin Author

    Posted 1 year ago #

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

  10. daviesda
    Member
    Posted 1 year ago #

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

  11. camu
    Member
    Plugin Author

    Posted 1 year ago #

    Great, thank you for reporting back.

  12. azjaleah
    Member
    Posted 11 months ago #

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

  13. camu
    Member
    Plugin Author

    Posted 11 months ago #

    Can you please post a screenshot?

  14. azjaleah
    Member
    Posted 11 months ago #

    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.

  15. camu
    Member
    Plugin Author

    Posted 11 months ago #

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

  16. son0fhobs
    Member
    Posted 2 months ago #

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

  17. camu
    Member
    Plugin Author

    Posted 2 months ago #

    A vote for SlimStat would be a nice way to say thank you ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic