Skip to content

Save converted MP3 audio as audio/mpeg, and fix files already saved as audio/mp3 - #2208

Merged
subodhr258 merged 3 commits into
developfrom
fix/transcoded-mp3-mime-type
Oct 20, 2026
Merged

subodhr258 merged 3 commits into
developfrom
fix/transcoded-mp3-mime-type

Conversation

@subodhr258

@subodhr258 subodhr258 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #2220

Review packet

In one line: audio that GoDAM Central converts to MP3 is now saved with WordPress's MP3 type, audio/mpeg, instead of audio/mp3, so the block editor's Inserter > Media > Audio list and other REST API readers find it; a one-time update step fixes files converted before. Fixes no issue: this is the "Transcoded MP3 mime type" known issue from the 2.4.0 QA sign-off.

Why it happened: when Central's "MP3 ready" callback arrives, add_transcoded_files() in admin/class-rtgodam-transcoder-handler.php saves the attachment as audio/mp3. WordPress registers MP3 as audio/mpeg and does not know audio/mp3, so anything that reads WordPress's list of types misses these files. The Media Library's Audio filter still showed them, because it matches audio/ as a prefix.

The fix:

  • New conversions are saved as audio/mpeg (video still saves video/mp4).
  • A one-time migration, Transcoded_Mp3_Mime_Type, in the existing migrations runner under a 2.5.0 batch: one UPDATE changes every audio/mp3 attachment to audio/mpeg, then clears each one's cache. It runs on the first request after the update, once per site (each site on a multisite), and retries if the database fails.

1. Criteria and proof

Acceptance criterion Proof
After GoDAM Central's "MP3 ready" callback the attachment is audio/mpeg (2.4.0: audio/mp3) V2 step 2 vs V1 step 2; TranscodedAudioMimeTypeTest
The converted file is in the block editor's Inserter > Media > Audio, which asks REST for media_type=audio (2.4.0: missing) V2 step 3: 2 players (the 0:03 WAV and the 0:07 note); V1 step 3: only the WAV
A file converted by 2.4.0 (still audio/mp3) becomes audio/mpeg on the first request after the update and shows in the list V2 steps 5 and 6: 3 players; V1: still audio/mp3, still missing; TranscodedMp3MimeTypeTest
A site that already updated to 2.4.1 (which ships without this PR) still gets the fix when it updates to 2.5.0 V4: the older file goes from audio/mp3 to audio/mpeg and appears in the list; V3 shows the same update skipping it while the fix was filed under 2.4.1; test_the_migration_runner_runs_it
Video conversions still save video/mp4 test_converted_video_is_still_saved_as_video_mp4
The migration runs once, does nothing on a site with no audio/mp3 files, and is retried (not marked done) when the SELECT or the UPDATE fails TranscodedMp3MimeTypeTest (6 tests)

2. Before and after

Two panes, recorded in Chrome on godam-dev.local with the same steps on 2.4.0 and on this branch. Left (CAUSE): the recording's details in the Media Library. Right (EFFECT): the block editor's Inserter > Media > Audio list, which asks the REST API for media_type=audio. GoDAM Central's "MP3 ready" callback is its real request, replayed on the local site with an MP3 served from the same machine. Each caption is checked before the next step. The videos are in the rtCamp Test GoDAM library (log in to watch).

V1, before (GoDAM 2.4.0): after the callback the 0:07 voice note reads audio/mp3 and is missing from the Audio list (only the existing 0:03 WAV). A 0:05 note converted earlier stays audio/mp3 after the update step.

V1 before: converted MP3 saved as audio/mp3 and missing from the Audio list

V2, after (this PR): the same steps. The voice note reads audio/mpeg and appears in the list; after the update step the older note is audio/mpeg too, and the list shows all three.

V2 after: saved as audio/mpeg and listed; the older file is fixed on update

Update from 2.4.1 to 2.5.0. 2.4.1 ships without this PR but still stores 2.4.1 as the site's update version, and the runner only runs batches above that. Both videos start on godam-dev with the stored version at 2.4.1 and an older voice note saved as audio/mp3, then run the update step with the version set to 2.5.0 (one WP-CLI request).

V3, fix filed under 2.4.1 (4db9e5e): the stored version moves to 2.5.0, but the file stays audio/mp3 and missing from the Audio list: the update skipped it.

V3: fix filed under 2.4.1 is skipped on an update from 2.4.1

