• Resolved iSaumya

    (@isaumya)


    Hi,
    Inside the plugin code lib/creations/class-creations-views.php online no 265 you guys have a function named add_async_styles() which basically adds a <link rel="preload" ...> for the mediavine create CSS.

    But adding rel=preload inside the body content will have no effect as the rel=preload is supposed to be used inside the <head> in fact as early as possible so that the browser can preload and parse that styles before going inside the body content.

    But here as the preload is happening way inside the <body> it has absolutely no purpose and the browser cannot preload it as intended.

    Currently the add_async_styles() is being called using the style_loader_tag filter, but I would highly recommend instead using the wp_head action to ensure that the preload gets added within the <head> as early as possible so that the browser can preload it.

    On top of that you guys have added the normal stylesheet load i.e. <link rel="stylesheet" id="mv-create-card/css-css" href="..."> inside a <noscript> which makes absolutely no sense. The link preload is not a javascript dependent task. So, no script makes no sense.

    So, if you wish to preload the CSS using rel=preload just do that, no need to add the noscript part.

    On the other hand if you want to load the CSS in the normal way, do that and don’t use the preload. But whatever you do needs to be done in the <head> and not inside <body>.

    Hope someone from the development team will see this message and work on it.
    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author mediavine

    (@mediavine)

    Hey Saumya,

    Thank you so much for reaching out to us about this! I’m just following up to let you know that I submitted these suggestions as feedback over to our plugin engineers for review and possible consideration for adjusting in a future release.

    I don’t quite have an ETA on if/when this will become a thing but we thank you so much for taking the time to let us know about this.

    If you notice anything else please don’t hesitate to reach out and let us know!

    Have a great day. 🙂

    Plugin Author mediavine

    (@mediavine)

    Hey there,

    It’s been awhile since we’ve heard from you so we’re going to go ahead and close this thread. If there’s anything else you need please don’t hesitate to start a new one!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Preloading CSS inside the Body makes no sense and will just cause CLS’ is closed to new replies.