Support » Plugin: WP YouTube Lyte » After activation some of the pages return empty content

  • Resolved oksanaromaniv

    (@oksanaromaniv)


    Hello,

    I’ve noticed that after activation on the linked page, the content area became empty.

    Thanks,
    Oksana

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Hey Oksana ๐Ÿ™‚

    Haven’t seen that happen yet, some questions;
    * does this only happen on the linked page, or also on other pages with YT-video’s?
    * any difference between a page with one and a page with multiple video’s?
    * how were the videos added to the page?
    * re. the content area being blank; is everything gone, or is the content before the first video still there?
    * is there any PHP error in your php errorlog?

    frank

    Thread Starter oksanaromaniv

    (@oksanaromaniv)

    Hello Frank,

    To respond to your questions:

    1. Found one other page this happens upon activation: https://www.mein-adventskalender.de/ideen/geschenkideen-game-of-thrones/
    2. Didn’t notice any difference in having one or two videos on the page
    3. They are part of the <InnerBlocks> content of the custom Gutenberg block and were added via copying iframe code from Youtube (there is a bug now in Gutenberg that prevents normal embed in the reusable blocks)
    4. Everything. Looks like the_content() returned empty string
    5. No, nothing logged in PHP error logs.

    If you’d like, I can share with you a staging website credentials to test in this particular case via email.

    Thanks,
    Oksana

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, some more questions ๐Ÿ™‚

    -> So it only happens when you have YT iframe embed code in a (reusable) gutenberg block?

    -> What happens if you put a YT link (on a separate line) or a httpv-link (which was the old way LYTE detected youtube-links) in a gutenberg block?

    -> What happens if you add a YT iframe in a “normal” HTML block?

    -> Can you extract the exact Gutenberg HTML (so before being rendered, with all the Gutenberg markup in HTML comments) and put it up a pastebin or in a github gist so I can check what LYTE’s gutenberg regexp does with that?

    Thread Starter oksanaromaniv

    (@oksanaromaniv)

    @optimizingmatters ,

    1. No, in fact, on both pages the blocks used are not reusable
    2. In empty paragraph block: WP creates an embed, the page still remains blank
    3. The page remains empty. Screenshot of editor
    4. The content of the blank pages:
    4.1. https://bitbucket.org/snippets/Oksana_R/Lrgqrx
    4.2. https://bitbucket.org/snippets/Oksana_R/7nB4nG

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, looks like a problem with the Gutenbeard regular expression in LYTE;

    so in wp-youtube-lyte.php on line 129 can you try changing
    $gutenbeard_single_regex = '%<\!--\s?wp:(?:core[-|/])?embed(?:/youtube)?\s?{"url":"https?://(?:www\.)?youtu(?:be\.com|.be)/(?:watch\?v=)?(.*)"}\s?-->.*<figcaption>(.*)</figcaption><\!--\s?/wp:(?:core[-|/])?embed(?:/youtube)?\s?-->%Us';
    into:
    $gutenbeard_single_regex = '%<\!--\s?wp:(?:core[-|/])?embed(?:/youtube)?\s?{"url":"https?://(?:www\.)?youtu(?:be\.com|.be)/(?:watch\?v=)?(.*)"}\s?-->.*(?:<figcaption>(.*)</figcaption>)?<\!--\s?/wp:(?:core[-|/])?embed(?:/youtube)?\s?-->%Us';

    frank

    Thread Starter oksanaromaniv

    (@oksanaromaniv)

    Hello Frank,

    This did the trick. The content is back ๐Ÿ™‚ Great work!

    Thanks,
    Oksana

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    thanks for the confirmation, I’ll make sure this goes into the next version!

    Hi. I used the code provided here to fix the same missing content issue, which worked great. But after the change, the text “wp-has-aspect-ratio” is appearing below every video.

    Unfortunately I can’t show this live because it’s not on my site, and the plugin had to be deactivated for now because it either hide content or put this below every video embedded.

    Just letting you know and hoping this is fixed in the next update.

    Thanks!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    interesting @jhmattern , do you have a non-production site somewhere where you could leave things broken so I could investigate?

    Unfortunately not. I was just helping a colleague switch her site theme, and we installed this to try to optimize her Youtube-embed-heavy site. Worked great for site speed other than the missing content vs. wp-has-aspect-ratio problem.

    That site was on GeneratePress. Cache plugin was cleared in testing the plugin. No issues other than the slow load of Youtube-heavy pages before adding the plugin. When it was added a YouTube-heavy post lost all content (front page w/ one video looked fine though). Then I swapped in your code suggestion here, the content came back, but all videos had that line of text below them. Disabled the plugin, deleted it, and tried from scratch after refreshing cache again, and saw the exact same cycle.

    We had set up a theme move on my server first, but hadn’t tested your plugin there as optimization issues came up after. But I just went ahead and installed it there to test, and I’m seeing the same issue.

    1. With no plugin, YouTube videos display properly but cause very slow loading issues.

    2. With the plugin as-is, content disappears from some pages with YouTube videos.

    3. With the plugin modified based on your suggestion in this thread, the content comes back, but “wp-has-aspect-ratio” appears below every video.

    On some pages, that text appears in a paragraph tag, so I can at least get around it with CSS. But in posts, it’s marked as #text and falls outside what I’m able to modify with custom CSS.

    I can give you access to the site if there’s a private way to send details, but you won’t be able to edit the plugin files there as I have in-WordPress editing locked down for all sites at the server level. In the meantime, here are screenshots. And I’ll contact the site owner to see if she’d be willing to let you log in there and see the problem live.

    Here’s what it looks like when the plugin is first installed — not on a page with a YouTube video, but this happened to a post with numerous videos embedded. As you can see, it goes from the title and post meta data right to the comments.

    https://jennifer-mattern.com/no-content.png

    And this is what it looks like with the modifications to line 129.

    https://jennifer-mattern.com/wp-has-aspect-ratio.png

    Note: Thinking this was a Gutenberg-specific issue, I checked it with the classic editor installed as well, and the wp-has-aspect-ratio line still appears.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Seeing this happen would most certainly help @jhmattern, feel free to mail me at futtta-at-gmail-dot-com ๐Ÿ™‚

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    What could also help, though, is a pastebin/ github gist/ bitbucket snippet with the gutenberg HTML (so HTML with gutenberg markup in it) so I can test my regex against it.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    nevermind, was able to reproduce, more soon-ish ๐Ÿ™‚

    Sorry. Just saw your messages now.

    So glad you were able to reproduce the issue. Thanks so much for looking into it! ๐Ÿ™‚

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘After activation some of the pages return empty content’ is closed to new replies.