Title: Error log spam
Last modified: October 29, 2025

---

# Error log spam

 *  Resolved [topsyde](https://wordpress.org/support/users/topsyde/)
 * (@topsyde)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/error-log-spam/)
 * Just a heads up guys — you need to comment out this error log in your /inc/lazyload_replacer.
   php file, we’re getting log spammed.
 *     ```wp-block-code
       public function get_svg_for( $width, $height, $url = null ) {
   
           if ( $url !== null && ! is_numeric( $width ) ) {
               $url   = strtok( $url, '?' );
               $key   = crc32( $url );
               $sizes = wp_cache_get( $key, 'optml_sources' );
               if ( $sizes === false ) {
                   $filepath = substr( $url, strpos( $url, $this->upload_resource['content_folder'] ) + $this->upload_resource['content_folder_length'] );
                   $filepath = WP_CONTENT_DIR . $filepath;
                   if ( is_file( $filepath ) ) {
                       $sizes = getimagesize( $filepath );
                       error_log( 'get_svg_for: ' . var_export( $sizes, true ) . ' ' . $url );
                       wp_cache_add( $key, [ $sizes[0], $sizes[1] ], 'optml_sources', DAY_IN_SECONDS );
                   }
               }
               list( $width, $height ) = $sizes;
           }
           // If the width is not found the url might be an offloaded attachment so we can get the width and height from the metadata.
           if ( ! is_numeric( $width ) && ! empty( $url ) ) {
               $attachment_id = $this->attachment_url_to_post_id( $url );
               $meta = wp_get_attachment_metadata( $attachment_id );
               $width = $meta['width'] ?? false;
               $height = $meta['height'] ?? false;
           }
   
           $width  = ! is_numeric( $width ) ? '100%' : $width;
           $height = ! is_numeric( $height ) ? '100%' : $height;
           $fill = $this->settings->get( 'placeholder_color' );
   
           if ( empty( $fill ) ) {
               $fill = 'transparent';
           }
   
           return str_replace(
               [ '#width#', '#height#', '#fill#' ],
               [
                   $width,
                   $height,
                   urlencode( $fill ),
               ],
               self::SVG_PLACEHOLDER
           );
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Buddy](https://wordpress.org/support/users/friendswp/)
 * (@friendswp)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/error-log-spam/#post-18700308)
 * Hi there,
 * You are right, we will roll out a fix tomorrow.
 * Thank you!
 *  Plugin Support [Buddy](https://wordpress.org/support/users/friendswp/)
 * (@friendswp)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/error-log-spam/#post-18701091)
 * Hi there,
 * The most recent version, 4.1.2 is fixing the issue.
 * Thank you for understanding.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error log spam’ is closed to new replies.

 * ![](https://ps.w.org/optimole-wp/assets/icon-256x256.gif?rev=3013666)
 * [Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization](https://wordpress.org/plugins/optimole-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/optimole-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/optimole-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/optimole-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/optimole-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/optimole-wp/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Buddy](https://wordpress.org/support/users/friendswp/)
 * Last activity: [7 months, 1 week ago](https://wordpress.org/support/topic/error-log-spam/#post-18701091)
 * Status: resolved