Flying Scripts by WP Speed Matters

Description

Download and execute JavaScript on user interaction.

Quick Links

Flying Scripts delay the execution of JavaScript until there is no user activity. You can specify keywords to include JavaScripts to be delayed. There is also a timeout which executes JavaScript when there is no user activity.

Why should I use this plugin?

JavaScript is very resource-heavy. By delaying the execution of non-critical JavaScript (that are not needed for the initial render), you’re prioritizing and giving more resources to critical JavaScript files. This way you will reduce render time, time to interactive, first CPU idle, max Potential input delay etc. This will also reduce initial payload to browsers by reducing the no. of requests.

Contributors

Installation

  1. Visit ‘Plugins > Add New’
  2. Search for ‘Flying Scripts’
  3. Activate Flying Scripts for WordPress from your Plugins page.
  4. Visit Settings -> Flying Scripts to configure

FAQ

What are the ideal scripts to be included?

Any script that is not crucial for rendering the first view or above fold contents. 3rd party scripts like tracking scripts, chat plugins, etc are ideal.

What should I put in include keywords

Any keyword inside your inline script that uniquely identifies that script. For example “fbevents.js” for Facebook Pixel, “gtag” for Google Tag Manager, “customerchat.js” for Facebook Customer Chat plugin.

How is it different from `defer`

defer tells browser to download the script when found and execute it when HTML parsing is complete. When you include a script in Flying Scripts, those scripts won’t be executed until there is a user interaction.

What is user interaction?

Events from the user like mouse hover, scroll, keyboard input, touch in mobile device, etc.

What is timeout?

Even if there is no user interaction, scripts will be executed after the specified timeout.

Reviews

February 12, 2020
As a freelancer, I always face problems with external scripts while optimizing WordPress sites, but this plugin is a lifesaver. I tried this today with various scripts including Facebook chat and even Google Adsense & it works like a charm. Thank you very much GIJO! Keep rocking. Zia
February 7, 2020
Great plugin ! Eliminate multiple requests and external domains from chat plugins, Facebook pixel...
Read all 6 reviews

Contributors & Developers

“Flying Scripts by WP Speed Matters” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.1.5

  • [UPDATE] Set data-type='lazy' instead of type='lazy'. Removed setting type='text/javascript' via JavaScript

1.1.4

  • [BUGFIX] Remove event listeners after scripts are loaded

1.1.3

  • [UPDATE] Copy updates

1.1.2

  • [UPDATE] Minified JavaScript
  • [UPDATE] Updated copy, FAQ

1.1.1

  • [BUGFIX] Exclude json and other script tags

1.1.0

  • [NEW] Load scripts on user interaction
  • [REMOVED] Load scripts after delay

1.0.0

  • Initial release