WP Manifestindependent plugin directory
manifest / performance / script-modules-in-footer

Script Modules in Footer archived

[OBSOLETE WITH WP 6.9] Prints script modules at wp_footer instead of at wp_head to improve performance by reducing network contention for the critical rendering path. Only relevant for block themes.

by Weston Ruter · github.com/westonruter/script-modules-in-footer · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/westonruter/script-modules-in-footer/archive/refs/heads/main.zip

Declares an update source (https://github.com/westonruter/script-modules-in-footer), so updates arrive through the plugin's own updater.

Readme

[!NOTE]
This plugin is obsolete because the functionality in this plugin landed in WordPress 6.9. See section in frontend performance field guide.

Script Modules in Footer

Contributors: westonruter
Tested up to: 6.8
Stable tag: 0.1.0
License: GPLv2 or later
Tags: performance

Description

Prints script modules at wp_footer instead of at wp_head to improve performance by reducing network contention for the critical rendering path. This can be used with Script Fetch Priority Low to improve performance even more. This is only relevant for block themes.

This is a prototype for #63486 in WordPress core to test the performance impact.

Important: This moves all script modules to the footer. In WordPress core, script modules are used exclusively for the Interactivity API which uses server-side rendering, so they are safe to deprioritize by moving to the footer. However, if you have any script modules that are in the critical rendering path then you shouldn't use this plugin.

See full writeup: Improve LCP by Deprioritizing Script Modules from the Interactivity API.

Related plugin: Script Fetch Priority Low

Installation

  1. Download the plugin ZIP from GitHub or if you have a local clone of the repo, run npm run plugin-zip.
  2. Visit Plugins > Add New Plugin in the WordPress Admin.
  3. Click Upload Plugin.
  4. Select the script-modules-in-footer.zip file on your system from step 1 and click Install Now.
  5. Click the Activate Plugin button.

You may also install and update via Git Updater.

Changelog

0.1.0

  • Initial release.

Read the full README on GitHub →