• Resolved abitofmind

    (@abitofmind)


    Web acceleration basics: Each HTTP request fewer is better!

    Whereas as soon as one enables your plugin:

    1) Each page/post in its <head> contains an extra CSS file:

    <link rel='stylesheet' id='simple-iframe-style-css'  media='all'/>

    regardless whether it features an iFrame block or not.

    2) That CSS file is empty, so has no use anyhow. But nevertheless ofc causes an HTTP overhead.

    Could your plugin possible get more efficient/performant in that regard?

    Ad 2) If the CSS is empty anyhow, don’t insert a <link> element into the markup at all.

    Ad 1) Possible make use of the WordPress theme.json Style Engine, which

Viewing 1 replies (of 1 total)
  • Plugin Author unapersona

    (@unapersona)

    Hello @abitofmind,
    thank you for your message, the plugin was created a few years ago as a way to learn how to make blocks, and a lot changed since then.

    I’ve just uploaded a new version using the @wordpress/create-block, the block.json file and including the css file only in the editor view.

    Please check it out and let me know if you detect any issues.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin inserts CSS into head of each page regardless whether it has iFrame block’ is closed to new replies.