Skip to content

Main to develop sync after release v2.8.0 - #2353

Merged
subodhr258 merged 5 commits into
developfrom
main
Nov 11, 2026
Merged

subodhr258 merged 5 commits into
developfrom
main

Conversation

@subodhr258

Copy link
Copy Markdown
Collaborator

Back-sync after the v2.8.0 release (rtCamp/godam-plugin-wp#92): brings three commits from main onto develop:

develop has no commits that main lacks, and git merge-tree shows no conflicts. Merge with a merge commit, not squash.

subodhr258 and others added 4 commits November 6, 2026 12:00
* fix(deps): bump follow-redirects to 1.16.2 for Dependabot alert 398 (#2314)

Pins follow-redirects 1.16.2 in overrides (GHSA-mrwp-f3q8-3g9p). Build output is byte-identical; follow-redirects is only used by axios on Node and by webpack-dev-server.

* Update Changelog (#2326)

* Let the analytics service work out the visitor's location (#2214)

* Let the analytics service work out the visitor's location

The page params that GoDAM prints on every front-end page no longer carry
`locationIP`, and the analytics request body no longer has a `location_ip`
field. The analytics service works out the location from the request itself.

Merge after the analytics service reads the address from the request
(rtCamp/godam-analytics#364, item 1).

Tests: the request-body helper and the page params are both checked for the
absence of the address, including a page cached by an older version.

* Keep the JS tests clear of the sibling change's lines

Move the new location tests to the end of the file and leave the shared fixture lines untouched, so this branch and the one that stops sending the viewer's email do not conflict in the test file.

* docs: note that rtgodam_get_user_ip() is kept for other plugins

Nothing in GoDAM calls it after this PR; it stays as a public helper.

Addresses review: #2214 (comment)

* Run the PHP unit tests before publishing to WordPress.org (#2335)

release_on_tag.yml now calls the PHPUnit workflow as a tests job, and
the deploy job needs it, so a tag on a commit with failing tests no
longer reaches WordPress.org.

* Stop sending the signed-in viewer's WordPress user ID with analytics (#2334)

The page now carries userId 0, so the player and the GoDAM for Woo
senders send wp_user_id 0. No analytics report reads the field.

Refs rtCamp/godam-plugin-wp#104

* Point the Vimeo migration links at Central's Vimeo connect tab (#2333)

Both links in the Vimeo migration tab went to Central's home page and
general settings page. They now open Settings > Third-party apps, where
the Vimeo account is connected, and a Step 1 line at the top of the
panel says so.

* Wait for the visitor's statistics consent (WP Consent API) before GoDAM analytics stores or sends anything (#2332)

* feat(analytics): wait for WP Consent API statistics consent before tracking visitors

With the WP Consent API active, GoDAM's video and image-hotspot analytics store
nothing in the visitor's browser and send nothing to analytics.godam.io until
wp_has_consent( 'statistics' ) is true. Tracking starts if the visitor agrees
mid-page, and GoDAM's items are deleted if they withdraw. Sites without the
API keep today's behaviour; the godam_visitor_tracking_enabled filter turns
visitor tracking off entirely.

- utils/consent.js: one consent check, folded into shouldSkipAnalytics(), plus
  a consent-aware storage for the analytics library (visitor id in memory until
  consent) and the grant/withdraw listeners.
- The first-view flag and the layer-click buffer are not written without consent.
- Visitor_Consent: the filter, WP Consent API registration, and the three
  browser items listed with wp_add_cookie_info().

Part of rtCamp/godam-plugin-wp#47 (Phase 1, first PR).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(analytics): keep a returning visitor's id when consent is confirmed after page load

The WP Consent API's script prints after GoDAM's, so on every page GoDAM first
sees "no consent yet" and the analytics library makes a fresh id in memory.
When consent was then confirmed, that id overwrote the visitor's stored one, so
a returning visitor counted as new on every page. Found testing with CookieYes.

On grant, an id already on the device now wins, the live instance switches to
it (setAnonymousId), and the grant callbacks wait until it has. Test added; it
fails without the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(analytics): honour a recorded statistics refusal when the banner sets no consent type

wp_has_consent() returns true whenever no consent type is set on the page.
CookieYes 3.5 sets the type only when the visitor acts, so on the page after
"Reject All" it was unset and GoDAM tracked again despite the
wp_consent_statistics=deny cookie. An explicit deny cookie now always wins.
Test added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(analytics): hold events until the visitor chooses; setAnalyticsConsent() for custom banners

Meets rtCamp/godam-plugin-wp#55:
- Events from before the visitor's choice wait in memory (nothing stored, nothing
  sent): views of videos seen before consent, plays, and layer clicks are sent if
  the visitor accepts on that page and discarded if they refuse. Held events go
  out with the visitor's final id.
- window.GoDAM.setAnalyticsConsent( true | false ) lets a banner without WP
  Consent API support pass the choice; the godam_visitor_tracking_requires_consent
  filter makes GoDAM wait for it. One call reaches both the player and the
  image-page bundles.
- A readme FAQ entry documents the filters and the JavaScript call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(analytics): expose the consent check on window.GoDAM for add-ons

GoDAM for Woo can now gate its own senders with GoDAM's consent state:
window.GoDAM.hasStatisticsConsent(), holdUntilConsent(fn) (held add-on events
are discarded with GoDAM's own on refusal), onStatisticsConsent(fn), and
onStatisticsConsentWithdrawn(fn), called once per refusal or withdrawal after
GoDAM has deleted its own items, so the add-on can delete its cookies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: start a new visitor id when consent is withdrawn and given again on the same page

Withdrawal cleared the browser but kept the id in memory, so accepting again
wrote the deleted id back. Memory is now emptied and the live instance gets a
fresh id, kept in memory while consent is off.

Addresses review: #2332 (comment)

* fix: send held events with the stored visitor id, not the library's live id

When the library had not switched to a returning visitor's stored id within
the 1 s wait, held events went out under the in-memory id. They now read the
id from GoDAM's own storage, which has the stored id once consent is confirmed.

Addresses review: #2332 (comment)

* fix: start nothing if consent is refused while the grant waits for the stored id

The grant step can wait up to a second for the library to switch to a returning
visitor's id. A refusal in that window was followed by the grant step re-arming
view tracking. It now checks consent is still given before it runs.

Addresses review: #2332 (comment)

* fix: tell add-ons about a refusal once, not on every repeated deny

Banners can fire the same deny more than once; each one called the add-on
withdrawal callbacks again. They now run once per refusal, and again only
after the visitor accepts and refuses again.

Addresses review: #2332 (comment)

* fix: drop the unused category from the consent settings sent to the page

The JS fixes the category to statistics and never read the setting.

Addresses review: #2332 (comment)

* fix: re-check consent on load and first interaction for delayed consent scripts

A delay-JavaScript optimizer can hold the WP Consent API script back, and it
fires no event when it loads, so events waiting for consent could stay held.
GoDAM now re-checks once on load and once on the first pointerdown, keydown or
scroll.

Addresses review: #2332 (comment)

* docs: correct the comment on re-checking videos after consent

Held views are sent by their held action; the re-observe covers videos left
observed while analytics was not ready, and refuse-then-accept on one page.

Addresses review: #2332 (comment)

* docs: scope the consent FAQ to GoDAM's own analytics

GoDAM for Woo's Shoppable Video and Reel Pop counts are gated in a GoDAM for
Woo update, so the FAQ says what this plugin covers.

Addresses review: #2332 (comment)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Multi-language captions + multilingual transcription (plugin side) (#2174)

* Add multi-language captions + multilingual transcription support

Integrate the plugin with GoDAM Central's first-class caption tracks and
multilingual/multi-audio transcription (godam-core #1340).

Backend proxies (class-transcription.php):
- generate_transcription forwards optional `language` (BCP 47, or auto/multi
  detection) and `track_index` to process_transcription.
- New caption-track proxies to the SaaS api/captions.py: list, upload, update,
  delete and set-default, resolving the job-ID per attachment and injecting the
  licence key server-side. SaaS validation reasons are surfaced verbatim.

Editor UI (video-editor Transcription tab):
- Transcription language selector wired into Generate.
- Caption manager dialog: per-track rows (label, language, Generated/Uploaded
  badge, cue count, default marker) with set-default, edit, replace, download
  and delete; add form with client-side file read; cue editor for round-trippable
  tracks (disabled for has_rich_formatting).

Player:
- transcriptManager builds one subtitle <track> per caption_tracks row (default
  first), with a legacy single-transcript fallback; dedup by source URL so two
  same-language tracks both render.

* Fix the caption manager list and keep WordPress and Central captions in sync

- Caption manager reads Central's `captions` list (it read `caption_tracks`,
  so the list was always empty), shows list errors, and offers the cue editor
  only for tracks without rich formatting.
- Generate starts on "Account default" and sends no language, so Central's
  account language applies; the list matches the languages Central accepts.
- Player: a transcript uploaded in WordPress plays first, then every ready
  Central caption track; the cached copy is only a fallback when Central is
  unreachable. Tracks still generating no longer hide the rest.
- The transcription callback caches the default caption from `caption_tracks`
  instead of whichever audio track finished last, and never overwrites a
  WordPress upload. Caption-manager changes re-cache it and clear the
  deleted flag.
- Language codes keep their case and subtags (pt-BR, zh-Hant-TW); caption
  text is no longer unslashed twice; cue timestamps reuse the player's writer.

* Keep the WordPress transcript track on source changes and tidy the caption manager

Found in a live test against GoDAM Central:
- addRemoteTextTrack(..., false) lets video.js drop the track when the player
  changes its source. The transcript uploaded in WordPress is added before
  the Central request returns, so it vanished in 1 of 4 page loads. Pass true.
- Caption manager had no styles: label and language ran together. Add row
  layout for the manager and cue editor (both render outside the editor root).
- A generated track with no file shows its status and can't be set as
  default; "1 cue" is singular; Edit and Replace use edit and upload icons.

* Match GoDAM Central's caption dialog and keep caption order and edits stable

- Caption manager: the picked file's name shows beside "Choose another file";
  each row has a Default badge and a Generated/Uploaded badge; the default and
  replace icons match Central's dialog.
- Rows and the player's CC menu are sorted A to Z by label, so setting a
  default no longer moves a track; the player switches the default on directly.
- The label is required and must be unique on the video; a taken name is
  flagged in the field before upload.
- The player adds each track's revision to its file URL, so an edit made in
  Central reaches visitors at once instead of after the CDN's 30-day browser
  cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Explain caption tracks and offer the upgrade to free and unconnected sites

The caption manager showed a raw "not transcoded" error to sites with no
GoDAM account, and Central's "No active subscription" to free accounts.
Both now see what paid plans add, a See plans link, and Connect your
account when no key is set. Upload File keeps working for them.

- caption_context checks the API key before the video's job, so a site
  with no account is told to connect one.
- call_saas maps Central's NoActiveSubscription and SubscriptionInactive
  to rtgodam_no_subscription.
- The Add caption track button is hidden when the list cannot load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Disable Generate for videos GoDAM has not transcoded

Transcription runs on GoDAM, so a video it has not transcoded (no job)
cannot be transcribed; clicking Generate only returned an error. The
transcription GET route now says whether the video has a job, and the
Transcription tab disables Generate and the language picker for one
without, with a line saying why and that a caption file can still be
uploaded. The caption manager's plan notice is renamed to
"Multi-language captions are part of the paid GoDAM plans".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Captions: keep Central's tracks after a WordPress delete, follow Central's default, warn before deleting a track

- Delete in the Transcription tab now drops only WordPress's copy: the player
  still plays the caption tracks stored in GoDAM Central.
- The Transcription tab re-reads Central's default caption when it opens, and
  the video SEO data queues a background re-check at most every 12 hours, so
  changes made in Central's own dashboard reach WordPress without a callback.
- Deleting a caption track asks first, saying every site using the video loses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Captions: refresh Central defaults in batches, not one cron event per video

Right after an update every existing video has never been checked, so a
sitemap page queued one cron event (and one Central call) per video at once.
Due videos now go into one non-autoloaded queue: a page view adds at most 20,
the queue holds at most 500, and a single cron event refreshes 20 per run,
every 5 minutes, until the queue is empty. Review: #2174.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Captions: check the typed language code and the file size in the dialog

- "Other (enter code)": a value Central would refuse, such as "English", now
  shows "Enter a language code, such as cy or pt-BR, not the language name."
  under the field and keeps Add disabled.
- Add and Replace refuse a file over Central's 1 MB limit before reading it.
Review: #2174.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>
Co-authored-by: Subodh Rajpopat <subodh.rajpopat@rtcamp.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Set WPBakery param defaults in settings['default'] as well as std (#2323)

WPBakery 9.1 deprecated the 'std' key and logs a notice for every
element that still uses it without settings['default'] (7 lines per
page load from these 5 elements). Add settings['default'] with the same
value next to each of the 39 'std' keys. Keep 'std' so WPBakery 8.x,
which reads only 'std', keeps the same defaults.

* Ask sites on GoDAM for WooCommerce older than 2.3.1 to update it (#2338)

Earlier versions send their Shoppable Video and Reel Pops analytics
without waiting for the visitor's consent (GoDAM 2.8.0 holds its own).

* Restrict the MetForm and poll REST routes to Media Editor users (#2339)

* Restrict the MetForm and poll REST routes to Media Editor users

/metforms, /metform, /polls and /poll/{id} used __return_true, so anyone
could call them. /metform renders any form ID through the [metform]
shortcode, which shows pending, private and scheduled builder forms to
logged-out visitors, and /polls returns every WP-Polls row, including
scheduled polls.

Only the Media Editor calls these routes; the player renders MetForm and
poll layers on the server. They now use forms_permissions_check
(upload_files), like the other form routes.

* Send the REST nonce from the Media Editor's poll client

The poll routes now need upload_files. polls.js sent no X-WP-Nonce, so
WordPress treated the editor's cookie request as logged out and the Poll
layer's picker came back empty. Same header as gravity-forms.js (#2049),
with a Jest test that both poll requests carry it.

* Bump version to 2.8.0 and add the v2.8.0 changelog (#2337)

* Bump version to 2.8.0 and add the v2.8.0 changelog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Set @SInCE n.e.x.t to 2.8.0 and regenerate the POT after #2174 and #2332

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add the WPBakery 9.1 fix to the 2.8.0 changelog and regenerate the POT

Merges develop (#2323), adds its Fix line to CHANGELOG.md and readme.txt,
and regenerates languages/godam.pot with --slug=godam so the bug-report
URL is /plugin/godam and the WPBakery line references are current.

* Add the GoDAM for Woo 2.3.1 notice to the 2.8.0 changelog and refresh the POT

Merges develop (#2338, #2339). Regenerated with --slug=godam; only
source references moved.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Rudrakshi Gupta <109859631+rudrakshi-gupta@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Kuldip Chaudhary <64731232+KMchaudhary@users.noreply.github.com>
Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>
…e build (#2347)

* Move the 2.8.0 date to November 10, 2026

* Transcription: say it usually takes a few minutes, not 10-15

The message shown while an AI transcription runs said it usually takes
10-15 minutes. It usually finishes in a few minutes, so say that, and
that long videos take longer.

* Update the POT for the transcription time message

* Transcription: say it usually takes a few seconds

A preprod test on 9 Nov transcribed 140 seconds of audio in about
3 seconds, so 'a few minutes' was still too long.

* Caption manager: add test ids to the file inputs, row actions and add form

The add and replace file inputs had no id, name or test id, so E2E tests
could only reach them by position. Row actions were only reachable through
a row test id keyed by the caption's id, which a test cannot know ahead.

Rows also carry data-caption-language and data-caption-label, so a test can
find the row for a language or label.

* Regenerate the POT after the caption manager test ids

* Build: resolve react/jsx-runtime to WordPress's React in the admin pages

Packages bundled from node_modules (such as @wordpress/dataviews) import
react/jsx-runtime. The pages build bundled that package, inlining React 18's
element factory into 11 bundles. Elements were then created by a different
copy of React from the one rendering them, and Plugin Check 2.2.0 fails the
build (inlined_react_jsx_runtime), which blocks merges to main.

Resolve the import to pages/jsx-runtime.js, which creates elements with
createElement from the externalized React global. WordPress registers a
shared react-jsx-runtime script only from 6.6, and GoDAM supports 6.5.

* Transcription: keep the cached transcript while the default has no file

Opening the Transcription tab asks Central for the caption list. When the
default caption had no file yet (an AI transcript still pending, or one
that failed), WordPress deleted its cached transcript, so the tab went
empty and the player lost it. Now the cached transcript stays while
Central still lists it; one Central no longer has is still cleared.

* Regenerate the POT after resolving react/jsx-runtime

* Regenerate the POT for the shifted transcription REST lines

* Transcription: say it usually takes a few minutes

"A few seconds" rested on one preprod run, and the panel polls every
8 seconds, so the note stays up longer than the job anyway.

Addresses review: #2347 (comment)

* Caption manager: one helper for a caption's display label

The label-or-language-name fallback was written in five places. It now
lives in captionDisplayLabel(), so data-caption-label and the visible
text can't drift apart. No behaviour change.

Addresses review: #2347 (comment)

* Regenerate the POT for the new transcription message

* Transcription: stop waiting and say why when GoDAM refuses to start

When Central refused a transcription, for example "Transcription limit
exceeded" on an account with no quota left, it gave the reason in
message and left error empty. The editor only read error, so it showed
nothing and kept the spinner running, polling every 8 seconds with no end.

getGenerateRefusal() now treats any success: false answer with no job
running as final and returns error or message. The editor stops waiting
and shows it, or a generic message when Central gave none.

* Regenerate the POT for the transcription refusal fix

* POT: restore the plugin slug in the bug-report header

The last two POT regenerations ran from worktree folders whose names
became the slug in Report-Msgid-Bugs-To. Regenerated with --slug=godam.

* Transcription: compare caption files, not signed URLs; keep an in-flight status

Central signs caption URLs with a fresh token on every request, so the
cached URL never equalled the listed one and the cache was still deleted
on accounts with signed delivery. Compare the file part, before the query
string. Also keep an in-flight status such as Transcribing when nothing
is cached, so the tab opens on the progress state.

Addresses review: #2347 (comment)
Addresses review: #2347 (comment)

* Regenerate the POT for the shifted transcription REST lines
* Keep caption files uploaded before 2.8.0

2.8.0 marks a caption file uploaded in WordPress with
rtgodam_transcript_source = upload, but uploads from earlier versions
have no mark. They were treated as a cached copy of GoDAM Central's
caption: opening the Transcription tab or the background refresh
overwrote or removed them, and the player played Central's tracks
instead.

An unmarked transcript whose address is not on Central's CDN now counts
as an upload. Generate marks the source as central, so a new
transcript still replaces an old upload.

* Regenerate godam.pot for the shifted transcription line numbers

* Keep the stored caption file until Generate finishes

Generate marked the transcript as Central's as soon as a job started,
so while the job ran, or after it failed, the caption sync saw an
unlisted Central copy and removed the uploaded file the video used.

Generate now marks a running job central-pending: the stored file is
kept and played as an upload until Central reports a ready default,
which then replaces it and marks it central. Every write of Central's
transcript (sync, callback, godam_get_transcript_path) now marks it
central too, so the address check only decides for transcripts stored
before 2.8.0. The rtgodam_transcoder_file_hosts docblock says so.

Regenerate godam.pot for the shifted line references.
@subodhr258 subodhr258 added the risk: low QA automation only (Dependabot fixes, copy, CSS) label Nov 10, 2026
@github-actions

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
13 0 13

⚠️ Warnings (13)

📁 readme.txt (1 warning)
📍 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".
📁 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/10/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/10/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

@subodhr258
subodhr258 merged commit 2e16ecd into develop Nov 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low QA automation only (Dependabot fixes, copy, CSS)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants