diff --git a/admin/rt-transcoder-admin.php b/admin/rt-transcoder-admin.php index bcd1c33..6bce904 100755 --- a/admin/rt-transcoder-admin.php +++ b/admin/rt-transcoder-admin.php @@ -69,6 +69,10 @@ public function __construct() { include_once RT_TRANSCODER_PATH . 'admin/rt-transcoder-actions.php'; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) ); + add_action( 'admin_notices', [ $this, 'show_transcoding_disabled_notice' ], 12 ); + if ( is_multisite() ) { + add_action( 'network_admin_notices', [ $this, 'show_transcoding_disabled_notice' ], 12 ); + } add_filter( 'attachment_fields_to_edit', array( $this, 'edit_video_thumbnail' ), 11, 2 ); add_filter( 'attachment_fields_to_save', array( $this, 'save_video_thumbnail' ), 11, 1 ); @@ -486,9 +490,6 @@ public function mediaelement_add_class( $output, $url ) { return sprintf( '%1$s', esc_url( $url ) ); } - /** - * Display GoDAM installation recommendation admin notice on specific pages. - */ public function install_godam_admin_notice() { $current_screen = get_current_screen(); @@ -501,15 +502,14 @@ public function install_godam_admin_notice() { 'plugins-network' ); - // Check if we’re on allowed page using screen ID or $_GET['page'] + // Check if we're on allowed page using screen ID or $_GET['page'] $current_page = isset( $_GET['page'] ) ? $_GET['page'] : ''; - $screen_id = isset( $current_screen->id ) ? $current_screen->id : ''; + $screen_id = isset( $current_screen->id ) ? $current_screen->id : ''; // Skip if not in our allowed pages - if ( - ( ! in_array( $current_page, $allowed_pages, true ) && ! in_array( $screen_id, $allowed_pages, true ) ) || - get_user_meta( get_current_user_id(), '_godam_notice_dismissed', true ) - ) { + if ( ( ! in_array( $current_page, $allowed_pages, true ) && + ! in_array( $screen_id, $allowed_pages, true ) ) || + get_user_meta( get_current_user_id(), '_godam_notice_dismissed', true ) ) { return; } @@ -519,24 +519,47 @@ public function install_godam_admin_notice() { } $plugin_slug = 'godam'; - $plugin_modal_url = is_multisite() - ? network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&TB_iframe=true&width=772&height=666' ) - : admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&TB_iframe=true&width=772&height=666' ); - - $class = 'notice notice-warning'; - $valid_tags = array( - 'div' => array( 'class' => array(), 'id' => array() ), - 'p' => array(), - 'strong' => array(), - 'a' => array( 'href' => array(), 'class' => array(), 'target' => array() ), - 'span' => array( 'class' => array(), 'style' => array() ), - ); + $plugin_modal_url = is_multisite() ? + network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&TB_iframe=true&width=772&height=666' ) : + admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&TB_iframe=true&width=772&height=666' ); + + $class = 'notice notice-error'; printf( - wp_kses( - __( '

NOTICE: Transcoder plugin will be retired on May 31, 2025. We recommend removing this plugin and switching to our new plugin, GoDAM which includes powerful Digital Asset Management features along with video transcoding services. Install GoDAM now!

', 'transcoder' ), - $valid_tags - ), + '
+
+ +
+ + +
+ + +
+ +
+ Transcoding via the Transcoder plugin is disabled from June 1st, 2025. +
+ + +

+ Switch to the GoDAM services for advanced Digital Asset Management and seamless video transcoding. Subscribe to a GoDAM plan to maintain access to transcoding services. Please deactivate and delete the transcoder plugin once GoDAM plugin is installed. +

+ + + +
+ + Get GoDAM + + + Learn More + + +
+
+
+
', esc_attr( $class ), esc_url( $plugin_modal_url ) ); @@ -548,4 +571,43 @@ public function install_godam_admin_notice() { public function enqueue_thickbox_on_transcoder_settings() { add_thickbox(); } + + /** + * Display a notice in the Media Library indicating that the Transcoder plugin + * no longer provides transcoding functionality and suggesting users subscribe + * to the GoDAM service instead. + * + * This notice only appears on the "Media > Library" page (`upload` screen). + * + * @since 2.0.0 + */ + public function show_transcoding_disabled_notice() { + $screen = get_current_screen(); + + if ( $screen && 'upload' === $screen->id ) { + $info_link = 'https://godam.io/pricing/?utm_source=transcoder-plugin&utm_medium=media-library-notice&utm_campaign=transcoding-disabled'; + + printf( + '

%s

', + wp_kses( + sprintf( + /* translators: %s: GoDAM pricing link */ + __( 'Transcoding is no longer available through Transcoder. For continued media processing, please subscribe to our GoDAM services.', 'transcoder' ), + esc_url( $info_link ) + ), + array( + 'span' => array( + 'class' => array(), + 'style' => array(), + ), + 'strong' => array(), + 'a' => array( + 'href' => array(), + 'target' => array(), + ), + ) + ) + ); + } + } } diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php index c155f2e..e0024c7 100755 --- a/admin/rt-transcoder-handler.php +++ b/admin/rt-transcoder-handler.php @@ -195,6 +195,9 @@ public function __construct( $no_init = false ) { * @param string $autoformat If true then generating thumbs only else trancode video. */ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat = true ) { + + return $wp_metadata; + if ( empty( $wp_metadata['mime_type'] ) ) { return $wp_metadata; } @@ -584,20 +587,28 @@ public function allowed_types_admin_settings( $types ) { public function successfully_subscribed_notice() { ?>
-

- array(), - ) +

+ GoDAM'; + + $api_key_updated = transcoder_filter_input( INPUT_GET, 'api-key-updated', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); + + printf( + wp_kses( + /* translators: %s is the GoDAM plugin link */ + __( 'You have successfully subscribed. However, transcoding via transcoder has been discontinued. Please use %s for continued transcoding services.', 'transcoder' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), ), - esc_html( sanitize_text_field( wp_unslash( $api_key_updated ) ) ) - ); - ?> -

+ 'strong' => array(), + ) + ), + $godam_link + ); + ?> +

- + GoDAM'; + + printf( + wp_kses( + __( 'This license key is invalid. Transcoding is now supported via our %s services.', 'transcoder' ), + [ + 'a' => [ + 'href' => [], + 'target' => [], + ], + ] + ), + $godam_link + ); + ?>

error_code ) && ! empty( $status_info->error_msg ) ) { - $message = $messages['failed']; + // Custom handling error code 301. + if ( (int) $status_info->error_code === 301 ) { + $message = __( 'Transcoding through Transcoder is disabled. Please install GoDAM', 'transcoder' ); + } else { + $message = $messages['failed']; + } } elseif ( ! empty( $status_info ) && 'processing' === $status_info->status && empty( $status_info->error_code ) && empty( $status_info->error_msg ) ) {