V4, fix filed under 2.5.0 (4b6b0a5): the same steps. The file becomes audio/mpeg and appears in the Audio list.

V4: fix filed under 2.5.0 runs on an update from 2.4.1

What REST returns for a converted file on godam-dev.local (Central's callback replayed locally):

Request 2.4.0 This branch
/wp/v2/media?media_type=audio the converted file is left out (only the WAV) listed
/wp/v2/media?mime_type=audio/mp3 the filter is ignored: all 64 media items come back no audio/mp3 items left
/wp/v2/media?mime_type=audio/mpeg 0 items the converted files

3. Tests

  • Added: tests/php/TranscodedAudioMimeTypeTest.php (4 tests). It calls add_transcoded_files() with stubbed WordPress functions: converted .webm, Safari .mp4 and WAV audio is saved as audio/mpeg and _wp_attached_file points at the MP3; a converted video is still saved as video/mp4.
  • Added: tests/php/TranscodedMp3MimeTypeTest.php (6 tests). audio/mp3 attachments become audio/mpeg and only they change (not other audio, videos, or non-attachment rows), and their caches are cleared; a site with none runs no UPDATE; a failed SELECT or UPDATE is not marked done; it runs only once; the runner has it in the 2.5.0 batch and the batches stay in version order.
  • Changed: none.
  • Revert check: with audio/mp3 put back in the handler, 3 of 4 TranscodedAudioMimeTypeTest tests fail ('post_mime_type' => 'audio/mp3' instead of 'audio/mpeg'). Removing the runner entry fails test_the_migration_runner_runs_it; writing another type fails test_audio_mp3_attachments_become_audio_mpeg.
  • Full PHP suite: 434 tests OK. PHPCS clean; hook-integrity checks (coverage and balance) pass.

4. Risk flags

2 spots in 2 files, raised by a script, not by judgement.

Database migrations (2)

  • inc/classes/migrations/class-runner.php, inc/classes/migrations/class-transcoded-mp3-mime-type.php: a new 2.5.0 batch that changes post_mime_type from audio/mp3 to audio/mpeg on attachments. It cannot be undone by the plugin, but it only moves files to the type WordPress already uses for MP3. It does not run on develop today (RTGODAM_VERSION is 2.4.0); it runs when 2.5.0 or later reaches a site, whether that site comes from 2.4.0 or from 2.4.1.

5. Independent review

A separate review pass saw only the problem and the diff, ran the PHP suite, PHPCS and both hook checks, and mutated the code to see which tests fail.

Finding Grade What I did
The hook-integrity check (coverage.php) flags the migration's two direct queries, so CI would go red Valid Fixed in 4db9e5e: each query carries a godam-coverage-ignore note (the runner already runs it once per site); the check passes
The handler change had no test: reverting it left every test green Valid Added TranscodedAudioMimeTypeTest in 4db9e5e. Writing it showed add_transcoded_files() started $transcoded_files as false and then used it as an array, which PHP 8.1+ reports as deprecated on every conversion; it now starts as array()
A failed SELECT returns an empty list, so the migration was marked done without running Valid, low Fixed in 4db9e5e: it checks $wpdb->last_error and returns false; test_a_failed_select_is_retried
The runner test asserted 2.4.1 is the last batch, which breaks when a later batch is added Valid, nit It now checks that batches are in version order
The 2.4.1 key must be the version this ships in Valid Fixed in 4b6b0a5: this ships in 2.5.0, so the batch is keyed 2.5.0. 2.4.1 ships without it but stores 2.4.1 as the site's version, and the runner skips batches at or below that, so a 2.4.1 key would never run on sites that update through 2.4.1
clean_post_cache() per file on a site with thousands of converted MP3s, not batched Valid, low Not changed: converted audio is usually a few dozen files per site
The raw UPDATE skips edit_attachment hooks Overstated GoDAM's listeners there are for video; the audio block already writes type="audio/mpeg"
No other code writes or compares audio/mp3 Checked All type checks in PHP and JS use the audio/ prefix
GoDAM-tab virtual media take Central's type as sent; if Central ever sends audio/mp3 they would have the same problem Unverified Not changed; listed in section 6

6. Not verified

  • A real GoDAM Central conversion: the callback was replayed on godam-dev.local with Central's parameters and an MP3 served from the same machine; nothing was sent to Central.
  • A real plugin update: the update step was run through WP-CLI with the version constant set (2.4.1 for V2; 2.5.0 for V3 and V4, starting from a site whose stored version is 2.4.1).
  • Multisite: covered by reading the runner code (it switches to each site), not run.
  • What Central sends as the type for GoDAM-tab virtual media.
  • audio/webm and audio/mp4 (stored since 2.4.0 for audio-only uploads) are not registered WordPress types either, so a file is missing from media_type=audio while it is being converted, or if the conversion fails. Not changed here.

7. Scope

  • add_transcoded_files() starts $transcoded_files as array() instead of false (PHP 8.1+ deprecation, found by the new test).
  • The migration changes every audio/mp3 attachment, including any another plugin created; all of them are MP3 files, so audio/mpeg is right for all.

WordPress registers MP3 as audio/mpeg. Attachments saved as audio/mp3
were left out of REST media_type=audio, and REST ignored a
mime_type=audio/mp3 filter. New conversions are saved as audio/mpeg,
and a one-time migration (2.4.1 batch) fixes the ones saved before.
… SELECT

- TranscodedAudioMimeTypeTest calls add_transcoded_files() and checks
  that converted audio is saved as audio/mpeg (video stays video/mp4).
  With the old audio/mp3 it fails.
- add_transcoded_files() starts $transcoded_files as array(), not false;
  PHP 8.1+ reported every conversion as a deprecated false-to-array use.
- The migration's two direct queries carry godam-coverage-ignore: the
  runner already runs it once per site.
- A failed SELECT now returns false so the runner retries, instead of
  marking the site done with nothing changed.
- The runner test checks batch order instead of which batch is last.
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
13 0 13

⚠️ Warnings (13)

📁 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.
📁 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/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/10/20/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

2.4.1 ships without this change but still stores 2.4.1 as each site's
migration version, and the runner skips batches at or below the stored
version. Keyed 2.4.1, the migration would never run on sites that update
through 2.4.1; keyed 2.5.0 it runs for both 2.4.0 and 2.4.1 sites.
@KMchaudhary

Copy link
Copy Markdown
Collaborator

Code review

Verdict: LGTM — correct fix, idempotent migration, and genuinely thorough tests. I traced both halves:

  • Handler: the real fix is the wp_update_post literal at :961 (audio/mp3 → audio/mpeg), gated by strpos( $mime_type, 'audio' ). The false → array() change fixes a real PHP 8.1 Automatic conversion of false to array deprecation at the $transcoded_files[$key][] = append, and both usage sites behave identically (! empty() treats false and [] the same), so no behavioural change there. Good catch via the new test.
  • Migration: the retry-on-failure design is right — last_error after the SELECT and false === after the UPDATE both return false so the per-site OPTION_KEY is not set and the runner retries. It's also idempotent (a re-run finds no audio/mp3 rows) and safe on multisite (per-site option, switch_to_blog). Caches are cleared for the selected IDs.

Three low-severity notes, none blocking:

1. The migration normalizes all audio/mp3 attachments, not only GoDAM's — class-transcoded-mp3-mime-type.php

The UPDATE … WHERE post_mime_type = 'audio/mp3' has no GoDAM-specific predicate (e.g. a rtgodam_transcoded_url meta), so any audio/mp3 row from another plugin or a manual import is also rewritten. This is almost certainly correct — WordPress never assigns audio/mp3, and audio/mpeg is the right type for an MP3 — so it's corrective, not harmful. Just worth one line in the release notes that the step normalizes every audio/mp3 attachment, since the scope is a touch wider than "files GoDAM converted."

2. The :902 ternary edit is cosmetic, not the fix — class-rtgodam-transcoder-handler.php:902

$post_mime_type from that ternary is consumed only by the $timeout branch (if ( 'video/mp4' === $post_mime_type )); the stored type comes from wp_update_post at :961. Changing the audio branch from audio/mp3 to audio/mpeg has no functional effect. Fine to keep for consistency — flagging only so a future reader doesn't think this line is where the mime type is set.

3. @since n.e.x.t — class-transcoded-mp3-mime-type.php

Placeholder on the class and maybe_run(); resolve to 2.5.0 before tagging (your usual convention).

Minor

  • Tiny SELECT→UPDATE race: an audio/mp3 attachment created between the two queries gets its type changed but its cache not cleared (it isn't in $ids). For a one-time migration this is negligible.
  • Worth confirming the RTGODAM_VERSION bump to 2.5.0 ships with this release, since the 2.5.0 batch only runs once the constant reaches that version (you've noted it won't run on develop at 2.4.0).

Really nice test coverage — the in-memory $wpdb fake exercising the SELECT/UPDATE failure paths and the once-only guard is exactly right for this.

🤖 Automated review via Claude Code (/code-review, high effort).

@subodhr258

Copy link
Copy Markdown
Collaborator Author

@KMchaudhary on your comment:

Thanks Kuldip.

  1. Every audio/mp3 attachment: yes, intended, since WordPress never assigns audio/mp3 and audio/mpeg is right for any MP3. It's in the PR's scope section, and the 2.5.0 release notes will say it.
  2. The :902 ternary: agreed, consistency only. The stored type comes from wp_update_post at :961.
  3. @since n.e.x.t: resolved to 2.5.0 at release prep.

Minor: agreed the race is negligible. The batch is keyed 2.5.0 since 4b6b0a5 and the version bump ships with the release, so it runs on update from 2.4.0 and from 2.4.1 (V3 and V4 in the description).

@subodhr258
subodhr258 merged commit 577a8d1 into develop Oct 20, 2026
7 checks passed
@subodhr258
subodhr258 deleted the fix/transcoded-mp3-mime-type branch October 20, 2026 11:27
subodhr258 added a commit that referenced this pull request Oct 22, 2026
* Stop the admin menu jumping when a GoDAM page loads (#2207)

* Fix: stop the admin menu jumping when a GoDAM page loads

pages/style.css restores Tailwind's border reset for every element on the
page. It is injected by page-css.min.js after the page has painted, and
core's a { transition: border .05s } then animates each admin menu link's
border from 3px to 0: every item grows from 34px to 40px and the whole
menu jumps by about 186px, then snaps back. Keep the reset off
#adminmenumain and #wpadminbar.

* Fix: open the Media Editor with the admin menu already folded

The editor folds the menu from React after the page has painted, so the
menu showed at full width and then collapsed. Add the folded body class
on the server when the editor opens a file.

* Keep the reset off the menu and admin bar containers too; test the editor fold

- pages/style.css also excludes #adminmenumain and #wpadminbar themselves,
  not only their descendants.
- MediaEditorMenuFoldTest: the Media Editor with an id gets 'folded';
  its file picker, other GoDAM pages, the Media Library and no screen
  do not.

* Regenerate the POT: 12 references into class-pages.php moved down

Line numbers only; no strings added or changed. Built like CI: Node
22.14.0, npm ci, npm run build:prod, composer pot.

* feat(seo): fix VideoObject schema and add video sitemap (#2186)

* feat(seo): fix VideoObject schema and add video sitemap (#1622 v1)

Make GoDAM's video schema indexable by Google and add a video sitemap
that plugs into Yoast SEO, Rank Math, All in One SEO or the WordPress
core sitemap. No new public URLs are created.

- Schema contentUrl now uses the HLS (.m3u8) stream, falling back to the
  original file; the DASH .mpd is never output. Resolved at output time,
  so pages cached before this change are fixed without a re-save.
- Add embedUrl pointing at GoDAM's existing video-embed player page.
- Never output an empty description: fall back to a 160-char transcript
  excerpt (fetched on save only, cached in _godam_seo_transcript_excerpt),
  then the page excerpt, otherwise omit the property.
- Output isFamilyFriendly as a real JSON boolean (string values such as
  "false" are parsed correctly) and omit an empty uploadDate.
- Add Video_Sitemap: /godam-video-sitemap.xml with one <url> per
  published page and one <video:video> per video, built from the cached
  video SEO post meta via the shared schema builder so both always agree.
- Exclude drafts, private and password-protected posts, pages noindexed
  in Yoast / Rank Math / AIOSEO, and videos the editor excludes.
- List the sitemap in the Yoast, Rank Math and AIOSEO indexes, or via a
  core sitemap provider when none is active; paginate at 1000 URLs,
  cache per site with version-based invalidation.
- Add GoDAM > Settings > SEO with an "Enable video sitemap" toggle (off
  by default) and a per-video "Exclude from video sitemap" toggle in
  Gutenberg, Elementor and WPBakery.
- Warn editors in all three editors when a video title looks like a
  raw file name.
- Prefer the HLS URL when prefilling SEO contentUrl in the editors.
- Add new filters: godam_video_seo_content_url, godam_video_seo_embed_url,
  godam_video_seo_description, godam_video_sitemap_enabled,
  godam_video_sitemap_entries_per_page, godam_video_sitemap_post_types,
  godam_video_sitemap_exclude_post, godam_video_sitemap_entry.
- Add PHPUnit coverage (VideoSeoSchemaTest, VideoSitemapTest) and Jest
  tests for the filename-title check.

* Resolve feedback

* Resolve feedbacks and regenrate POT file

* Revert the POT file

* Resolve Privacy Issue

* feat(seo): add key moments to video schema from chapters (#1597) (#2194)

Output each GoDAM video chapter as a schema.org Clip in the VideoObject's
hasPart, so Google can show "key moments" (jump-to links) for the video
in search results.

- Add Seo::get_key_moment_clips(): reads the chapters from the
  attachment's rtgodam_meta at output time, so editing chapters updates
  the schema without re-saving the page.
- Each Clip has name, startOffset, endOffset and a deep link of the form
  <page>?t=<seconds>#godam-video-<attachment id>, which the GoDAM player
  already uses to seek on page load.
- A clip ends at the chapter's own endTime, else the next chapter's
  start, else the video duration (clamped to the duration when known).
- Skip chapters with no title, an unreadable start, a start at or past
  the end of the video, or zero length; drop duplicate start times;
  strip HTML from chapter names.
- Parse chapter times as plain seconds, mm:ss or hh:mm:ss(.ms), falling
  back to originalTime when startTime is missing.
- Build clip URLs without add_query_arg(): use & on plain permalinks and
  drop any existing fragment from the page URL.
- Only add hasPart when the video has an attachment and a host page
  (render-time output on archives/404 has nothing to deep-link to).
- Add filters godam_video_seo_key_moments_enabled and
  godam_video_seo_key_moments.
- Move ISO 8601 duration parsing to Seo::iso8601_to_seconds();
  Video_Sitemap::iso8601_duration_to_seconds() now delegates to it.
- Add VideoSeoKeyMomentsTest (27 tests) and a get_permalink() test stub.

* Match WPBakery SEO Settings to Gutenberg Model (#2209)

* ci: run the POT check only on PRs into main (#2188)

* ci: run the POT check only on the develop → main merge

Feature PRs into develop no longer have to regenerate languages/godam.pot.
The release PR from develop into main still fails if the committed POT is
stale. PRs into main from any other branch skip the job.

* ci: run the POT check on every PR into main

Patch releases reach main from fix and hotfix branches, not only from
develop, so they need the check too. The branches: [main] trigger
already keeps it off feature PRs into develop.

* Pass only a numeric form ID to the form layer preview (#2223)

Cast the layer id to an integer in the preview template and in the Ninja Forms
and MetForm callbacks, and add unit tests for it.

* Keep the Gravity Forms recorder working after an AJAX page change (#2217)

* Keep the Gravity Forms recorder working after an AJAX page change

Gravity Forms replaces a page's markup on every AJAX page change or failed
submit. The recorder kept pointing at the replaced container, file input and
button, and Uppy had bound its dashboard trigger once to the old button, so
Start Recording opened nothing on the new page.

On every gform_post_render, an uploader whose markup left the page now finds
the new container by its id, reads the input and button from it, binds the
new button once and shows the recording it holds again.

* Regenerate the translation template for the recorder's moved lines

* Stop sending the signed-in viewer's email with video analytics (#2213)

* Stop sending the signed-in viewer's email with video analytics

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.

* Remove the viewer's email from the analytics data listed in the readme

The analytics.godam.io entry under External services no longer lists Email as data sent.

* Keep the signed-in viewer's email out of the player's page data

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.

* Keep the fixture lines untouched in the JS test

The explanation moves into the test, so the fixture lines this branch leaves alone cannot conflict with the sibling change.

* List the page's user fields instead of removing one

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.

* Regenerate the POT for the new line numbers

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.

* Clean up video share popup: remove GoDAM Central/Embed links, use Page link, show share button for all videos (#2211)

* Clean up video share popup links and share button gating

- Remove the redundant GoDAM Central and Embed copy fields from the share
  modal footer, keeping only the Page Link field.
- Point the social share links at the WordPress page link instead of the
  GoDAM Central URL, which is private by default and shows a login prompt.
- Show the share button for all videos when sharing is enabled in the
  block settings, instead of only transcoded videos.

Closes #2210

* Address review: keep share anchor and gate button on an ID

- Encode the share link with encodeURIComponent so the #godam-video-{id}
  anchor and any query param travel with the social share URL instead of
  splitting off (encodeURI left #, ? and & intact).
- Hide the share button for players with neither a WordPress attachment ID
  nor a transcoding job ID ("Insert from URL" embeds), since their share
  link could not target the video.
- Remove stale README references to the removed GoDAM Central/Embed links
  and correct the ID described for share links.

---------

Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>

* Save converted MP3 audio as audio/mpeg, and fix files already saved as audio/mp3 (#2208)

* Fix: store transcoded MP3 audio as audio/mpeg, not audio/mp3

WordPress registers MP3 as audio/mpeg. Attachments saved as audio/mp3
were left out of REST media_type=audio, and REST ignored a
mime_type=audio/mp3 filter. New conversions are saved as audio/mpeg,
and a one-time migration (2.4.1 batch) fixes the ones saved before.

* Test the saved type, satisfy the hook-integrity check, retry a failed SELECT

- TranscodedAudioMimeTypeTest calls add_transcoded_files() and checks
  that converted audio is saved as audio/mpeg (video stays video/mp4).
  With the old audio/mp3 it fails.
- add_transcoded_files() starts $transcoded_files as array(), not false;
  PHP 8.1+ reported every conversion as a deprecated false-to-array use.
- The migration's two direct queries carry godam-coverage-ignore: the
  runner already runs it once per site.
- A failed SELECT now returns false so the runner retries, instead of
  marking the site done with nothing changed.
- The runner test checks batch order instead of which batch is last.

* Run the MP3 type migration in the 2.5.0 batch

2.4.1 ships without this change but still stores 2.4.1 as each site's
migration version, and the runner skips batches at or below the stored
version. Keyed 2.4.1, the migration would never run on sites that update
through 2.4.1; keyed 2.5.0 it runs for both 2.4.0 and 2.4.1 sites.

* Release prep v2.5.0: version bump, changelog and POT refresh (#2231)

- Version 2.5.0 in godam.php, readme.txt, README.md, package.json and package-lock.json.
- v2.5.0 changelog in readme.txt and CHANGELOG.md; v2.3.2 removed from readme.txt to keep the last three.
- Every @SInCE n.e.x.t replaced with 2.5.0 (51 tags in 6 files).
- languages/godam.pot regenerated from a production build.

* Fix the two new Plugin Check warnings in the Video SEO sitemap code (#2232)

- class-video-sitemap.php: the phpcs:ignore named slow_query_meta_key, which is not a sniff, so it ignored nothing. Use slow_db_query_meta_key.
- class-video-sitemap-core-provider.php: ignore NonPrefixedHooknameFound on WordPress core's own wp_sitemaps_index_entry filter.

* Keep page-builder shortcode text out of the video sitemap description (#2235)

* Keep page-builder shortcode text out of the video sitemap description

The sitemap is served at parse_request priority 1, before WPBakery and Divi
register their shortcodes, so core's strip_shortcodes() left tags such as
[vc_row] in the fallback description taken from the page text. Add the tag
names found in the text to strip_shortcodes()'s own list so unregistered
shortcodes are removed the same way registered ones are, which gives the same
description in the sitemap and on the front end.

The strip_shortcodes() test stub removed every [tag], which hid the bug. It now
follows core: only registered shortcodes are removed.

* Only strip builder-style unregistered shortcode names from the fallback description

Review of the first version found that it also removed ordinary bracketed text
([sic], [1], [b]bold[/b]) from the front-end description, that one very long
bracketed word made core's pattern too large and the description empty, that a
tag another filter had taken off the strip list was re-added, and that the
filter stayed registered if stripping threw.

Only names that look like a builder tag are added now (a letter first, an
underscore or hyphen in the name, 64 characters at most), tags that are
registered are left to core, and the filter is removed in a finally block.
New tests pin the cap, the length limit, the filter removal and the ordinary
bracketed text.

* Set the 2.5.0 changelog date to October 22, 2026 (#2236)

2.5.0 releases on 22 Oct (release ticket rtCamp/godam-plugin-wp#60), but readme.txt and CHANGELOG.md dated it October 21.

---------

Co-authored-by: Kuldip Chaudhary <64731232+KMchaudhary@users.noreply.github.com>
Co-authored-by: Rudrakshi Gupta <109859631+rudrakshi-gupta@users.noreply.github.com>
Co-authored-by: Vishal Kumar <vishnshiv3@gmail.com>
Co-authored-by: KMchaudhary <kuldipkumar.chaudhary@rtcamp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants