Support » Plugin: Simple Share Buttons Adder » “Undefined index: “, “Trying to get property of non-object”

  • With PHP 7.3..13, the plugin generates a lot of PHP notices if WP_DEBUG is enabled.

    An undefined index bar_call:

    [18-Feb-2020 07:32:42 UTC] PHP Notice: Undefined index: bar_call in /data/www/example.com/www/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 652

    And there is a notice about trying to get a property of a non-object:

    [18-Feb-2020 07:33:43 UTC] PHP Notice: Trying to get property 'post_title' of non-object in /data/www/example.com/www/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 297

    Haven’t tried PHP 7.4.2 yet.

Viewing 1 replies (of 1 total)
  • Plugin Contributor ShareThis

    (@sharethis)

    Hi there,

    Thank you for reaching out!

    In this case, I’m not sure what page you’re seeing this error on. The object the error is referring to is the “post” object, which means the page that is showing the error must not be a proper post type, and or you’re resetting the $post global somewhere causing it not to be an object that function is running on the action “wp_head” 99 in priority.

    If you have a function that is overriding the global $post object you should change the priority or the function.

    Hope this helps!

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘“Undefined index: “, “Trying to get property of non-object”’ is closed to new replies.