From d3fd0bd3be13f9e3b060e7bf6b77b499f7e2ada4 Mon Sep 17 00:00:00 2001
From: rtBot <43742164+rtBot@users.noreply.github.com>
Date: Thu, 10 Sep 2020 11:14:14 +0000
Subject: [PATCH 01/16] Remove vault dependency from workflows
---
.github/workflows/phpcs_on_pull_request.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/phpcs_on_pull_request.yml b/.github/workflows/phpcs_on_pull_request.yml
index 2b6579e0..b431e111 100644
--- a/.github/workflows/phpcs_on_pull_request.yml
+++ b/.github/workflows/phpcs_on_pull_request.yml
@@ -12,7 +12,6 @@ jobs:
uses: rtCamp/action-phpcs-code-review@master
env:
SKIP_FOLDERS: "tests,.github"
- VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
- VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
+ GH_BOT_TOKEN: ${{ secrets.RTBOT_TOKEN }}
with:
args: WordPress,WordPress-Core,WordPress-Docs
From df919b57ef900c596f8f70c3a81020553db1c47b Mon Sep 17 00:00:00 2001
From: Ravat Parmar
Date: Mon, 28 Sep 2020 17:06:37 +0530
Subject: [PATCH 02/16] Added WP Job Manager plugin parameter in transcoder to
fix conflict
---
admin/rt-transcoder-handler.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index 251534cb..73920cd5 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -1129,7 +1129,11 @@ public function handle_callback() {
die();
}
} else {
- if ( isset( $job_id ) && class_exists( 'RTDBModel' ) ) {
+
+ // To check if request is sumitted from the WP Job Manager plugin ( https://wordpress.org/plugins/wp-job-manager/ ).
+ $job_manager_form = transcoder_filter_input( INPUT_POST, 'job_manager_form', FILTER_SANITIZE_STRING );
+
+ if ( isset( $job_id ) && ! empty( $job_id ) && class_exists( 'RTDBModel' ) && empty( $job_manager_form ) ) {
$has_thumbs = isset( $thumbnail ) ? true : false;
$flag = false;
From 738615cb0361bb96ea4a479807ffa450158bb92a Mon Sep 17 00:00:00 2001
From: Ravat Parmar
Date: Mon, 28 Sep 2020 17:15:04 +0530
Subject: [PATCH 03/16] Fix PHPCS issues
---
admin/rt-transcoder-handler.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index 73920cd5..070a9207 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -1130,7 +1130,7 @@ public function handle_callback() {
}
} else {
- // To check if request is sumitted from the WP Job Manager plugin ( https://wordpress.org/plugins/wp-job-manager/ ).
+ // To check if request is sumitted from the WP Job Manager plugin ( https://wordpress.org/plugins/wp-job-manager/ ).
$job_manager_form = transcoder_filter_input( INPUT_POST, 'job_manager_form', FILTER_SANITIZE_STRING );
if ( isset( $job_id ) && ! empty( $job_id ) && class_exists( 'RTDBModel' ) && empty( $job_manager_form ) ) {
From 0dcf870b25af9c86e1e28ac0714650c448a11cf4 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Tue, 3 Nov 2020 14:04:55 +0530
Subject: [PATCH 04/16] Add filter for transcoded video and thumbnail name
changes, deprecate old filter
---
admin/rt-transcoder-handler.php | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index 251534cb..e8915843 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -782,8 +782,23 @@ public function add_media_thumbnails( $post_array ) {
$temp_name = $thumbinfo['basename'];
$temp_name = urldecode( $temp_name );
$temp_name_array = explode( '/', $temp_name );
- $temp_name = $temp_name_array[ count( $temp_name_array ) - 1 ];
- $thumbinfo['basename'] = apply_filters( 'transcoded_temp_filename', $temp_name );
+ $thumbinfo['basename'] = $temp_name_array[ count( $temp_name_array ) - 1 ];
+
+ /**
+ * Filter: 'transcoded_temp_filename' - Allows changes for the thumbnail name.
+ *
+ * @deprecated 1.3.2. Use the {@see 'transcoded_thumb_filename'} filter instead.
+ */
+ $thumbinfo['basename'] = apply_filters_deprecated( 'transcoded_temp_filename', array( $thumbinfo['basename'] ), '1.3.2', 'transcoded_thumb_filename' );
+
+ /**
+ * Allows users/plugins to filter the thumbnail Name
+ *
+ * @since 1.3.2
+ *
+ * @param string $temp_name Contains the thumbnail public name
+ */
+ $thumbinfo['basename'] = apply_filters( 'transcoded_thumb_filename', $thumbinfo['basename'] );
if ( 'wp-media' !== $post_thumbs_array['job_for'] ) {
add_filter( 'upload_dir', array( $this, 'upload_dir' ) );
@@ -920,7 +935,15 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
add_filter( 'upload_dir', array( $this, 'upload_dir' ) );
}
- $upload_info = wp_upload_bits( $new_wp_attached_file_pathinfo['basename'], null, $file_content );
+ /**
+ * Allows users/plugins to filter the transcoded file Name
+ *
+ * @since 1.0.5
+ *
+ * @param string $new_wp_attached_file_pathinfo['basename'] Contains the file public name
+ */
+ $video_url = apply_filters( 'transcoded_video_filename', $new_wp_attached_file_pathinfo['basename'] );
+ $upload_info = wp_upload_bits( $video_url, null, $file_content );
/**
* Allow users to filter/perform action on uploaded transcoded file.
From fca5154de73c674ae742dc104317a592d0b7565a Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Wed, 23 Dec 2020 11:55:16 +0530
Subject: [PATCH 05/16] Change message to show on deprecated
transcoded_temp_filename filter
---
admin/rt-transcoder-handler.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index e8915843..be7b864e 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -789,7 +789,7 @@ public function add_media_thumbnails( $post_array ) {
*
* @deprecated 1.3.2. Use the {@see 'transcoded_thumb_filename'} filter instead.
*/
- $thumbinfo['basename'] = apply_filters_deprecated( 'transcoded_temp_filename', array( $thumbinfo['basename'] ), '1.3.2', 'transcoded_thumb_filename' );
+ $thumbinfo['basename'] = apply_filters_deprecated( 'transcoded_temp_filename', array( $thumbinfo['basename'] ), '1.3.2', 'transcoded_thumb_filename', __( 'Use transcoded_thumb_filename filter to modify video thumbnail name and transcoded_video_filename filter to modify video file name.', 'transcoder' ) );
/**
* Allows users/plugins to filter the thumbnail Name
From 7d95a3dddd99671f0a5dcb8bcd6fae6c325bfe27 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Fri, 25 Dec 2020 12:16:10 +0530
Subject: [PATCH 06/16] Resolve errors while transcoding thumbnails
---
admin/rt-transcoder-handler.php | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index be7b864e..a3d72f8d 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -775,9 +775,10 @@ public function add_media_thumbnails( $post_array ) {
$largest_thumb = false;
$largest_thumb_url = false;
$upload_thumbnail_array = array();
+ $failed_thumbnails = false;
foreach ( $post_thumbs_array['thumbnail'] as $thumbnail ) {
- $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail ) : wp_remote_get( $thumbnail ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
+ $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail, [ 'timeout' => 3000 ] ) : wp_remote_get( $thumbnail, [ 'timeout' => 3000 ] ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
$thumbinfo = pathinfo( $thumbnail );
$temp_name = $thumbinfo['basename'];
$temp_name = urldecode( $temp_name );
@@ -798,7 +799,12 @@ public function add_media_thumbnails( $post_array ) {
*
* @param string $temp_name Contains the thumbnail public name
*/
- $thumbinfo['basename'] = apply_filters( 'transcoded_thumb_filename', $thumbinfo['basename'] );
+ $thumbinfo['basename'] = apply_filters( 'transcoded_thumb_filename', $thumbinfo['basename'], $post_array );
+
+ // Verify Extension.
+ if ( empty( pathinfo( $thumbinfo['basename'], PATHINFO_EXTENSION ) ) ) {
+ $thumbinfo['basename'] .= '.' . $thumbinfo['extension'];
+ }
if ( 'wp-media' !== $post_thumbs_array['job_for'] ) {
add_filter( 'upload_dir', array( $this, 'upload_dir' ) );
@@ -807,6 +813,11 @@ public function add_media_thumbnails( $post_array ) {
// Create a file in the upload folder with given content.
$thumb_upload_info = wp_upload_bits( $thumbinfo['basename'], null, $thumbresource['body'] );
+ // Check error.
+ if ( ! empty( $thumb_upload_info['error'] ) ) {
+ $failed_thumbnails = $thumb_upload_info;
+ }
+
/**
* Allow users to filter/perform action on uploaded transcoded file.
*
@@ -817,7 +828,6 @@ public function add_media_thumbnails( $post_array ) {
* and $thumb_upload_info['file'] contains the file physical path
* @param int $post_id Contains the attachment ID for which transcoded file is uploaded
*/
-
$thumb_upload_info = apply_filters( 'transcoded_file_stored', $thumb_upload_info, $post_id );
if ( 'wp-media' !== $post_thumbs_array['job_for'] ) {
@@ -849,6 +859,10 @@ public function add_media_thumbnails( $post_array ) {
}
}
+ if ( false !== $failed_thumbnails && ! empty( $failed_thumbnails['error'] ) ) {
+ $this->nofity_transcoding_failed( $post_array['job_id'], sprintf( 'Failed saving of Thumbnail for %1$s.', $post_array['file_name'] ) );
+ }
+
update_post_meta( $post_id, '_rt_media_source', $post_thumbs_array['job_for'] );
update_post_meta( $post_id, '_rt_media_thumbnails', $upload_thumbnail_array );
@@ -938,7 +952,7 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
/**
* Allows users/plugins to filter the transcoded file Name
*
- * @since 1.0.5
+ * @since 1.3.2
*
* @param string $new_wp_attached_file_pathinfo['basename'] Contains the file public name
*/
From 21cdf109c291f0bbd26f8018caae8df5d192300e Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Fri, 25 Dec 2020 12:19:27 +0530
Subject: [PATCH 07/16] Resolve PHPCS warnings
---
admin/rt-transcoder-handler.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index a3d72f8d..cbc3fb18 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -778,7 +778,7 @@ public function add_media_thumbnails( $post_array ) {
$failed_thumbnails = false;
foreach ( $post_thumbs_array['thumbnail'] as $thumbnail ) {
- $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail, [ 'timeout' => 3000 ] ) : wp_remote_get( $thumbnail, [ 'timeout' => 3000 ] ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
+ $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail, array( 'timeout' => 3000 ) ) : wp_remote_get( $thumbnail, array( 'timeout' => 3000 ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
$thumbinfo = pathinfo( $thumbnail );
$temp_name = $thumbinfo['basename'];
$temp_name = urldecode( $temp_name );
From 875ee431083aa88b93642f59b7702c811b84f469 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Fri, 25 Dec 2020 13:37:49 +0530
Subject: [PATCH 08/16] Remove post array from transcoded_thumb_filename filter
---
admin/rt-transcoder-handler.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index cbc3fb18..a94ed084 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -799,7 +799,7 @@ public function add_media_thumbnails( $post_array ) {
*
* @param string $temp_name Contains the thumbnail public name
*/
- $thumbinfo['basename'] = apply_filters( 'transcoded_thumb_filename', $thumbinfo['basename'], $post_array );
+ $thumbinfo['basename'] = apply_filters( 'transcoded_thumb_filename', $thumbinfo['basename'] );
// Verify Extension.
if ( empty( pathinfo( $thumbinfo['basename'], PATHINFO_EXTENSION ) ) ) {
From 02c54d4059338bd6b0389b07886643fcb6f307c1 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Mon, 28 Dec 2020 10:09:14 +0530
Subject: [PATCH 09/16] Change timeout for requests to remove notices
---
admin/rt-transcoder-handler.php | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index a94ed084..d7828656 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -778,7 +778,7 @@ public function add_media_thumbnails( $post_array ) {
$failed_thumbnails = false;
foreach ( $post_thumbs_array['thumbnail'] as $thumbnail ) {
- $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail, array( 'timeout' => 3000 ) ) : wp_remote_get( $thumbnail, array( 'timeout' => 3000 ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
+ $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail, '', 3, 3 ) : wp_remote_get( $thumbnail, array( 'timeout' => 30 ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
$thumbinfo = pathinfo( $thumbnail );
$temp_name = $thumbinfo['basename'];
$temp_name = urldecode( $temp_name );
@@ -935,8 +935,15 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
$new_wp_attached_file_pathinfo = pathinfo( $download_url );
$post_mime_type = 'mp4' === $new_wp_attached_file_pathinfo['extension'] ? 'video/mp4' : 'audio/mp3';
$attachemnt_url = wp_get_attachment_url( $attachment_id );
+
+ $timeout = 5;
+
+ if ( 'video/mp4' === $post_mime_type ) {
+ $timeout = 30;
+ }
+
try {
- $response = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $download_url, '', 3, 3 ) : wp_remote_get( $download_url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
+ $response = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $download_url, '', 3, 3 ) : wp_remote_get( $download_url, array( 'timeout' => $timeout ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
} catch ( Exception $e ) {
$flag = $e->getMessage();
}
@@ -1028,6 +1035,7 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
} else {
$uploads = wp_upload_dir();
}
+
if ( 'video/mp4' === $post_mime_type ) {
$media_type = 'mp4';
} elseif ( 'audio/mp3' === $post_mime_type ) {
From 504402b8ffbc5a090cd50cf831387197ed6e2fec Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Mon, 28 Dec 2020 18:01:29 +0530
Subject: [PATCH 10/16] Change timeout for requests to remove notices
---
admin/rt-transcoder-handler.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index d7828656..49a654ad 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -778,7 +778,7 @@ public function add_media_thumbnails( $post_array ) {
$failed_thumbnails = false;
foreach ( $post_thumbs_array['thumbnail'] as $thumbnail ) {
- $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail, '', 3, 3 ) : wp_remote_get( $thumbnail, array( 'timeout' => 30 ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
+ $thumbresource = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( $thumbnail, '', 3, 3 ) : wp_remote_get( $thumbnail, array( 'timeout' => 120 ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
$thumbinfo = pathinfo( $thumbnail );
$temp_name = $thumbinfo['basename'];
$temp_name = urldecode( $temp_name );
@@ -939,7 +939,7 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
$timeout = 5;
if ( 'video/mp4' === $post_mime_type ) {
- $timeout = 30;
+ $timeout = 120;
}
try {
From 73813a01379670a2a804fc280934b3b92553275d Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Mon, 28 Dec 2020 18:45:58 +0530
Subject: [PATCH 11/16] Replace wp_remote_get with wp_safe_remote_get
---
admin/rt-transcoder-handler.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index 251534cb..896e699b 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -357,7 +357,7 @@ public function is_valid_key( $key ) {
if ( function_exists( 'vip_safe_wp_remote_get' ) ) {
$validation_page = vip_safe_wp_remote_get( $validate_url, '', 3, 3 );
} else {
- $validation_page = wp_remote_get( $validate_url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
+ $validation_page = wp_safe_remote_get( $validate_url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
}
if ( ! is_wp_error( $validation_page ) ) {
$validation_info = json_decode( $validation_page['body'] );
@@ -385,7 +385,7 @@ public function update_usage( $key ) {
if ( function_exists( 'vip_safe_wp_remote_get' ) ) {
$usage_page = vip_safe_wp_remote_get( $usage_url, '', 3, 3 );
} else {
- $usage_page = wp_remote_get( $usage_url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
+ $usage_page = wp_safe_remote_get( $usage_url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
}
if ( ! is_wp_error( $usage_page ) ) {
$usage_info = json_decode( $usage_page['body'] );
@@ -1451,7 +1451,7 @@ public function get_transcoding_status( $post_id ) {
if ( function_exists( 'vip_safe_wp_remote_get' ) ) {
$status_page = vip_safe_wp_remote_get( $status_url, '', 3, 3 );
} else {
- $status_page = wp_remote_get( $status_url, array( 'timeout' => 120 ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
+ $status_page = wp_safe_remote_get( $status_url, array( 'timeout' => 120 ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout
}
if ( ! is_wp_error( $status_page ) ) {
From fe5bad7c812a7cb55376a4d62707fe450f6977d3 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Fri, 8 Jan 2021 18:16:40 +0530
Subject: [PATCH 12/16] Resolve issue with Video trancoding thumbnail auto load
---
admin/rt-transcoder-handler.php | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php
index e68c1eee..8186c8c7 100755
--- a/admin/rt-transcoder-handler.php
+++ b/admin/rt-transcoder-handler.php
@@ -963,8 +963,14 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for
*
* @param string $new_wp_attached_file_pathinfo['basename'] Contains the file public name
*/
- $video_url = apply_filters( 'transcoded_video_filename', $new_wp_attached_file_pathinfo['basename'] );
- $upload_info = wp_upload_bits( $video_url, null, $file_content );
+ $file_name = apply_filters( 'transcoded_video_filename', $new_wp_attached_file_pathinfo['basename'] );
+
+ // Verify Extension.
+ if ( empty( pathinfo( $file_name, PATHINFO_EXTENSION ) ) ) {
+ $file_name .= '.' . $new_wp_attached_file_pathinfo['extension'];
+ }
+
+ $upload_info = wp_upload_bits( $file_name, null, $file_content );
/**
* Allow users to filter/perform action on uploaded transcoded file.
From 966fb665f4e17843f4f791ca7cb2deab43cd8f76 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Tue, 12 Jan 2021 13:47:08 +0530
Subject: [PATCH 13/16] Changes to remove notice for register_rest_route
function use
---
admin/rt-transcoder-rest-routes.php | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/admin/rt-transcoder-rest-routes.php b/admin/rt-transcoder-rest-routes.php
index 816e930c..c3576d28 100644
--- a/admin/rt-transcoder-rest-routes.php
+++ b/admin/rt-transcoder-rest-routes.php
@@ -34,8 +34,9 @@ public function register_routes() {
$this->namespace_prefix . $this->version,
'/amp-media/(?P\d+)',
array(
- 'methods' => WP_REST_Server::READABLE,
- 'callback' => array( $this, 'get_media_data' ),
+ 'methods' => WP_REST_Server::READABLE,
+ 'callback' => array( $this, 'get_media_data' ),
+ 'permission_callback' => '__return_true',
)
);
@@ -44,8 +45,9 @@ public function register_routes() {
$this->namespace_prefix . $this->version,
'/amp-rtmedia',
array(
- 'methods' => WP_REST_Server::READABLE,
- 'callback' => array( $this, 'get_rtmedia_data' ),
+ 'methods' => WP_REST_Server::READABLE,
+ 'callback' => array( $this, 'get_rtmedia_data' ),
+ 'permission_callback' => '__return_true',
)
);
}
From 98a49e11d748459aa504c27abdbf008ab16ed825 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Tue, 12 Jan 2021 14:40:56 +0530
Subject: [PATCH 14/16] Version update v1.3.2
---
README.md | 13 +++++++++++--
readme.txt | 19 ++++++++++++++-----
rt-transcoder.php | 4 ++--
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 1644ce8d..0d51c57a 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Transcoding services for ANY WordPress website. Convert audio/video files of any
-* **Contributors:** [rtcamp] (http://profiles.wordpress.org/rtcamp), [mangeshp] (http://profiles.wordpress.org/mangeshp), [chandrapatel] (http://profiles.wordpress.org/chandrapatel), [manishsongirkar36] (http://profiles.wordpress.org/manishsongirkar36), [bhargavbhandari90] (http://profiles.wordpress.org/bhargavbhandari90), [kiranpotphode] (http://profiles.wordpress.org/kiranpotphode), [thrijith] (http://profiles.wordpress.org/thrijith), [devikvekariya] (http://profiles.wordpress.org/devikvekariya), [sagarnasit] (http://profiles.wordpress.org/sagarnasit), [sudhiryadav] (http://profiles.wordpress.org/sudhiryadav), [sid177] (https://profiles.wordpress.org/sid177/), [pooja1210] (https://profiles.wordpress.org/pooja1210/)
+* **Contributors:** [rtcamp] (http://profiles.wordpress.org/rtcamp), [mangeshp] (http://profiles.wordpress.org/mangeshp), [chandrapatel] (http://profiles.wordpress.org/chandrapatel), [manishsongirkar36] (http://profiles.wordpress.org/manishsongirkar36), [bhargavbhandari90] (http://profiles.wordpress.org/bhargavbhandari90), [kiranpotphode] (http://profiles.wordpress.org/kiranpotphode), [thrijith] (http://profiles.wordpress.org/thrijith), [devikvekariya] (http://profiles.wordpress.org/devikvekariya), [sagarnasit] (http://profiles.wordpress.org/sagarnasit), [sudhiryadav] (http://profiles.wordpress.org/sudhiryadav), [sid177] (https://profiles.wordpress.org/sid177/), [pooja1210] (https://profiles.wordpress.org/pooja1210/), [vaishu.agola27] (https://profiles.wordpress.org/vaishuagola27/)
* **License:** [GPL v2 or later] ( http://www.gnu.org/licenses/gpl-2.0.html)
@@ -65,6 +65,15 @@ Read [Documentation](https://rtmedia.io/docs/transcoder/?utm_source=readme&utm_m
1. Transcoder Settings
## Changelog ##
+#### 1.3.2 [January 12, 2021] ####
+
+* FIXED
+
+ * The conflict with temp_filename filter and modified the filter
+ * Compatibility issues with WordPress 5.6
+ * Conflicts with WP Job Manager plugin
+ * PHP Notices and Warnings
+
#### 1.3.1 [August 14, 2020] ####
* ENHANCEMENTS
@@ -190,4 +199,4 @@ Read [Documentation](https://rtmedia.io/docs/transcoder/?utm_source=readme&utm_m
#### 1.0.0 ####
Initial release
-Transcoder 1.3.1, with WordPress 5.5 compatibility and media thumbnails auto update feature after transcoding is completed on rtMedia pages.
+Transcoder 1.3.2, with WordPress 5.6 compatibility and some minor fixes and modification of transcoded_temp_filename filter.
diff --git a/readme.txt b/readme.txt
index bc73b232..0e54b728 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,10 +1,10 @@
=== Transcoder ===
-Contributors: rtcamp, mangeshp, chandrapatel, manishsongirkar36, bhargavbhandari90, kiranpotphode, thrijith, devikvekariya, sagarnasit, sudhiryadav, sid177, pooja1210
+Contributors: rtcamp, mangeshp, chandrapatel, manishsongirkar36, bhargavbhandari90, kiranpotphode, thrijith, devikvekariya, sagarnasit, sudhiryadav, sid177, pooja1210, vaishu.agola27
Tags: media, multimedia, audio, songs, music, video, ffmpeg, media-node, rtMedia, WordPress, kaltura, transcode, transcoder, encoding, encode
Donate link: https://rtcamp.com/donate/
Requires at least: 4.1
-Tested up to: 5.5
-Stable tag: 1.3.1
+Tested up to: 5.6
+Stable tag: 1.3.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -62,6 +62,15 @@ Read [Documentation](https://rtmedia.io/docs/transcoder/?utm_source=readme&utm_m
1. Transcoder Settings
== Changelog ==
+= 1.3.2 [January 12, 2021] =
+
+* FIXED
+
+ * The conflict with temp_filename filter and modified the filter
+ * Compatibility issues with WordPress 5.6
+ * Conflicts with WP Job Manager plugin
+ * PHP Notices and Warnings
+
= 1.3.1 [August 14, 2020] =
* ENHANCEMENTS
@@ -188,5 +197,5 @@ Read [Documentation](https://rtmedia.io/docs/transcoder/?utm_source=readme&utm_m
Initial release
== Upgrade Notice ==
-= 1.3.1 =
-Transcoder 1.3.1, with WordPress 5.5 compatibility and media thumbnails auto update feature after transcoding is completed on rtMedia pages.
+= 1.3.2 =
+Transcoder 1.3.2, with WordPress 5.6 compatibility and some minor fixes and modification of transcoded_temp_filename filter.
diff --git a/rt-transcoder.php b/rt-transcoder.php
index 1fbb1402..17977ef5 100644
--- a/rt-transcoder.php
+++ b/rt-transcoder.php
@@ -3,7 +3,7 @@
* Plugin Name: Transcoder
* Plugin URI: https://rtmedia.io/transcoder/?utm_source=dashboard&utm_medium=plugin&utm_campaign=transcoder
* Description: Audio & video transcoding services for ANY WordPress website. Allows you to convert audio/video files of any format to a web-friendly format (mp3/mp4).
- * Version: 1.3.1
+ * Version: 1.3.2
* Text Domain: transcoder
* Author: rtCamp
* Author URI: https://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=transcoder
@@ -39,7 +39,7 @@
/**
* The version of the plugin
*/
- define( 'RT_TRANSCODER_VERSION', '1.3.1' );
+ define( 'RT_TRANSCODER_VERSION', '1.3.2' );
}
if ( ! defined( 'RT_TRANSCODER_NO_MAIL' ) && defined( 'VIP_GO_APP_ENVIRONMENT' ) ) {
From 03d60c9c09d6e8034d7cdcf99ff900cce4a062de Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Tue, 12 Jan 2021 15:02:55 +0530
Subject: [PATCH 15/16] Update contributors
---
README.md | 2 +-
readme.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 0d51c57a..03f68340 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Transcoding services for ANY WordPress website. Convert audio/video files of any
-* **Contributors:** [rtcamp] (http://profiles.wordpress.org/rtcamp), [mangeshp] (http://profiles.wordpress.org/mangeshp), [chandrapatel] (http://profiles.wordpress.org/chandrapatel), [manishsongirkar36] (http://profiles.wordpress.org/manishsongirkar36), [bhargavbhandari90] (http://profiles.wordpress.org/bhargavbhandari90), [kiranpotphode] (http://profiles.wordpress.org/kiranpotphode), [thrijith] (http://profiles.wordpress.org/thrijith), [devikvekariya] (http://profiles.wordpress.org/devikvekariya), [sagarnasit] (http://profiles.wordpress.org/sagarnasit), [sudhiryadav] (http://profiles.wordpress.org/sudhiryadav), [sid177] (https://profiles.wordpress.org/sid177/), [pooja1210] (https://profiles.wordpress.org/pooja1210/), [vaishu.agola27] (https://profiles.wordpress.org/vaishuagola27/)
+* **Contributors:** [rtcamp] (http://profiles.wordpress.org/rtcamp), [mangeshp] (http://profiles.wordpress.org/mangeshp), [chandrapatel] (http://profiles.wordpress.org/chandrapatel), [manishsongirkar36] (http://profiles.wordpress.org/manishsongirkar36), [bhargavbhandari90] (http://profiles.wordpress.org/bhargavbhandari90), [kiranpotphode] (http://profiles.wordpress.org/kiranpotphode), [thrijith] (http://profiles.wordpress.org/thrijith), [devikvekariya] (http://profiles.wordpress.org/devikvekariya), [sagarnasit] (http://profiles.wordpress.org/sagarnasit), [sudhiryadav] (http://profiles.wordpress.org/sudhiryadav), [sid177] (https://profiles.wordpress.org/sid177/), [pooja1210] (https://profiles.wordpress.org/pooja1210/), [vaishu.agola27] (https://profiles.wordpress.org/vaishuagola27/), [ravatparmar] (https://profiles.wordpress.org/ravatparmar/)
* **License:** [GPL v2 or later] ( http://www.gnu.org/licenses/gpl-2.0.html)
diff --git a/readme.txt b/readme.txt
index 0e54b728..205a77aa 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,5 +1,5 @@
=== Transcoder ===
-Contributors: rtcamp, mangeshp, chandrapatel, manishsongirkar36, bhargavbhandari90, kiranpotphode, thrijith, devikvekariya, sagarnasit, sudhiryadav, sid177, pooja1210, vaishu.agola27
+Contributors: rtcamp, mangeshp, chandrapatel, manishsongirkar36, bhargavbhandari90, kiranpotphode, thrijith, devikvekariya, sagarnasit, sudhiryadav, sid177, pooja1210, vaishu.agola27,ravatparmar
Tags: media, multimedia, audio, songs, music, video, ffmpeg, media-node, rtMedia, WordPress, kaltura, transcode, transcoder, encoding, encode
Donate link: https://rtcamp.com/donate/
Requires at least: 4.1
From b17d378ec7689dd71bf2dc09792675824e5af7a2 Mon Sep 17 00:00:00 2001
From: Vaishali Agola
Date: Tue, 12 Jan 2021 16:13:35 +0530
Subject: [PATCH 16/16] Run grunt to update assets
---
languages/transcoder.pot | 66 ++++++++++++++++++++++------------------
1 file changed, 36 insertions(+), 30 deletions(-)
diff --git a/languages/transcoder.pot b/languages/transcoder.pot
index 6e1a7733..f8d71f9d 100644
--- a/languages/transcoder.pot
+++ b/languages/transcoder.pot
@@ -1,14 +1,14 @@
-# Copyright (C) 2020
+# Copyright (C) 2021
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://community.rtcamp.com/\n"
-"POT-Creation-Date: 2020-08-14 11:39:04+00:00\n"
+"POT-Creation-Date: 2021-01-12 10:42:24+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
"Last-Translator: Transcoder \n"
"Language-Team: Transcoder \n"
"Language: en\n"
@@ -416,7 +416,7 @@ msgstr ""
msgid " page."
msgstr ""
-#: admin/rt-transcoder-admin.php:204 admin/rt-transcoder-handler.php:1232
+#: admin/rt-transcoder-admin.php:204 admin/rt-transcoder-handler.php:1287
msgid "Please enter the license key."
msgstr ""
@@ -556,99 +556,105 @@ msgstr ""
msgid "Transcoding usage this month"
msgstr ""
-#: admin/rt-transcoder-handler.php:947
+#: admin/rt-transcoder-handler.php:793
+msgid ""
+"Use transcoded_thumb_filename filter to modify video thumbnail name and "
+"transcoded_video_filename filter to modify video file name."
+msgstr ""
+
+#: admin/rt-transcoder-handler.php:997
msgid "Could not read file."
msgstr ""
-#: admin/rt-transcoder-handler.php:960 admin/rt-transcoder-handler.php:1113
-#: admin/rt-transcoder-handler.php:1178
+#: admin/rt-transcoder-handler.php:1010 admin/rt-transcoder-handler.php:1164
+#: admin/rt-transcoder-handler.php:1233
msgid "Transcoding: Download Failed"
msgstr ""
-#: admin/rt-transcoder-handler.php:961 admin/rt-transcoder-handler.php:1114
-#: admin/rt-transcoder-handler.php:1179 admin/rt-transcoder-handler.php:1376
-#: admin/rt-transcoder-handler.php:1379
+#: admin/rt-transcoder-handler.php:1011 admin/rt-transcoder-handler.php:1165
+#: admin/rt-transcoder-handler.php:1234 admin/rt-transcoder-handler.php:1431
+#: admin/rt-transcoder-handler.php:1434
msgid "Media"
msgstr ""
-#: admin/rt-transcoder-handler.php:961 admin/rt-transcoder-handler.php:1114
+#: admin/rt-transcoder-handler.php:1011 admin/rt-transcoder-handler.php:1165
msgid " was successfully encoded but there was an error while downloading:"
msgstr ""
-#: admin/rt-transcoder-handler.php:961
+#: admin/rt-transcoder-handler.php:1011
msgid "You can "
msgstr ""
-#: admin/rt-transcoder-handler.php:961
+#: admin/rt-transcoder-handler.php:1011
msgid "retry the download"
msgstr ""
-#: admin/rt-transcoder-handler.php:974 admin/rt-transcoder-handler.php:1127
-#: admin/rt-transcoder-handler.php:1192
+#: admin/rt-transcoder-handler.php:1024 admin/rt-transcoder-handler.php:1178
+#: admin/rt-transcoder-handler.php:1247
msgid "Done"
msgstr ""
-#: admin/rt-transcoder-handler.php:1075
+#: admin/rt-transcoder-handler.php:1126
msgid "Something went wrong. Invalid post request."
msgstr ""
-#: admin/rt-transcoder-handler.php:1107 admin/rt-transcoder-handler.php:1172
+#: admin/rt-transcoder-handler.php:1158 admin/rt-transcoder-handler.php:1227
msgid ""
"Something went wrong. The required attachment id does not exists. It must "
"have been deleted."
msgstr ""
-#: admin/rt-transcoder-handler.php:1179
+#: admin/rt-transcoder-handler.php:1234
msgid " was successfully transcoded but there was an error while downloading:"
msgstr ""
-#: admin/rt-transcoder-handler.php:1244
+#: admin/rt-transcoder-handler.php:1299
msgid "Transcoding disabled successfully."
msgstr ""
-#: admin/rt-transcoder-handler.php:1255
+#: admin/rt-transcoder-handler.php:1310
msgid "Transcoding enabled successfully."
msgstr ""
-#: admin/rt-transcoder-handler.php:1372
+#: admin/rt-transcoder-handler.php:1427
msgid "Transcoding: Something went wrong."
msgstr ""
-#: admin/rt-transcoder-handler.php:1375
+#: admin/rt-transcoder-handler.php:1430
msgid " There was unexpected error occurred while transcoding this following media."
msgstr ""
-#: admin/rt-transcoder-handler.php:1380
+#: admin/rt-transcoder-handler.php:1435
msgid " there was unexpected error occurred while transcoding this media."
msgstr ""
-#: admin/rt-transcoder-handler.php:1415
+#: admin/rt-transcoder-handler.php:1470
msgid "Something went wrong. Please try again!"
msgstr ""
-#: admin/rt-transcoder-handler.php:1433 admin/rt-transcoder-handler.php:1469
+#: admin/rt-transcoder-handler.php:1488 admin/rt-transcoder-handler.php:1524
msgid "Your file is transcoded successfully. Please refresh the page."
msgstr ""
-#: admin/rt-transcoder-handler.php:1464
+#: admin/rt-transcoder-handler.php:1519
msgid ""
"Looks like the server is taking too long to respond, Please try again in "
"sometime."
msgstr ""
-#: admin/rt-transcoder-handler.php:1465
+#: admin/rt-transcoder-handler.php:1520
msgid "Unfortunately, Transcoder failed to transcode this file."
msgstr ""
-#: admin/rt-transcoder-handler.php:1466
+#: admin/rt-transcoder-handler.php:1521
msgid "Your file is getting transcoded. Please refresh after some time."
msgstr ""
-#: admin/rt-transcoder-handler.php:1467
+#: admin/rt-transcoder-handler.php:1522
msgid "This file is still in the queue. Please refresh after some time."
msgstr ""
-#: admin/rt-transcoder-handler.php:1468
+#: admin/rt-transcoder-handler.php:1523
msgid "Your server should be ready to receive the transcoded file."
msgstr ""