Open gravityrail opened 3 years ago
I'm going to move this over to the Calypso repo for WP.com to track.
When Jetpack enqueues w.js
, we do it "the WordPress" way with the same jp-tracks
handle, so WordPress should ensure those don't duplicate. It looks like, scanning wp.com source code, there are various instances of adding a script
tag directly (the notifications panel in the admin bar when logged in being one).
Impacted plugin
Jetpack
Steps to Reproduce
and
This results in stats like
initial-visibility
firing twice with different random numbers, among probably other side-effects:The datestamped w.js request comes from class-tracking.php in Jetpack.
The other w.js has its W_JS_VER suffix of 61 set in stats.php in WPCOM, and I believe is also rendered to the page from that file (directly as HTML, not enqueued like the Jetpack version)
A clear and concise description of what you expected to happen.
We should only load w.js once, and fire stats once.
What actually happened
We load w.js twice and fire stats twice.
Other information
No response
Operating System
macOS
OS Version
11.5.2
Browser
Chrome/Chromium
Browser Version(s)
92