Title: Constant Error Log
Last modified: January 10, 2023

---

# Constant Error Log

 *  Resolved [atutrabajo](https://wordpress.org/support/users/atutrabajo/)
 * (@atutrabajo)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/constant-error-log/)
 * Dear [@s](https://wordpress.org/support/users/s/). Good night.
   I just gave you
   a couple of examples so as not to overwhelm you. But, strictly speaking, it’s
   been several days since, according to my error log file, your plugin is generating
   the following errors:
 * [Mon Jan 09 14:08:06.360906 2023] [:error] [pid 670149:tid 47849880749824] [client
   40.77.167.23:0] PHP Warning: Attempt to read property “ID” on null in /home/username/
   domain_name/directory_name/plugins/optimize-more-images/includes/classes/partials/
   preload-featured-imgs.php on line 150
 * 
   [Mon Jan 09 11:46:40.429869 2023] [:error] [pid 563779:tid 47849964308224] [
   client 182.79.238.133:0] PHP Warning: Attempt to read property “ID” on null in/
   home/username/domain_name/directory_name/plugins/optimize-more-images/includes/
   classes/partials/preload-featured-imgs.php on line 150
 * 
   [Sun Jan 08 14:21:40.217307 2023] [:error] [pid 3877515:tid 47849878648576] [
   client 40.77.167.23:0] PHP Warning: Attempt to read property “ID” on null in /
   home/username/domain_name/directory_name/plugins/optimize-more-images/includes/
   classes/partials/preload-featured-imgs.php on line 150
 * As you can see, what changes is the client but it is ALWAYS the same error.
   Could
   you please tell me what is happening?From already thank you very much.Regards.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fconstant-error-log%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Arya Dhiratara](https://wordpress.org/support/users/aryadhiratara/)
 * (@aryadhiratara)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/constant-error-log/#post-16356635)
 * Hi [@atutrabajo](https://wordpress.org/support/users/atutrabajo/) 
   I can’t replicate
   the issue. At first I tought it’s because there’s a post/page that doesn’t have
   a featured image. But when I tried to remove the featured image in some post/
   page in some of my websites, the error not shows up.
 * I need you to help me solve the issue, and I will put in the next updates if 
   it solved.
   There are several things that we can try.
    - try move the `global $post;` in line 136 to line 125 (before `if ( is_user_logged_in()){`,
      right after
    - if the error still exist, try to change this code `$thumbnail_id = apply_filters('
      preload_featured_images_id', get_post_thumbnail_id( $post->ID ), $post );`
      on line 150 to
 *     ```wp-block-code
       if ( has_post_thumbnail() ) {
           $thumbnail_id = apply_filters( 'preload_featured_images_id', get_post_thumbnail_id( $post->ID ), $post );
       }
       ```
   
 * or
 *     ```wp-block-code
       if ( ! is_null( $post ) ) {
           $thumbnail_id = apply_filters( 'preload_featured_images_id', get_post_thumbnail_id( $post->ID ), $post );
       }
       ```
   
 * Hope one of those solve the issue. Please try the first one (move the `global
   $post;` line) first. Thank you.

Viewing 1 replies (of 1 total)

The topic ‘Constant Error Log’ is closed to new replies.

 * ![](https://ps.w.org/optimize-more-images/assets/icon-256x256.png?rev=2915413)
 * [Optimize More! - Images](https://wordpress.org/plugins/optimize-more-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/optimize-more-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/optimize-more-images/)
 * [Active Topics](https://wordpress.org/support/plugin/optimize-more-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/optimize-more-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/optimize-more-images/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Arya Dhiratara](https://wordpress.org/support/users/aryadhiratara/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/constant-error-log/#post-16356635)
 * Status: resolved