Skip to content

Instantly share code, notes, and snippets.

View patrick-wc's full-sized avatar

Patrick Whitty-Clarke patrick-wc

View GitHub Profile

How WordPress Plugins Should Handle Front End Resources

It's extremely common for people to be unhappy with how a WordPress plugin adds front end resources to their site. If a plugin needs CSS, it'll slap in a <link> to that stylesheet. Or a <script>. Or link up images.

Plugins do this because it works. It's damn important for a WordPress plugin to work, even in adverse conditions.

In optimizing front end performance of a site, reducing the number of HTTP requests is a huge thing. It's my site, I want to decide and control how front end resources are being handled.

So perhaps we can suggest how WordPress plugins should handle external resources: