• I’m getting this php notice in the log

    PHP Notice: Undefined variable: lazy_sources in /var/www/html/wp-content/plugins/rocket-lazy-load/src/Dependencies/RocketLazyload/Image.php on line 273

    $lazy_sources needs to be initialized.

    Nothing dramatic, but would be nice to get rid of it for the next release.

Viewing 1 replies (of 1 total)
  • Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi there!

    Jorge from WP Rocket here. Thank you for taking the time to contact support.

    The $lazy_sources variable is declared inside of the if conditional above it. But if that condition is false, the variable is never declared.

    So what’s happening is that the variable mentioned above is set if this regex passes https://github.com/wp-media/rocket-lazyload-common/blob/master/src/Image.php#L259.

    Some of your images do not have a source element thus the variable is never set. In this scenario you would need to include a source tag to your picture variables and so you don’t get this error message. This is something that’s planned to be fixed in the future and you can follow the progress made on it here https://github.com/wp-media/wp-rocket/issues/3056

    Should you have any more questions or concerns please let me know and I’ll be more than happy to help you. Thank you for your time and patience. I hope you have a great day.

    Regards,

    Jorge M

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Notice: Undefined variable: lazy_sources in …’ is closed to new replies.