Replies: 0
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.