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!
+ 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. +
+ + + +%s
- 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 + ); + ?>