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
31 changes: 0 additions & 31 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

19 changes: 0 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
# Changelog #

## v1.5.0 (January 20, 2026) ##

- Feat: Implemented GoDAM virtual attachment support for Image, Audio, and PDF media. This allows users to import a wide range of media directly from GoDAM Central.
- Feat: Added support for the video quality menu on the Desktop Safari browser.
- Tweak: Made the Dashboard and Analytics pages mobile-responsive.
- Tweak: Improved the video player mobile view for different player skins, including Default, Classic, Minimal, Pills, and Bubble.
- Tweak: Improved layer styles for mobile device sizes.
- Tweak: Improved keyboard forward and backward shortcuts for the video player.
- Fix: Resolved interactive form and poll layer submission issues in the GoDAM Gallery block.
- Fix: Constrained hotspot layer points within the video canvas to ensure consistency across devices.
- Fix: Skipped poll label updates on poll submission to improve user experience.
- Fix: Displayed media item metadata (such as transcoded and embed URLs) in the GoDAM tab.
- Fix: Improved real-time aspect ratio updates for the GoDAM Block.
- Fix: Resolved an issue where input was not possible when a form was used in fullscreen mode on Safari with GoDAM Video.
- Fix: Made the video preview page work correctly for all layers.
- Fix: Fixed overlap issues between the GoDAM Video block UI and the engagement modal on mobile screens.
- Fix: Resolved GoDAM block rendering issues when used as a child block of Row, Columns, or Grid blocks.


## v1.4.9 (December 19, 2025) ##

- Feat: Added Free Plan for GoDAM
Expand Down
2 changes: 1 addition & 1 deletion admin/class-rtgodam-retranscodemedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function load_rest_endpoints() {
* Add the Retranscode Media meta box to the EasyDam Tools page.
*/
public function render_tools_page() {
$this->add_easydam_meta_boxes();
$this->add_easydam_meta_boxes()
?>
<div>
<h1><?php esc_html_e( 'GoDAM Tools', 'godam' ); ?></h1>
Expand Down
151 changes: 9 additions & 142 deletions admin/class-rtgodam-transcoder-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ public function __construct() {
add_action( 'admin_notices', array( $this, 'dashboard_offer_banner' ) );
add_action( 'admin_notices', array( $this, 'free_plan_admin_notice' ) );
add_action( 'admin_notices', array( $this, 'usage_limit_notices' ) );
add_action( 'admin_notices', array( $this, 'posthog_tracking_notice' ) );
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' ) );
}
}
Expand Down Expand Up @@ -391,41 +388,6 @@ public function is_dashboard_screen() {
return isset( $current_screen->id ) && 'dashboard' === $current_screen->id;
}

/**
* Handle the cache clearing request for GoDAM usage data.
* This runs on admin_init to ensure headers haven't been sent yet.
*
* @since 1.5.0
*/
public function handle_clear_godam_cache() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce is verified below.
if ( ! isset( $_GET['clear_godam_cache'] ) ) {
return;
}

// Verify user capabilities.
if ( ! current_user_can( 'manage_options' ) ) {
return;
}

// Verify nonce.
if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'clear_godam_cache' ) ) {
return;
}

// Clear the cache.
delete_option( 'rtgodam_user_data' );

// Build redirect URL safely.
$current_url = remove_query_arg( array( 'clear_godam_cache', '_wpnonce' ) );

// Perform the redirect with error handling.
if ( ! headers_sent() ) {
wp_safe_redirect( $current_url );
exit;
}
}

/**
* Display usage limit notices when bandwidth/storage usage is high.
*/
Expand All @@ -446,6 +408,15 @@ public function usage_limit_notices() {
return;
}

