• Resolved iamazified

    (@iamazified)


    after the last update the lightbox doesnt work and clicking the images links to their own url.

    • This topic was modified 4 years, 6 months ago by iamazified.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter iamazified

    (@iamazified)

    solved. sorry guys, it was a bug…

    Got the same problem, how did you fix it?

    If your css/js are cached and minified, clearing your cache could solve this issue

    Plugin Author Arno Welzel

    (@awelzel)

    In addition:

    If you use a caching system make sure that the cache is always refreshed after updating WordPress or any theme or plugin.

    Also you should never remove version parameters of included scripts to avoid conflicts caused by browsers still using the old cached version of a script. Also see here about this:

    https://arnowelzel.de/en/versioning-of-static-resources-in-wordpress

    Lightbox with Photoswipe changed a lot between version 2.92 and 2.100. The frontend script of version 2.92 or 2.94 is not compatible with newer backends like 2.100. Having a cached version of 2.92 or 2.94 and the backend of 2.100 will not work.

    After the update I’m having this problem, too, but in random pages! I use Litespeed cache and purged everything twice. Asset Cleanup too. And I disabled both to try. But in that specific page Lightbox doesn’t work:
    https://www.saindodamatrix.com.br/planos-vibratorios/

    when I click the image i get this in dev:
    frontend.min.js?ver=2.100:1 Uncaught TypeError: Cannot read property ‘getAttribute’ of null
    at frontend.min.js?ver=2.100:1
    at NodeList.forEach (<anonymous>)
    at parseThumbnailElements (frontend.min.js?ver=2.100:1)
    at openPhotoSwipe (frontend.min.js?ver=2.100:1)
    at HTMLAnchorElement.<anonymous> (frontend.min.js?ver=2.100:1)

    In the others it works, but there’s always the message
    Uncaught ReferenceError: Swiper is not defined
    at body-41e44f0460e34800310d79faba5c2915966b10fc-1.js:294
    at body-41e44f0460e34800310d79faba5c2915966b10fc-1.js:294

    Plugin Author Arno Welzel

    (@awelzel)

    The error makes no sense to me, as the same code works on many other sites without any issues. Just to be sure please turn off any caching and “script optimization” so the JavaScript assets get loaded as they are provided with the plugins and not as one single minified file for all scripts on your site.

    Also keep in mind that the server on which your website is hosted already uses HTTP/2 – so minifiying everything to one single file will not improve the performance anyway since with HTTP/2 browsers request included CSS and JavaScript files in one single connection and parallel. It makes no difference if there is only one file or many.

    For example – open my website https://arnowelzel.de and use the web developer tools of your browser to see the “waterfall” for the HTTP requests in the network tab. Due to HTTP/2 many elements get requested at the same time and downloaded in parallel. Also see this screenshot:

    https://nextcloud.0x0c.de/s/afKiQo4GrSgFL7S/preview

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘lightbox doesnt load’ is closed to new replies.