Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog #

## v1.8.0 (April 29, 2026) ##

- Feat: Enhanced GoDAM Gallery block with improved layouts and controls.
- Feat: Introduced Performance Mode settings for video and gallery blocks.
- Feat: Implemented blur-up thumbnail optimization in Video and Video Gallery blocks.
- Tweak: Replaced gallery item width range input with S/M/L size selector.
- Tweak: Performance improvements for GoDAM blocks.
- Fix: Improved GoDAM Video and Video Gallery Block UX.
- Fix: Added GoDAM Gallery migration support.
- Fix: Removed GoDAM CPT and added migration for existing data.
- Fix: Fixed alignment issues on GoDAM blocks.
- Fix: Addressed security vulnerabilities.

## v1.7.2 (March 20, 2026) ##

- Fix: Fixed video data collection in analytics.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Tested up to: 6.9

Requires PHP: 7.4

Stable tag: 2.0.0
Stable tag: 1.8.0

License: [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)

Expand Down
2 changes: 1 addition & 1 deletion admin/class-rtgodam-transcoder-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct() {
add_action( 'admin_init', array( $this, 'handle_posthog_tracking_action' ) );
add_action( 'admin_init', array( $this, 'handle_clear_godam_cache' ) );
add_action( 'wp_ajax_rtgodam_dismiss_free_plan_notice', array( $this, 'dismiss_free_plan_notice' ) );
add_action( 'wp_ajax_rtgodam_dismiss_woo_promo_notice', array( $this, 'dismiss_woo_promo_notice' ) );
add_action( 'wp_ajax_rtgodam_dismiss_woo_promo_notice', array( $this, 'dismiss_woo_promo_notice' ) );
}
}

Expand Down
4 changes: 4 additions & 0 deletions assets/src/blocks/godam-gallery-v2/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
"performanceMode": {
"type": "string",
"default": "balanced"
},
"engagements": {
"type": "boolean",
"default": true
}
},
"providesContext": {
Expand Down
13 changes: 13 additions & 0 deletions assets/src/blocks/godam-gallery-v2/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ export default function Edit( { attributes, setAttributes, clientId } ) {
showTitle,
layout,
performanceMode,
engagements,
} = attributes;
const engagementFeatureEnabled = window?.godamSettings?.engagementFeatureEnabled ?? false;
const showEngagementSetting = engagementFeatureEnabled && ( window?.godamSettings?.enableGlobalVideoEngagement ?? false );
const [ startDatePopoverOpen, setStartDatePopoverOpen ] = useState( false );
const [ endDatePopoverOpen, setEndDatePopoverOpen ] = useState( false );
const [ dateError, setDateError ] = useState( '' );
Expand Down Expand Up @@ -596,6 +599,16 @@ export default function Edit( { attributes, setAttributes, clientId } ) {
checked={ !! showTitle }
onChange={ ( value ) => setAttributes( { showTitle: value } ) }
/>
{
showEngagementSetting && (
<ToggleControl
label={ __( 'Enable Likes & Comments', 'godam' ) }
checked={ !! engagements }
onChange={ ( value ) => setAttributes( { engagements: value } ) }
help={ __( 'Engagement will only be visible for transcoded videos', 'godam' ) }
/>
)
}
<SelectControl
label={ __( 'Performance', 'godam' ) }
value={ performanceMode || 'balanced' }
Expand Down
1 change: 1 addition & 0 deletions assets/src/blocks/godam-gallery-v2/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function godam_gallery_v2_get_video_data( $attachment_id ) {
'data-layout' => $godam_layout,
'data-ratio' => $godam_view_ratio,
'data-embed-base-url' => home_url( '/' ),
'data-engagements' => rtgodam_is_engagement_feature_enabled() && ! empty( $attributes['engagements'] ) ? 'show' : '',
)
);

Expand Down
4 changes: 3 additions & 1 deletion assets/src/blocks/godam-gallery-v2/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const { __ } = require( '@wordpress/i18n' );
this.element = element;
this.mode = element.dataset.mode || 'handpicked';
this.embedBaseUrl = element.dataset.embedBaseUrl || '/';
this.engagements = element.dataset.engagements || '';
this.currentIndex = -1;
this.previouslyFocusedElement = null;
this.isLoading = false;
Expand Down Expand Up @@ -363,7 +364,8 @@ const { __ } = require( '@wordpress/i18n' );

this.currentIndex = index;
activeGallery = this;
this.modal.iframe.src = `${ this.embedBaseUrl }?godam_page=video-embed&id=${ encodeURIComponent( videoId ) }&godam_gallery=1`;
const engagementsParam = this.engagements === 'show' ? '&engagements=show' : '';
this.modal.iframe.src = `${ this.embedBaseUrl }?godam_page=video-embed&id=${ encodeURIComponent( videoId ) }&godam_gallery=1${ engagementsParam }`;
this.modal.overlay.classList.add( 'is-active' );
this.modal.modal.classList.add( 'is-active' );
this.modal.closeButton.classList.add( 'is-active' );
Expand Down
4 changes: 4 additions & 0 deletions assets/src/blocks/godam-player/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
"type": "boolean",
"default": false
},
"engagements": {
"type": "boolean",
"default": false
},
"playerHeight": {
"type": "string",
"default": ""
Expand Down
16 changes: 15 additions & 1 deletion assets/src/blocks/godam-player/edit-common-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ const resolveLegacyPerformanceMode = ( preload, preloadPoster ) => {
* @return {WPElement} The video settings component.
*/
const VideoSettings = ( { setAttributes, attributes, isInsideQueryLoop = false } ) => {
const { autoplay, controls, loop, muted, preload, preloadPoster, performanceMode, showShareButton } =
const { autoplay, controls, loop, muted, preload, preloadPoster, performanceMode, showShareButton, engagements } =
attributes;
const showShareButtonSetting = window?.godamSettings?.enableGlobalVideoShare ?? false;
const engagementFeatureEnabled = window?.godamSettings?.engagementFeatureEnabled ?? false;
const showEngagementSetting = engagementFeatureEnabled && ( window?.godamSettings?.enableGlobalVideoEngagement ?? false );

// Show a specific help for autoplay setting.
const getAutoplayHelp = useMemo( () => {
Expand Down Expand Up @@ -77,6 +79,7 @@ const VideoSettings = ( { setAttributes, attributes, isInsideQueryLoop = false }
muted: toggleAttribute( 'muted' ),
controls: toggleAttribute( 'controls' ),
showShareButton: toggleAttribute( 'showShareButton' ),
engagements: toggleAttribute( 'engagements' ),
};
}, [ setAttributes ] );

Expand Down Expand Up @@ -152,6 +155,17 @@ const VideoSettings = ( { setAttributes, attributes, isInsideQueryLoop = false }
help={ performanceHelpText[ selectedPerformanceMode ] }
/>
) }
{
showEngagementSetting && (
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Enable Likes & Comments', 'godam' ) }
onChange={ toggleFactory.engagements }
checked={ !! engagements }
help={ __( 'Engagement will only be visible for transcoded videos', 'godam' ) }
/>
)
}
</>
);
};
Expand Down
7 changes: 7 additions & 0 deletions assets/src/blocks/godam-player/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ function VideoEdit( {
}

const unit = heightMatch[ 2 ] || 'px';

// Skip width derivation for percentage units: % resolves against different
// axes for width vs. height, so the computed max-width would be meaningless.
if ( '%' === unit ) {
return null;
}

const arMatch = calculatedAspectRatio.match( /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/ );
if ( ! arMatch ) {
return null;
Expand Down
104 changes: 104 additions & 0 deletions assets/src/js/godam-video-embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,107 @@ document.addEventListener( 'godamAllPlayersReady', () => {
}
} );
} );