// Handle cache clearing request.
if ( isset( $_GET['clear_godam_cache'] ) && current_user_can( 'manage_options' ) && isset( $_GET['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'clear_godam_cache' ) ) {
delete_option( 'rtgodam_user_data' );
// Redirect back to the same page without the query parameter.
$current_url = remove_query_arg( array( 'clear_godam_cache', '_wpnonce' ) );
wp_safe_redirect( $current_url );
exit;
}

// Get user data with usage information.
$user_data = rtgodam_get_user_data( true );

Expand Down Expand Up @@ -652,108 +623,4 @@ private function display_bandwidth_exceeded_notice( $bandwidth_percentage ) {
</div>
<?php
}

/**
* Display PostHog tracking notice.
*
* @since 1.5.0
*/
public function posthog_tracking_notice() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}

$settings = get_option( 'rtgodam-settings', array() );
$api_key = get_option( 'rtgodam-api-key', '' );

// If API key is present, we don't show the notice (it's auto-enabled or already handled).
if ( ! empty( $api_key ) ) {
return;
}

// If posthog_initialized is true, it means the user has already made a choice or it was auto-enabled.
if ( ! empty( $settings['general']['posthog_initialized'] ) ) {
return;
}

$optin_url = wp_nonce_url( add_query_arg( 'godam_tracker_optin', 'true' ), 'godam_tracker_action' );
$optout_url = wp_nonce_url( add_query_arg( 'godam_tracker_optout', 'true' ), 'godam_tracker_action' );

$notice = sprintf(
__( 'Want to help make <strong>GoDAM</strong> even more awesome? Allow GoDAM to collect anonymous diagnostic data and usage information.', 'godam' )
);

$policy_url = 'https://posthog.com/privacy';

echo '<div class="updated"><p>';
echo wp_kses_post( $notice );
echo ' (<a class="godam-insights-data-we-collect" href="#">' . esc_html__( 'what we collect', 'godam' ) . '</a>)';
echo '<div class="description" style="display:none; margin-top: 10px; padding: 10px; background: #f9f9f9; border: 1px solid #e5e5e5; border-radius: 4px;">';
echo '<p style="margin-top: 0;"><strong>' . esc_html__( 'Data we collect:', 'godam' ) . '</strong></p>';
echo '<ul style="list-style: disc; margin-left: 20px;">';
echo '<li>' . esc_html__( 'Server environment details (PHP, MySQL, Server, and WordPress versions)', 'godam' ) . '</li>';
echo '<li>' . esc_html__( 'Site and user count (Language and number of users)', 'godam' ) . '</li>';
echo '<li>' . esc_html__( 'Plugin details (Number of active and inactive plugins)', 'godam' ) . '</li>';
echo '<li>' . esc_html__( 'Usage data (Interactions, navigation, session replays, heatmaps, and errors via PostHog)', 'godam' ) . '</li>';
echo '</ul>';
echo '<p style="margin-bottom: 0;">';
printf(
wp_kses(
/* translators: %s: PostHog privacy policy URL */
__( 'We are using PostHog to collect anonymous data. <a href="%s" target="_blank">Learn more</a>. This can be disabled from the settings on the Help page.', 'godam' ),
array(
'a' => array(
'href' => array(),
'target' => array(),
),
)
),
esc_url( $policy_url )
);
echo '</p></div>';
echo '</p><p class="submit">';
echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-primary button-large">' . esc_html__( 'Allow', 'godam' ) . '</a>';
echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary button-large">' . esc_html__( 'No thanks', 'godam' ) . '</a>';
echo '</p></div>';
}

/**
* Handle PostHog tracking action.
*
* @since 1.4.9
*/
public function handle_posthog_tracking_action() {
if ( ! isset( $_GET['godam_tracker_optin'] ) && ! isset( $_GET['godam_tracker_optout'] ) ) {
return;
}

$nonce = isset( $_GET['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) : '';

if ( ! wp_verify_nonce( $nonce, 'godam_tracker_action' ) ) {
return;
}

if ( ! current_user_can( 'manage_options' ) ) {
return;
}

$settings = get_option( 'rtgodam-settings', array() );

if ( ! isset( $settings['general'] ) ) {
$settings['general'] = array();
}

if ( isset( $_GET['godam_tracker_optin'] ) && 'true' === $_GET['godam_tracker_optin'] ) {
$settings['general']['enable_posthog_tracking'] = true;
$settings['general']['posthog_initialized'] = true;
} elseif ( isset( $_GET['godam_tracker_optout'] ) && 'true' === $_GET['godam_tracker_optout'] ) {
$settings['general']['enable_posthog_tracking'] = false;
$settings['general']['posthog_initialized'] = true;
}

update_option( 'rtgodam-settings', $settings );

wp_safe_redirect( esc_url_raw( remove_query_arg( array( 'godam_tracker_optin', 'godam_tracker_optout', '_wpnonce' ) ) ) );
exit;
}
}
41 changes: 6 additions & 35 deletions admin/class-rtgodam-transcoder-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,34 +202,6 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat
return;
}

/**
* Filter to allow external developers to disable automatic transcoding on upload.
* This allows users to have manual control over when videos get transcoded.
*
* Note: This filter only applies to automatic uploads. Manual retranscoding requests
* (via bulk actions, tools page, etc.) will always proceed regardless of this setting.
* Form integrations will also use this filter to disable transcoding for form uploads.
*
* Example usage:
* add_filter( 'godam_auto_transcode_on_upload', '__return_false' ); // Disable globally
*
* @since 1.5.0
*
* @param bool $auto_transcode_on_upload Whether to automatically transcode on upload. Default true.
*/
if ( ! $retranscode ) {
$auto_transcode_on_upload = apply_filters( 'godam_auto_transcode_on_upload', true );

if ( ! $auto_transcode_on_upload ) {
return $wp_metadata;
}
}

// Skip transcoding and re-transcoding for images.
if ( preg_match( '/image/i', $wp_metadata['mime_type'], $type_array ) ) {
return $wp_metadata;
}

