Plugin Directory

Changeset 3301420


Ignore:
Timestamp:
05/27/2025 11:10:21 AM (8 months ago)
Author:
rtcamp
Message:

Update to version 1.0.8 from GitHub

Location:
godam
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • godam/tags/1.0.8/admin/godam-transcoder-actions.php

    r3294292 r3301420  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 /**
    14  * Add a field for the transcoded URL to the media attachment edit screen.
    15  *
    16  * @param array  $form_fields An array of attachment form fields.
    17  * @param object $post The attachment post object.
    18  * @return array The modified array of attachment form fields.
    19  */
    20 function rtgodam_add_transcoded_url_field( $form_fields, $post ) {
     13if ( ! function_exists( 'rtgodam_add_transcoded_url_field' ) ) {
    2114
    22     // Check if post is of type attachment.
    23     if ( 'attachment' !== $post->post_type ) {
     15    /**
     16     * Add a field for the transcoded URL to the media attachment edit screen.
     17     *
     18     * @param array  $form_fields An array of attachment form fields.
     19     * @param object $post The attachment post object.
     20     * @return array The modified array of attachment form fields.
     21     */
     22    function rtgodam_add_transcoded_url_field( $form_fields, $post ) {
     23   
     24        // Check if post is of type attachment.
     25        if ( 'attachment' !== $post->post_type ) {
     26            return $form_fields;
     27        }
     28   
     29        // Check if attachment is of type video.
     30        $mime_type = get_post_mime_type( $post->ID );
     31   
     32        if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) {
     33            return $form_fields;
     34        }
     35   
     36        $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true );
     37   
     38        $easydam_settings = get_option( 'rtgodam-settings', array() );
     39   
     40        $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
     41   
     42        // Add the transcoded URL field.
     43        $form_fields['transcoded_url'] = array(
     44            'label' => __( 'Transcoded CDN URL', 'godam' ),
     45            'input' => 'html',
     46            'html'  => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>',
     47            'value' => esc_url( $transcoded_url ),
     48            'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),
     49        );
     50   
    2451        return $form_fields;
    2552    }
    26 
    27     // Check if attachment is of type video.
    28     $mime_type = get_post_mime_type( $post->ID );
    29 
    30     if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) {
    31         return $form_fields;
    32     }
    33 
    34     $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true );
    35 
    36     $easydam_settings = get_option( 'rtgodam-settings', array() );
    37 
    38     $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
    39 
    40     // Add the transcoded URL field.
    41     $form_fields['transcoded_url'] = array(
    42         'label' => __( 'Transcoded CDN URL', 'godam' ),
    43         'input' => 'html',
    44         'html'  => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>',
    45         'value' => esc_url( $transcoded_url ),
    46         'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),
    47     );
    48 
    49     return $form_fields;
    5053}
    5154
    5255add_filter( 'attachment_fields_to_edit', 'rtgodam_add_transcoded_url_field', 10, 2 );
    5356
    54 /**
    55  * Save the transcoded URL field when the attachment is saved.
    56  *
    57  * @param array $post The post data for the attachment.
    58  * @param array $attachment The attachment data.
    59  * @return array The post data for the attachment.
    60  */
    61 function rtgodam_save_transcoded_url_field( $post, $attachment ) {
    62     // Check if adaptive bitrate streaming is enabled.
    63     $easydam_settings = get_option( 'rtgodam-settings', array() );
    6457
    65     $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
     58if ( ! function_exists( 'rtgodam_save_transcoded_url_field' ) ) {
    6659
    67     if ( ! $adaptive_bitrate_enabled ) {
     60    /**
     61     * Save the transcoded URL field when the attachment is saved.
     62     *
     63     * @param array $post The post data for the attachment.
     64     * @param array $attachment The attachment data.
     65     * @return array The post data for the attachment.
     66     */
     67    function rtgodam_save_transcoded_url_field( $post, $attachment ) {
     68        // Check if adaptive bitrate streaming is enabled.
     69        $easydam_settings = get_option( 'rtgodam-settings', array() );
     70   
     71        $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
     72   
     73        if ( ! $adaptive_bitrate_enabled ) {
     74            return $post;
     75        }
     76   
     77        if ( isset( $attachment['transcoded_url'] ) ) {
     78            // Check the user's permissions.
     79            if ( ! current_user_can( 'edit_post', $post['ID'] ) ) {
     80                return $post;
     81            }
     82            // Update the post meta with the new value.
     83            update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) );
     84        }
     85   
    6886        return $post;
    6987    }
    70 
    71     if ( isset( $attachment['transcoded_url'] ) ) {
    72         // Check the user's permissions.
    73         if ( ! current_user_can( 'edit_post', $post['ID'] ) ) {
    74             return $post;
    75         }
    76         // Update the post meta with the new value.
    77         update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) );
    78     }
    79 
    80     return $post;
    8188}
    8289
    8390add_filter( 'attachment_fields_to_save', 'rtgodam_save_transcoded_url_field', 10, 2 );
    8491
    85 /**
    86  * Register the transcoded URL meta field.
    87  */
    88 function rtgodam_register_transcoded_url_meta() {
    89     register_post_meta(
    90         'attachment',
    91         'rtgodam_transcoded_url',
    92         array(
    93             'type'          => 'string',
    94             'single'        => true,
    95             'show_in_rest'  => true,
    96             'auth_callback' => function () {
    97                 return current_user_can( 'edit_posts' );
    98             },
    99         )
    100     );
     92
     93if ( ! function_exists( 'rtgodam_register_transcoded_url_meta' ) ) {
     94
     95    /**
     96     * Register the transcoded URL meta field.
     97     */
     98    function rtgodam_register_transcoded_url_meta() {
     99        register_post_meta(
     100            'attachment',
     101            'rtgodam_transcoded_url',
     102            array(
     103                'type'          => 'string',
     104                'single'        => true,
     105                'show_in_rest'  => true,
     106                'auth_callback' => function () {
     107                    return current_user_can( 'edit_posts' );
     108                },
     109            )
     110        );
     111    }
    101112}
    102113
     
    105116
    106117
    107 if ( ! function_exists( 'rtt_set_video_thumbnail' ) ) {
     118if ( ! function_exists( 'rtgodam_rtt_set_video_thumbnail' ) ) {
    108119
    109120    /**
     
    114125     * @param number $id rtMedia activity ID.
    115126     */
    116     function rtt_set_video_thumbnail( $id ) {
     127    function rtgodam_rtt_set_video_thumbnail( $id ) {
    117128        $media_type    = rtmedia_type( $id );
    118129        $attachment_id = rtmedia_media_id( $id );      // Get the wp attachment ID.
     
    147158}
    148159
    149 add_action( 'rtmedia_after_update_media', 'rtt_set_video_thumbnail', 12 );
     160add_action( 'rtmedia_after_update_media', 'rtgodam_rtt_set_video_thumbnail', 12 );
    150161
    151 /**
    152  * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity
    153  *
    154  * @since 1.0.7
    155  * @param string $thumb_url     Video thumbnail URL.
    156  * @param int    $attachment_id Attachment ID of the media/video for which thumbnail has to be set.
    157  */
    158 function rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) {
    159     if ( class_exists( 'RTMediaModel' ) ) {
    160         $model = new RTMediaModel();
    161         $media = $model->get( array( 'media_id' => $attachment_id ) );
    162162
    163         if ( ! empty( $media ) && ! empty( $media[0] ) ) {
    164             $attachment_id = $media[0]->media_id;
    165             $media_type    = $media[0]->media_type;
    166             $cover_art     = $media[0]->cover_art;
     163if ( ! function_exists( 'rtgodam_rtt_update_wp_media_thumbnail' ) ) {
    167164
    168             if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) {
    169                 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) );
     165    /**
     166     * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity
     167     *
     168     * @since 1.0.7
     169     * @param string $thumb_url     Video thumbnail URL.
     170     * @param int    $attachment_id Attachment ID of the media/video for which thumbnail has to be set.
     171     */
     172    function rtgodam_rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) {
     173        if ( class_exists( 'RTMediaModel' ) ) {
     174            $model = new RTMediaModel();
     175            $media = $model->get( array( 'media_id' => $attachment_id ) );
     176   
     177            if ( ! empty( $media ) && ! empty( $media[0] ) ) {
     178                $attachment_id = $media[0]->media_id;
     179                $media_type    = $media[0]->media_type;
     180                $cover_art     = $media[0]->cover_art;
     181   
     182                if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) {
     183                    $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) );
     184                }
    170185            }
    171186        }
     
    173188}
    174189
    175 add_action( 'rtgodam_transcoded_thumb_added', 'rtt_update_wp_media_thumbnail', 10, 2 );
     190add_action( 'rtgodam_transcoded_thumb_added', 'rtgodam_rtt_update_wp_media_thumbnail', 10, 2 );
  • godam/tags/1.0.8/godam.php

    r3298881 r3301420  
    44 * Plugin URI: https://godam.io
    55 * Description: Seamlessly manage and optimize digital assets with GoDAM – featuring transcoding, adaptive streaming, interactive video layers, gravity forms integration, and ad integration.
    6  * Version: 1.0.7
     6 * Version: 1.0.8
    77 * Text Domain: godam
    88 * Author: rtCamp
     
    4242     * The version of the plugin
    4343     */
    44     define( 'RTGODAM_VERSION', '1.0.7' );
     44    define( 'RTGODAM_VERSION', '1.0.8' );
    4545}
    4646
  • godam/tags/1.0.8/inc/classes/class-assets.php

    r3298881 r3301420  
    5050            RTGODAM_URL . 'assets/build/js/main.min.js',
    5151            array(),
    52             filemtime( RTGODAM_PATH . '/assets/build/js/main.min.js' ),
     52            filemtime( RTGODAM_PATH . 'assets/build/js/main.min.js' ),
    5353            true
    5454        );
     
    5656        wp_register_style(
    5757            'rtgodam-style',
    58             RTGODAM_URL . '/assets/build/css/main.css',
    59             array(),
    60             filemtime( RTGODAM_PATH . '/assets/build/css/main.css' )
     58            RTGODAM_URL . 'assets/build/css/main.css',
     59            array(),
     60            filemtime( RTGODAM_PATH . 'assets/build/css/main.css' )
    6161        );
    6262
    6363        wp_enqueue_script(
    6464            'analytics-library',
    65             RTGODAM_URL . '/assets/src/libs/analytics.min.js',
    66             array(),
    67             filemtime( RTGODAM_PATH . '/assets/src/libs/analytics.min.js' ),
     65            RTGODAM_URL . 'assets/src/libs/analytics.min.js',
     66            array(),
     67            filemtime( RTGODAM_PATH . 'assets/src/libs/analytics.min.js' ),
    6868            true
    6969        );
     
    143143            RTGODAM_URL . 'assets/build/js/admin.min.js',
    144144            array(),
    145             filemtime( RTGODAM_PATH . '/assets/build/js/admin.min.js' ),
     145            filemtime( RTGODAM_PATH . 'assets/build/js/admin.min.js' ),
    146146            true
    147147        );
     
    169169        wp_register_style(
    170170            'rtgodam-style',
    171             RTGODAM_URL . '/assets/build/css/admin.css',
    172             array(),
    173             filemtime( RTGODAM_PATH . '/assets/build/css/admin.css' )
     171            RTGODAM_URL . 'assets/build/css/admin.css',
     172            array(),
     173            filemtime( RTGODAM_PATH . 'assets/build/css/admin.css' )
    174174        );
    175175
     
    183183            RTGODAM_URL . 'assets/build/js/media-library.min.js',
    184184            array(),
    185             filemtime( RTGODAM_PATH . '/assets/build/js/media-library.min.js' ),
     185            filemtime( RTGODAM_PATH . 'assets/build/js/media-library.min.js' ),
    186186            true
    187187        );
     
    189189        wp_register_style(
    190190            'easydam-media-library',
    191             RTGODAM_URL . '/assets/build/css/media-library.css',
    192             array(),
    193             filemtime( RTGODAM_PATH . '/assets/build/css/media-library.css' )
     191            RTGODAM_URL . 'assets/build/css/media-library.css',
     192            array(),
     193            filemtime( RTGODAM_PATH . 'assets/build/css/media-library.css' )
    194194        );
    195195
     
    240240         * Dependency library for date range picker.
    241241         */
    242         wp_enqueue_script( 'moment-js', RTGODAM_URL . '/assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/moment-js.min.js' ), true );
    243         wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . '/assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.min.js' ), true );
    244         wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . '/assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.css' ) );
     242        wp_enqueue_script( 'moment-js', RTGODAM_URL . 'assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/moment-js.min.js' ), true );
     243        wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . 'assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.min.js' ), true );
     244        wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . 'assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.css' ) );
    245245    }
    246246
  • godam/tags/1.0.8/languages/godam.pot

    r3298881 r3301420  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: GoDAM 1.0.7\n"
     5"Project-Id-Version: GoDAM 1.0.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/godam\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-05-22T13:33:19+00:00\n"
     12"POT-Creation-Date: 2025-05-27T09:29:04+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    307307msgstr ""
    308308
    309 #: admin/godam-transcoder-actions.php:42
     309#: admin/godam-transcoder-actions.php:44
    310310msgid "Transcoded CDN URL"
    311311msgstr ""
    312312
    313 #: admin/godam-transcoder-actions.php:46
     313#: admin/godam-transcoder-actions.php:48
    314314msgid "The URL of the transcoded file is generated automatically and cannot be edited."
    315315msgstr ""
     
    336336#: inc/classes/class-pages.php:116
    337337#: assets/build/blocks/godam-audio/index.js:1
    338 #: assets/build/blocks/godam-player/index.js:3
     338#: assets/build/blocks/godam-player/index.js:2
    339339#: assets/src/blocks/godam-audio/edit.js:136
    340340#: assets/src/blocks/godam-player/edit.js:321
     
    690690
    691691#: assets/build/blocks/godam-player/index.js:2
    692 msgid "URL of the video content can be MOV, MP4, MPD. Example: https://www.example.com/video.mp4"
    693 msgstr ""
    694 
    695 #: assets/build/blocks/godam-player/index.js:2
    696 msgid "Title of the video"
    697 msgstr ""
    698 
    699 #: assets/build/blocks/godam-player/index.js:2
    700 msgid "Description of the video"
    701 msgstr ""
    702 
    703 #: assets/build/blocks/godam-player/index.js:2
    704 msgid "URL of the video thumbnail. Example: https://www.example.com/thumbnail.jpg"
    705 msgstr ""
    706 
    707 #: assets/build/blocks/godam-player/index.js:2
    708 msgid "Is the video suitable for all audiences?"
    709 msgstr ""
    710 
    711 #: assets/build/blocks/godam-player/index.js:2
    712 #: pages/video-editor/components/layers/AdsLayer.js:59
    713 #: pages/video-editor/components/layers/CTALayer.js:153
    714 #: pages/video-editor/components/layers/FormLayer.js:97
    715 #: pages/video-editor/components/layers/HotspotLayer.js:160
    716 #: pages/video-editor/components/layers/PollLayer.js:55
    717 #: pages/video-editor/components/LayerSelector.jsx:130
    718 msgid "Cancel"
    719 msgstr ""
    720 
    721 #: assets/build/blocks/godam-player/index.js:2
    722 #: pages/video-editor/VideoEditor.js:191
    723 msgid "Save"
    724 msgstr ""
    725 
    726 #. translators: %s: Label of the video text track e.g: "French subtitles".
    727 #: assets/build/blocks/godam-player/index.js:3
    728692#: assets/src/blocks/godam-player/edit.js:263
    729693msgid "GoDAM video"
    730694msgstr ""
    731695
    732 #: assets/build/blocks/godam-player/index.js:3
     696#: assets/build/blocks/godam-player/index.js:2
    733697#: assets/src/blocks/godam-player/edit.js:264
    734698msgid "Drag and drop a video, upload, or choose from your library."
    735699msgstr ""
    736700
    737 #: assets/build/blocks/godam-player/index.js:3
     701#: assets/build/blocks/godam-player/index.js:2
    738702#: assets/src/blocks/godam-player/edit.js:329
    739703msgid "Poster image"
    740704msgstr ""
    741705
    742 #: assets/build/blocks/godam-player/index.js:3
     706#: assets/build/blocks/godam-player/index.js:2
    743707#: assets/src/blocks/godam-player/edit.js:332
    744708msgid "Select poster image"
    745709msgstr ""
    746710
    747 #: assets/build/blocks/godam-player/index.js:3
     711#: assets/build/blocks/godam-player/index.js:2
    748712#: assets/src/blocks/godam-player/edit.js:343
    749713#: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:47
     
    754718msgstr ""
    755719
    756 #: assets/build/blocks/godam-player/index.js:3
     720#: assets/build/blocks/godam-player/index.js:2
    757721#: assets/src/blocks/godam-player/edit.js:343
    758722msgid "Select"
     
    760724
    761725#. translators: %s: poster image URL.
    762 #: assets/build/blocks/godam-player/index.js:4
     726#: assets/build/blocks/godam-player/index.js:3
    763727#: assets/src/blocks/godam-player/edit.js:351
    764728msgid "The current poster image url is %s"
    765729msgstr ""
    766730
    767 #: assets/build/blocks/godam-player/index.js:4
     731#: assets/build/blocks/godam-player/index.js:3
    768732#: assets/src/blocks/godam-player/edit.js:354
    769733msgid "There is no poster image currently selected"
    770734msgstr ""
    771735
    772 #: assets/build/blocks/godam-player/index.js:4
     736#: assets/build/blocks/godam-player/index.js:3
    773737#: assets/src/blocks/godam-player/edit.js:362
    774738#: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:56
     
    778742msgstr ""
    779743
    780 #: assets/build/blocks/godam-player/index.js:4
     744#: assets/build/blocks/godam-player/index.js:3
    781745#: assets/src/blocks/godam-player/edit.js:369
    782746msgid "Customise Video"
    783747msgstr ""
    784748
    785 #: assets/build/blocks/godam-player/index.js:4
     749#: assets/build/blocks/godam-player/index.js:3
    786750#: assets/src/blocks/godam-player/edit.js:380
    787751msgid "Customise"
    788752msgstr ""
    789753
    790 #: assets/build/blocks/godam-player/index.js:4
    791 msgid "SEO Settings"
    792 msgstr ""
    793 
    794 #: assets/build/blocks/godam-player/index.js:4
     754#: assets/build/blocks/godam-player/index.js:3
    795755#: assets/src/blocks/godam-player/edit.js:394
    796756msgid "Video caption text"
     
    13781338msgstr ""
    13791339
     1340#: pages/video-editor/components/layers/AdsLayer.js:59
     1341#: pages/video-editor/components/layers/CTALayer.js:153
     1342#: pages/video-editor/components/layers/FormLayer.js:97
     1343#: pages/video-editor/components/layers/HotspotLayer.js:160
     1344#: pages/video-editor/components/layers/PollLayer.js:55
     1345#: pages/video-editor/components/LayerSelector.jsx:130
     1346msgid "Cancel"
     1347msgstr ""
     1348
    13801349#: pages/video-editor/components/layers/AdsLayer.js:72
    13811350msgid "Self hosted video Ad"
     
    16471616msgstr ""
    16481617
     1618#: pages/video-editor/VideoEditor.js:191
     1619msgid "Save"
     1620msgstr ""
     1621
    16491622#: pages/video-editor/VideoEditor.js:201
    16501623msgid "Video changes saved successfully"
  • godam/tags/1.0.8/readme.txt

    r3298881 r3301420  
    55Tested up to: 6.8.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.7
     7Stable tag: 1.0.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1717
    1818Check out our source code and contribute to the plugin on GitHub: [Official GoDAM GitHub](https://github.com/rtCamp/godam).
    19 Read our blog: [GoDAM blog](https://rtcamp.com/blog/godam/)
     19Read our blog: [GoDAM blog](https://godam.io/blog/)
    2020
    2121[youtube https://www.youtube.com/watch?v=UGmKa6aLSgU]
     
    147147== Changelog ==
    148148
     149= v1.0.8 (May 27, 2025) =
     150- Renamed functions and added checks for function existence to prevent fatal errors caused by other plugin functions.
     151
    149152= v1.0.7 (May 22, 2025) =
    150153- Fix: Update the POT creation process for translation.
  • godam/trunk/admin/godam-transcoder-actions.php

    r3294292 r3301420  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 /**
    14  * Add a field for the transcoded URL to the media attachment edit screen.
    15  *
    16  * @param array  $form_fields An array of attachment form fields.
    17  * @param object $post The attachment post object.
    18  * @return array The modified array of attachment form fields.
    19  */
    20 function rtgodam_add_transcoded_url_field( $form_fields, $post ) {
     13if ( ! function_exists( 'rtgodam_add_transcoded_url_field' ) ) {
    2114
    22     // Check if post is of type attachment.
    23     if ( 'attachment' !== $post->post_type ) {
     15    /**
     16     * Add a field for the transcoded URL to the media attachment edit screen.
     17     *
     18     * @param array  $form_fields An array of attachment form fields.
     19     * @param object $post The attachment post object.
     20     * @return array The modified array of attachment form fields.
     21     */
     22    function rtgodam_add_transcoded_url_field( $form_fields, $post ) {
     23   
     24        // Check if post is of type attachment.
     25        if ( 'attachment' !== $post->post_type ) {
     26            return $form_fields;
     27        }
     28   
     29        // Check if attachment is of type video.
     30        $mime_type = get_post_mime_type( $post->ID );
     31   
     32        if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) {
     33            return $form_fields;
     34        }
     35   
     36        $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true );
     37   
     38        $easydam_settings = get_option( 'rtgodam-settings', array() );
     39   
     40        $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
     41   
     42        // Add the transcoded URL field.
     43        $form_fields['transcoded_url'] = array(
     44            'label' => __( 'Transcoded CDN URL', 'godam' ),
     45            'input' => 'html',
     46            'html'  => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>',
     47            'value' => esc_url( $transcoded_url ),
     48            'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),
     49        );
     50   
    2451        return $form_fields;
    2552    }
    26 
    27     // Check if attachment is of type video.
    28     $mime_type = get_post_mime_type( $post->ID );
    29 
    30     if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) {
    31         return $form_fields;
    32     }
    33 
    34     $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true );
    35 
    36     $easydam_settings = get_option( 'rtgodam-settings', array() );
    37 
    38     $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
    39 
    40     // Add the transcoded URL field.
    41     $form_fields['transcoded_url'] = array(
    42         'label' => __( 'Transcoded CDN URL', 'godam' ),
    43         'input' => 'html',
    44         'html'  => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>',
    45         'value' => esc_url( $transcoded_url ),
    46         'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),
    47     );
    48 
    49     return $form_fields;
    5053}
    5154
    5255add_filter( 'attachment_fields_to_edit', 'rtgodam_add_transcoded_url_field', 10, 2 );
    5356
    54 /**
    55  * Save the transcoded URL field when the attachment is saved.
    56  *
    57  * @param array $post The post data for the attachment.
    58  * @param array $attachment The attachment data.
    59  * @return array The post data for the attachment.
    60  */
    61 function rtgodam_save_transcoded_url_field( $post, $attachment ) {
    62     // Check if adaptive bitrate streaming is enabled.
    63     $easydam_settings = get_option( 'rtgodam-settings', array() );
    6457
    65     $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
     58if ( ! function_exists( 'rtgodam_save_transcoded_url_field' ) ) {
    6659
    67     if ( ! $adaptive_bitrate_enabled ) {
     60    /**
     61     * Save the transcoded URL field when the attachment is saved.
     62     *
     63     * @param array $post The post data for the attachment.
     64     * @param array $attachment The attachment data.
     65     * @return array The post data for the attachment.
     66     */
     67    function rtgodam_save_transcoded_url_field( $post, $attachment ) {
     68        // Check if adaptive bitrate streaming is enabled.
     69        $easydam_settings = get_option( 'rtgodam-settings', array() );
     70   
     71        $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );
     72   
     73        if ( ! $adaptive_bitrate_enabled ) {
     74            return $post;
     75        }
     76   
     77        if ( isset( $attachment['transcoded_url'] ) ) {
     78            // Check the user's permissions.
     79            if ( ! current_user_can( 'edit_post', $post['ID'] ) ) {
     80                return $post;
     81            }
     82            // Update the post meta with the new value.
     83            update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) );
     84        }
     85   
    6886        return $post;
    6987    }
    70 
    71     if ( isset( $attachment['transcoded_url'] ) ) {
    72         // Check the user's permissions.
    73         if ( ! current_user_can( 'edit_post', $post['ID'] ) ) {
    74             return $post;
    75         }
    76         // Update the post meta with the new value.
    77         update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) );
    78     }
    79 
    80     return $post;
    8188}
    8289
    8390add_filter( 'attachment_fields_to_save', 'rtgodam_save_transcoded_url_field', 10, 2 );
    8491
    85 /**
    86  * Register the transcoded URL meta field.
    87  */
    88 function rtgodam_register_transcoded_url_meta() {
    89     register_post_meta(
    90         'attachment',
    91         'rtgodam_transcoded_url',
    92         array(
    93             'type'          => 'string',
    94             'single'        => true,
    95             'show_in_rest'  => true,
    96             'auth_callback' => function () {
    97                 return current_user_can( 'edit_posts' );
    98             },
    99         )
    100     );
     92
     93if ( ! function_exists( 'rtgodam_register_transcoded_url_meta' ) ) {
     94
     95    /**
     96     * Register the transcoded URL meta field.
     97     */
     98    function rtgodam_register_transcoded_url_meta() {
     99        register_post_meta(
     100            'attachment',
     101            'rtgodam_transcoded_url',
     102            array(
     103                'type'          => 'string',
     104                'single'        => true,
     105                'show_in_rest'  => true,
     106                'auth_callback' => function () {
     107                    return current_user_can( 'edit_posts' );
     108                },
     109            )
     110        );
     111    }
    101112}
    102113
     
    105116
    106117
    107 if ( ! function_exists( 'rtt_set_video_thumbnail' ) ) {
     118if ( ! function_exists( 'rtgodam_rtt_set_video_thumbnail' ) ) {
    108119
    109120    /**
     
    114125     * @param number $id rtMedia activity ID.
    115126     */
    116     function rtt_set_video_thumbnail( $id ) {
     127    function rtgodam_rtt_set_video_thumbnail( $id ) {
    117128        $media_type    = rtmedia_type( $id );
    118129        $attachment_id = rtmedia_media_id( $id );      // Get the wp attachment ID.
     
    147158}
    148159
    149 add_action( 'rtmedia_after_update_media', 'rtt_set_video_thumbnail', 12 );
     160add_action( 'rtmedia_after_update_media', 'rtgodam_rtt_set_video_thumbnail', 12 );
    150161
    151 /**
    152  * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity
    153  *
    154  * @since 1.0.7
    155  * @param string $thumb_url     Video thumbnail URL.
    156  * @param int    $attachment_id Attachment ID of the media/video for which thumbnail has to be set.
    157  */
    158 function rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) {
    159     if ( class_exists( 'RTMediaModel' ) ) {
    160         $model = new RTMediaModel();
    161         $media = $model->get( array( 'media_id' => $attachment_id ) );
    162162
    163         if ( ! empty( $media ) && ! empty( $media[0] ) ) {
    164             $attachment_id = $media[0]->media_id;
    165             $media_type    = $media[0]->media_type;
    166             $cover_art     = $media[0]->cover_art;
     163if ( ! function_exists( 'rtgodam_rtt_update_wp_media_thumbnail' ) ) {
    167164
    168             if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) {
    169                 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) );
     165    /**
     166     * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity
     167     *
     168     * @since 1.0.7
     169     * @param string $thumb_url     Video thumbnail URL.
     170     * @param int    $attachment_id Attachment ID of the media/video for which thumbnail has to be set.
     171     */
     172    function rtgodam_rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) {
     173        if ( class_exists( 'RTMediaModel' ) ) {
     174            $model = new RTMediaModel();
     175            $media = $model->get( array( 'media_id' => $attachment_id ) );
     176   
     177            if ( ! empty( $media ) && ! empty( $media[0] ) ) {
     178                $attachment_id = $media[0]->media_id;
     179                $media_type    = $media[0]->media_type;
     180                $cover_art     = $media[0]->cover_art;
     181   
     182                if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) {
     183                    $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) );
     184                }
    170185            }
    171186        }
     
    173188}
    174189
    175 add_action( 'rtgodam_transcoded_thumb_added', 'rtt_update_wp_media_thumbnail', 10, 2 );
     190add_action( 'rtgodam_transcoded_thumb_added', 'rtgodam_rtt_update_wp_media_thumbnail', 10, 2 );
  • godam/trunk/godam.php

    r3298881 r3301420  
    44 * Plugin URI: https://godam.io
    55 * Description: Seamlessly manage and optimize digital assets with GoDAM – featuring transcoding, adaptive streaming, interactive video layers, gravity forms integration, and ad integration.
    6  * Version: 1.0.7
     6 * Version: 1.0.8
    77 * Text Domain: godam
    88 * Author: rtCamp
     
    4242     * The version of the plugin
    4343     */
    44     define( 'RTGODAM_VERSION', '1.0.7' );
     44    define( 'RTGODAM_VERSION', '1.0.8' );
    4545}
    4646
  • godam/trunk/inc/classes/class-assets.php

    r3298881 r3301420  
    5050            RTGODAM_URL . 'assets/build/js/main.min.js',
    5151            array(),
    52             filemtime( RTGODAM_PATH . '/assets/build/js/main.min.js' ),
     52            filemtime( RTGODAM_PATH . 'assets/build/js/main.min.js' ),
    5353            true
    5454        );
     
    5656        wp_register_style(
    5757            'rtgodam-style',
    58             RTGODAM_URL . '/assets/build/css/main.css',
    59             array(),
    60             filemtime( RTGODAM_PATH . '/assets/build/css/main.css' )
     58            RTGODAM_URL . 'assets/build/css/main.css',
     59            array(),
     60            filemtime( RTGODAM_PATH . 'assets/build/css/main.css' )
    6161        );
    6262
    6363        wp_enqueue_script(
    6464            'analytics-library',
    65             RTGODAM_URL . '/assets/src/libs/analytics.min.js',
    66             array(),
    67             filemtime( RTGODAM_PATH . '/assets/src/libs/analytics.min.js' ),
     65            RTGODAM_URL . 'assets/src/libs/analytics.min.js',
     66            array(),
     67            filemtime( RTGODAM_PATH . 'assets/src/libs/analytics.min.js' ),
    6868            true
    6969        );
     
    143143            RTGODAM_URL . 'assets/build/js/admin.min.js',
    144144            array(),
    145             filemtime( RTGODAM_PATH . '/assets/build/js/admin.min.js' ),
     145            filemtime( RTGODAM_PATH . 'assets/build/js/admin.min.js' ),
    146146            true
    147147        );
     
    169169        wp_register_style(
    170170            'rtgodam-style',
    171             RTGODAM_URL . '/assets/build/css/admin.css',
    172             array(),
    173             filemtime( RTGODAM_PATH . '/assets/build/css/admin.css' )
     171            RTGODAM_URL . 'assets/build/css/admin.css',
     172            array(),
     173            filemtime( RTGODAM_PATH . 'assets/build/css/admin.css' )
    174174        );
    175175
     
    183183            RTGODAM_URL . 'assets/build/js/media-library.min.js',
    184184            array(),
    185             filemtime( RTGODAM_PATH . '/assets/build/js/media-library.min.js' ),
     185            filemtime( RTGODAM_PATH . 'assets/build/js/media-library.min.js' ),
    186186            true
    187187        );
     
    189189        wp_register_style(
    190190            'easydam-media-library',
    191             RTGODAM_URL . '/assets/build/css/media-library.css',
    192             array(),
    193             filemtime( RTGODAM_PATH . '/assets/build/css/media-library.css' )
     191            RTGODAM_URL . 'assets/build/css/media-library.css',
     192            array(),
     193            filemtime( RTGODAM_PATH . 'assets/build/css/media-library.css' )
    194194        );
    195195
     
    240240         * Dependency library for date range picker.
    241241         */
    242         wp_enqueue_script( 'moment-js', RTGODAM_URL . '/assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/moment-js.min.js' ), true );
    243         wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . '/assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.min.js' ), true );
    244         wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . '/assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.css' ) );
     242        wp_enqueue_script( 'moment-js', RTGODAM_URL . 'assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/moment-js.min.js' ), true );
     243        wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . 'assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.min.js' ), true );
     244        wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . 'assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.css' ) );
    245245    }
    246246
  • godam/trunk/languages/godam.pot

    r3298881 r3301420  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: GoDAM 1.0.7\n"
     5"Project-Id-Version: GoDAM 1.0.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/godam\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-05-22T13:33:19+00:00\n"
     12"POT-Creation-Date: 2025-05-27T09:29:04+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    307307msgstr ""
    308308
    309 #: admin/godam-transcoder-actions.php:42
     309#: admin/godam-transcoder-actions.php:44
    310310msgid "Transcoded CDN URL"
    311311msgstr ""
    312312
    313 #: admin/godam-transcoder-actions.php:46
     313#: admin/godam-transcoder-actions.php:48
    314314msgid "The URL of the transcoded file is generated automatically and cannot be edited."
    315315msgstr ""
     
    336336#: inc/classes/class-pages.php:116
    337337#: assets/build/blocks/godam-audio/index.js:1
    338 #: assets/build/blocks/godam-player/index.js:3
     338#: assets/build/blocks/godam-player/index.js:2
    339339#: assets/src/blocks/godam-audio/edit.js:136
    340340#: assets/src/blocks/godam-player/edit.js:321
     
    690690
    691691#: assets/build/blocks/godam-player/index.js:2
    692 msgid "URL of the video content can be MOV, MP4, MPD. Example: https://www.example.com/video.mp4"
    693 msgstr ""
    694 
    695 #: assets/build/blocks/godam-player/index.js:2
    696 msgid "Title of the video"
    697 msgstr ""
    698 
    699 #: assets/build/blocks/godam-player/index.js:2
    700 msgid "Description of the video"
    701 msgstr ""
    702 
    703 #: assets/build/blocks/godam-player/index.js:2
    704 msgid "URL of the video thumbnail. Example: https://www.example.com/thumbnail.jpg"
    705 msgstr ""
    706 
    707 #: assets/build/blocks/godam-player/index.js:2
    708 msgid "Is the video suitable for all audiences?"
    709 msgstr ""
    710 
    711 #: assets/build/blocks/godam-player/index.js:2
    712 #: pages/video-editor/components/layers/AdsLayer.js:59
    713 #: pages/video-editor/components/layers/CTALayer.js:153
    714 #: pages/video-editor/components/layers/FormLayer.js:97
    715 #: pages/video-editor/components/layers/HotspotLayer.js:160
    716 #: pages/video-editor/components/layers/PollLayer.js:55
    717 #: pages/video-editor/components/LayerSelector.jsx:130
    718 msgid "Cancel"
    719 msgstr ""
    720 
    721 #: assets/build/blocks/godam-player/index.js:2
    722 #: pages/video-editor/VideoEditor.js:191
    723 msgid "Save"
    724 msgstr ""
    725 
    726 #. translators: %s: Label of the video text track e.g: "French subtitles".
    727 #: assets/build/blocks/godam-player/index.js:3
    728692#: assets/src/blocks/godam-player/edit.js:263
    729693msgid "GoDAM video"
    730694msgstr ""
    731695
    732 #: assets/build/blocks/godam-player/index.js:3
     696#: assets/build/blocks/godam-player/index.js:2
    733697#: assets/src/blocks/godam-player/edit.js:264
    734698msgid "Drag and drop a video, upload, or choose from your library."
    735699msgstr ""
    736700
    737 #: assets/build/blocks/godam-player/index.js:3
     701#: assets/build/blocks/godam-player/index.js:2
    738702#: assets/src/blocks/godam-player/edit.js:329
    739703msgid "Poster image"
    740704msgstr ""
    741705
    742 #: assets/build/blocks/godam-player/index.js:3
     706#: assets/build/blocks/godam-player/index.js:2
    743707#: assets/src/blocks/godam-player/edit.js:332
    744708msgid "Select poster image"
    745709msgstr ""
    746710
    747 #: assets/build/blocks/godam-player/index.js:3
     711#: assets/build/blocks/godam-player/index.js:2
    748712#: assets/src/blocks/godam-player/edit.js:343
    749713#: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:47
     
    754718msgstr ""
    755719
    756 #: assets/build/blocks/godam-player/index.js:3
     720#: assets/build/blocks/godam-player/index.js:2
    757721#: assets/src/blocks/godam-player/edit.js:343
    758722msgid "Select"
     
    760724
    761725#. translators: %s: poster image URL.
    762 #: assets/build/blocks/godam-player/index.js:4
     726#: assets/build/blocks/godam-player/index.js:3
    763727#: assets/src/blocks/godam-player/edit.js:351
    764728msgid "The current poster image url is %s"
    765729msgstr ""
    766730
    767 #: assets/build/blocks/godam-player/index.js:4
     731#: assets/build/blocks/godam-player/index.js:3
    768732#: assets/src/blocks/godam-player/edit.js:354
    769733msgid "There is no poster image currently selected"
    770734msgstr ""
    771735
    772 #: assets/build/blocks/godam-player/index.js:4
     736#: assets/build/blocks/godam-player/index.js:3
    773737#: assets/src/blocks/godam-player/edit.js:362
    774738#: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:56
     
    778742msgstr ""
    779743
    780 #: assets/build/blocks/godam-player/index.js:4
     744#: assets/build/blocks/godam-player/index.js:3
    781745#: assets/src/blocks/godam-player/edit.js:369
    782746msgid "Customise Video"
    783747msgstr ""
    784748
    785 #: assets/build/blocks/godam-player/index.js:4
     749#: assets/build/blocks/godam-player/index.js:3
    786750#: assets/src/blocks/godam-player/edit.js:380
    787751msgid "Customise"
    788752msgstr ""
    789753
    790 #: assets/build/blocks/godam-player/index.js:4
    791 msgid "SEO Settings"
    792 msgstr ""
    793 
    794 #: assets/build/blocks/godam-player/index.js:4
     754#: assets/build/blocks/godam-player/index.js:3
    795755#: assets/src/blocks/godam-player/edit.js:394
    796756msgid "Video caption text"
     
    13781338msgstr ""
    13791339
     1340#: pages/video-editor/components/layers/AdsLayer.js:59
     1341#: pages/video-editor/components/layers/CTALayer.js:153
     1342#: pages/video-editor/components/layers/FormLayer.js:97
     1343#: pages/video-editor/components/layers/HotspotLayer.js:160
     1344#: pages/video-editor/components/layers/PollLayer.js:55
     1345#: pages/video-editor/components/LayerSelector.jsx:130
     1346msgid "Cancel"
     1347msgstr ""
     1348
    13801349#: pages/video-editor/components/layers/AdsLayer.js:72
    13811350msgid "Self hosted video Ad"
     
    16471616msgstr ""
    16481617
     1618#: pages/video-editor/VideoEditor.js:191
     1619msgid "Save"
     1620msgstr ""
     1621
    16491622#: pages/video-editor/VideoEditor.js:201
    16501623msgid "Video changes saved successfully"
  • godam/trunk/readme.txt

    r3298881 r3301420  
    55Tested up to: 6.8.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.7
     7Stable tag: 1.0.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1717
    1818Check out our source code and contribute to the plugin on GitHub: [Official GoDAM GitHub](https://github.com/rtCamp/godam).
    19 Read our blog: [GoDAM blog](https://rtcamp.com/blog/godam/)
     19Read our blog: [GoDAM blog](https://godam.io/blog/)
    2020
    2121[youtube https://www.youtube.com/watch?v=UGmKa6aLSgU]
     
    147147== Changelog ==
    148148
     149= v1.0.8 (May 27, 2025) =
     150- Renamed functions and added checks for function existence to prevent fatal errors caused by other plugin functions.
     151
    149152= v1.0.7 (May 22, 2025) =
    150153- Fix: Update the POT creation process for translation.
Note: See TracChangeset for help on using the changeset viewer.