From 1daf6d5f950c91c965231d8c09c94a12490479ac Mon Sep 17 00:00:00 2001 From: krishana7911 Date: Thu, 4 Sep 2025 16:05:22 +0530 Subject: [PATCH 1/4] Update jQuery dependency enqueing check --- app/main/RTMedia.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/main/RTMedia.php b/app/main/RTMedia.php index 9469e0d64..bb32f2474 100755 --- a/app/main/RTMedia.php +++ b/app/main/RTMedia.php @@ -1216,12 +1216,12 @@ public function create_table_error_notice() { /** * Ensure WordPress 6.7 compatibility by handling jQuery Migrate dependency. * WordPress 6.7 removed jQuery Migrate by default, which can break plugins using deprecated jQuery methods. - * + * * @since 4.6.23 */ public function ensure_wp67_compatibility() { global $wp_version; - + // Check if we're running WordPress 6.7 or higher if ( version_compare( $wp_version, '6.7', '>=' ) ) { // Enqueue jQuery Migrate if not already enqueued to maintain backward compatibility @@ -1234,16 +1234,16 @@ public function ensure_wp67_compatibility() { /** * WordPress 6.7 compatibility scripts enqueue. * Ensures jQuery Migrate is available early in the loading process. - * + * * @since 4.6.23 */ public function wp67_compatibility_scripts() { - global $wp_version; - + global $wp_version; + // Enqueue jQuery Migrate for WordPress 6.7+ compatibility if ( version_compare( $wp_version, '6.7', '>=' ) ) { - if ( ! wp_script_is( 'jquery-migrate', 'enqueued' ) ) { - wp_enqueue_script( 'jquery-migrate' ); + if ( wp_script_is('jquery', 'enqueued') && !wp_script_is('jquery-migrate', 'enqueued') ) { + wp_enqueue_script( 'jquery-migrate' ); } } } @@ -1251,12 +1251,12 @@ public function wp67_compatibility_scripts() { /** * WordPress 6.7 MediaElement.js compatibility initialization. * Ensures MediaElement is properly initialized in WordPress 6.7+ - * + * * @since 4.6.23 */ public function wp67_media_element_init() { global $wp_version; - + if ( version_compare( $wp_version, '6.7', '>=' ) ) { ?>