WP Rocket
Forum Replies Created
-
Sorry to hear that.
This might happen if the lightbox copies and store the
srcattribute value while the page is loading.What you can do is disable lazy loading on images where the lightbox is used.
If the lightbox adds specific classes to images, you can use our
rocket_lazyload_excluded_attributesfilter to target specific classes:function rocket_lazyload_exclude_class( $attributes ) { $attributes[] = 'class="example-lightbox-class"'; return $attributes; } add_filter( 'rocket_lazyload_excluded_attributes', 'rocket_lazyload_exclude_class' );If you don’t have any specific class applied to images, you will need to manually add the following class to them (without using the filter I mentioned above):
class="<strong>skip-lazy</strong>"I hope it helps!
Best regards,
Adame
Hi there,
Can you please send me a URL where the issue happens so I can test it?
You don’t need to have lazyload enabled, I would like to check the source code.I’ll wait for your response,
thanks!
Hi nonobio,
Alfonso from WP Rocket here.
I’m sorry for the trouble you are having with this.Could you please check if these images have a width and height set in the markup? you can check if by viewing the source code and searching for the img tags. These should have a height and width.
The Lazyload script will take these values.
Let me know if you need any further assistance, I am happy to help. 😉
Best Regards,
Hi @brettvermette,
Sorry to hear that.
This usually happens if you are using a layout that needs to calculate positions. If the gallery images don’t have explicit image sizes on the
<img>tag (using thewidthandheightattributes), the gallery will try to calculate the position using our SVG placeholder, leading to the images overlapping once the lazy loading kicks in and replaces the assets with the full URL.Having the
widthandheightattributes mentioned on each gallery image will keep the layout intact.If this doesn’t apply to your case, please send us what theme and what type of gallery you are using to have a closer look.
Best regards,
Adame D.
Hi @silencerocks!
I’m afraid we have no plans for the moment to host YouTube preview images.
If you are using one specific video per website, you can do the following:
- Download the preview image and upload it to the media library.
- Get the URL.
- Go the to following file: src/Dependencies/RocketLazyload/Assets.php
- Replace:
https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpgwith the URL of your preview image. - Save the changes.
- Clear the cache (if you are using any cache plugin).
If you are using multiple videos per website, you can do the following:
- Create a new folder where you can put manually videos preview. Let’s name it wp-content/uploads/youtube/
- Upload preview images using the following naming logic
video_id.jpg. - Go the to following file: src/Dependencies/RocketLazyload/Assets.php
- Replace:
https://i.ytimg.com/vi/ID/' . $args['resolution'] . '.jpgwithhttps://domain.ext/wp-content/uploads/youtube/ID.jpg. Replace the domain.ext with your own domain name. - Save the changes.
- Clear the cache (if you are using any cache plugin).
I hope it helps you achieve what you are looking for.
Best regards,
Adame D.
Hi there!
Jorge from WP Rocket here. Thank you for taking the time to contact support.
The
$lazy_sourcesvariable is declared inside of theifconditional above it. But if that condition isfalse, 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
Forum: Plugins
In reply to: [LazyLoad Plugin – Lazy Load Images, Videos, and Iframes] Images disappearHi there,
Jorge from WP Rocket here. Thank you for taking the time to contact us.
I see the problem is already marked as resolved. In case you are facing any of the common issues you may want to take a look at our document that talks about them https://docs.wp-rocket.me/article/278-common-issues-with-lazyload
Thanks a lot for your time and patience. I hope you have a great day!
Regards,
Jorge M
Forum: Plugins
In reply to: [WooCommerce] Update 4.4.0 Causes Fatal ErrorsHi there!
WP Rocket 3.6.4 is available now for our customers to upgrade to it.
It fixes:
- the WooCommerce 4.4.0 fatal error
- prevents the PHP notice about the REST API
Thanks a lot for your patience!
Forum: Plugins
In reply to: [WooCommerce] Not compatible with Wp RocketHi there!
WP Rocket 3.6.4 is available now for our customers to upgrade to it.
It fixes:
- the WooCommerce 4.4.0 fatal error
- prevents the PHP notice about the REST API
Thanks a lot for your patience!
Forum: Plugins
In reply to: [WooCommerce] Fatal Error: Conflict with “WP Rocket” pluginHi there!
WP Rocket 3.6.4 is available now for our customers to upgrade to it.
It fixes:
- the WooCommerce 4.4.0 fatal error
- prevents the PHP notice about the REST API
Thanks a lot for your patience!
Hi there!
WP Rocket 3.6.4 is available now for our customers to upgrade to it.
It fixes:
- the WooCommerce 4.4.0 fatal error
- prevents the PHP notice about the REST API
Thanks a lot for your patience!
Forum: Plugins
In reply to: [WooCommerce] Fatal ErrorHi there!
WP Rocket 3.6.4 is available now for our customers to upgrade to it.
It fixes:
- the WooCommerce 4.4.0 fatal error
- prevents the PHP notice about the REST API
Thanks a lot for your patience!
Forum: Plugins
In reply to: [WooCommerce] Fatal Error after 4.4.0 updateHi there!
WP Rocket 3.6.4 is available now for our customers to upgrade to it.
It fixes:
- the WooCommerce 4.4.0 fatal error
- prevents the PHP notice about the REST API
Thanks a lot for your patience!
Forum: Plugins
In reply to: [Heartbeat Control] Error after updateHi there,
We have reported the issue on our official Github repository:
https://github.com/wp-media/heartbeat-control/issues/7We will fix the issue in the next minor version.
Best
Forum: Plugins
In reply to: [Heartbeat Control] Another error after updateHi,
Thanks for your feedbacks.
As everything seems to work, I’m closing this ticket 😉
Best