• Resolved tapulator

    (@tapulator)


    Weird bug ahead:

    I’m working at a non profit organisation and administrate our website. Our editors are using Elementor and therefore insert videos as Elementor video widget.

    Embed Privacy works fine: A consent layer overlays the video – except in combination with Elementor’s text editor widget or another video widget. *

    When a text editor or video widget is inserted directly before or after a video widget in the same section, Embed Privacy’s CSS doesn’t load – so the website visitor basically gets a plain text version of the consent layer.

    Any idea why this is happening?

    I reproduced this error on 2 WordPress installations with the latest version of WordPress, Elementor and Embed Privacy.

    * The described error may occur with other widgets, too. I didn’t test all combinations since there are a trillion available. But for example the image widget gets along with the video widget.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tapulator

    (@tapulator)

    I dug into the source.

    Apparently the stylesheet is only inserted when the “old/original” and “new/replaced” content are not identical, what is for some reason the case when the described widget combination is used.

    I can’t wrap my head around the logic behind the multiple content manipulation passes and the content comparisons, but I’m sure they’re used for a good reason. Unfortunately, this means I can’t point my finger on the code causing the described behavior.

    My workaround:

    I hooked up the filter “embed_privacy_overlay_replaced_content” and print the stylesheet (and other assets) in the callback. My thinking: If content is replaced, the stylesheet is definitely needed. Multiple printing shouldn’t occur, since the method “printing_assets” also checks if the assets were already printed.

    Seems to work.

    Do you have suggestions to the presented workaround or know a better one? Maybe even know how to fix this bug properly?

    Plugin Author Matthias Kittsteiner

    (@kittmedia)

    Hi there,

    thank you for your detailed report!

    I could identify the problem and fixed it here: https://github.com/epiphyt/embed-privacy/commit/ef5a106665abbe8b5e7c5495f16031345407b508
    You weren’t that far off, though. ??

    Best regards,
    Matthias

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.