Web Worker Offloading
Description
This plugin offloads JavaScript execution to a Web Worker, improving performance by freeing up the main thread. This should translate into improved Interaction to Next Paint (INP) scores.
This functionality is experimental.
In order to opt in a script to be loaded in a worker, simply add worker script data to a registered script. For example, if you have a script registered with the handle of foo, opt-in to offload it to a web worker by doing:
wp_script_add_data( 'foo', 'worker', true );
Unlike with the script loading strategies (async/defer), any inline before/after scripts associated with the worker-offloaded registered script will also be offloaded to the worker, whereas with the script strategies an inline after script would block the script from being delayed.
Otherwise, the plugin currently ships with built-in integrations to offload Google Analytics to a web worker for the following plugin: Rank Math SEO, Site Kit by Google, WooCommerce.
Please monitor your analytics once activating to ensure all the expected events are being logged. At the same time, monitor your INP scores to check for improvement.
This plugin relies on the Partytown library by Builder.io, released under the MIT license. This library is in beta and there are quite a few open bugs.
The Partytown configuration can be modified via the plwwo_configuration filter. However, not all of the configuration options can be serialized to JSON in this way, for example the resolveUrl configuration is a function.
Other Notable Features
Here are a few other notable features of this free Web Worker Offloading plugin.
FAQ
If you find that your offloaded scripts aren’t working while also seeing a 404 error in the console for a file at /wp-content/plugins/web-worker-offloading/build/partytown-sandbox-sw.html?1727389399791 then it’s likely you have Chrome DevTools open with the “Bypass for Network” toggle enabled in the Application panel.
Contributors and developers
“Web Worker Offloading” is open source software. The following people have contributed to this plugin.
WPS
7.06
Very Good
Ratings
3 out of 5 | 3Version
0.2.1Last updated
1 month agoActive installations
20,000+WordPress version
7.0 or higherPHP version
7.2 or higherLanguages
7Tags
Analytics,Javascript,Partytown,Performance,Web WorkerOther plugins you might like
LiteSpeed Cache
By LiteSpeed Technologies
WPS
7.7
Very Good
2.7k+reviews
active installation
Tested with
6.9.4Imagify Image Optimization – Optimize Images | Compress Images | Convert WebP | Convert AVIF
By WP Media
WPS
7.28
Very Good
1.6k+reviews
active installation
Tested with
7.0Image Optimizer – Optimize Images and Convert to WebP or AVIF
By Elementor
WPS
7.13
Very Good
72+reviews
active installation
Tested with
6.9.4EWWW Image Optimizer
By nosilver4u
WPS
7.49
Very Good
1.8k+reviews
active installation
Tested with
7.0Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP & AVIF | Image CDN
By WPMU DEV - Your All-in-One WordPress Platform
WPS
7.43
Very Good
6k+reviews
active installation
Tested with
6.9.4WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance
By David Anderson / Team Updraft
WPS
7.8
Very Good
2.6k+reviews
active installation
Tested with
7.0