Repository navigation
Consent follow-ups: "Track visitors" setting, privacy-policy text, and the browser items in the readme - #2374
Conversation
…ser storage in the readme - GoDAM > Settings > General gets a "Track visitors" switch (general.enable_visitor_tracking, on by default). It is the default for the godam_visitor_tracking_enabled filter, so the filter still wins. - Suggested privacy-policy text through wp_add_privacy_policy_content(). - readme.txt and README.md: the analytics.godam.io entry lists the data sent and the three items GoDAM keeps in the browser. Items 3, 4 and 5 of rtCamp/godam-plugin-wp#55. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MexDKVufPym43bCVfuHnms
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Video Hosting for LMS & Online Courses" is different from the name declared in plugin header "GoDAM". |
0 |
readme_parser_warnings_trimmed_section_description | The "Description" section is too long and was truncated. A maximum of 2500 characters is supported. |
📁 assets/build/pages/video-editor.min.js (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
2 |
react_removed_api | This file calls "ReactDOM.findDOMNode", which was removed in React 19 and stops working once WordPress upgrades React. Use a ref on the element instead. |
📁 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/11/17/hello-world/ (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/sample-page/ (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/11/17/hello-world/ (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/sample-page/ (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
…y text Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MexDKVufPym43bCVfuHnms
…s-55 # Conflicts: # languages/godam.pot
… user ID The player sends wp_user_id from the page's userId, which is always 0 since 2.8.0. The suggested privacy-policy text and both readmes said the ID is sent.
|
Code review — looks solid. Settings/REST/Redux wiring, the filter-default chaining, and the privacy-policy text are all consistent, and the tests cover the important paths (missing key → on, filter overrides setting). No correctness bugs found. Two minor notes:
Neither blocks merge. Reviewed with Claude Code |
|
Thanks @KMchaudhary.
Replied with Claude Code Generated by Claude Code |
Code reviewVerdict: LGTM, no blocking issues. The setting is wired in the least risky way: it only changes the default of What I ran (head of
|
| Check | Result |
|---|---|
VisitorConsentTest |
12/12 pass |
| Full PHPUnit | 1471 tests pass |
PHPCS (class-visitor-consent.php, class-settings.php, test) / ESLint (GeneralSettings.jsx, media-settings.js) |
Clean |
| POT | Includes the new strings; all 14 refs for class-visitor-consent.php point at their translation calls |
What I verified
- The setting round-trips: a REST default and sanitizer entry (
rest_sanitize_boolean), the Redux defaulttrue, and the toggle uses?? true, so an old saved settings object without the key shows as on. - The privacy text can't drift from what the banner gets: the list comes from
get_storage_items(), the same three items given towp_add_cookie_info(), with translated purpose and lifetime. What it says GoDAM sends matches what's sent today: the IP read from the request (Let the analytics service work out the visitor's location #2214), no email (Stop sending the signed-in viewer's email with video analytics #2213),wp_user_idalways 0 (Stop sending the signed-in viewer's WordPress user ID with analytics #2334). Output goes throughwp_kses_post(), andclasssurvives onp/strong. wp_add_privacy_policy_content()onadmin_init, guarded withfunction_exists, matches core's guidance.
Suggestions (non-blocking)
- The help text vs the GTM option. "GoDAM stores nothing in visitors' browsers and sends no view or click events" is true for GoDAM analytics. But with Enable Google Tag Manager tracking on,
gtm-video-tracker.jsstill pushes video events into the site'sdataLayer; it has no consent or tracking-setting gate (pre-existing, not from this PR). Adding "to GoDAM analytics", or "the Google Tag Manager option is separate", would stop an admin thinking one switch stops both. - Page caches.
trackingEnabledis printed into the page, so turning the switch off only takes effect on cached pages once the cache is purged. A short "Purge your page cache after changing this" in the help text (or the readme FAQ) would save a support ticket. - UTM in the privacy text. The readme now lists UTM parameters among what's sent, but the suggested policy paragraph doesn't mention them ("...the page you are on and the page that referred you, including campaign (UTM) parameters..."). It's minor, but the two lists should match.
|
Thanks @rudrakshi-gupta. All three hold; I checked the first one:
All three go in the next push, with @KMchaudhary's test-isolation note, rather than a push for them alone. Replied with Claude Code Generated by Claude Code |
…s-55 # Conflicts: # languages/godam.pot
…ated privacy test - "Track visitors" help text and readme FAQ: the switch covers GoDAM analytics; the Google Tag Manager option is separate; purge the page cache after changing it. - Suggested privacy text names campaign (UTM) parameters, as the readme does. - VisitorConsentTest: the wp_add_privacy_policy_content() stub runs in its own process, and a new test covers the function_exists() guard. - POT regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MexDKVufPym43bCVfuHnms
|
Merged
PHPUnit (1599) and ESLint pass. The POT is regenerated. Posted with Claude Code Generated by Claude Code |
Part of the 2.10.1 release: https://github.com/rtCamp/godam-plugin-wp/issues/112
What this does
The GoDAM half of the consent follow-ups still open on Let sites hold video analytics until the visitor consents (items 3, 4 and 5 of this comment), for GoDAM 2.10.1. The consent gate itself shipped in 2.8.0 (#2332).
godam_visitor_tracking_enabledfilterHow
Visitor_Consent::is_tracking_setting_enabled()readsrtgodam-settings> general >enable_visitor_tracking. A missing key means on, so sites updating from 2.8.0 keep tracking.is_tracking_enabled()passes that value as the filter's default. Nothing else changes in the front end: it already readsvideoAnalyticsParams.consent.trackingEnabled.true; oneToggleControlin General Settings.add_privacy_policy_content()onadmin_init. The list of items comes fromget_storage_items(), the same list the WP Consent API gets, so the two can't drift.Testing
VisitorConsentTest: 5 new tests (12 total): setting off stops tracking, a missing key keeps it on, the filter overrides the setting, the privacy text names analytics.godam.io and every browser item, the text is hooked onadmin_init. Full PHPUnit: 1471 pass.jest pages/godampasses.npm run build:prodpasses./analytics/request and no__anon_idappear; the Policy Guide screen. QA steps below.QA steps
__anon_idis in local storage andanalytics.godam.iorequests are sent.__anon_id, nogodamVideoSeen:keys, noanalytics.godam.iorequests (play the video, click a layer, leave the page).add_filter( 'godam_visitor_tracking_enabled', '__return_true' );in a mu-plugin, tracking runs even with the switch off.Risk
risk: low: default is unchanged; the switch only turns tracking off.Generated by Claude Code