• Resolved Joseph Dickson

    (@josephdickson)


    While I have WP-Optomize running and i’m logging errors and notices I see this message pop up every two minutes or so in that log.

    [18-Feb-2020 00:53:15 UTC] PHP Notice: Trying to get property ‘comment_status’ of non-object in F:\inetpub\wwwroot\wp-includes\comment-template.php on line 1219
    [18-Feb-2020 00:55:52 UTC] PHP Notice: Trying to get property ‘comment_status’ of non-object in F:\inetpub\wwwroot\wp-includes\comment-template.php on line 1219
    [18-Feb-2020 00:57:26 UTC] PHP Notice: Trying to get property ‘comment_status’ of non-object in F:\inetpub\wwwroot\wp-includes\comment-template.php on line 1219

    I’m somewhat new to this plugin and using the free version. My best guess is I didn’t set it up properly for multisite. As its a notice I’m not terribly concerned but I was wondering if this is expected.

    If not, chances are I have some debugging to do in my themes ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi Joseph,

    This is unlikely to be related with WP-Optimize: nothing in our code tries to access comment_status, and the warning appears to be triggered in a WP Core file.

    Kind regards,
    Marc

    Thread Starter Joseph Dickson

    (@josephdickson)

    I was hopping it was a “toggle this” solution.
    No doubt the error is of my own design ??

    Thanks for taking the time to reply.

    I am getting this issue too. It only appears when WP Optimize is enabled. It goes away when I remove the plugin and all residual files.

    Agreed this does appear to be related to WP optimize. I have the same error and it also appears to not occur when WP Optimize is disabled.

    I’d implore @marcusig to re-investigate this. Seems to have a 10 minute cycle.

    I have comments disabled on my site btw.

    I recently installed WP Optimize on my site and also just started getting this error. Can someone advise how to resolve?

    Hi there,

    Sorry we missed the more recent messages in this thread.
    We’ll investigate again.

    Marc.

    I’m also experiencing the same issue after installing WP optimize. Please let us know how to solve this.
    Thanks

    This will be fixed in the next release (hopefully in the next week or so).
    If you want to manually fix it already now, you can edit the file plugins/wp-optimize/cache/file-based-page-cache-functions.php, around line 54.

    The current is

    if (function_exists('comments_open') && comments_open()) {

    and should be changed to

    if (function_exists('comments_open') && function_exists('get_post') && get_post() && comments_open()) {

    Marc.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP Notice: Trying to get property ‘comment_status’ of non-object in …’ is closed to new replies.