• Resolved dogel

    (@dogel)


    Hi,

    I am sorry to say, but the plugin doesn’t really work in a satisfying way on a multisite of mine. The link I added leads to a post on a sub-site of that multi-site (video is at the end of the post).

    I can only get it to work if I change the “https” part of the youtube link to “httpv” in the code editor. But it is not possible to make that change in the visual editor, which is the only thing I can expect from my clients (i.e. clicking on the video and choosing “edit”) – the saved code will always switch back to https, and with https the plugin doesn’t work although “Also act on normal YouTube links and iframes?” is activated.

    Note: The plugin “Easy FancyBox” (which can handle YouTube links) is also installed, but first its Youtube options are deactivated, and secondly, I deactivated it for testing purposes (cleared all cache) and Youtube Lyte still wouldn’t work.

    Any chance to get that working for regular Youtube links?

    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)

    No idea what is happening there I’m afraid @dogel, normally it does work on youtube links (I use it like that myself). Maybe a plugin conflict of some kind?

    Thread Starter dogel

    (@dogel)

    As I described, I tried to deactive the only plugin that possibly could be a conflict (Easy FancyBox), which didn’t make a difference.

    And it also can’t be a conflict with the theme – I wrote the theme myself, and it has no Youtube-related functionality in it whatsoever.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Had a look at the HTML source, looks like WordPress oEmbed is somehow parsing the link iso LYTE, maybe try disabling oEmbed?

    Thread Starter dogel

    (@dogel)

    Hmm – I tried that, but now the link is displayed as pure text (in the editor the video is displayed, but not on the page itself)

    (FWIW: Another post on the parent website for which I changed the code to “httpv” still is displayed as expected: https://www.youtube.com/watch?v=bCqe93FtiZU)

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Is there any difference how this works on the main vs child sites? I mean; does https-youtube links work on the main site?

    Thread Starter dogel

    (@dogel)

    No, https-Links also don’t work as expected on the main site (i.e. a normal Youtube embed is shown, and when I disable oEmbed, the link is shown as pure text).

    Actually, I don’t really know whether it has to do with the multisite setup…

    FWIW: I am using “Disable Gutenberg”, “TinyMCE Advanced” and “TinyMCE Custom Styles”, but I suppose all this shouldn’t affect the display on the page itself, but only the editor. (?)

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The only next step I can think of is disabling other plugins one at a time and even briefly switching themes to a stock wordpress core one dogel, I have no other ideas.

    Thread Starter dogel

    (@dogel)

    Okay, I found that this has nothing to do with multisite or not – I tested it on another website of mine (in a private post – can’t post the link here), and it also doesn’t work.

    So i am going to check all the other plugins…

    • This reply was modified 5 years, 6 months ago by dogel.
    Thread Starter dogel

    (@dogel)

    It seems I found the weak spot (although unfortunately no solution yet):

    As I wrote, I am using the “TinyMCE Advanced” plugin. Now, when I deactivate it, edit the post and save it, Youtube Lyte works as expected.

    When I activate “TinyMCE Advanced” again and do *not* edit the post, Youtube Lyte still works as expected.

    However, as soon as I change anything in that post (with “TinyMCE Advanced” active), Youtube Lyte again fails to work.

    Any idea what to do?

    Thread Starter dogel

    (@dogel)

    Another step forward:

    It’s due to the “Keep paragraph tags in the Classic block and the Classic Editor” option in TinyMCE Advanced. If I deactivate it, “Youtube Lyte” works as expected.

    Unfortunately this is one of the main reasons why I use this plugin – I want to be able to edit HTML, including <p> tags and classes I add to them…

    Does “Youtube Lyte” work differently if a Youtube link is wrapped in a <p> tag or not?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    LYTE only treats YT-links of they’re at the start of a line, so

    
    <p>
    https://youtu.be/xyz
    </p>

    would work but

    
    <p>https://youtu.be/xyz</p>

    not.

    Thread Starter dogel

    (@dogel)

    Ah, now the reason is clear!

    So if I want to keep my settings I have to “train” my clients to use a line break (shift + return) instead of a new paragraph (return) when they insert a Youtube link. Hmm – for some of them this is going to be tough… ??

    Anyway – thank you very much for all your quick responses!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, if you want your clients not to have to worry, you could create a little filter (hooking into lyte_content_preparse) to remove <p> in front of youtube links? ??

    Thread Starter dogel

    (@dogel)

    hmm – I am not so sure how to accomplish that…

    But anyway: Why are Youtube links only treated at the beginning of a line – is there a technical reason? What difference would it make always converting them, regardless if they are at the beginning of a line or not?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    this should work;

    add_filter('lyte_content_preparse','lyte_remove_leadingp');
    function lyte_remove_leadingp($in){
      $out = preg_replace('#^<p>(http(?:s)?://(?:www.)?youtu)#','$1',$in);
      return $out;
    }

    re. reason; because users may wish to add a youtube URL in their content without expecting it to be rendered as a video ??

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Not working on Multisites automatically’ is closed to new replies.