Skip to content

Conversation

@AhmarZaidi
Copy link
Contributor

@AhmarZaidi AhmarZaidi commented Jan 2, 2026

Issue: #1274

Implements audio recording support for WPForms GoDAM Recorder field.

  • Import Uppy audio CSS and add audio player styling
  • Move inline styles from templates to SCSS
  • Detect audio files and set correct transcoding job type
  • Add audio file selector option in field settings
  • Update button text from "Record Video" to "Start Recording"
  • Handle .webm audio files using name-based detection

Note: Referenced #1194 for consistency.

Demo

Screen.Recording.2026-01-02.at.5.20.39.PM.mov

- Import Uppy audio CSS styles in WPForms stylesheet
- Add audio player styles matching Ninja Forms implementation
- Remove inline styles from entry view/edit templates
- Detect audio files and render audio player conditionally
- Set correct job_type for audio transcoding requests
@AhmarZaidi AhmarZaidi self-assigned this Jan 2, 2026
Copilot AI review requested due to automatic review settings January 2, 2026 11:57
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
17 0 17

⚠️ Warnings (17)

📁 composer.json (1 warning)
📍 Line 🔖 Check 💬 Message
0 missing_composer_json_file The "/vendor" directory using composer exists, but "composer.json" file is missing.
📁 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/media-library/class-media-folder-utils.php (1 warning)
📍 Line 🔖 Check 💬 Message
91 PluginCheck.Security.DirectDB.UnescapedDBParameter Unescaped parameter $where_clause used in $wpdb->get_var($wpdb->prepare(\n\t\t\t\t"\n\t\t\tSELECT COUNT(DISTINCT p.ID)\n\t\t\tFROM {$wpdb->posts} p\n\t\t\tINNER JOIN {$wpdb->term_relationships} tr ON p.ID = tr.object_id\n\t\t\tINNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id\n\t\t\tWHERE {$where_clause}\n\t\t",\n\t\t\t\t$query_params\n\t\t\t))\n$where_clause assigned unsafely at line 82:\n $where_clause .= ' AND p.post_mime_type LIKE %s'\n$query_params[] used without escaping.\n$mime_type used without escaping.
📁 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 (6 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/?p=1 (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/?page_id=2 (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/?attachment_id=6 (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/?godam-video=demo-godam-video-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 (6 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/?p=1 (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/?page_id=2 (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/?attachment_id=6 (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/?godam-video=demo-godam-video-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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds audio recording support to the WPForms GoDAM Recorder field, extending it beyond video-only functionality.

  • Implements audio file detection using MIME type checking and name-based fallback for .webm files
  • Updates UI elements to be more generic (button text changed from "Record Video" to "Start Recording")
  • Adds audio player rendering in entry view and edit pages with transcoding support
  • Sets correct transcoding job type (audio vs stream) based on detected file type

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
inc/classes/wpforms/wpforms-field-godam-record-frontend.php Updates button text to be more generic for both audio and video recording
inc/classes/wpforms/wpforms-field-godam-record-entry-view.php Adds audio file detection and renders HTML5 audio player for audio files
inc/classes/wpforms/wpforms-field-godam-record-entry-edit.php Adds audio file detection and renders HTML5 audio player in entry edit view
inc/classes/wpforms/class-wpforms-integration.php Detects file type and passes correct job_type parameter to transcoding function
inc/classes/wpforms/class-wpforms-field-godam-video.php Adds "Audio" option to file selection settings and accepts audio MIME types for upload
assets/src/css/wpforms-uppy-video.scss Imports Uppy audio CSS and adds styling for audio player elements in various contexts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AhmarZaidi AhmarZaidi requested a review from subodhr258 January 5, 2026 06:34
Copy link
Member

@mi5t4n mi5t4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest looks good, just a couple of issues and we are good to go.

  1. The audio link is not working in the GoDAM Record column in the entries page.
Image
  1. Misleading text Video is being transcoded where it's supposed to be Audio is being transcoded if it's being transcoded at all.
Image

$mime_type = ! empty( $file_type['type'] ) ? $file_type['type'] : '';
$is_audio = ! empty( $mime_type ) && strpos( $mime_type, 'audio' ) !== false;

if ( 'webm' === $file_type['ext'] && godam_is_audio_file_by_name( $godam_value ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason we are explicitly checking for the webm extension? Can't there be other audio formats?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filetype of screencapture, video or audio is mainly decided by browsers. REF REF

From the uppy docs:

If no preferred video mime type is given, the ScreenCapture plugin [audio & video] will prefer types listed in the allowedFileTypes restriction, if any.

We have not specified any mime type for audio/video instead we have added a allowedFileTypes list here, so the browser defaults are being taken.

For example in my testing:

  • Chromium browsers (Edge, Chrome) save both video and audio in .webm format
  • Firefox saves audio in .ogg and video in .webm

So we had added an additional check that if the extension is .webm then we can fallback on 'audio' string in the filename.

However on further testing I found that Safari saves both audio and video in .mp4 so I've updated the godam_is_audio_file to take care of both cases .webm and .mp4

- Add godam_is_audio_file fucntion
- Add check for mp4 audio files
- Add godam variable prexif
- Update godam_is_audio_file for early return
- Update ambiguous_extensions to container_formats
- Fix URL truncation issue
- Update entry view message for audio files
@AhmarZaidi
Copy link
Contributor Author

@mi5t4n

Added the fixes for #1446 (review)

The audio link is not working in the GoDAM Record column in the entries page.

I noticed that the video links were not working either. Implemented the fix for both.

Misleading text Video is being transcoded where it's supposed to be Audio is being transcoded if it's being transcoded at all.

Since, audio files are not being transcoded, I've updated the message accordingly for audio files:

image

@AhmarZaidi AhmarZaidi requested a review from mi5t4n January 8, 2026 08:00
@subodhr258 subodhr258 removed their request for review January 27, 2026 08:07
@KMchaudhary KMchaudhary requested a review from mi5t4n February 2, 2026 15:34
Copy link
Member

@mi5t4n mi5t4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KMchaudhary KMchaudhary merged commit d289dae into develop Feb 2, 2026
4 checks passed
@KMchaudhary KMchaudhary deleted the feat/1274-wp-forms-audio-recording branch February 2, 2026 15:44
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.

4 participants