• Hello,

    When using you plugin, error_log is filled with tons of notices like those:

    [07-Jul-2022 09:00:47 UTC] PHP Notice:  Trying to get property 'ID' of non-object in /public/wp-content/plugins/pagerestrict/pagerestrict.php on line 155
    [07-Jul-2022 09:00:47 UTC] PHP Notice:  Trying to get property 'ID' of non-object in /public/wp-content/plugins/pagerestrict/pagerestrict.php on line 155
    [07-Jul-2022 09:00:47 UTC] PHP Notice:  Trying to get property 'ID' of non-object in /public/wp-content/plugins/pagerestrict/pagerestrict.php on line 163
    [07-Jul-2022 09:00:47 UTC] PHP Notice:  Trying to get property 'ID' of non-object in /public/wp-content/plugins/pagerestrict/pagerestrict.php on line 163

    You could avoid those replacing in lines 155 and 163 all following occurrences
    $post->ID with $post->ID ?? ''

    • This topic was modified 2 years, 4 months ago by lekiend.
  • The topic ‘Many PHP notices in error_log’ is closed to new replies.