/**
* Render CommentBox component on video embed page by default.
*
* @since 1.5.0
Comment thread
KMchaudhary marked this conversation as resolved.
*/
document.addEventListener( 'DOMContentLoaded', function() {
const embedElement = document.querySelector( '.godam-video-embed' );

if ( embedElement?.getAttribute( 'data-show-engagements' ) !== 'true' ) {
return;
}

const urlParams = new URLSearchParams( window.location.search );

const videoId = urlParams.get( 'id' );

if ( ! videoId ) {
return;
}

const videoIdNum = parseInt( videoId, 10 );
if ( ! videoIdNum || isNaN( videoIdNum ) ) {
return;
}

// Create and show loading overlay
const loadingOverlay = document.createElement( 'div' );
loadingOverlay.className = 'godam-video-embed-loading';

// Create spinner element
const spinner = document.createElement( 'div' );
spinner.className = 'godam-video-embed-spinner';
loadingOverlay.appendChild( spinner );

document.body.appendChild( loadingOverlay );

// Function to hide loading overlay
const hideLoadingOverlay = () => {
if ( loadingOverlay && loadingOverlay.parentNode ) {
loadingOverlay.style.opacity = '0';
loadingOverlay.style.pointerEvents = 'none';
loadingOverlay.style.transition = 'opacity 0.3s ease-out';
setTimeout( () => {
loadingOverlay.remove();
}, 300 );
}
};

// Fallback: remove the overlay after 10 s in case the engagement store
// event never fires or renderCommentBox() exits early.
const overlayFallbackTimer = setTimeout( hideLoadingOverlay, 10000 );

// Listen for the engagement store to be initialized (once only).
document.addEventListener( 'godamEngagementStoreInitialized', renderCommentBox, { once: true } );

// Render the comment box.
function renderCommentBox() {
// Always clear the fallback timer — we are now handling the overlay ourselves.
clearTimeout( overlayFallbackTimer );

// Check WordPress dependencies
if ( typeof wp === 'undefined' || ! wp.data || ! wp.element?.createRoot ) {
hideLoadingOverlay();
return;
}

const storeName = 'godam-video-engagement';
const select = wp.data.select( storeName );
const dispatch = wp.data.dispatch( storeName );

if ( ! select || ! dispatch ) {
hideLoadingOverlay();
return;
}

// Find video element and get instance ID
const videoElement = document.querySelector( `.easydam-player.video-js[data-id="${ videoIdNum }"]` );
const videoInstanceId = videoElement?.getAttribute( 'data-instance-id' );

if ( ! videoInstanceId ) {
hideLoadingOverlay();
return;
}

// Get site URL
const siteUrl = window.location.origin;

// Determine if engagements should be shown
const skipEngagements = embedElement?.getAttribute( 'data-show-engagements' ) !== 'true';

// Dispatch action to initiate comment modal
dispatch.initiateCommentModal(
videoIdNum.toString(),
siteUrl,
`engagement-${ videoInstanceId }`,
skipEngagements,
true,
);

// Hide loading overlay after modal is initiated
hideLoadingOverlay();
}
} );
6 changes: 4 additions & 2 deletions godam.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: GoDAM
* Plugin URI: https://godam.io
* Description: Seamlessly manage and deliver your media assets directly from the cloud-based media management. Store assets efficiently, stream them via a CDN, and enhance your website's performance and user experience. Featuring adaptive bit rate streaming, adding interactive layers in videos, and taking full advantage of a digital asset management solution within WordPress.
* Version: 2.0.0
* Version: 1.8.0
* Requires at least: 6.5
* Requires PHP: 7.4
* Text Domain: godam
Expand Down Expand Up @@ -43,7 +43,7 @@
/**
* The version of the plugin
*/
define( 'RTGODAM_VERSION', '2.0.0' );
define( 'RTGODAM_VERSION', '1.8.0' );
}

