YouTube Embed - Version 5.0.5

Version Description

  • Maintenance: The rel parameter has changed and the showinfo has been deprecated. Have updated the plugin for these changes
  • Maintenance: I've removed the editor button. It doesn't work after WP 5.0 and I don't wish to maintain it
  • Maintenance: I'm now using a time constant when caching
  • Maintenance: Added Github links to plugin meta
  • Maintenance: Using the checked function for screen output
  • Maintenance: A minor language tweak, where I was specifying something that should, ideally, be captured by translations instead
Download this release

Release Info

Developer dartiss
Plugin Icon 128x128 YouTube Embed
Version 5.0.5
Comparing to
See all releases

Code changes from version 5.0.4 to 5.0.5

includes/add-scripts.php CHANGED
@@ -254,4 +254,3 @@ function youtube_embed_shortcode_checks( $source ) {
254
 
255
  update_option( 'youtube_embed_shortcode_' . $source, $shortcode );
256
  }
257
- ?>
254
 
255
  update_option( 'youtube_embed_shortcode_' . $source, $shortcode );
256
  }
 
includes/admin-config.php CHANGED
@@ -49,7 +49,13 @@ add_filter( 'plugin_action_links', 'ye_add_settings_link', 10, 2 );
49
 
50
  function ye_set_plugin_meta( $links, $file ) {
51
 
52
- if ( strpos( $file, 'youtube-embed.php' ) !== false ) { $links = array_merge( $links, array( '<a href="https://wordpress.org/support/plugin/youtube-embed">' . __( 'Support', 'youtube-embed' ) . '</a>' ) ); }
 
 
 
 
 
 
53
 
54
  return $links;
55
  }
