From 09906a3736c6e73d8c9ce054ec7dc503470ef3c5 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Wed, 29 Apr 2020 20:04:52 +0530 Subject: [PATCH 01/21] Add is_multisite check before replacing image URL --- app/main/controllers/template/rtmedia-filters.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/main/controllers/template/rtmedia-filters.php b/app/main/controllers/template/rtmedia-filters.php index 0b1f233e9..7939ea675 100644 --- a/app/main/controllers/template/rtmedia-filters.php +++ b/app/main/controllers/template/rtmedia-filters.php @@ -427,9 +427,15 @@ function replace_aws_img_urls_from_activities( $content, $activity = '' ) { $baseurl = $uploads['baseurl']; + $thumbnail_url = ''; if ( 0 === strpos( $url, $uploads['baseurl'] ) ) { $thumbnail_url = $url; - } else { + } elseif ( ! is_multisite() ) { + /** + * Code in this condition replaces AWS image URL with normal URL, which shouldn't happen in case of a multisite. + * Because wp_upload_dir will give current site's uploads directory, which will be different for image of different subsite. + */ + $rtmedia_folder_name = apply_filters( 'rtmedia_upload_folder_name', 'rtMedia' ); $thumbnail_url = explode( $rtmedia_folder_name, $url ); From 864bfeb0df44dc33855a85e99ab4f0f6b5d9c975 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 23 Jun 2020 13:30:55 +0530 Subject: [PATCH 02/21] Fix notices/warnings when posting activity with media --- .../upload/RTMediaUploadEndpoint.php | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/app/main/controllers/upload/RTMediaUploadEndpoint.php b/app/main/controllers/upload/RTMediaUploadEndpoint.php index d276e6998..2821ec916 100755 --- a/app/main/controllers/upload/RTMediaUploadEndpoint.php +++ b/app/main/controllers/upload/RTMediaUploadEndpoint.php @@ -270,23 +270,25 @@ public function template_redirect( $create_activity = true ) { } $obj_activity = new RTMediaActivity( $update_activity_media, $privacy, false ); - global $wpdb, $bp; - $user = get_userdata( $same_medias[0]->media_author ); - $username = '' . esc_html( $user->display_name ) . ''; - - // translators: 1: Username, 2: Number of medias, 3: Media slug. - $action = sprintf( esc_html__( '%1$s added %2$d %3$s', 'buddypress-media' ), $username, count( $same_medias ), RTMEDIA_MEDIA_SLUG ); - $action = apply_filters( 'rtmedia_buddypress_action_text_fitler_multiple_media', $action, $username, count( $same_medias ), $user->display_name ); - - $wpdb->update( - $bp->activity->table_name, - array( - 'type' => 'rtmedia_update', - 'content' => $obj_activity->create_activity_html(), - 'action' => $action, - ), - array( 'id' => $activity_id ) - ); + if ( ! empty( $same_medias[0] ) && ! empty( $activity_id ) ) { + global $wpdb, $bp; + $user = get_userdata( $same_medias[0]->media_author ); + $username = '' . esc_html( $user->display_name ) . ''; + + // translators: 1: Username, 2: Number of medias, 3: Media slug. + $action = sprintf( esc_html__( '%1$s added %2$d %3$s', 'buddypress-media' ), $username, count( $same_medias ), RTMEDIA_MEDIA_SLUG ); + $action = apply_filters( 'rtmedia_buddypress_action_text_fitler_multiple_media', $action, $username, count( $same_medias ), $user->display_name ); + + $wpdb->update( + $bp->activity->table_name, + array( + 'type' => 'rtmedia_update', + 'content' => $obj_activity->create_activity_html(), + 'action' => $action, + ), + array( 'id' => $activity_id ) + ); + } } // update group last active. From e692e660e810560b46804b09dee36e10b6fb1d98 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 23 Jun 2020 13:37:25 +0530 Subject: [PATCH 03/21] Fix NAN seconds ago bug and related notices and warnings --- app/main/controllers/template/rtmedia-functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/main/controllers/template/rtmedia-functions.php b/app/main/controllers/template/rtmedia-functions.php index 57d81aad5..6a86d8e86 100644 --- a/app/main/controllers/template/rtmedia-functions.php +++ b/app/main/controllers/template/rtmedia-functions.php @@ -3308,7 +3308,9 @@ function rtmedia_convert_date( $_date ) { $no = $diff / $length[ $i ]; while ( $i >= 0 && $no <= 1 ) { $i--; - $no = $diff / $length[ $i ]; + if ( $i >= 0 ) { + $no = $diff / $length[ $i ]; + } } if ( $i < 0 ) { From 0e28420f9bd8da274ab6c886295c4376eb253ca5 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 23 Jun 2020 14:48:05 +0530 Subject: [PATCH 04/21] Change path from rtMediaWP/rtMedia to rtCamp/rtMedia --- bin/.travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/.travis.yml b/bin/.travis.yml index d40b82593..af20c78c2 100644 --- a/bin/.travis.yml +++ b/bin/.travis.yml @@ -56,7 +56,7 @@ before_script: - cd $PLUGIN_DIR/tests/codeception/ # - composer update - composer install - - export PATH="$PATH:/home/travis/build/rtMediaWP/rtMedia/tests/codeception/vendor/bin" + - export PATH="$PATH:/home/travis/build/rtCamp/rtMedia/tests/codeception/vendor/bin" ## PHP_CodeSniffer - git clone https://github.com/squizlabs/PHP_CodeSniffer.git - cd PHP_CodeSniffer From 40b4c8692b96ce702f54042175334bb61fde8f46 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 23 Jun 2020 15:01:39 +0530 Subject: [PATCH 05/21] Fix extension changes when editing media title bug --- app/assets/js/rtMedia.backbone.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index aa21dcbf3..5eb79dffb 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -718,8 +718,9 @@ jQuery( function( $ ) { var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); if ( file_title_val != '' ) { - file_name_wrapper_el.text( file_title_val + '.' + rtm_file_name_array[ 1 ] ); - file.title = file_title_val; + var extension = file.name.split( '.' )[1]; + file_name_wrapper_el.text( file_title_val + '.' + extension ); + file.title = file_title_val; } if ( file_desc_val != '' ) { @@ -1286,7 +1287,8 @@ jQuery( document ).ready( function( $ ) { var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); if ( file_title_val != '' ) { - file_name_wrapper_el.text( file_title_val + '.' + rtm_file_name_array[ 1 ] ); + var extension = file.name.split( '.' )[1]; + file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; } @@ -2632,7 +2634,8 @@ function renderUploadercomment_media( widget_id, parent_id_type ) { var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); if ( file_title_val != '' ) { - file_name_wrapper_el.text( file_title_val + '.' + rtm_file_name_array[ 1 ] ); + var extension = file.name.split( '.' )[1]; + file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; } From b0c3b29912b4439ee295db0a097211d0272704bc Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 23 Jun 2020 15:05:51 +0530 Subject: [PATCH 06/21] Fix indentation, Yoda condition and strict type checking --- app/assets/js/rtMedia.backbone.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index 5eb79dffb..2ad9b16a9 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -717,11 +717,11 @@ jQuery( function( $ ) { var file_desc_val = jQuery( rtm_file_desc_input ).val(); var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); - if ( file_title_val != '' ) { + if ( '' !== trim( file_title_val ) ) { var extension = file.name.split( '.' )[1]; file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; - } + } if ( file_desc_val != '' ) { file.description = file_desc_val; @@ -1286,7 +1286,7 @@ jQuery( document ).ready( function( $ ) { var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); - if ( file_title_val != '' ) { + if ( '' !== trim( file_title_val ) ) { var extension = file.name.split( '.' )[1]; file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; @@ -2633,7 +2633,7 @@ function renderUploadercomment_media( widget_id, parent_id_type ) { var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); - if ( file_title_val != '' ) { + if ( '' !== trim( file_title_val ) ) { var extension = file.name.split( '.' )[1]; file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; From 9fe327e9ad70bdc410efa28fe7fff7266785a700 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 23 Jun 2020 15:09:39 +0530 Subject: [PATCH 07/21] Use trim() function properly --- app/assets/js/rtMedia.backbone.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index 2ad9b16a9..8dee34f5c 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -717,7 +717,7 @@ jQuery( function( $ ) { var file_desc_val = jQuery( rtm_file_desc_input ).val(); var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); - if ( '' !== trim( file_title_val ) ) { + if ( '' !== file_title_val.trim() ) { var extension = file.name.split( '.' )[1]; file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; @@ -1286,7 +1286,7 @@ jQuery( document ).ready( function( $ ) { var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); - if ( '' !== trim( file_title_val ) ) { + if ( '' !== file_title_val.trim() ) { var extension = file.name.split( '.' )[1]; file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; @@ -2633,7 +2633,7 @@ function renderUploadercomment_media( widget_id, parent_id_type ) { var file_name_wrapper_el = jQuery( rtm_file_label ).siblings( '.plupload_file_name_wrapper' ); - if ( '' !== trim( file_title_val ) ) { + if ( '' !== file_title_val.trim() ) { var extension = file.name.split( '.' )[1]; file_name_wrapper_el.text( file_title_val + '.' + extension ); file.title = file_title_val; From 7bcd1c67c3f8101bb7a0d37ecda6c573ca4682ca Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 23 Jun 2020 15:26:10 +0530 Subject: [PATCH 08/21] Add hook document comments, add attachment_ids in rtmedia_after_add_media hook --- app/main/controllers/media/RTMediaMedia.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/main/controllers/media/RTMediaMedia.php b/app/main/controllers/media/RTMediaMedia.php index 62dd4df8d..5625e9893 100755 --- a/app/main/controllers/media/RTMediaMedia.php +++ b/app/main/controllers/media/RTMediaMedia.php @@ -206,9 +206,20 @@ public function add( $uploaded, $file_object ) { $rtmedia_points_media_id = $media_ids[0]; } + /** + * Action after a specific type of media is added from rtMedia. + */ do_action( 'rtmedia_after_add_' . $rtmedia_type ); - do_action( 'rtmedia_after_add_media', $media_ids, $file_object, $uploaded ); + /** + * Action after media is added from rtMedia. + * + * @param array $media_ids rtMedia IDs. + * @param array $file_object File details. + * @param array $uploaded Uploaded media details. + * @param array $attachment_ids Attachment IDs of uploaded media. + */ + do_action( 'rtmedia_after_add_media', $media_ids, $file_object, $uploaded, $attachment_ids ); return $media_ids; } From 6f679cb5582bbd2266a7f14651bace3343649bd7 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Wed, 24 Jun 2020 17:44:54 +0530 Subject: [PATCH 09/21] Removed imageEdit.save call from save button, added it only when required --- app/assets/js/rtMedia.backbone.js | 18 ++++++++++++++++++ templates/media/media-single-edit.php | 7 ++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index 8dee34f5c..67144bbc5 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -28,6 +28,24 @@ jQuery( function( $ ) { media_children.remove(); } }); + + /** + * Remove imageEdit.save function call and add it only when image is being modified in WP editor. + */ + $( '#rtmedia_media_single_edit .rtm-button-save' ).on( 'click', function() { + var $media_id = $( '#rtmedia-editor-media-id' ).val(); + var $nonce = $( '#rtmedia-editor-nonce' ).val(); + if ( '' === $nonce.trim() || '' === $media_id.trim() ) { + return; + } + $media_id = parseInt( $media_id ); + $media_head = $( '#media-head-' + $media_id ); + if ( ! $media_head.length || 'undefined' === typeof $media_head.css( 'display' ) || 'none' !== $media_head.css( 'display' ).trim() ) { + return; + } + + imageEdit.save( $media_id, $nonce ); + } ); }); /** * End of issue 1059 fix diff --git a/templates/media/media-single-edit.php b/templates/media/media-single-edit.php index eeb9b9abf..87d22e2b3 100755 --- a/templates/media/media-single-edit.php +++ b/templates/media/media-single-edit.php @@ -55,9 +55,10 @@
- - + + + +
From 17c55d86a30341f68c467d38b211a4a0b9b2bdfe Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Wed, 24 Jun 2020 20:22:31 +0530 Subject: [PATCH 10/21] Add undefined check for media_id and nonce hidden fields --- app/assets/js/rtMedia.backbone.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index 67144bbc5..68d234f16 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -35,9 +35,10 @@ jQuery( function( $ ) { $( '#rtmedia_media_single_edit .rtm-button-save' ).on( 'click', function() { var $media_id = $( '#rtmedia-editor-media-id' ).val(); var $nonce = $( '#rtmedia-editor-nonce' ).val(); - if ( '' === $nonce.trim() || '' === $media_id.trim() ) { + if ( ( 'undefined' !== typeof $nonce && '' === $nonce.trim() ) || ( 'undefined' !== typeof $media_id && '' === $media_id.trim() ) ) { return; } + $media_id = parseInt( $media_id ); $media_head = $( '#media-head-' + $media_id ); if ( ! $media_head.length || 'undefined' === typeof $media_head.css( 'display' ) || 'none' !== $media_head.css( 'display' ).trim() ) { From ba3313cb302ee2d60df088b00013acf73a23690f Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Wed, 24 Jun 2020 20:24:08 +0530 Subject: [PATCH 11/21] Add undefined check for media_id and nonce hidden fields --- app/assets/js/rtMedia.backbone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index 68d234f16..a28e9fc4b 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -35,7 +35,7 @@ jQuery( function( $ ) { $( '#rtmedia_media_single_edit .rtm-button-save' ).on( 'click', function() { var $media_id = $( '#rtmedia-editor-media-id' ).val(); var $nonce = $( '#rtmedia-editor-nonce' ).val(); - if ( ( 'undefined' !== typeof $nonce && '' === $nonce.trim() ) || ( 'undefined' !== typeof $media_id && '' === $media_id.trim() ) ) { + if ( 'undefined' === typeof $nonce || '' === $nonce.trim() || 'undefined' === typeof $media_id || '' === $media_id.trim() ) { return; } From a8156a9968e4acb6d26e33689bb31f72297b24ab Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Thu, 25 Jun 2020 13:41:38 +0530 Subject: [PATCH 12/21] Remove extra line in backbone js file --- app/assets/js/rtMedia.backbone.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index a28e9fc4b..6fb356e39 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -38,7 +38,6 @@ jQuery( function( $ ) { if ( 'undefined' === typeof $nonce || '' === $nonce.trim() || 'undefined' === typeof $media_id || '' === $media_id.trim() ) { return; } - $media_id = parseInt( $media_id ); $media_head = $( '#media-head-' + $media_id ); if ( ! $media_head.length || 'undefined' === typeof $media_head.css( 'display' ) || 'none' !== $media_head.css( 'display' ).trim() ) { From 2cdf927f5f79933bd5918e6e509a124b2994fa79 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 Jun 2020 08:56:50 +0000 Subject: [PATCH 13/21] Get blog_id from activity id and get uploads url of that blog --- app/helper/RTMediaActivityModel.php | 16 +++++++++++++++ .../controllers/template/rtmedia-filters.php | 20 ++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/app/helper/RTMediaActivityModel.php b/app/helper/RTMediaActivityModel.php index 474413716..4fd3d69f8 100644 --- a/app/helper/RTMediaActivityModel.php +++ b/app/helper/RTMediaActivityModel.php @@ -40,6 +40,22 @@ public function get( $columns, $offset = false, $per_page = false, $order_by = ' return parent::get( $columns, $offset, $per_page, $order_by ); } + /** + * Get activity without setting blog_id. + * + * @since v4.6.4 + * + * @param array $columns Columns. + * @param bool|int $offset Offset. + * @param bool|int $per_page Per page. + * @param string $order_by Order by. + * + * @return array Returned data. + */ + public function get_without_blog_id( $columns, $offset = false, $per_page = false, $order_by = 'activity_id DESC' ) { + return parent::get( $columns, $offset, $per_page, $order_by ); + } + /** * Insert row. * diff --git a/app/main/controllers/template/rtmedia-filters.php b/app/main/controllers/template/rtmedia-filters.php index 7939ea675..c83cb2f47 100644 --- a/app/main/controllers/template/rtmedia-filters.php +++ b/app/main/controllers/template/rtmedia-filters.php @@ -418,24 +418,30 @@ function replace_aws_img_urls_from_activities( $content, $activity = '' ) { if ( ! class_exists( 'RTAWSS3_Class' ) && ! class_exists( 'AS3CF_Utils' ) ) { - // for WordPress backward compatibility. + // Get blog_id of activity from rtMedia table. + $rt_activity_model = new RTMediaActivityModel(); + $rtmedia_activity = $rt_activity_model->get_without_blog_id( array( 'activity_id' => $activity->id ) ); + // Switch to activity blog to get correct uploads URL. + if ( ! empty( $rtmedia_activity[0]->blog_id ) ) { + switch_to_blog( $rtmedia_activity[0]->blog_id ); + } + // For WordPress backward compatibility. if ( function_exists( 'wp_get_upload_dir' ) ) { $uploads = wp_get_upload_dir(); } else { $uploads = wp_upload_dir(); } + // Restore current blog if it was switched to other blog. + if ( ! empty( $rtmedia_activity[0]->blog_id ) ) { + restore_current_blog(); + } $baseurl = $uploads['baseurl']; $thumbnail_url = ''; if ( 0 === strpos( $url, $uploads['baseurl'] ) ) { $thumbnail_url = $url; - } elseif ( ! is_multisite() ) { - /** - * Code in this condition replaces AWS image URL with normal URL, which shouldn't happen in case of a multisite. - * Because wp_upload_dir will give current site's uploads directory, which will be different for image of different subsite. - */ - + } else { $rtmedia_folder_name = apply_filters( 'rtmedia_upload_folder_name', 'rtMedia' ); $thumbnail_url = explode( $rtmedia_folder_name, $url ); From 1fbf0d0d362be0afdbeffb3efcc34c1c2670b014 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 Jun 2020 09:01:37 +0000 Subject: [PATCH 14/21] Add reason comment for get_without_blog_id function --- app/helper/RTMediaActivityModel.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helper/RTMediaActivityModel.php b/app/helper/RTMediaActivityModel.php index 4fd3d69f8..3898e4ed2 100644 --- a/app/helper/RTMediaActivityModel.php +++ b/app/helper/RTMediaActivityModel.php @@ -42,6 +42,8 @@ public function get( $columns, $offset = false, $per_page = false, $order_by = ' /** * Get activity without setting blog_id. + * This function is needed because there's no way to get activity of a different blog. + * Existing get method sets blog_id to current blog. * * @since v4.6.4 * From 966b785fc3819946380ab5a663ee6e0bc1142b2a Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Thu, 25 Jun 2020 18:42:29 +0530 Subject: [PATCH 15/21] Check whether a URL has querystring, based on that add timestamp at the end of URL --- .../controllers/template/rtmedia-filters.php | 11 ++++-- .../template/rtmedia-functions.php | 35 +++++++++++++------ 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/app/main/controllers/template/rtmedia-filters.php b/app/main/controllers/template/rtmedia-filters.php index 0b1f233e9..c73745c14 100644 --- a/app/main/controllers/template/rtmedia-filters.php +++ b/app/main/controllers/template/rtmedia-filters.php @@ -297,8 +297,15 @@ function replace_src_with_transcoded_file_url( $html, $rtmedia_media ) { $final_file_url = wp_get_attachment_url( $attachment_id ); } - // Add timestamp to resolve conflict with cache media. - return preg_replace( '/src=["]([^"]+)["]/', 'src="' . $final_file_url . '?' . time() . '"', $html ); + // Add timestamp to bypass cache and load fresh image. + $final_file_url_query = wp_parse_url( $final_file_url, PHP_URL_QUERY ); + if ( empty( $final_file_url_query ) ) { + $final_file_url .= '?' . time(); + } else { + $final_file_url .= '&' . time(); + } + + return preg_replace( '/src=["]([^"]+)["]/', 'src="' . $final_file_url . '"', $html ); } add_filter( 'rtmedia_single_content_filter', 'replace_src_with_transcoded_file_url', 100, 2 ); diff --git a/app/main/controllers/template/rtmedia-functions.php b/app/main/controllers/template/rtmedia-functions.php index 6a86d8e86..e1351588e 100644 --- a/app/main/controllers/template/rtmedia-functions.php +++ b/app/main/controllers/template/rtmedia-functions.php @@ -578,18 +578,26 @@ function rtmedia_media( $size_flag = true, $echo = true, $media_size = 'rt_media if ( isset( $rtmedia_media->media_type ) ) { if ( 'photo' === $rtmedia_media->media_type ) { - $src = wp_get_attachment_image_src( $rtmedia_media->media_id, $media_size ); - /** - * Used `set_url_scheme` because `esc_url` breaks the image if there is special characters are there into image name. - * Added by checking the code from "wp-admin/includes/media.php:2740". - * Because in media library, it was not breaking. - * - * Add timestamp to resolve conflict with cache image. - */ - $html = "" . esc_attr( $rtmedia_media->post_name ) . ""; + if ( ! empty( $src[0] ) ) { + $src = $src[0]; + + // Add timestamp to bypass cache and load fresh image. + $src_query = wp_parse_url( $src, PHP_URL_QUERY ); + if ( empty( $src_query ) ) { + $src .= '?' . time(); + } else { + $src .= '&' . time(); + } + /** + * Used `set_url_scheme` because `esc_url` breaks the image if there is special characters are there into image name. + * Added by checking the code from "wp-admin/includes/media.php:2740". + * Because in media library, it was not breaking. + */ + $html = "" . esc_attr( $rtmedia_media->post_name ) . ""; + } } elseif ( 'video' === $rtmedia_media->media_type ) { $youtube_url = get_rtmedia_meta( $rtmedia_media->id, 'video_url_uploaded_from' ); @@ -747,8 +755,13 @@ function rtmedia_image( $size = 'rt_media_thumbnail', $id = false, $echo = true, $src = apply_filters( 'rtmedia_media_thumb', $src, $media_object->id, $media_object->media_type ); - // Added timestamp because conflict with cache image. - $src = $src . '?' . time(); + // Add timestamp to bypass cache and load fresh image. + $src_query = wp_parse_url( $src, PHP_URL_QUERY ); + if ( empty( $src_query ) ) { + $src .= '?' . time(); + } else { + $src .= '&' . time(); + } if ( true === $echo ) { echo wp_kses( set_url_scheme( $src ), RTMedia::expanded_allowed_tags() ); From b523109e509a90984f2f911088ea9f726519bc97 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Thu, 25 Jun 2020 19:27:10 +0530 Subject: [PATCH 16/21] Add name attribute in hidden fields --- templates/media/media-single-edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/media/media-single-edit.php b/templates/media/media-single-edit.php index 87d22e2b3..f0027f55c 100755 --- a/templates/media/media-single-edit.php +++ b/templates/media/media-single-edit.php @@ -55,8 +55,8 @@
- - + +
From b2cfc3bdc25039dde3362d3e4a9f0ca13a1e3b37 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Fri, 3 Jul 2020 12:30:12 +0530 Subject: [PATCH 17/21] Add separate function to append URL, don't add timestamp if url is from amazon --- .../controllers/template/rtmedia-filters.php | 8 +--- .../template/rtmedia-functions.php | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/app/main/controllers/template/rtmedia-filters.php b/app/main/controllers/template/rtmedia-filters.php index e557284d4..4eb4ca576 100644 --- a/app/main/controllers/template/rtmedia-filters.php +++ b/app/main/controllers/template/rtmedia-filters.php @@ -297,13 +297,7 @@ function replace_src_with_transcoded_file_url( $html, $rtmedia_media ) { $final_file_url = wp_get_attachment_url( $attachment_id ); } - // Add timestamp to bypass cache and load fresh image. - $final_file_url_query = wp_parse_url( $final_file_url, PHP_URL_QUERY ); - if ( empty( $final_file_url_query ) ) { - $final_file_url .= '?' . time(); - } else { - $final_file_url .= '&' . time(); - } + $final_file_url = rtmedia_append_timestamp_in_url( $final_file_url ); return preg_replace( '/src=["]([^"]+)["]/', 'src="' . $final_file_url . '"', $html ); diff --git a/app/main/controllers/template/rtmedia-functions.php b/app/main/controllers/template/rtmedia-functions.php index e1351588e..4f905ff28 100644 --- a/app/main/controllers/template/rtmedia-functions.php +++ b/app/main/controllers/template/rtmedia-functions.php @@ -581,15 +581,7 @@ function rtmedia_media( $size_flag = true, $echo = true, $media_size = 'rt_media $src = wp_get_attachment_image_src( $rtmedia_media->media_id, $media_size ); if ( ! empty( $src[0] ) ) { - $src = $src[0]; - - // Add timestamp to bypass cache and load fresh image. - $src_query = wp_parse_url( $src, PHP_URL_QUERY ); - if ( empty( $src_query ) ) { - $src .= '?' . time(); - } else { - $src .= '&' . time(); - } + $src = rtmedia_append_timestamp_in_url( $src[0] ); /** * Used `set_url_scheme` because `esc_url` breaks the image if there is special characters are there into image name. @@ -754,14 +746,7 @@ function rtmedia_image( $size = 'rt_media_thumbnail', $id = false, $echo = true, } $src = apply_filters( 'rtmedia_media_thumb', $src, $media_object->id, $media_object->media_type ); - - // Add timestamp to bypass cache and load fresh image. - $src_query = wp_parse_url( $src, PHP_URL_QUERY ); - if ( empty( $src_query ) ) { - $src .= '?' . time(); - } else { - $src .= '&' . time(); - } + $src = rtmedia_append_timestamp_in_url( $src ); if ( true === $echo ) { echo wp_kses( set_url_scheme( $src ), RTMedia::expanded_allowed_tags() ); @@ -771,6 +756,24 @@ function rtmedia_image( $size = 'rt_media_thumbnail', $id = false, $echo = true, } +/** + * Appends timestamp at the end of the URL to bypass cache and load fresh image. + * + * @param string $src Image URL. + * + * @return string Modified URL. + */ +function rtmedia_append_timestamp_in_url( $src ) { + $src_query = wp_parse_url( $src, PHP_URL_QUERY ); + if ( empty( $src_query ) ) { + $src .= '?' . time(); + } elseif ( false === strpos( $src, 'amazonaws.com' ) ) { + $src .= '&' . time(); + } + + return $src; +} + /** * Get media alt * From d09f437e97708810214fdf72479ff9c351c0faef Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Tue, 7 Jul 2020 18:57:06 +0530 Subject: [PATCH 18/21] Remove code which disallows threaded comments on rtmedia_update --- .../activity/RTMediaBuddyPressActivity.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/main/controllers/activity/RTMediaBuddyPressActivity.php b/app/main/controllers/activity/RTMediaBuddyPressActivity.php index 6ce85f287..12df66a86 100755 --- a/app/main/controllers/activity/RTMediaBuddyPressActivity.php +++ b/app/main/controllers/activity/RTMediaBuddyPressActivity.php @@ -35,7 +35,6 @@ public function __construct() { add_filter( 'bp_activity_truncate_entry', array( $this, 'bp_activity_truncate_entry' ), 10, 3 ); } } - add_action( 'bp_init', array( $this, 'non_threaded_comments' ) ); add_action( 'bp_activity_comment_posted', array( $this, 'comment_sync' ), 10, 2 ); add_action( 'bp_activity_delete_comment', array( $this, 'delete_comment_sync' ), 10, 2 ); add_filter( 'bp_activity_allowed_tags', array( &$this, 'override_allowed_tags' ) ); @@ -557,22 +556,6 @@ public function comment_sync( $comment_id, $param ) { } } - /** - * Save Non-threaded comments. - */ - public function non_threaded_comments() { - $action = sanitize_text_field( filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING ) ); - if ( 'new_activity_comment' === $action ) { - $activity_id = filter_input( INPUT_POST, 'form_id', FILTER_SANITIZE_NUMBER_INT ); - $disable_media = filter_input( INPUT_POST, 'rtmedia_disable_media_in_commented_media', FILTER_SANITIZE_STRING ); - $act = new BP_Activity_Activity( $activity_id ); - - if ( 'rtmedia_update' === $act->type && ! empty( $disable_media ) ) { - $_POST['comment_id'] = $activity_id; - } - } - } - /** * Groups posted update. * From c45b9dc2d62221f55684a71f2450ef45a523e502 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Fri, 10 Jul 2020 12:27:59 +0530 Subject: [PATCH 19/21] Add empty check before accessing values, fix phpcs --- .../template/rtmedia-functions.php | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/app/main/controllers/template/rtmedia-functions.php b/app/main/controllers/template/rtmedia-functions.php index 4f905ff28..3b036b10e 100644 --- a/app/main/controllers/template/rtmedia-functions.php +++ b/app/main/controllers/template/rtmedia-functions.php @@ -3137,22 +3137,22 @@ function rtmedia_who_like_html( $like_count = false, $user_like_it = false ) { } /** - * Get music cover art + * Get music cover art. * * @param object $media_object Media details object. * - * @return bool|string + * @return bool|string Uploaded thumbnail URL | False. */ function rtm_get_music_cover_art( $media_object ) { - // return URL if cover_art already set. + // Return URL if cover_art already set. $url = $media_object->cover_art; if ( ! empty( $url ) && ! is_numeric( $url ) ) { return $url; } - // return false if covert_art is already analyzed earlier. + // Return false if covert_art is already analyzed earlier. if ( -1 === intval( $url ) ) { return false; } @@ -3163,25 +3163,25 @@ function rtm_get_music_cover_art( $media_object ) { $media_tags = new RTMediaTags( $file ); $title_info = $media_tags->title; $image_info = $media_tags->image; - $image_mime = $image_info['mime']; - $mime = explode( '/', $image_mime ); $id = $media_object->id; - if ( ! empty( $image_info['data'] ) ) { + if ( ! empty( $image_info['data'] ) && ! empty( $image_info['mime'] ) ) { + $mime = explode( '/', $image_info['mime'] ); - $thumb_upload_info = wp_upload_bits( $title_info . '.' . $mime[ count( $mime ) - 1 ], null, $image_info['data'] ); - - if ( is_array( $thumb_upload_info ) && ! empty( $thumb_upload_info['url'] ) ) { - $media_obj->model->update( - array( - 'cover_art' => $thumb_upload_info['url'], - ), - array( - 'id' => $id, - ) - ); + if ( ! empty( $mime ) && is_array( $mime ) ) { + $thumb_upload_info = wp_upload_bits( $title_info . '.' . $mime[ count( $mime ) - 1 ], null, $image_info['data'] ); + if ( ! empty( $thumb_upload_info['url'] ) ) { + $media_obj->model->update( + array( + 'cover_art' => $thumb_upload_info['url'], + ), + array( + 'id' => $id, + ) + ); - return $thumb_upload_info['url']; + return $thumb_upload_info['url']; + } } } @@ -3195,7 +3195,6 @@ function rtm_get_music_cover_art( $media_object ) { ); return false; - } if ( ! function_exists( 'get_music_cover_art' ) ) { From 9b66f5e26162e54264865022db689b52dc7eaf42 Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Fri, 10 Jul 2020 12:30:46 +0530 Subject: [PATCH 20/21] Update function doc comment --- app/main/controllers/template/rtmedia-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/controllers/template/rtmedia-functions.php b/app/main/controllers/template/rtmedia-functions.php index 3b036b10e..230ee3686 100644 --- a/app/main/controllers/template/rtmedia-functions.php +++ b/app/main/controllers/template/rtmedia-functions.php @@ -3141,7 +3141,7 @@ function rtmedia_who_like_html( $like_count = false, $user_like_it = false ) { * * @param object $media_object Media details object. * - * @return bool|string Uploaded thumbnail URL | False. + * @return string|bool Uploaded thumbnail URL | False. */ function rtm_get_music_cover_art( $media_object ) { From ac11331f79e44db2ac696c5fc7170c53ebd2f4ef Mon Sep 17 00:00:00 2001 From: Siddharth Tikekar Date: Wed, 15 Jul 2020 18:02:14 +0530 Subject: [PATCH 21/21] Version update v4.6.4 --- README.md | 15 ++++ index.php | 4 +- languages/buddypress-media.po | 162 +++++++++++++++++----------------- readme.txt | 24 ++++- 4 files changed, 118 insertions(+), 87 deletions(-) diff --git a/README.md b/README.md index 8c45c0ae1..bfba49781 100755 --- a/README.md +++ b/README.md @@ -147,6 +147,21 @@ https://www.youtube.com/watch?v=dJrykKQGDcs ## Changelog ## +### 4.6.4 [July 16, 2020] ### + +* Enhancement + * Support for Amazon S3 presigned URLs + * Add attachment_ids in `rtmedia_after_add_media` action hook + +* FIXED + + * Console errors on media editing + * Extension getting changed when renaming media before upload + * Activities not in sync with other subsites in a multisite network, when each subsite has a separate BuddyPress activity feed + * PHP Notices and Warnings + * Comment nesting issue with media activities + * Wrong timestamp while adding comments + ### 4.6.3 [April 30, 2020] ### * FIXED diff --git a/index.php b/index.php index 4d2b73504..df37472f6 100755 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: rtMedia for WordPress, BuddyPress and bbPress Plugin URI: https://rtmedia.io/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously! - Version: 4.6.3 + Version: 4.6.4 Author: rtCamp Text Domain: buddypress-media Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media @@ -21,7 +21,7 @@ /** * The version of the plugin */ - define( 'RTMEDIA_VERSION', '4.6.3' ); + define( 'RTMEDIA_VERSION', '4.6.4' ); } if ( ! defined( 'RTMEDIA_PATH' ) ) { diff --git a/languages/buddypress-media.po b/languages/buddypress-media.po index bad631d44..b90591241 100644 --- a/languages/buddypress-media.po +++ b/languages/buddypress-media.po @@ -2,9 +2,9 @@ # This file is distributed under the same license as the rtMedia for WordPress, BuddyPress and bbPress package. msgid "" msgstr "" -"Project-Id-Version: rtMedia for WordPress, BuddyPress and bbPress 4.6.3\n" +"Project-Id-Version: rtMedia for WordPress, BuddyPress and bbPress 4.6.4\n" "Report-Msgid-Bugs-To: https://rtmedia.io/support/\n" -"POT-Creation-Date: 2020-04-30 10:14:18+00:00\n" +"POT-Creation-Date: 2020-07-15 12:31:21+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -2286,7 +2286,7 @@ msgid "No time remaining." msgstr "" #: app/main/RTMedia.php:162 app/main/RTMedia.php:1498 -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:744 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:727 #: app/main/controllers/shortcodes/RTMediaGalleryShortcode.php:112 #: app/main/controllers/upload/processors/RTMediaUploadFile.php:246 msgid "Media Files" @@ -2460,16 +2460,16 @@ msgstr "" #: app/main/RTMedia.php:1344 #: app/main/controllers/media/RTMediaGalleryItemAction.php:86 #: app/main/controllers/media/RTMediaGalleryItemAction.php:109 -#: app/main/controllers/template/rtmedia-functions.php:1261 -#: app/main/controllers/template/rtmedia-functions.php:1280 +#: app/main/controllers/template/rtmedia-functions.php:1277 +#: app/main/controllers/template/rtmedia-functions.php:1296 msgid "Edit" msgstr "" #: app/main/RTMedia.php:1345 #: app/main/controllers/media/RTMediaGalleryItemAction.php:89 #: app/main/controllers/media/RTMediaGalleryItemAction.php:109 -#: app/main/controllers/template/rtmedia-functions.php:2220 -#: app/main/controllers/template/rtmedia-functions.php:2229 +#: app/main/controllers/template/rtmedia-functions.php:2236 +#: app/main/controllers/template/rtmedia-functions.php:2245 #: templates/media/album-single-edit.php:94 msgid "Delete" msgstr "" @@ -2558,61 +2558,61 @@ msgstr "" msgid "I agree to" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:457 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:456 #: app/main/controllers/upload/RTMediaUploadEndpoint.php:60 #: app/main/controllers/upload/RTMediaUploadEndpoint.php:74 msgid "Terms and Conditions checkbox not found!" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:791 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:774 #: app/main/controllers/media/RTMediaComment.php:204 #: app/main/controllers/shortcodes/RTMediaUploadShortcode.php:125 -#: app/main/controllers/template/rtmedia-functions.php:2259 +#: app/main/controllers/template/rtmedia-functions.php:2275 msgid "You are not allowed to upload/attach media." msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:938 -#: app/main/controllers/media/RTMediaMedia.php:782 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:921 +#: app/main/controllers/media/RTMediaMedia.php:793 #. translators: 1: user link, 2: media. #. translators: 1: username, 2: media type, 3: media name, 4: total media. msgid "%1$s added a %2$s" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:946 -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:949 -#: app/main/controllers/upload/RTMediaUploadEndpoint.php:278 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:929 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:932 +#: app/main/controllers/upload/RTMediaUploadEndpoint.php:279 #. translators: 1: user link, 2: media count, 3: media. #. translators: 1: user link, 2: media count, 3: rtMedia slug. #. translators: 1: Username, 2: Number of medias, 3: Media slug. msgid "%1$s added %2$d %3$s" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1003 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:986 #. translators: 1: username, 2: media, 3: group name. msgid "%1$s liked a %2$s in the group %3$s" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1007 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:990 #. translators: 1: username, 2: media. msgid "%1$s liked their %2$s" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1012 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:995 #. translators: 1: username, 2: author, 3: media. msgid "%1$s liked %2$s's %3$s" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1102 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1085 #. translators: 1: username, 2: media, 3: group name. msgid "%1$s commented on a %2$s in the group %3$s" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1107 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1090 #. translators: 1: username, 2: media. msgid "%1$s commented on their %2$s" msgstr "" -#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1112 +#: app/main/controllers/activity/RTMediaBuddyPressActivity.php:1095 #. translators: 1: username, 2: author, 3: media. msgid "%1$s commented on %2$s's %3$s" msgstr "" @@ -2997,11 +2997,11 @@ msgstr "" msgid " to login." msgstr "" -#: app/main/controllers/media/RTMediaMedia.php:650 +#: app/main/controllers/media/RTMediaMedia.php:661 msgid "Error creating attachment for the media file, please try again" msgstr "" -#: app/main/controllers/media/RTMediaMedia.php:782 +#: app/main/controllers/media/RTMediaMedia.php:793 msgid "%1$s added %4$d %3$s" msgstr "" @@ -3168,7 +3168,7 @@ msgid "Doing wrong, invalid AJAX request!" msgstr "" #: app/main/controllers/template/rtmedia-ajax-actions.php:144 -#: app/main/controllers/template/rtmedia-functions.php:2157 +#: app/main/controllers/template/rtmedia-functions.php:2173 msgid "Comment" msgstr "" @@ -3184,202 +3184,202 @@ msgstr "" msgid "Delete Album" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:918 -#: app/main/controllers/template/rtmedia-functions.php:4633 +#: app/main/controllers/template/rtmedia-filters.php:931 +#: app/main/controllers/template/rtmedia-functions.php:4650 msgid "rtMedia Shortcode Uploads" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:922 -#: app/main/controllers/template/rtmedia-functions.php:4515 +#: app/main/controllers/template/rtmedia-filters.php:935 +#: app/main/controllers/template/rtmedia-functions.php:4532 msgid "rtMedia Activities" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:926 +#: app/main/controllers/template/rtmedia-filters.php:939 msgid "rtMedia Comments" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:930 -#: app/main/controllers/template/rtmedia-functions.php:4860 +#: app/main/controllers/template/rtmedia-filters.php:943 +#: app/main/controllers/template/rtmedia-functions.php:4877 msgid "rtMedia Media Views" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:934 -#: app/main/controllers/template/rtmedia-functions.php:4961 +#: app/main/controllers/template/rtmedia-filters.php:947 +#: app/main/controllers/template/rtmedia-functions.php:4978 msgid "rtMedia Media Likes" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:952 +#: app/main/controllers/template/rtmedia-filters.php:965 msgid "rtMedia Eraser" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:957 +#: app/main/controllers/template/rtmedia-filters.php:970 msgid "rtMedia Likes Eraser" msgstr "" -#: app/main/controllers/template/rtmedia-filters.php:962 +#: app/main/controllers/template/rtmedia-filters.php:975 msgid "rtMedia Album Eraser" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:1346 +#: app/main/controllers/template/rtmedia-functions.php:1362 msgid "There are no comments on this media yet." msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:1382 +#: app/main/controllers/template/rtmedia-functions.php:1398 #. translators: %s Count of comments. msgid "Show all %s comments" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:1415 +#: app/main/controllers/template/rtmedia-functions.php:1431 msgid "Delete Comment" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:1773 +#: app/main/controllers/template/rtmedia-functions.php:1789 msgid "Go to page no : " msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:1778 +#: app/main/controllers/template/rtmedia-functions.php:1794 msgid "Go" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:2155 +#: app/main/controllers/template/rtmedia-functions.php:2171 msgid "Type Comment..." msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:2220 -#: app/main/controllers/template/rtmedia-functions.php:2229 +#: app/main/controllers/template/rtmedia-functions.php:2236 +#: app/main/controllers/template/rtmedia-functions.php:2245 msgid "Delete Media" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:2483 +#: app/main/controllers/template/rtmedia-functions.php:2499 msgid "Profile Albums" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:2487 -#: app/main/controllers/template/rtmedia-functions.php:2536 +#: app/main/controllers/template/rtmedia-functions.php:2503 +#: app/main/controllers/template/rtmedia-functions.php:2552 msgid "Group Albums" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:2717 +#: app/main/controllers/template/rtmedia-functions.php:2733 msgid "Privacy : " msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3069 +#: app/main/controllers/template/rtmedia-functions.php:3085 msgid "You like this" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3083 +#: app/main/controllers/template/rtmedia-functions.php:3099 msgid "You and " msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3106 +#: app/main/controllers/template/rtmedia-functions.php:3122 msgid " person likes this" msgid_plural " people like this" msgstr[0] "" msgstr[1] "" -#: app/main/controllers/template/rtmedia-functions.php:3227 +#: app/main/controllers/template/rtmedia-functions.php:3242 msgid "Public" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3232 +#: app/main/controllers/template/rtmedia-functions.php:3247 msgid "All members" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3237 +#: app/main/controllers/template/rtmedia-functions.php:3252 msgid "Your friends" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3242 +#: app/main/controllers/template/rtmedia-functions.php:3257 msgid "Only you" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3247 +#: app/main/controllers/template/rtmedia-functions.php:3262 msgid "Blocked temporarily" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3305 +#: app/main/controllers/template/rtmedia-functions.php:3320 #. translators: %s: count of hour/minute/second. msgid "%s ago " msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:3325 +#: app/main/controllers/template/rtmedia-functions.php:3342 #. translators: %s: number of seconds. msgid "%s second" msgid_plural "%s seconds" msgstr[0] "" msgstr[1] "" -#: app/main/controllers/template/rtmedia-functions.php:3330 +#: app/main/controllers/template/rtmedia-functions.php:3347 #. translators: %s: number of minutes. msgid "%s minute" msgid_plural "%s minutes" msgstr[0] "" msgstr[1] "" -#: app/main/controllers/template/rtmedia-functions.php:3335 +#: app/main/controllers/template/rtmedia-functions.php:3352 #. translators: %s: number of hours. msgid "%s hour" msgid_plural "%s hours" msgstr[0] "" msgstr[1] "" -#: app/main/controllers/template/rtmedia-functions.php:3962 +#: app/main/controllers/template/rtmedia-functions.php:3979 #. translators: %s: date format, see http:php.net/date. msgid "View Conversation" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4541 +#: app/main/controllers/template/rtmedia-functions.php:4558 msgid "Activity Date" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4545 +#: app/main/controllers/template/rtmedia-functions.php:4562 msgid "Activity Content" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4549 -#: app/main/controllers/template/rtmedia-functions.php:4770 +#: app/main/controllers/template/rtmedia-functions.php:4566 +#: app/main/controllers/template/rtmedia-functions.php:4787 msgid "Attachments" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4642 +#: app/main/controllers/template/rtmedia-functions.php:4659 msgid "Media Upload Date" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4646 +#: app/main/controllers/template/rtmedia-functions.php:4663 msgid "Media Title" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4650 -#: app/main/controllers/template/rtmedia-functions.php:4864 -#: app/main/controllers/template/rtmedia-functions.php:4965 +#: app/main/controllers/template/rtmedia-functions.php:4667 +#: app/main/controllers/template/rtmedia-functions.php:4881 +#: app/main/controllers/template/rtmedia-functions.php:4982 msgid "Media URL" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4654 +#: app/main/controllers/template/rtmedia-functions.php:4671 msgid "Album Title" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4742 +#: app/main/controllers/template/rtmedia-functions.php:4759 msgid "rtMedia Activity Comments" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4762 +#: app/main/controllers/template/rtmedia-functions.php:4779 msgid "Comment Date" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4766 +#: app/main/controllers/template/rtmedia-functions.php:4783 msgid "Comment Content" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4868 +#: app/main/controllers/template/rtmedia-functions.php:4885 msgid "Number of Views" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4872 +#: app/main/controllers/template/rtmedia-functions.php:4889 msgid "Date of First View" msgstr "" -#: app/main/controllers/template/rtmedia-functions.php:4969 +#: app/main/controllers/template/rtmedia-functions.php:4986 msgid "Date" msgstr "" @@ -3473,7 +3473,7 @@ msgid "Album List" msgstr "" #: templates/media/album-gallery.php:83 templates/media/media-gallery.php:123 -#: templates/media/media-single-edit.php:73 +#: templates/media/media-single-edit.php:74 #: templates/media/media-single.php:212 msgid "Sorry !! There's no media found for the request !!" msgstr "" @@ -3497,7 +3497,7 @@ msgid "Description: " msgstr "" #: templates/media/album-single-edit.php:71 -#: templates/media/media-single-edit.php:60 +#: templates/media/media-single-edit.php:61 msgid "Back" msgstr "" @@ -3537,11 +3537,11 @@ msgstr "" msgid "Media Gallery" msgstr "" -#: templates/media/media-single-edit.php:58 +#: templates/media/media-single-edit.php:60 msgid "Save" msgstr "" -#: templates/media/media-single-edit.php:67 +#: templates/media/media-single-edit.php:68 msgid "Sorry !! You do not have rights to edit this media" msgstr "" diff --git a/readme.txt b/readme.txt index 5e01034e6..dcd355c14 100755 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Tags: BuddyPress, media, multimedia, album, audio, songs, music, video, photo, i License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Requires at least: WordPress 4.1 -Tested up to: 5.4 -Stable tag: 4.6.3 +Tested up to: 5.4.2 +Stable tag: 4.6.4 Add albums, photo, audio/video upload, privacy, sharing, front-end uploads & more. All this works on mobile/tablets devices. @@ -134,6 +134,22 @@ http://www.youtube.com/watch?v=dJrykKQGDcs == Changelog == += 4.6.4 [July 16, 2020] = + +* Enhancement + + * Support for Amazon S3 presigned URLs + * Add attachment_ids in `rtmedia_after_add_media` action hook + +* FIXED + + * Console errors on media editing + * Extension getting changed when renaming media before upload + * Activities not in sync with other subsites in a multisite network, when each subsite has a separate BuddyPress activity feed + * PHP Notices and Warnings + * Comment nesting issue with media activities + * Wrong timestamp while adding comments + = 4.6.3 [April 30, 2020] = * FIXED @@ -1693,8 +1709,8 @@ http://www.youtube.com/watch?v=dJrykKQGDcs == Upgrade Notice == -= 4.6.3 = -rtMedia 4.6.3 with added fix for fatal errors issue with Yoast plugin along with the missing timestamp of media and added script tag for rtMedia social sync add-on += 4.6.4 = +rtMedia 4.6.4 with support for Amazon S3 presigned URLs, along with some fixes such as: issue with nested comments, activities sync issue in a multisite network and other small fixes and improvements. == Sponsors ==