if ( empty( $wp_metadata['mime_type'] ) ) {
return $wp_metadata;
}
Expand Down Expand Up @@ -283,6 +255,7 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat
$type = strtolower( $type_arry[ count( $type_arry ) - 1 ] );
$extension = pathinfo( $path, PATHINFO_EXTENSION );
$not_allowed_type = array();
preg_match( '/video|audio/i', $metadata['mime_type'], $type_array );

if ( (
preg_match( '/video|audio/i', $metadata['mime_type'], $type_array ) ||
Expand Down Expand Up @@ -348,16 +321,14 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat
// Get author name with fallback to username.
$author_first_name = '';
$author_last_name = '';
$author_email = '';

if ( $attachment_author ) {
$author_first_name = $attachment_author->first_name ?? '';
$author_last_name = $attachment_author->last_name ?? '';
$author_email = $attachment_author->user_email ?? '';
$author_first_name = $attachment_author->first_name;
$author_last_name = $attachment_author->last_name;

// If first and last names are empty, use username as fallback.
if ( empty( $author_first_name ) && empty( $author_last_name ) ) {
$author_first_name = $attachment_author->user_login ?? '';
$author_first_name = $attachment_author->user_login;
}
}

Expand All @@ -381,7 +352,7 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat
'watermark' => boolval( $rtgodam_watermark ),
'resolutions' => array( 'auto' ),
'video_quality' => $rtgodam_video_compress_quality,
'wp_author_email' => apply_filters( 'godam_author_email_to_send', $author_email, $attachment_id ),
'wp_author_email' => apply_filters( 'godam_author_email_to_send', $attachment_author ? $attachment_author->user_email : '', $attachment_id ),
'wp_site' => $site_url,
'wp_author_first_name' => apply_filters( 'godam_author_first_name_to_send', $author_first_name, $attachment_id ),
'wp_author_last_name' => apply_filters( 'godam_author_last_name_to_send', $author_last_name, $attachment_id ),
Expand Down Expand Up @@ -794,7 +765,7 @@ public function get_post_id_by_meta_key_and_value( $key, $value ) {
$meta = wp_cache_get( $cache_key, 'godam' );
if ( empty( $meta ) ) {
$meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_value = %s", $key, $value ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
wp_cache_set( $cache_key, $meta, 'godam', HOUR_IN_SECONDS );
wp_cache_set( $cache_key, $meta, 'godam', 3600 );
}

if ( is_array( $meta ) && ! empty( $meta ) && isset( $meta[0] ) ) {
Expand Down
5 changes: 0 additions & 5 deletions admin/class-rtgodam-transcoder-rest-routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,6 @@ public function handle_callback( WP_REST_Request $request ) {
// Setting the transcoded PDF URL.
update_post_meta( $attachment_id, 'rtgodam_transcoded_url', esc_url_raw( $post_array['download_url'] ) );
}

if ( 'image' === $job_type && isset( $post_array['download_url'] ) && ! empty( $post_array['download_url'] ) ) {
// Setting the transcoded Image URL.
update_post_meta( $attachment_id, 'rtgodam_transcoded_url', esc_url_raw( $post_array['download_url'] ) );
}
} else {
$flag = __( 'Something went wrong. The required attachment id does not exists. It must have been deleted.', 'godam' );
}
Expand Down
9 changes: 5 additions & 4 deletions admin/godam-transcoder-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function rtgodam_add_transcoded_url_field( $form_fields, $post ) {
$is_allowed = (
str_starts_with( $mime_type, 'video/' ) ||
str_starts_with( $mime_type, 'audio/' ) ||
str_starts_with( $mime_type, 'image/' ) ||
'application/pdf' === $mime_type
);

Expand All @@ -45,13 +44,15 @@ function rtgodam_add_transcoded_url_field( $form_fields, $post ) {

$easydam_settings = get_option( 'rtgodam-settings', array() );

$adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );

// Determine if the site has a valid API key (i.e., Premium user).
$api_key = get_option( 'rtgodam-api-key', '' );

if ( ! empty( $api_key ) ) {

// If $job_id is present then show the oEmbed URL field for video files.
if ( ! empty( $job_id ) && 0 === strpos( $mime_type, 'video/' ) ) {
// If $job_id is present then show the oEmbed URL.
if ( ! empty( $job_id ) ) {
$oembed_url = RTGODAM_API_BASE . '/web/video/' . $job_id;

$form_fields['oembed_url'] = array(
Expand All @@ -69,7 +70,7 @@ function rtgodam_add_transcoded_url_field( $form_fields, $post ) {
}

$transcoded_url_label = __( 'Transcoded CDN URL', 'godam' );
if ( 0 === strpos( $mime_type, 'video/' ) ) {
if ( strpos( $mime_type, 'video/' ) === 0 ) {
$transcoded_url_label = __( 'Transcoded CDN URL (MPD)', 'godam' );
}

Expand Down
Loading
Loading