@@ -366,42 +372,6 @@ function youtube_embed_button() {
366
 
367
  add_action( 'admin_init', 'youtube_embed_button' );
368
 
369
- /**
370
- * Register new TinyMCE button
371
- *
372
- * Register details of new TinyMCE button
373
- *
374
- * @since 2.0
375
- *
376
- * @param string $buttons TinyMCE button data
377
- * @return string TinyMCE button data, but with new YouTube button added
378
- */
379
-
380
- function register_youtube_embed_button( $buttons ) {
381
-
382
- array_push( $buttons, 'mce4_youtube_button' );
383
-
384
- return $buttons;
385
- }
386
-
387
- /**
388
- * Register TinyMCE Script
389
- *
390
- * Register JavaScript that will be actioned when the new TinyMCE button is used
391
- *
392
- * @since 2.0
393
- *
394
- * @param string $plugin_array Array of MCE plugin data
395
- * @return string Array of MCE plugin data, now with URL of MCE script
396
- */
397
-
398
- function add_youtube_embed_mce_plugin( $plugin_array ) {
399
-
400
- $plugin_array[ 'mce4_youtube_button' ] = plugins_url( 'js/mce4-button.min.js', dirname(__FILE__) );
401
-
402
- return $plugin_array;
403
- }
404
-
405
  /**
406
  * Show Admin Messages
407
  *
@@ -444,4 +414,3 @@ function youtube_embed_admin_messages() {
444
  }
445
 
446
  add_action( 'admin_notices', 'youtube_embed_admin_messages' );
447
- ?>
49
 
50
  function ye_set_plugin_meta( $links, $file ) {
51
 
52
+ if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
53
+
54
+ $links = array_merge( $links, array( '<a href="https://github.com/dartiss/youtube-embed">' . __( 'Github', 'youtube-embed' ) . '</a>' ) );
55
+
56
+ $links = array_merge( $links, array( '<a href="https://wordpress.org/support/plugin/youtube-embed">' . __( 'Support', 'youtube-embed' ) . '</a>' ) );
57
+
58
+ }
59
 
60
  return $links;
61
  }
372
 
373
  add_action( 'admin_init', 'youtube_embed_button' );
374
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  /**
376
  * Show Admin Messages
377
  *
414
  }
415
 
416
  add_action( 'admin_notices', 'youtube_embed_admin_messages' );
 
includes/api-access.php CHANGED
@@ -161,7 +161,7 @@ function ye_get_api_data( $video_id, $api_key = '', $no_cache = false, $cache_ti
161
 
162
  if ( $options[ 'api_cache' ] != 0 && $id_found ) {
163
 
164
- $cache = $options[ 'api_cache' ] * 60 * 60 * 24;
165
 
166
  ye_set_transient( $key, $return_data, $cache );
167
 
@@ -169,4 +169,3 @@ function ye_get_api_data( $video_id, $api_key = '', $no_cache = false, $cache_ti
169
 
170
  return $return_data;
171
  }
172
- ?>
161
 
162
  if ( $options[ 'api_cache' ] != 0 && $id_found ) {
163
 
164
+ $cache = $options[ 'api_cache' ] * DAY_IN_SECONDS;
165
 
166
  ye_set_transient( $key, $return_data, $cache );
167
 
169
 
170
  return $return_data;
171
  }
 
includes/caching.php CHANGED
@@ -96,10 +96,9 @@ function ye_housekeep_transients() {
96
  AND b.option_value < UNIX_TIMESTAMP()
97
  ";
98
 
99
- $clean = $wpdb -> query( $sql );
100
 
101
  return;
102
  }
103
 
104
  add_action( 'ye_housekeep_transients', 'ye_clean_transients' );
105
- ?>
96
  AND b.option_value < UNIX_TIMESTAMP()
97
  ";
98
 
99
+ $wpdb -> query( $sql );
100
 
101
  return;
102
  }
103
 
104
  add_action( 'ye_housekeep_transients', 'ye_clean_transients' );
 
includes/generate-embed-code.php CHANGED
@@ -31,7 +31,7 @@ function ye_generate_youtube_code( $array ) {
31
 
32
  // Set defaults then merge with passed array. Finally, split array into individual variables
33
 
34
- $default = array( 'id' => '', 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'stop' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'list_style' => '', 'template' => '', 'color' => '', 'theme' => '', 'responsive' => '', 'search' => '', 'user' => '', 'modest' => '', 'playsinline' => '', 'html5' => '' );
35
 
36
  $array = array_merge( $default, $array );
37
 
@@ -220,7 +220,6 @@ function ye_generate_youtube_code( $array ) {
220
  if ( $related == '' ) { $related = $options[ 'related' ]; }
221
  if ( $autoplay == '' ) { $autoplay = $options[ 'autoplay' ]; }
222
  if ( $loop == '' ) { $loop = $options[ 'loop' ]; }
223
- if ( $info == '' ) { $info = $options[ 'info' ]; }
224
  if ( $annotation == '' ) { $annotation = $options[ 'annotation' ]; }
225
  if ( $cc == '' ) { $cc = $options[ 'cc' ]; }
226
  if ( $disablekb == '' ) { $disablekb = $options[ 'disablekb' ]; }
@@ -276,7 +275,6 @@ function ye_generate_youtube_code( $array ) {
276
  if ( $related != 1 ) { $paras .= $amp . 'rel=0'; }
277
  if ( $autoplay == 1 ) { $paras .= $amp . 'autoplay=1'; }
278
  if ( $loop == 1 ) { $paras .= $amp . 'loop=1'; }
279
- if ( $info != 1 ) { $paras .= $amp . 'showinfo=0'; }
280
  if ( $annotation != 1 ) { $paras .= $amp . 'iv_load_policy=3'; }
281
  if ( $cc != '' ) { $paras .= $amp . 'cc_load_policy=' . $cc; }
282
  if ( $disablekb == 1 ) { $paras .= $amp . 'disablekb=1'; }
@@ -408,7 +406,7 @@ function ye_generate_youtube_code( $array ) {
408
 
409
  if ( $general[ 'video_cache' ] != 0 && get_the_date() !== false && !$cache_suppress ) {
410
 
411
- $cache = $general[ 'video_cache' ] * 60 * 60;
412
 
413
  ye_set_transient( $key, $result, $cache, true );
414
 
@@ -579,6 +577,7 @@ function ye_do_not_track() {
579
  function ye_calculate_video_size( $width, $height, $default_width, $default_height, $ratio ) {
580
 
581
  $ratio_to_use = '';
 
582
 
583
  // If a ratio has been specified by the user, extract it
584
 
@@ -605,4 +604,3 @@ function ye_calculate_video_size( $width, $height, $default_width, $default_heig
605
 
606
  return $new_sizes;
607
  }
608
- ?>
31
 
32
  // Set defaults then merge with passed array. Finally, split array into individual variables
33
 
34
+ $default = array( 'id' => '', 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'stop' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'list_style' => '', 'template' => '', 'color' => '', 'theme' => '', 'responsive' => '', 'search' => '', 'user' => '', 'modest' => '', 'playsinline' => '', 'html5' => '' );
35
 
36
  $array = array_merge( $default, $array );
37
 
220
  if ( $related == '' ) { $related = $options[ 'related' ]; }
221
  if ( $autoplay == '' ) { $autoplay = $options[ 'autoplay' ]; }
222
  if ( $loop == '' ) { $loop = $options[ 'loop' ]; }
 
223
  if ( $annotation == '' ) { $annotation = $options[ 'annotation' ]; }
224
  if ( $cc == '' ) { $cc = $options[ 'cc' ]; }
225
  if ( $disablekb == '' ) { $disablekb = $options[ 'disablekb' ]; }
275
  if ( $related != 1 ) { $paras .= $amp . 'rel=0'; }
276
  if ( $autoplay == 1 ) { $paras .= $amp . 'autoplay=1'; }
277
  if ( $loop == 1 ) { $paras .= $amp . 'loop=1'; }
 
278
  if ( $annotation != 1 ) { $paras .= $amp . 'iv_load_policy=3'; }
279
  if ( $cc != '' ) { $paras .= $amp . 'cc_load_policy=' . $cc; }
280
  if ( $disablekb == 1 ) { $paras .= $amp . 'disablekb=1'; }
406
 
407
  if ( $general[ 'video_cache' ] != 0 && get_the_date() !== false && !$cache_suppress ) {
408
 
409
+ $cache = $general[ 'video_cache' ] * HOURS_IN_SECONDS;
410
 
411
  ye_set_transient( $key, $result, $cache, true );
412
 
577
  function ye_calculate_video_size( $width, $height, $default_width, $default_height, $ratio ) {
578
 
579
  $ratio_to_use = '';
580
+ $new_sizes = array();
581
 
582
  // If a ratio has been specified by the user, extract it
583
 
604
 
605
  return $new_sizes;
606
  }
 
includes/generate-other-code.php CHANGED
@@ -146,4 +146,3 @@ function ye_generate_vinfo_code( $id, $text ) {
146
 
147
  return $output;
148
  }
149
- ?>
146
 
147
  return $output;
148
  }
 
includes/generate-widgets.php CHANGED
@@ -206,4 +206,3 @@ function youtube_embed_register_widgets() {
206
  register_widget( 'YouTubeEmbedWidget' );
207
  }
208
  add_action( 'widgets_init', 'youtube_embed_register_widgets' );
209
- ?>
206
  register_widget( 'YouTubeEmbedWidget' );
207
  }
208
  add_action( 'widgets_init', 'youtube_embed_register_widgets' );
 
includes/options-general.php CHANGED
@@ -116,7 +116,7 @@ $shortcode = ye_get_shortcode();
116
 
117
  <tr>
118
  <th scope="row"><label for="youtube_embed_metadata"><?php _e( 'Add Metadata', 'youtube-embed' ); ?></label></th>
119
- <td><input type="checkbox" name="youtube_embed_metadata" value="1"<?php if ( $options[ 'metadata' ] == "1" ) { echo ' checked="checked"'; } ?>/>
120
  <?php _e( 'Allow rich metadata to be added to code', 'youtube-embed' ); ?></td>
121
  </tr>
122
 
@@ -164,7 +164,7 @@ $shortcode = ye_get_shortcode();
164
 
165
  <tr>
166
  <th scope="row"><?php _e( 'Allow shortcodes in widgets', 'youtube-embed' ); ?></th>
167
- <td><label for="youtube_embed_widgets"><input type="checkbox" name="youtube_embed_widgets" value="1"<?php if ( $options[ 'widgets' ] == "1" ) { echo ' checked="checked"'; } ?>/>
168
  <?php _e( 'Allow shortcodes to be used in widgets', 'youtube-embed' ); ?></label>
169
  <p class="description"><?php _e( 'This will apply to <strong>all</strong> widgets.', 'youtube-embed' ); ?></p></td>
170
  </tr>
@@ -190,7 +190,7 @@ $shortcode = ye_get_shortcode();
190
 
191
  <tr>
192
  <th scope="row"><?php _e( 'Show Shortcode Re-use Prompt', 'youtube-embed' ); ?></th>
193
- <td><label for="youtube_embed_prompt"><input type="checkbox" name="youtube_embed_prompt" value="1"<?php if ( $options[ 'prompt' ] == "1" ) { echo ' checked="checked"'; } ?>/>
194
  <?php _e( 'Show a prompt if the main shortcode is being re-used by another plugin', 'youtube-embed' ); ?></label></td>
195
  </tr>
196
 
@@ -200,7 +200,7 @@ $shortcode = ye_get_shortcode();
200
 
201
  <tr>
202
  <th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
203
- <td><label for="youtube_embed_editor_button"><input type="checkbox" name="youtube_embed_editor_button" value="1"<?php if ( $options[ 'editor_button' ] == "1" ) { echo ' checked="checked"'; } ?>/>
204
  <?php _e( 'Show the YouTube button on the post editor', 'youtube-embed' ); ?></label></td>
205
  </tr>
206
 
@@ -208,7 +208,7 @@ $shortcode = ye_get_shortcode();
208
 
209
  <tr>
210
  <th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
211
- <td><label for="youtube_embed_admin_bar"><input type="checkbox" name="youtube_embed_admin_bar" value="1"<?php if ( $options[ 'admin_bar' ] == "1" ) { echo ' checked="checked"'; } ?>/>
212
  <?php _e( 'Add link to options screen to Admin Bar', 'youtube-embed' ); ?></label></td>
213
  </tr>
214
 
@@ -248,7 +248,7 @@ $shortcode = ye_get_shortcode();
248
 
249
  <tr>
250
  <th scope="row"><?php _e( 'Force list specification', 'youtube-embed' ); ?></th>
251
- <td><label for="youtube_embed_list"><input type="checkbox" name="youtube_embed_list" value="1"<?php if ( $options[ 'force_list_type' ] == '1' ) { echo ' checked="checked"'; } ?>/>
252
  <?php _e( 'Force users to specify a list type', 'youtube-embed' ); ?></label>
253
  <p class="description"><?php _e( 'By switching this on, a list type must be specified for a list to be valid. This improves performance as use of a list doesn\'t then need to be verified.', 'youtube-embed' ); ?></p></td>
254
  </tr>
@@ -287,7 +287,7 @@ $shortcode = ye_get_shortcode();
287
 
288
  <tr>
289
  <th scope="row"><?php _e( 'Show debug output', 'youtube-embed' ); ?></th>
290
- <td><label for="youtube_embed_debug"><input type="checkbox" name="youtube_embed_debug" value="1"<?php if ( $options[ 'debug' ] == "1" ) { echo ' checked="checked"'; } ?>/>
291
  <?php _e( 'Show debug output as HTML comments', 'youtube-embed' ); ?></label></td>
292
  </tr>
293
 
@@ -297,7 +297,7 @@ $shortcode = ye_get_shortcode();
297
 
298
  <tr>
299
  <th scope="row"><?php _e( 'Improve Validation', 'youtube-embed' ); ?></th>
300
- <td><label for="youtube_embed_frameborder"><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; } ?>/>
301
  <?php _e( 'Improve the validity of the generated markup', 'youtube-embed' ); ?></label>
302
  <p class="description"><?php _e( 'Will extend the length of the URL, limiting the number of videos in a manual playlist. Switch off metadata for even better validation results.', 'youtube-embed' ); ?></p></td>
303
  </tr>
116
 
117
  <tr>
118
  <th scope="row"><label for="youtube_embed_metadata"><?php _e( 'Add Metadata', 'youtube-embed' ); ?></label></th>
119
+ <td><input type="checkbox" name="youtube_embed_metadata" value="1" <?php checked( $options[ 'metadata' ], "1" ); ?>/>
120
  <?php _e( 'Allow rich metadata to be added to code', 'youtube-embed' ); ?></td>
121
  </tr>
122
 
164
 
165
  <tr>
166
  <th scope="row"><?php _e( 'Allow shortcodes in widgets', 'youtube-embed' ); ?></th>
167
+ <td><label for="youtube_embed_widgets"><input type="checkbox" name="youtube_embed_widgets" value="1" <?php checked( $options[ 'widgets' ], "1" ); ?>/>
168
  <?php _e( 'Allow shortcodes to be used in widgets', 'youtube-embed' ); ?></label>
169
  <p class="description"><?php _e( 'This will apply to <strong>all</strong> widgets.', 'youtube-embed' ); ?></p></td>
170
  </tr>
190
 
191
  <tr>
192
  <th scope="row"><?php _e( 'Show Shortcode Re-use Prompt', 'youtube-embed' ); ?></th>
193
+ <td><label for="youtube_embed_prompt"><input type="checkbox" name="youtube_embed_prompt" value="1" <?php checked( $options[ 'prompt' ], "1" ); ?>/>
194
  <?php _e( 'Show a prompt if the main shortcode is being re-used by another plugin', 'youtube-embed' ); ?></label></td>
195
  </tr>
196
 
200
 
201
  <tr>
202
  <th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
203
+ <td><label for="youtube_embed_editor_button"><input type="checkbox" name="youtube_embed_editor_button" value="1" <?php checked( $options[ 'editor_button' ], "1" ); ?>/>
204
  <?php _e( 'Show the YouTube button on the post editor', 'youtube-embed' ); ?></label></td>
205
  </tr>
206
 
208
 
209
  <tr>
210
  <th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
211
+ <td><label for="youtube_embed_admin_bar"><input type="checkbox" name="youtube_embed_admin_bar" value="1" <?php checked( $options[ 'admin_bar' ], "1" ); ?>/>
212
  <?php _e( 'Add link to options screen to Admin Bar', 'youtube-embed' ); ?></label></td>
213
  </tr>
214
 
248
 
249
  <tr>
250
  <th scope="row"><?php _e( 'Force list specification', 'youtube-embed' ); ?></th>
251
+ <td><label for="youtube_embed_list"><input type="checkbox" name="youtube_embed_list" value="1" <?php checked( $options[ 'force_list_type' ], "1" ); ?>/>
252
  <?php _e( 'Force users to specify a list type', 'youtube-embed' ); ?></label>
253
  <p class="description"><?php _e( 'By switching this on, a list type must be specified for a list to be valid. This improves performance as use of a list doesn\'t then need to be verified.', 'youtube-embed' ); ?></p></td>
254
  </tr>
287
 
288
  <tr>
289
  <th scope="row"><?php _e( 'Show debug output', 'youtube-embed' ); ?></th>
290
+ <td><label for="youtube_embed_debug"><input type="checkbox" name="youtube_embed_debug" value="1" <?php checked( $options[ 'debug' ], "1" ); ?>/>
291
  <?php _e( 'Show debug output as HTML comments', 'youtube-embed' ); ?></label></td>
292
  </tr>
293
 
297
 
298
  <tr>
299
  <th scope="row"><?php _e( 'Improve Validation', 'youtube-embed' ); ?></th>
300
+ <td><label for="youtube_embed_frameborder"><input type="checkbox" name="youtube_embed_frameborder" value="1" <?php checked( $options[ 'frameborder' ], "1" ); ?>/>
301
  <?php _e( 'Improve the validity of the generated markup', 'youtube-embed' ); ?></label>
302
  <p class="description"><?php _e( 'Will extend the length of the URL, limiting the number of videos in a manual playlist. Switch off metadata for even better validation results.', 'youtube-embed' ); ?></p></td>
303
  </tr>
includes/options-plugins.php CHANGED
@@ -72,8 +72,8 @@ function ye_plugin_status( $plugin_name, $title, $description, $id, $code_name =
72
  $status = ye_check_plugin( $plugin_name, $code_name );
73
 
74
  echo '<tr><th scope="row"><label for="ye_plugins_' . $id . '">' . $title . '</th>';
75
- echo '<td><input disabled="disabled" type="checkbox" name="ye_plugins_' . $id . '" value="1"';
76
- if ( $status == 2) { echo ' checked="checked"'; }
77
  echo '/>';
78
 
79
  if ( $status == 0 ) {
@@ -125,4 +125,3 @@ function ye_check_plugin( $plugin_dir, $plugin_name = '' ) {
125
  }
126
  return $status;
127
  }
128
- ?>
72
  $status = ye_check_plugin( $plugin_name, $code_name );
73
 
74
  echo '<tr><th scope="row"><label for="ye_plugins_' . $id . '">' . $title . '</th>';
75
+ echo '<td><input disabled="disabled" type="checkbox" name="ye_plugins_' . $id . '" value="1" ';
76
+ checked( $status, 2 );
77
  echo '/>';
78
 
79
  if ( $status == 0 ) {
125
  }
126
  return $status;
127
  }
 
includes/options-profiles.php CHANGED
@@ -8,7 +8,7 @@
8
  * @since 2.0
9
  */
10
 
11
- $demo_video = 'EYs_FckMqow';
12
 
13
  // Set current profile number
14
 
@@ -73,7 +73,6 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
73
  if ( isset( $_POST[ 'youtube_embed_cc' ] ) ) { $options[ 'cc'] = sanitize_text_field( $_POST[ 'youtube_embed_cc' ] ); } else { $options[ 'cc' ] = ''; }
74
  if ( isset( $_POST[ 'youtube_embed_annotation' ] ) ) { $options[ 'annotation'] = sanitize_text_field( $_POST[ 'youtube_embed_annotation' ] ); } else { $options[ 'annotation' ] = ''; }
75
  if ( isset( $_POST[ 'youtube_embed_related' ] ) ) { $options[ 'related'] = sanitize_text_field( $_POST[ 'youtube_embed_related' ] ); } else { $options[ 'related' ] = ''; }
76
- if ( isset( $_POST[ 'youtube_embed_info' ] ) ) { $options[ 'info'] = sanitize_text_field( $_POST[ 'youtube_embed_info' ] ); } else { $options[ 'info' ] = ''; }
77
  if ( isset( $_POST[ 'youtube_embed_disablekb' ] ) ) { $options[ 'disablekb'] = sanitize_text_field( $_POST[ 'youtube_embed_disablekb' ] ); } else { $options[ 'disablekb' ] = ''; }
78
  if ( isset( $_POST[ 'youtube_embed_html5' ] ) ) { $options[ 'html5'] = sanitize_text_field( $_POST[ 'youtube_embed_html5' ] ); } else { $options[ 'html5' ] = ''; }
79
  if ( isset( $_POST[ 'youtube_embed_modest' ] ) ) { $options[ 'modest' ] = sanitize_text_field( $_POST[ 'youtube_embed_modest' ] ); } else { $options[ 'modest' ] = ''; }
@@ -240,7 +239,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
240
 
241
  <tr>
242
  <th scope="row"><?php _e( 'Responsive Output', 'youtube-embed' ); ?></th>
243
- <td><label for="youtube_embed_dynamic"><input type="checkbox" name="youtube_embed_dynamic" value="1"<?php if ( $options[ 'dynamic' ] == "1" ) { echo ' checked="checked"'; } ?>/>
244
  <?php _e( 'Show full width and resize with the browser', 'youtube-embed' ); ?></label></td>
245
  </tr>
246
 
@@ -248,7 +247,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
248
 
249
  <tr>
250
  <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Set Maximum Size', 'youtube-embed' ); ?></th>
251
- <td><label for="youtube_embed_fixed"><input type="checkbox" name="youtube_embed_fixed" value="1"<?php if ( $options[ 'fixed' ] == "1" ) { echo ' checked="checked"'; } ?>/>
252
  <?php _e( 'Use above width to define maximum size', 'youtube-embed' ); ?></label></td>
253
  </tr>
254
 
@@ -257,7 +256,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
257
  <tr>
258
  <th scope="row"><?php _e( 'Plays Inline', 'youtube-embed' ); ?>&nbsp;<img src="<?php echo plugins_url( 'images/html5.png', dirname(__FILE__) ); ?>" alt="<?php _e( 'HTML5', 'youtube-embed' ) ?>" width="10px" align="top"></th>
259
 
260
- <td><label for="youtube_embed_playsinline"><input type="checkbox" name="youtube_embed_playsinline" value="1"<?php if ( $options[ 'playsinline' ] == "1" ) { echo ' checked="checked"'; } ?>/>
261
  <?php _e( 'Whether videos play inline or fullscreen in an HTML5 player on iOS. ', 'youtube-embed' ); ?></label></td>
262
  </tr>
263
 
@@ -267,7 +266,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
267
 
268
  <tr>
269
  <th scope="row"><?php _e( 'Autoplay', 'youtube-embed' ); ?></th>
270
- <td><label for="youtube_embed_autoplay"><input type="checkbox" name="youtube_embed_autoplay" value="1"<?php if ( $options[ 'autoplay' ] == "1" ) { echo ' checked="checked"'; } ?>/>
271
  <?php _e( 'Choose whether the initial video will automatically start to play when the player loads', 'youtube-embed' ); ?></label></td>
272
  </tr>
273
 
@@ -275,7 +274,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
275
 
276
  <tr>
277
  <th scope="row"><?php _e( 'Loop Video', 'youtube-embed' ); ?></th>
278
- <td><label for="youtube_embed_loop"><input type="checkbox" name="youtube_embed_loop" value="1"<?php if ( $options[ 'loop' ] == "1" ) { echo ' checked="checked"'; } ?>/>
279
  <?php _e( 'Play the initial video again and again', 'youtube-embed' ); ?></label>
280
  <p class="description"><?php _e( 'In the case of a playlist, this will play the entire playlist and then start again at the first video.', 'youtube-embed' ); ?></p></td>
281
  </tr>
@@ -284,7 +283,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
284
 
285
  <tr>
286
  <th scope="row"><?php _e( 'Annotations', 'youtube-embed' ); ?></th>
287
- <td><label for="youtube_embed_annotation"><input type="checkbox" name="youtube_embed_annotation" value="1"<?php if ( $options[ 'annotation' ] == "1" ) { echo ' checked="checked"'; } ?>/>
288
  <?php _e( 'Video annotations are shown by default', 'youtube-embed' ); ?></label></td>
289
  </tr>
290
 
@@ -297,43 +296,35 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
297
  <option value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Show closed captions', 'youtube-embed' ); ?></option>
298
  <option value=""<?php if ( $options[ 'cc' ] == "" ) { echo " selected='selected'"; } ?>><?php _e( 'User default', 'youtube-embed' ); ?></option>
299
  </select></label>
300
- <p class="description"><?php _e( 'Show closed captions (subtitles).', 'youtube-embed' ); ?></p></td>
301
  </tr>
302
 
303
  <!-- HTML5 -->
304
 
305
  <tr>
306
  <th scope="row"><?php _e( 'Default to HTML5', 'youtube-embed' ); ?></th>
307
- <td><label for="youtube_embed_html5"><input type="checkbox" name="youtube_embed_html5" value="1"<?php if ( $options[ 'html5' ] == "1" ) { echo ' checked="checked"'; } ?>/>
308
  <?php _e( 'Default to the HTML5 player (if available)', 'youtube-embed' ); ?></label>
309
  <p class="description"><?php _e( 'This is an undocumented feature and may not work.', 'youtube-embed' ); ?></p></td>
310
  </tr>
311
 
312
  </table><hr><h3 class="title"><?php _e( 'Information', 'youtube-embed' ); ?></h3><table class="form-table">
313
 
314
- <!-- Info -->
315
-
316
- <tr>
317
- <th scope="row"><?php _e( 'Information', 'youtube-embed' ); ?></th>
318
- <td><label for="youtube_embed_info"><input type="checkbox" name="youtube_embed_info" value="1"<?php if ( $options[ 'info' ] == "1" ) { echo ' checked="checked"'; } ?>/>
319
- <?php _e( 'Display the video title and uploader before the video starts', 'youtube-embed' ); ?></label>
320
- <p class="description"><?php _e( 'If displaying a playlist this will show video thumbnails.', 'youtube-embed' ); ?></p></td>
321
- </tr>
322
-
323
  <!-- Related -->
324
 
325
  <tr>
326
  <th scope="row"><?php _e( 'Related Videos', 'youtube-embed' ); ?></th>
327
- <td><label for="youtube_embed_related"><input type="checkbox" name="youtube_embed_related" value="1"<?php if ( $options[ 'related' ] == "1" ) { echo ' checked="checked"'; } ?>/>
328
- <?php _e( 'Load related videos once playback starts', 'youtube-embed' ); ?></label>
329
- <p class="description"><?php _e( 'Also toggles the search option.', 'youtube-embed' ); ?></p></td>
 
330
  </tr>
331
 
332
  <!-- Modest Branding -->
333
 
334
  <tr>
335
  <th scope="row"><?php _e( 'Modest Branding', 'youtube-embed' ); ?></th>
336
- <td><label for="youtube_embed_modest"><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/>
337
  <?php _e( 'Reduce branding on video', 'youtube-embed' ); ?></label></td>
338
  </tr>
339
 
@@ -367,7 +358,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
367
 
368
  <tr>
369
  <th scope="row"><?php _e( 'Disable Keyboard', 'youtube-embed' ); ?></th>
370
- <td><label for="youtube_embed_disablekb"><input type="checkbox" name="youtube_embed_disablekb" value="1"<?php if ( $options[ 'disablekb' ] == "1" ) { echo ' checked="checked"'; } ?>/>
371
  <?php _e( 'Disable the player keyboard controls', 'youtube-embed' ); ?></label></td>
372
  </tr>
373
 
@@ -375,7 +366,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
375
 
376
  <tr>
377
  <th scope="row"><?php _e( 'Fullscreen', 'youtube-embed' ); ?></th>
378
- <td><label for="youtube_embed_fullscreen"><input type="checkbox" name="youtube_embed_fullscreen" value="1"<?php if ( $options[ 'fullscreen' ] == "1" ) { echo ' checked="checked"'; } ?>/>
379
  <?php _e( 'A button will allow the viewer to watch the video fullscreen', 'youtube-embed' ); ?></label></td>
380
  </tr>
381
 
@@ -407,7 +398,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
407
 
408
  <tr>
409
  <th scope="row"><?php _e( 'Show Download Link', 'youtube-embed' ); ?></th>
410
- <td><label for="youtube_embed_download"><input type="checkbox" name="youtube_embed_download" value="1"<?php if ( $options[ 'download' ] == "1" ) { echo ' checked="checked"'; } ?>/>
411
  <?php echo sprintf( __( 'Show a link to %s under the video', 'youtube-embed' ), '<a href="http://keepvid.com/" rel="nofollow">KeepVid</a>' ); ?></label></td>
412
  </tr>
413
 
@@ -415,7 +406,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
415
 
416
  <tr>
417
  <th scope="row"><?php _e( 'Download Text', 'youtube-embed' ); ?></th>
418
- <td><label for="youtube_embed_download_txt"><input type="text" name="youtube_embed_download_text" class="large-text" value="<?php echo esc_html( $options[ 'download_text' ] ); ?>"/>
419
  <p class="description"><?php _e( 'Text or HTML to display to prompt download.', 'youtube-embed' ); ?></p></label></td>
420
  </tr>
421
 
@@ -423,7 +414,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
423
 
424
  <tr>
425
  <th scope="row"><?php _e( 'Download Style', 'youtube-embed' ); ?></th>
426
- <td><label for="youtube_embed_download_style"><input type="text" name="youtube_embed_download_style" class="large-text code" value="<?php echo esc_html( $options[ 'download_style' ] ); ?>"/>
427
  <p class="description"><?php _e( 'CSS elements to apply to video download link.', 'youtube-embed' ); ?></p></label></td>
428
  </tr>
429
 
8
  * @since 2.0
9
  */
10
 
11
+ $demo_video = 'X20GdsIUGKM';
12
 
13
  // Set current profile number
14
 
73
  if ( isset( $_POST[ 'youtube_embed_cc' ] ) ) { $options[ 'cc'] = sanitize_text_field( $_POST[ 'youtube_embed_cc' ] ); } else { $options[ 'cc' ] = ''; }
74
  if ( isset( $_POST[ 'youtube_embed_annotation' ] ) ) { $options[ 'annotation'] = sanitize_text_field( $_POST[ 'youtube_embed_annotation' ] ); } else { $options[ 'annotation' ] = ''; }
75
  if ( isset( $_POST[ 'youtube_embed_related' ] ) ) { $options[ 'related'] = sanitize_text_field( $_POST[ 'youtube_embed_related' ] ); } else { $options[ 'related' ] = ''; }
 
76
  if ( isset( $_POST[ 'youtube_embed_disablekb' ] ) ) { $options[ 'disablekb'] = sanitize_text_field( $_POST[ 'youtube_embed_disablekb' ] ); } else { $options[ 'disablekb' ] = ''; }
77
  if ( isset( $_POST[ 'youtube_embed_html5' ] ) ) { $options[ 'html5'] = sanitize_text_field( $_POST[ 'youtube_embed_html5' ] ); } else { $options[ 'html5' ] = ''; }
78
  if ( isset( $_POST[ 'youtube_embed_modest' ] ) ) { $options[ 'modest' ] = sanitize_text_field( $_POST[ 'youtube_embed_modest' ] ); } else { $options[ 'modest' ] = ''; }
239
 
240
  <tr>
241
  <th scope="row"><?php _e( 'Responsive Output', 'youtube-embed' ); ?></th>
242
+ <td><label for="youtube_embed_dynamic"><input type="checkbox" name="youtube_embed_dynamic" value="1" <?php checked( $options[ 'dynamic' ], "1" ); ?>/>
243
  <?php _e( 'Show full width and resize with the browser', 'youtube-embed' ); ?></label></td>
244
  </tr>
245
 
247
 
248
  <tr>
249
  <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Set Maximum Size', 'youtube-embed' ); ?></th>
250
+ <td><label for="youtube_embed_fixed"><input type="checkbox" name="youtube_embed_fixed" value="1" <?php checked( $options[ 'fixed' ], "1" ); ?>/>
251
  <?php _e( 'Use above width to define maximum size', 'youtube-embed' ); ?></label></td>
252
  </tr>
253
 
256
  <tr>
257
  <th scope="row"><?php _e( 'Plays Inline', 'youtube-embed' ); ?>&nbsp;<img src="<?php echo plugins_url( 'images/html5.png', dirname(__FILE__) ); ?>" alt="<?php _e( 'HTML5', 'youtube-embed' ) ?>" width="10px" align="top"></th>
258
 
259
+ <td><label for="youtube_embed_playsinline"><input type="checkbox" name="youtube_embed_playsinline" value="1" <?php checked( $options[ 'playsinline' ], "1" ); ?>/>
260
  <?php _e( 'Whether videos play inline or fullscreen in an HTML5 player on iOS. ', 'youtube-embed' ); ?></label></td>
261
  </tr>
262
 
266
 
267
  <tr>
268
  <th scope="row"><?php _e( 'Autoplay', 'youtube-embed' ); ?></th>
269
+ <td><label for="youtube_embed_autoplay"><input type="checkbox" name="youtube_embed_autoplay" value="1" <?php checked( $options[ 'autoplay' ], "1" ); ?>/>
270
  <?php _e( 'Choose whether the initial video will automatically start to play when the player loads', 'youtube-embed' ); ?></label></td>
271
  </tr>
272
 
274
 
275
  <tr>
276
  <th scope="row"><?php _e( 'Loop Video', 'youtube-embed' ); ?></th>
277
+ <td><label for="youtube_embed_loop"><input type="checkbox" name="youtube_embed_loop" value="1" <?php checked( $options[ 'loop' ], "1" ); ?>/>
278
  <?php _e( 'Play the initial video again and again', 'youtube-embed' ); ?></label>
279
  <p class="description"><?php _e( 'In the case of a playlist, this will play the entire playlist and then start again at the first video.', 'youtube-embed' ); ?></p></td>
280
  </tr>
283
 
284
  <tr>
285
  <th scope="row"><?php _e( 'Annotations', 'youtube-embed' ); ?></th>
286
+ <td><label for="youtube_embed_annotation"><input type="checkbox" name="youtube_embed_annotation" value="1" <?php checked( $options[ 'annotation' ], "1" ); ?>/>
287
  <?php _e( 'Video annotations are shown by default', 'youtube-embed' ); ?></label></td>
288
  </tr>
289
 
296
  <option value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Show closed captions', 'youtube-embed' ); ?></option>
297
  <option value=""<?php if ( $options[ 'cc' ] == "" ) { echo " selected='selected'"; } ?>><?php _e( 'User default', 'youtube-embed' ); ?></option>
298
  </select></label>
299
+ <p class="description"><?php _e( 'Show closed captions.', 'youtube-embed' ); ?></p></td>
300
  </tr>
301
 
302
  <!-- HTML5 -->
303
 
304
  <tr>
305
  <th scope="row"><?php _e( 'Default to HTML5', 'youtube-embed' ); ?></th>
306
+ <td><label for="youtube_embed_html5"><input type="checkbox" name="youtube_embed_html5" value="1" <?php checked( $options[ 'html5' ], "1" ); ?>/>
307
  <?php _e( 'Default to the HTML5 player (if available)', 'youtube-embed' ); ?></label>
308
  <p class="description"><?php _e( 'This is an undocumented feature and may not work.', 'youtube-embed' ); ?></p></td>
309
  </tr>
310
 
311
  </table><hr><h3 class="title"><?php _e( 'Information', 'youtube-embed' ); ?></h3><table class="form-table">
312
 
 
 
 
 
 
 
 
 
 
313
  <!-- Related -->
314
 
315
  <tr>
316
  <th scope="row"><?php _e( 'Related Videos', 'youtube-embed' ); ?></th>
317
+ <td><label for="youtube_embed_related"><select name="youtube_embed_related">
318
+ <option value="0"<?php if ( $options[ 'related' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Show from the same channel', 'youtube-embed' ); ?></option>
319
+ <option value="1"<?php if ( $options[ 'related' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Show related videos from any channel', 'youtube-embed' ); ?></option></label>
320
+ <p class="description"><?php _e( 'Defines where related videos are fetched from.', 'youtube-embed' ); ?></p></td>
321
  </tr>
322
 
323
  <!-- Modest Branding -->
324
 
325
  <tr>
326
  <th scope="row"><?php _e( 'Modest Branding', 'youtube-embed' ); ?></th>
327
+ <td><label for="youtube_embed_modest"><input type="checkbox" name="youtube_embed_modest" value="1" <?php checked( $options[ 'modest' ], "1" ); ?>/>
328
  <?php _e( 'Reduce branding on video', 'youtube-embed' ); ?></label></td>
329
  </tr>
330
 
358
 
359
  <tr>
360
  <th scope="row"><?php _e( 'Disable Keyboard', 'youtube-embed' ); ?></th>
361
+ <td><label for="youtube_embed_disablekb"><input type="checkbox" name="youtube_embed_disablekb" value="1" <?php checked( $options[ 'disablekb' ], "1" ); ?>/>
362
  <?php _e( 'Disable the player keyboard controls', 'youtube-embed' ); ?></label></td>
363
  </tr>
364
 
366
 
367
  <tr>
368
  <th scope="row"><?php _e( 'Fullscreen', 'youtube-embed' ); ?></th>
369
+ <td><label for="youtube_embed_fullscreen"><input type="checkbox" name="youtube_embed_fullscreen" value="1" <?php checked( $options[ 'fullscreen' ], "1" ); ?>/>
370
  <?php _e( 'A button will allow the viewer to watch the video fullscreen', 'youtube-embed' ); ?></label></td>
371
  </tr>
372
 
398
 
399
  <tr>
400
  <th scope="row"><?php _e( 'Show Download Link', 'youtube-embed' ); ?></th>
401
+ <td><label for="youtube_embed_download"><input type="checkbox" name="youtube_embed_download" value="1" <?php checked( $options[ 'download' ], "1" ); ?>/>
402
  <?php echo sprintf( __( 'Show a link to %s under the video', 'youtube-embed' ), '<a href="http://keepvid.com/" rel="nofollow">KeepVid</a>' ); ?></label></td>
403
  </tr>
404
 
406
 
407
  <tr>
408
  <th scope="row"><?php _e( 'Download Text', 'youtube-embed' ); ?></th>
409
+ <td><label for="youtube_embed_download_txt"><input type="text" name="youtube_embed_download_text" class="large-text" value="<?php echo esc_attr( $options[ 'download_text' ] ); ?>"/>
410
  <p class="description"><?php _e( 'Text or HTML to display to prompt download.', 'youtube-embed' ); ?></p></label></td>
411
  </tr>
412
 
414
 
415
  <tr>
416
  <th scope="row"><?php _e( 'Download Style', 'youtube-embed' ); ?></th>
417
+ <td><label for="youtube_embed_download_style"><input type="text" name="youtube_embed_download_style" class="large-text code" value="<?php echo esc_attr( $options[ 'download_style' ] ); ?>"/>
418
  <p class="description"><?php _e( 'CSS elements to apply to video download link.', 'youtube-embed' ); ?></p></label></td>
419
  </tr>
420
 
includes/shared-functions.php CHANGED
@@ -25,7 +25,7 @@ function ye_extract_id( $id ) {
25
  $replacement_from = array( '&#8211;', '&#8212;', '&#215;' );
26
  $replacement_to = array( '--', '---', 'x' );
27
 
28
- $id = trim( strip_tags( str_replace( $replacement_from, $replacement_to, $id ) ) );
29
 
30
  // Check if it's the full URL, as found in address bar
31
 
@@ -567,4 +567,3 @@ function ye_timer( $checkpoint, $name ) {
567
  return microtime( true );
568
 
569
  }
570
- ?>
25
  $replacement_from = array( '&#8211;', '&#8212;', '&#215;' );
26
  $replacement_to = array( '--', '---', 'x' );
27
 
28
+ $id = trim( wp_strip_all_tags( str_replace( $replacement_from, $replacement_to, $id ) ) );
29
 
30
  // Check if it's the full URL, as found in address bar
31
 
567
  return microtime( true );
568
 
569
  }
 
includes/shortcodes.php CHANGED
@@ -351,4 +351,3 @@ function ye_set_autohide( $autohide ) {
351
 
352
  return $autohide;
353
  }
354
- ?>
351
 
352
  return $autohide;
353
  }
 
js/mce4-button.js DELETED
@@ -1,17 +0,0 @@
1
- (function() {
2
- tinymce.PluginManager.add('mce4_youtube_button', function( editor, url ) {
3
- editor.addButton( 'mce4_youtube_button', {
4
- title: 'YouTube Embed',
5
- icon: 'icon dashicons-video-alt3',
6
- onclick: function() {
7
- selectText = tinymce.activeEditor.selection.getContent({format: 'text'});
8
- if ( selectText == '' ) {
9
- var yeOut = 'Insert video URL or ID here';
10
- } else {
11
- var yeOut = selectText;
12
- }
13
- editor.insertContent('[youtube]' + yeOut + '[/youtube]');
14
- }
15
- });
16
- });
17
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/mce4-button.min.js DELETED
@@ -1 +0,0 @@
1
- !function(){tinymce.PluginManager.add("mce4_youtube_button",function(t){t.addButton("mce4_youtube_button",{title:"YouTube Embed",icon:"icon dashicons-video-alt3",onclick:function(){if(selectText=tinymce.activeEditor.selection.getContent({format:"text"}),""==selectText)var e="Insert video URL or ID here";else var e=selectText;t.insertContent("[youtube]"+e+"[/youtube]")}})})}();
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: dartiss
3
  Tags: embed, insert, video, youtube
4
  Requires at least: 4.6
5
- Tested up to: 4.9
6
  Requires PHP: 5.3
7
- Stable tag: 5.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -70,14 +70,13 @@ Which options are available depends upon the users's set-up (for example, whethe
70
  * **annotation** - yes or no, this determines if annotations are shown
71
  * **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behavior, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
72
  * **autoplay** - yes or no, should the video automatically start playing?
73
- * **cc** - yes or no, decided whether closed captions (subtitles) are displayed. If you don't specify anything then the user's default will be used.
74
  * **color** - white or red, the color of the progress bar (see the FAQ about having a white progress bar with the light theme)
75
  * **controls** - 0, 1 or 2, this decides whether the controls should display and when the Flash will load. A value of 0 will not show the controls but 1 or 2 will. A value of 2 will load Flash once the user initiates playback - otherwise it's loaded straight away.
76
  * **disablekb** - yes or no, disable keyboard controls
77
  * **fullscreen** - yes or no, this will add the fullscreen button to the toolbar
78
  * **height** - the video height, in pixels
79
  * **html5** - yes or no, whether to force HTML5 as the default player or not (if available). NB: This is an undocumented feature and, as such, may not work
80
- * **info** - yes or no, show video information. If displaying a playlist this will show video thumbnails
81
  * **list** - if you've specified your own list, use this to select the way the videos should be output. Should be `random` (display videos in a random order), `single` (show just one video, randomly picked from the list) or `order` (show each video in the original order - this is the default)
82
  * **loop** - yes or no, whether to start the video again once it ends
83
  * **modest** - reduce the branding on the video
@@ -332,7 +331,15 @@ Before reporting it please bear in mind that this plugin uses the standard YouTu
332
 
333
  == Changelog ==
334
 
335
- [Learn more about my version numbering methodology](https://artiss.blog/2016/09/wordpress-plugin-versioning/ "WordPress Plugin Versioning")
 
 
 
 
 
 
 
 
336
 
337
  = 5.0.4 =
338
  * Maintenance: Updated this README for better presentation in the new plugin directory. Funky.
@@ -533,5 +540,5 @@ Before reporting it please bear in mind that this plugin uses the standard YouTu
533
 
534
  == Upgrade Notice ==
535
 
536
- = 5.0.4 =
537
  * Maintenance changes
2
  Contributors: dartiss
3
  Tags: embed, insert, video, youtube
4
  Requires at least: 4.6
5
+ Tested up to: 5.0.3
6
  Requires PHP: 5.3
7
+ Stable tag: 5.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
70
  * **annotation** - yes or no, this determines if annotations are shown
71
  * **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behavior, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
72
  * **autoplay** - yes or no, should the video automatically start playing?
73
+ * **cc** - yes or no, decided whether closed captions are displayed. If you don't specify anything then the user's default will be used.
74
  * **color** - white or red, the color of the progress bar (see the FAQ about having a white progress bar with the light theme)
75
  * **controls** - 0, 1 or 2, this decides whether the controls should display and when the Flash will load. A value of 0 will not show the controls but 1 or 2 will. A value of 2 will load Flash once the user initiates playback - otherwise it's loaded straight away.
76
  * **disablekb** - yes or no, disable keyboard controls
77
  * **fullscreen** - yes or no, this will add the fullscreen button to the toolbar
78
  * **height** - the video height, in pixels
79
  * **html5** - yes or no, whether to force HTML5 as the default player or not (if available). NB: This is an undocumented feature and, as such, may not work
 
80
  * **list** - if you've specified your own list, use this to select the way the videos should be output. Should be `random` (display videos in a random order), `single` (show just one video, randomly picked from the list) or `order` (show each video in the original order - this is the default)
81
  * **loop** - yes or no, whether to start the video again once it ends
82
  * **modest** - reduce the branding on the video
331
 
332
  == Changelog ==
333
 
334
+ [Learn more about my version numbering methodology](https://artiss.blog/2016/09/wordpress-plugin-versioning/ "WordPress Plugin Versioning")
335
+
336
+ = 5.0.5 =
337
+ * Maintenance: The `rel` parameter has changed and the `showinfo` has been deprecated. Have updated the plugin for these changes
338
+ * Maintenance: I've removed the editor button. It doesn't work after WP 5.0 and I don't wish to maintain it
339
+ * Maintenance: I'm now using a time constant when caching
340
+ * Maintenance: Added Github links to plugin meta
341
+ * Maintenance: Using the `checked` function for screen output
342
+ * Maintenance: A minor language tweak, where I was specifying something that should, ideally, be captured by translations instead
343
 
344
  = 5.0.4 =
345
  * Maintenance: Updated this README for better presentation in the new plugin directory. Funky.
540
 
541
  == Upgrade Notice ==
542
 
543
+ = 5.0.5 =
544
  * Maintenance changes
uninstall.php CHANGED
@@ -56,4 +56,3 @@ delete_option( 'youtube_embed_version' );
56
  global $wpdb;
57
  $sql = "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_youtubeembed_%' OR option_name LIKE '_transient_timeout_youtubeembed_%'";
58
  $wipe = $wpdb -> query( $sql );
59
- ?>
56
  global $wpdb;
57
  $sql = "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_youtubeembed_%' OR option_name LIKE '_transient_timeout_youtubeembed_%'";
58
  $wipe = $wpdb -> query( $sql );
 
youtube-embed.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: YouTube Embed
4
- Plugin URI: https://wordpress.org/plugins/youtube-embed/
5
  Description: An incredibly fast, simple, yet powerful, method of embedding YouTube videos into your WordPress site.
6
- Version: 5.0.4
7
  Author: dartiss
8
  Author URI: https://artiss.blog
9
  Text Domain: youtube-embed
@@ -18,7 +18,7 @@ Text Domain: youtube-embed
18
  * @since 2.0
19
  */
20
 
21
- define( 'youtube_embed_version', '5.0.3' );
22
 
23
  $functions_dir = plugin_dir_path( __FILE__ ) . 'includes/';
24
 
@@ -41,4 +41,3 @@ include_once( $functions_dir . 'caching.php' ); // Data caching functions
41
  include_once( $functions_dir . 'shortcodes.php' ); // Shortcodes
42
 
43
  include_once( $functions_dir . 'admin-config.php' ); // Administration configuration
44
- ?>
1
  <?php
2
  /*
3
  Plugin Name: YouTube Embed
4
+ Plugin URI: https://github.com/dartiss/youtube-embed
5
  Description: An incredibly fast, simple, yet powerful, method of embedding YouTube videos into your WordPress site.
6
+ Version: 5.0.5
7
  Author: dartiss
8
  Author URI: https://artiss.blog
9
  Text Domain: youtube-embed
18
  * @since 2.0
19
  */
20
 
21
+ define( 'youtube_embed_version', '5.0.5' );
22
 
23
  $functions_dir = plugin_dir_path( __FILE__ ) . 'includes/';
24
 
41
  include_once( $functions_dir . 'shortcodes.php' ); // Shortcodes
42
 
43
  include_once( $functions_dir . 'admin-config.php' ); // Administration configuration