From 14d3c90bbe2b00f0805a80c5bccadd69f3927cf3 Mon Sep 17 00:00:00 2001 From: sanketio Date: Mon, 10 Aug 2026 12:36:04 +0530 Subject: [PATCH] Fix page load warnings and dead GoDAM enqueue --- app/importers/RTMediaMigration.php | 2 ++ app/main/RTMediaUploadTerms.php | 5 +++-- templates/media/godam-integration.php | 5 ++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/importers/RTMediaMigration.php b/app/importers/RTMediaMigration.php index ca27dc0e7..087742e5f 100755 --- a/app/importers/RTMediaMigration.php +++ b/app/importers/RTMediaMigration.php @@ -163,6 +163,8 @@ public function get_total_count() { } else { $bp_prefix = ''; } + $count = 0; + $sql_album_usercount = "select count(*) FROM $wpdb->usermeta where meta_key ='bp-media-default-album' "; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Direct query is required for custom table. diff --git a/app/main/RTMediaUploadTerms.php b/app/main/RTMediaUploadTerms.php index d5b721745..c9a860b8a 100755 --- a/app/main/RTMediaUploadTerms.php +++ b/app/main/RTMediaUploadTerms.php @@ -85,7 +85,7 @@ public function dynamic_sidebar_params( $params ) { * Loads translation */ public function load_translation() { - load_plugin_textdomain( 'rtmedia', false, basename( RTMEDIA_PATH ) . '/languages/' ); + load_plugin_textdomain( 'buddypress-media', false, basename( RTMEDIA_PATH ) . '/languages/' ); } /** @@ -97,7 +97,8 @@ public function enqueue_scripts_styles() { global $rtmedia; $suffix = ( function_exists( 'rtm_get_script_style_suffix' ) ) ? rtm_get_script_style_suffix() : '.min'; - $general_upload_terms_error_message = apply_filters( 'rtmedia_upload_terms_check_terms_message', $rtmedia->options['general_upload_terms_error_message'] ); + $upload_terms_error_message = isset( $rtmedia->options['general_upload_terms_error_message'] ) ? $rtmedia->options['general_upload_terms_error_message'] : ''; + $general_upload_terms_error_message = apply_filters( 'rtmedia_upload_terms_check_terms_message', $upload_terms_error_message ); if ( ! ( isset( $rtmedia->options ) && isset( $rtmedia->options['styles_enabled'] ) && 0 === $rtmedia->options['styles_enabled'] ) ) { wp_enqueue_style( 'rtmedia-upload-terms-main', RTMEDIA_URL . 'app/assets/css/rtm-upload-terms' . $suffix . '.css', '', RTMEDIA_VERSION ); diff --git a/templates/media/godam-integration.php b/templates/media/godam-integration.php index c482a64a6..3cf471739 100644 --- a/templates/media/godam-integration.php +++ b/templates/media/godam-integration.php @@ -8,7 +8,6 @@ * - Enqueue Godam scripts and styles (including skins) on both normal pages and BuddyPress pages. * - Replace rtMedia video lists in BuddyPress activity streams with Godam players. * - Handle AJAX requests for activity comments to ensure Godam players load dynamically. - * - Ensure compatibility with multisite setups using `get_site_option` for global settings. * - Maintain Magnific Popup compatibility when Godam is active or inactive. */ @@ -24,10 +23,10 @@ function godam_enqueue_player_assets() { // Base scripts and styles wp_enqueue_script( 'godam-player-frontend-script' ); wp_enqueue_script( 'godam-player-analytics-script' ); - wp_enqueue_style( 'godam-player-frontend-style' ); wp_enqueue_style( 'godam-player-style' ); - // Skin detection — multisite safe (uses site option). + // Skin detection. GoDAM stores this with get_option()/update_option(), so it is + // intentionally per-site and must not be read with get_site_option(). $godam_settings = get_option( 'rtgodam-settings', array() ); $selected_skin = $godam_settings['video_player']['player_skin'] ?? '';