if ( ! defined( 'RTGODAM_API_BASE' ) ) {
Expand Down Expand Up @@ -159,6 +159,7 @@ function rtgodam_plugin_delete() {

delete_option( 'rtgodam_plugin_version' );
delete_option( 'rtgodam_show_whats_new' );
delete_transient( 'rtgodam_show_whats_new' ); // Stored as a transient in ≤1.7.2.
delete_option( 'rtgodam_user_data' );
delete_option( 'rtgodam-api-key' );
delete_option( 'rtgodam-api-key-stored' );
Expand All @@ -173,6 +174,7 @@ function rtgodam_plugin_delete() {
// For single site, delete options directly.
delete_option( 'rtgodam_plugin_version' );
delete_option( 'rtgodam_show_whats_new' );
delete_transient( 'rtgodam_show_whats_new' ); // Stored as a transient in ≤1.7.2.
delete_option( 'rtgodam_user_data' );
delete_option( 'rtgodam-api-key' );
delete_option( 'rtgodam-api-key-stored' );
Expand Down
4 changes: 3 additions & 1 deletion inc/classes/class-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ private function enqueue_godam_settings() {
$brand_image = $godam_settings['video_player']['brand_image'] ?? '';
$brand_color = $godam_settings['video_player']['brand_color'] ?? '';
$enable_gtm_tracking = $godam_settings['general']['enable_gtm_tracking'] ?? false;
$engagement_feature_enabled = rtgodam_is_engagement_feature_enabled();
$enable_global_video_engagement = $godam_settings['video']['enable_global_video_engagement'] ?? true;
$enable_global_share = $godam_settings['video']['enable_global_video_share'] ?? true;

Expand All @@ -396,7 +397,8 @@ private function enqueue_godam_settings() {
'apiBase' => RTGODAM_API_BASE,
'enableGTMTracking' => $enable_gtm_tracking,
'videoPostSettings' => get_option( 'rtgodam_video_post_settings', array() ),
'enableGlobalVideoEngagement' => $enable_global_video_engagement,
'engagementFeatureEnabled' => $engagement_feature_enabled,
'enableGlobalVideoEngagement' => $engagement_feature_enabled ? $enable_global_video_engagement : false,
'enableGlobalVideoShare' => $enable_global_share,

);
Expand Down
3 changes: 3 additions & 0 deletions inc/classes/class-video-engagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public function add_engagement_to_video( $attributes, $instance_id, $easydam_met
* @return bool True if engagements are enabled, otherwise false.
*/
public function check_if_engagements_enabled( $attachment_id, $attributes ) {
if ( ! rtgodam_is_engagement_feature_enabled() ) {
return false;
}

if ( empty( $attachment_id ) || ! isset( $attributes['engagements'] ) ) {
return false;
Expand Down
Loading
Loading