The WP Coder plugin provides a convenient option to include external CSS or JS files on your WordPress site by simply inserting the link to the file. This means you can utilize stylesheets or scripts hosted elsewhere without having to upload them to your own site.
To use this feature, navigate to the WP Coder settings in your WordPress dashboard, and in the appropriate section, insert the URL of the CSS or JS file you wish to include. This method is useful when you’re using a library or a framework hosted on a CDN (Content Delivery Network), or if you want to maintain the same version of a script or stylesheet across multiple sites.
Adding ‘defer’ and ‘async’ Attributes to JS Files: WP Coder allows you to add the ‘defer’ and ‘async’ attributes to the external JS files you include through the plugin. These attributes control how your JS files are loaded relative to your webpage’s loading, potentially improving your site’s performance.
When you include a JS file link, you’ll see options to add these attributes. By selecting ‘defer’, your JS file will not execute until your HTML document has fully loaded. By selecting ‘async’, your JS file will load and execute asynchronously with your HTML document, meaning it won’t prevent other elements from loading.