• Resolved corzel

    (@corzel)


    Hi,

    I’m getting these notices in php error log:

    Notice: Trying to get property ‘description’ of non-object in /var/www/html/wp-content/plugins/slim-seo/src/MetaTags/Description.php on line 84
    Notice: Trying to get property ‘term_id’ of non-object in /var/www/html/wp-content/plugins/slim-seo/src/Breadcrumbs.php on line 139
    Notice: Trying to get property ‘taxonomy’ of non-object in /var/www/html/wp-content/plugins/slim-seo/src/Breadcrumbs.php on line 139

    Wordpress: 5.6
    Php: 7.4.3

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @corzel ,

    Thanks for your message. Please let me know on which page do you see the error (or it’s logged)? Is that the single post/page or a category?

    Thread Starter corzel

    (@corzel)

    Hi Anh,

    I see this in the php error log file of my server in /var/www/logs/error.log

    The plugin seems to work just fine.

    Plugin Author Anh Tran

    (@rilwis)

    Hi @corzel ,

    Can you help me to see which page when you visit, an error is added to the error.log?

    Also, if possible, please enable WP_DEBUG in the wp-config.php file. Then if any error happens, it will show on the website. You can use this way to see which page causes the bug. When you’re done, please disable WP_DEBUG. For more details about that, please see this article:

    Debugging in WordPress

    Thread Starter corzel

    (@corzel)

    Hi Anh,

    I saw them on every page. After the last update those notices disappeared, but now this appears:

    Notice: Trying to get property 'display_name' of non-object in /var/www/html/wp-content/plugins/slim-seo/src/MetaTags/OpenGraph.php on line 159

    I modified OpenGraph.php and changed lines 158 and 159 for this:

    $author = get_the_author_meta( 'display_name', get_queried_object()->post_author );
    return $author;

    I don’t know if this breaks the function but at least the notice no longer appears.

    Regards.

    Plugin Author Anh Tran

    (@rilwis)

    Hi @corzel ,

    Thanks for your feedback. Your code seems to be “safer”. I’ve made the change to the plugin with your code and it’ll be available in the next version.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Notices in php error log’ is closed to new replies.