Update: GoDAM blocks in wp bakery#2029
Conversation
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 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. |
📁 assets/build/blocks/godam-gallery-v2/render.php (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
15 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
23 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
📁 tests/bootstrap.php (7 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
28 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "wp_strip_all_tags". |
48 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "wp_prepare_attachment_for_js". |
63 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "get_post_meta". |
77 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "get_post_mime_type". |
88 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "wp_get_attachment_url". |
99 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "get_the_title". |
111 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "date_i18n". |
📁 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/07/22/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/07/22/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
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Syncs WPBakery (Visual Composer) elements/shortcodes with the redesigned GoDAM 2.0 Gutenberg blocks (Video Gallery, Audio, Video) and fixes GoDAM video player preview initialization inside the WPBakery inline editor.
Changes:
- Adds newly introduced block controls to WPBakery elements (Video Gallery interaction + list layout; Audio metadata/transcript/chapters; Video transcription/caption toggles).
- Updates shortcodes to map WPBakery snake_case attributes to the blocks’ camelCase attributes consumed by shared
render.phptemplates. - Makes player initialization resilient to inline-editor DOM injection via readyState fallback, deferred re-init passes, and a WPBakery-only
MutationObserver.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| inc/classes/wpbakery-elements/class-wpb-godam-video.php | Adds WPBakery params for new Video block toggles (transcription/captions). |
| inc/classes/wpbakery-elements/class-wpb-godam-video-gallery.php | Adds List layout + interaction + play-button params to match redesigned gallery block. |
| inc/classes/wpbakery-elements/class-wpb-godam-audio.php | Adds redesigned Audio params and replaces obsolete caption parameter with transcript/chapters toggles. |
| inc/classes/shortcodes/class-godam-video-gallery.php | Maps new gallery params into block attributes (autoplay, playOnHover, showPlayButton). |
| inc/classes/shortcodes/class-godam-player.php | Maps new video toggles into block attributes while preserving defaults for hand-written shortcodes. |
| inc/classes/shortcodes/class-godam-audio.php | Maps new audio attributes (title/transcript/chapters) into block-consumed camelCase keys. |
| assets/src/js/wpbakery/wpbakery-audio-selector-param.js | Targets the correct hidden src field and auto-fills audio title/description on selection. |
| assets/src/js/godam-player/frontend.js | Improves init/re-init behavior to support WPBakery inline editor preview rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review notesReviewed all 8 files against the shared templates ( Correctness
|
Sync WPBakery elements with the redesigned 2.0 blocks (Video Gallery, Audio, Video)
Issue - rtCamp/godam-plugin-wp#19
Summary
The GoDAM 2.0 redesign added new attributes and controls to the Video Gallery, Audio, and Video blocks, but the corresponding WPBakery (Visual Composer) elements were never updated, so those options were missing from the page builder. This PR brings all three WPBakery elements (and their shortcodes) up to parity with the redesigned Gutenberg blocks, and fixes the Video block preview not rendering inside the WPBakery inline editor.
Branch:
update/godam-blocks-wp-bakery→developBackground
Each GoDAM media block has a matching WPBakery element that renders through a shortcode (
base→ shortcode name), and each shortcode reuses the block's server template/render.php. When the blocks were redesigned, the new attributes were added to the blocks and their templates, but not surfaced in the WPBakery element params or mapped in the shortcodes — so WPBakery users couldn't configure them.One important constraint throughout: WordPress'
shortcode_parse_atts()lowercases every attribute name, so WPBakery params use lowercase/snake_case names that are then mapped to the blocks' camelCase attribute keys in each shortcode.Changes by block
Video Gallery (
godam/gallery-v2)autoplay/playOnHoverbooleans.showPlayButton.[godam_video_gallery]): acceptsinteractionandshow_play_button, splitsinteractionintoautoplay/playOnHover, and passesshowPlayButtonto the shared template (which already consumes all three; playOnHover/showPlayButton default totrue, matching the block).Files:
inc/classes/wpbakery-elements/class-wpb-godam-video-gallery.php,inc/classes/shortcodes/class-godam-video-gallery.php.Audio (
godam/audio)audio_title→audioTitle), Description (description), Thumbnail (thumbnail, empty falls back to the GoDAM-generated cover), Show Transcript (show_transcript→showTranscript, default on) and Show Chapters (show_chapters→showChapters, default on).render.phpno longer reads it.onSelectAudio), and targets thesrchidden field specifically via[name="src"]instead of any hidden field.[godam_audio]): maps the new snake_case atts to the block's camelCase keys the sharedrender.phpconsumes (transcript/chapters default totrue).Files:
inc/classes/wpbakery-elements/class-wpb-godam-audio.php,inc/classes/shortcodes/class-godam-audio.php,assets/src/js/wpbakery/wpbakery-audio-selector-param.js.Video (
godam/video)show_transcription→showTranscription) and Show Caption (show_caption→showCaption), both defaulting to Yes (matching the block toggles'truedefaults).[godam_video]): maps these to the block's camelCase attributes only when explicitly provided, so hand-written[godam_video]shortcodes keep the template's own defaults (transcription on; caption derived from the attachment's Display-captions setting). The template already honors an explicitshowCaption/showTranscription.Files:
inc/classes/wpbakery-elements/class-wpb-godam-video.php,inc/classes/shortcodes/class-godam-player.php.Fix: Video preview not rendering in the WPBakery inline editor
Problem: In the WPBakery inline editor the Video block showed only a play button on a zero-height area — the player was stuck in its pre-init state (
easydam-video-container.loading/vjs-hidden, 0×0).Root cause:
godam-player/frontend.jsinitialized players only onDOMContentLoaded. WPBakery renders the shortcode markup into its preview iframe after that event has already fired, soPlayerManagernever ran against the block and the player was never initialized. (Gutenberg avoids this by rendering its own React player in the editor; WPBakery uses the shortcode path.)Fix (in
assets/src/js/godam-player/frontend.js):readyStatefallback), not only onDOMContentLoaded.PlayerManager.initializeVideo()is idempotent — guarded bydata-godam-initialized— so a re-run only initializes players that were missed; on a normal front-end load where everything is already initialized this is a cheapquerySelectorno-op.#vc_inline-framewrapper /vc_editorbody class), attach aMutationObserverthat re-initializes on demand as elements are re-rendered during editing. No observer is attached on the published front end.Verified live in the inline editor: after a plain reload the player initializes on its own (0×0 → 645×363,
loadingcleared,data-godam-initialized="1"). Because the changes are additive and idempotent, published-page behavior is unchanged (init still runs once; the deferred passes find nothing pending).How to test
js_composer) is active. Runnpm run build:jsandnpm run build:blocks(build artifacts underassets/build/are gitignored).Notes for reviewers
assets/build/**) are gitignored — rebuild withnpm run build:js/npm run build:blocks.frontend.jschange is on the shared player bundle used by all render paths; it is additive and idempotent (single init on the front end; deferred passes are no-ops when nothing is pending).Demo Video
Screen.Recording.2026-07-20.at.7.mp4