Repository navigation
Stop sending the signed-in viewer's email with video analytics - #2213
Conversation
The page params that GoDAM prints on every front-end page no longer carry the current user's email address (`emailId`), and the analytics request body no longer has an `email` field. The WordPress user id is still sent. Tests: the request-body helper and the page params are both checked for the absence of the email, including a page cached by an older version.
The analytics.godam.io entry under External services no longer lists Email as data sent.
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
620 |
WordPress.DB.SlowDBQuery.slow_db_query_meta_key | Detected usage of meta_key, possible slow query. |
📁 readme.txt (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" is different from the name declared in plugin header "GoDAM". |
0 |
trademarked_term | The plugin name includes a restricted term. Your chosen plugin name - "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" - contains the restricted term "wordpress" which cannot be used at all in your plugin name. |
📁 inc/classes/class-video-sitemap-core-provider.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
73 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound | Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "wp_sitemaps_index_entry". |
📁 assets/build/css/main.css (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedStylesScope | This style is being loaded in all contexts. |
📁 assets/src/libs/analytics.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/10/20/demo-post-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-page-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
📁 assets/build/js/main.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/10/20/demo-post-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-page-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
The player script's page data (godamData.currentLoggedInUserData) carried the current user's email address, which nothing in the browser reads. It now holds the display name and whether someone is signed in. The comments routes still read the email on the server.
The explanation moves into the test, so the fixture lines this branch leaves alone cannot conflict with the sibling change.
rtgodam_get_current_user_data_for_page() now returns only the display name and the sign-in type, so a field added later to the server-side user data is not printed into the page by accident.
The new helper in custom-functions.php moves five strings further down the file, so their source references change. Nothing else in the file differs from develop.
# Conflicts: # languages/godam.pot
Code reviewVerdict: LGTM — the privacy change is complete and verified at both ends (page params and request body), and the server-side comments path correctly keeps the email. I traced every consumer of the removed data:
Using an allowlist ( Two documentation-level notes, neither blocking: 1.
|
The page no longer sends the signed-in viewer's email (#2213), and readme.txt already dropped it; README.md still listed it. Addresses review: #2213 (comment) Addresses review: #2212 (comment)
|
Thanks Kuldip.
Minor: leaving the call-site test out; the 12-page scan covers it. |
Review packet
In one line: The plugin no longer puts the signed-in viewer's email address into the front-end page (in the
videoAnalyticsParamsobject and in the player'sgodamData.currentLoggedInUserData) or into the analytics events the player sends. No issue; planned in rtCamp/godam-analytics#364 (item 4).1. Criteria and proof
emailId(before: it carries the viewer's address)test_signed_in_viewers_email_is_not_in_the_page_params; capture S01, block 1email(before:godamData.currentLoggedInUserData.emailholds the address)test_player_page_data_for_a_signed_in_viewer_has_no_email; capture S01, block 2emailkey (before:emailholds the viewer's address)does not send the viewer email, even when the page still carries one; capture S01, block 3emailId, does not make the player send itemailId: 'a@b.test'on purpose)test_the_server_side_user_data_still_has_the_emailtest_page_params_keep_what_analytics_still_needs; JS teststill sends the WordPress user id2. Before and after
A signed-in subscriber opens a page with videos on godam-dev in Chrome and plays one for 6 seconds. Before is
develop(2.4.0); after is this branch. Captures are verbatim from the browser and from the analytics service's database.emailIdinvideoAnalyticsParamsemailingodamData.currentLoggedInUserDatanameandtypestay)emailin the play requestemailstored for the 6 events of the run3. Tests
tests/php/ViewerEmailNotInPageTest.php. It builds the page params with a signed-in user and asserts there is noemailIdkey and the address appears nowhere in the JSON; that the player's page data has noemailbut keepsnameandtype; that the server-side user data still has the email; and thatuserId,siteId,endpoint,tokenandpostIdare still in the page params. Each test runs in its own process, and loads its stubs there, because loadinggodam-transcoder-functions.phpregisters hooks andEarlyTranslationHooksTestchecks exactly that on first load.assets/src/js/godam-player/analytics-helpers.test.js(noemailkey even when the page still carriesemailId;wp_user_idstill sent).tests/stubs/template-tags.php, the page-tag stubs the PHP test needs (is_single,get_the_titleand similar).tests/stubs/engagement-functions.php. The current-user stub now also returnsIDanddata->user_email(an emptydatawhen nobody is signed in), as WordPress does. The Engagement tests that use it still pass: 428 PHP tests, 1414 assertions, in normal, reversed and random order.assets/src/js/godam-player/engagement.test.js. Its page-data fixture no longer has anemail, matching what the page now prints.test_signed_in_viewers_email_is_not_in_the_page_paramsfails with "Failed asserting that an array does not have the key 'emailId'",test_player_page_data_for_a_signed_in_viewer_has_no_emailfails with "Failed asserting that an array does not have the key 'email'", and the JS test fails withExpected path: not "email",Received value: "a@b.test".4. Risk flags
No risk flags fired on #2213. Nothing in the diff touched the watched areas.
5. Independent review
A separate review pass saw only the task and the diff, first on the analytics change and then again after the player-data and readme commits.
RTGODAM_ANALYTICS_BASEconstant reached every other testsetUp(), in the separate process. The suite passes in normal, reversed and random order.email, until those caches expire (raised twice)godamData.currentLoggedInUserData.emailin the player script's page data, seen on godam-dev. Fixed in 5732543. Static search of the source:emailIdis read only by the analytics sender and thegodam-for-wooadd-on;rtgodam_get_current_logged_in_user_data()is called by the page data (now filtered) and by the comments routes, which run on the server.assets/buildis not committed. A scan of 12 front-end pages as a signed-in viewer finds 0 copies from GoDAM.dataeven when nobody was signed in, and its header comment overstated what it guardsemailkey where it had''; a required column could reject itemail. The service tested isdevelop, which per rtCamp/godam-analytics#364 holds the same code as production.readme.txtlists "Email" among the data sent to analyticsREADME.mdhas the same table row; that file is changed by the readme PR of this release.class-godam-player.phpthat buildsgodamData, and removing one field is a blocklistnameandtype(240c9ba), so a later field is not printed by accident. No unit test for the call itself: the method registers about 20 scripts and styles and needs the built files, so the stubs would outweigh the check. The scan of 12 pages in S01 covers it on a real site.composer.jsonpins PHPUnit to^9.6, which honours them. The fixed values are the stub's, not the plugin's.6. Not verified
email, until they expire. Site owners can purge their page cache after updating. Not tested.godam-for-wooadd-on readsemailIdand sends it asemailtoo. After this PR it reads nothing there, so its Reel Pop events carry an emptyemail(seen in capture S02, type 4, stored empty). No change is needed in that repo for this PR.emailuntil they update. The analytics service already treats the field as optional; dropping it on the service side is item 4 of rtCamp/godam-analytics#364.7. Scope
Beyond the analytics code: the player's page data lost its
email(found when the page source was checked on godam-dev; no script reads it), and one line ofreadme.txtchanged, because the External services text for analytics.godam.io no longer lists Email as data sent (the later items are renumbered).languages/godam.potis regenerated (5 source line numbers moved, because the new helper sits above those strings incustom-functions.php).wp_user_idis kept for now: replacing it with an opaque id is a larger change and is not part of this PR.What changed
rtgodam_get_localize_array()no longer setsemailIdfrom the current user.buildAnalyticsRequestBody()no longer readsemailIdor sendsemail.rtgodam_get_current_user_data_for_page()returns the current user's data without the email; the player script'sgodamData.currentLoggedInUserDatauses it. The comments routes keep callingrtgodam_get_current_logged_in_user_data(), which still has the email.How to check by hand
videoAnalyticsParamshasuserIdand noemailId.analytics, play the video. The request payload has noemailkey.