Changeset 2779637
- Timestamp:
- 09/03/2022 06:08:40 PM (4 years ago)
- Location:
- wp-youtube-live
- Files:
-
- 6 edited
- 1 copied
-
tags/1.8.4 (copied) (copied from wp-youtube-live/trunk)
-
tags/1.8.4/inc/admin.php (modified) (3 diffs)
-
tags/1.8.4/readme.txt (modified) (2 diffs)
-
tags/1.8.4/wp-youtube-live.php (modified) (5 diffs)
-
trunk/inc/admin.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-youtube-live.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-youtube-live/tags/1.8.4/inc/admin.php
r2711798 r2779637 11 11 */ 12 12 function youtube_live_backend_assets() { 13 wp_ register_script( 'wp-youtube-live-backend', plugin_dir_url( __FILE__ ) . '../js/wp-youtube-live-backend.min.js', array( 'jquery' ), WP_YOUTUBE_LIVE_VERSION, true );13 wp_enqueue_script( 'wp-youtube-live-backend', plugin_dir_url( __FILE__ ) . '../js/wp-youtube-live-backend.min.js', array( 'jquery' ), WP_YOUTUBE_LIVE_VERSION, true ); 14 14 } 15 15 add_action( 'admin_enqueue_scripts', 'youtube_live_backend_assets' ); … … 127 127 */ 128 128 function youtube_live_api_key_render() { 129 wp_enqueue_script( 'wp-youtube-live-backend' );130 131 129 $options = get_option( 'youtube_live_settings' ); ?> 132 130 <input type="text" name="youtube_live_settings[youtube_live_api_key]" placeholder="AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI" size="45" value="<?php echo esc_attr( $options['youtube_live_api_key'] ); ?>"> … … 468 466 */ 469 467 function wp_youtube_live_dismiss_notice_1714() { 470 update_option( 'wp-youtube-live-1714-notice-dismissed', 1, false );471 } 472 468 update_option( 'wp-youtube-live-1714-notice-dismissed', true, false ); 469 } 470 -
wp-youtube-live/tags/1.8.4/readme.txt
r2712290 r2779637 5 5 Requires at least: 3.6 6 6 Tested up to: 5.9.3 7 Stable tag: 1.8. 37 Stable tag: 1.8.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 179 179 == Changelog == 180 180 181 = 1.8.4 = 182 - Fix “undefined index” issue in debug logs 183 - Fix persistent update notice 184 181 185 = 1.8.3 = 182 186 - Escape admin-visible debug output -
wp-youtube-live/tags/1.8.4/wp-youtube-live.php
r2712290 r2779637 4 4 * Plugin URI: https://github.com/macbookandrew/wp-youtube-live 5 5 * Description: Displays the current YouTube live video from a specified channel 6 * Version: 1.8. 36 * Version: 1.8.4 7 7 * Author: Andrew Minion 8 8 * Author URI: https://andrewrminion.com/ … … 51 51 'height' => $settings['default_height'], 52 52 'autoplay' => $settings['autoplay'], 53 'show Related'=> $settings['show_related'],53 'show_related' => $settings['show_related'], 54 54 'js_only' => false, 55 55 'ajaxUrl' => admin_url( 'admin-ajax.php' ), … … 121 121 $youtube_live->show_related = wp_youtube_live_is_ajax() && array_key_exists( 'show_related', $_POST ) 122 122 ? sanitize_key( wp_unslash( $_POST['show_related'] ) ) 123 : sanitize_key( $request_options['show Related'] );123 : sanitize_key( $request_options['show_related'] ); 124 124 $youtube_live->completed_video_id = wp_youtube_live_is_ajax() && array_key_exists( 'completedVideoID', $_POST ) 125 125 ? sanitize_key( wp_unslash( $_POST['completedVideoID'] ) ) … … 139 139 140 140 if ( $youtube_live->isLive ) { 141 if ( 'true' !== $request_options['js_only'] || ('true' === $request_options['js_only'] && wp_youtube_live_is_ajax() ) ) {141 if ( ( array_key_exists( 'js_only', $request_options ) && 'true' !== $request_options['js_only'] ) || ( array_key_exists( 'js_only', $request_options ) && 'true' === $request_options['js_only'] && wp_youtube_live_is_ajax() ) ) { 142 142 $is_live = true; 143 143 // TODO: load a placeholder or nothing on initial page load? … … 197 197 $debugging_code = var_export( $youtube_live, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- because this is only available for admins if they enable the debug option. 198 198 echo '<!-- YouTube Live debugging: ' . PHP_EOL . wp_kses_post( $debugging_code ) . PHP_EOL . ' -->'; 199 $json_data['error'] .$debugging_code;199 $json_data['error'] = $debugging_code; 200 200 } 201 201 -
wp-youtube-live/trunk/inc/admin.php
r2711798 r2779637 11 11 */ 12 12 function youtube_live_backend_assets() { 13 wp_ register_script( 'wp-youtube-live-backend', plugin_dir_url( __FILE__ ) . '../js/wp-youtube-live-backend.min.js', array( 'jquery' ), WP_YOUTUBE_LIVE_VERSION, true );13 wp_enqueue_script( 'wp-youtube-live-backend', plugin_dir_url( __FILE__ ) . '../js/wp-youtube-live-backend.min.js', array( 'jquery' ), WP_YOUTUBE_LIVE_VERSION, true ); 14 14 } 15 15 add_action( 'admin_enqueue_scripts', 'youtube_live_backend_assets' ); … … 127 127 */ 128 128 function youtube_live_api_key_render() { 129 wp_enqueue_script( 'wp-youtube-live-backend' );130 131 129 $options = get_option( 'youtube_live_settings' ); ?> 132 130 <input type="text" name="youtube_live_settings[youtube_live_api_key]" placeholder="AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI" size="45" value="<?php echo esc_attr( $options['youtube_live_api_key'] ); ?>"> … … 468 466 */ 469 467 function wp_youtube_live_dismiss_notice_1714() { 470 update_option( 'wp-youtube-live-1714-notice-dismissed', 1, false );471 } 472 468 update_option( 'wp-youtube-live-1714-notice-dismissed', true, false ); 469 } 470 -
wp-youtube-live/trunk/readme.txt
r2712290 r2779637 5 5 Requires at least: 3.6 6 6 Tested up to: 5.9.3 7 Stable tag: 1.8. 37 Stable tag: 1.8.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 179 179 == Changelog == 180 180 181 = 1.8.4 = 182 - Fix “undefined index” issue in debug logs 183 - Fix persistent update notice 184 181 185 = 1.8.3 = 182 186 - Escape admin-visible debug output -
wp-youtube-live/trunk/wp-youtube-live.php
r2712290 r2779637 4 4 * Plugin URI: https://github.com/macbookandrew/wp-youtube-live 5 5 * Description: Displays the current YouTube live video from a specified channel 6 * Version: 1.8. 36 * Version: 1.8.4 7 7 * Author: Andrew Minion 8 8 * Author URI: https://andrewrminion.com/ … … 51 51 'height' => $settings['default_height'], 52 52 'autoplay' => $settings['autoplay'], 53 'show Related'=> $settings['show_related'],53 'show_related' => $settings['show_related'], 54 54 'js_only' => false, 55 55 'ajaxUrl' => admin_url( 'admin-ajax.php' ), … … 121 121 $youtube_live->show_related = wp_youtube_live_is_ajax() && array_key_exists( 'show_related', $_POST ) 122 122 ? sanitize_key( wp_unslash( $_POST['show_related'] ) ) 123 : sanitize_key( $request_options['show Related'] );123 : sanitize_key( $request_options['show_related'] ); 124 124 $youtube_live->completed_video_id = wp_youtube_live_is_ajax() && array_key_exists( 'completedVideoID', $_POST ) 125 125 ? sanitize_key( wp_unslash( $_POST['completedVideoID'] ) ) … … 139 139 140 140 if ( $youtube_live->isLive ) { 141 if ( 'true' !== $request_options['js_only'] || ('true' === $request_options['js_only'] && wp_youtube_live_is_ajax() ) ) {141 if ( ( array_key_exists( 'js_only', $request_options ) && 'true' !== $request_options['js_only'] ) || ( array_key_exists( 'js_only', $request_options ) && 'true' === $request_options['js_only'] && wp_youtube_live_is_ajax() ) ) { 142 142 $is_live = true; 143 143 // TODO: load a placeholder or nothing on initial page load? … … 197 197 $debugging_code = var_export( $youtube_live, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- because this is only available for admins if they enable the debug option. 198 198 echo '<!-- YouTube Live debugging: ' . PHP_EOL . wp_kses_post( $debugging_code ) . PHP_EOL . ' -->'; 199 $json_data['error'] .$debugging_code;199 $json_data['error'] = $debugging_code; 200 200 } 201 201
Note: See TracChangeset
for help on using the changeset viewer.