• Hi there,

    it’s great to see the plugin emergem and so far, testing is going really well.

    I’ve been developing a workflow for dealing with page load for a while and have used the WP filter script_loader_tag to add “defer” & “async” attributes to scripts where necessary.

    Where I’m able to advise on themes or plugins this usually is enough but when installations get out of hand and some brute force minification is required your plugin is perfect.

    I’m still working out the best way to approach these situations but do you think that adding the ability to add these attributes via the plugin is a viable option?

    I understand this may create too much complexity from a code perspective and more so the user but I thought I’d run it by you to see if you what you think.

    All the best, and thanks for sharing your work!

    John

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter John McCarthy

    (@john-lion)

    To add to this request…

    Didn’t want post this here as it’s more of a support question than feature request but does follow on from this post ??

    accessing-scripts-loaded-by-the-plugin

    Plugin Author launchinteractive

    (@launchinteractive)

    Hi John,

    We could certainly add defer and async support but I wanted to confirm how you would prefer this to work. MMR is designed to merge scripts all into one file.. with that in mind, would you want to defer the lot or only some files?

    Thread Starter John McCarthy

    (@john-lion)

    Hey, thanks for getting back to me on this.

    Per file would be great.

    Here’s how I thought it could work; Having the ability to select files to be added to three concatenated groups; default, defer and async. Minification can also be turned on/off for each group.

    With these settings I think we’ve covered most cases ?? But at the same time having to select those files could make the interface messy so, perhaps this isn’t a good idea?

    Andrew Miguelez

    (@andrewmiguelez)

    Personally, I’d prefer if MMR simply followed the applied defer & async attributes by way of script_loader_tag. This, instead of a UI change, would mean the plugin could maintain its simplicity.

    I can see how configuration in the plugin settings would be helpful, however I’d argue that since we’re not adding stylesheets/scripts in the plugin, but through functions.php, we should manage the attributes in the same way. This way, the desired behavior for those files is constant whether the plugin is in use or not.

    • This reply was modified 8 years ago by Andrew Miguelez. Reason: added tags
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feature request – async & defer’ is closed to new replies.