YouTube Embed - Version 4.0.2

Version Description

  • Maintenance: Not really a bug, but in some circumstances I wasn't initialising a variable used when generating the embed code. It worked fine but wasn't best practise so fixed. Sloppy.
  • Maintenance: Modified the default parameters so new user videos should appear with the same options as on YouTube itself. Consistent.
  • Maintenance: I ABSOLUTELY refuse to call this a bug. But I was calling get_the_excerpt() to build some of the video meta data. For some reason, still unknown to me, other plugins were crashing as a result of it. I've removed it for now but am investigating the cause. Frustrating.
  • Enhancement: WMODE is now only added to the embed URL if it's anything other than the default. Shrinkage.
Download this release

Release Info

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

Code changes from version 4.0.1 to 4.0.2

includes/generate-embed-code.php CHANGED
@@ -297,6 +297,7 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
297
  if ( $controls != 1 ) { $paras .= '&controls=' . $controls; }
298
  if ( strtolower( $color ) != 'red' ) { $paras .= '&color=' . strtolower( $color ); }
299
  if ( strtolower( $theme ) != 'dark' ) { $paras .= '&theme=' . strtolower( $theme ); }
 
300
 
301
  // If not a playlist, add the playlist parameter
302
 
@@ -322,6 +323,7 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
322
  }
323
  } else {
324
  $ttab = '';
 
325
  }
326
 
327
  // Add Metadata
@@ -330,7 +332,7 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
330
 
331
  $result .= $ttab . '<meta itemprop="url" content="http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '" />' . $newline;
332
  $result .= $ttab . '<meta itemprop="name" content="' . get_the_title() . '" />' . $newline;
333
- $result .= $ttab . '<meta itemprop="description" content="' . htmlentities( get_the_excerpt() ). '" />' . $newline;
334
  $result .= $ttab . '<meta itemprop="uploadDate" content="' . get_the_date( 'c' ) . '" />' . $newline;
335
  $result .= $ttab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/hqdefault.jpg" />' . $newline;
336
  $result .= $ttab . '<meta itemprop="embedUrl" content="http' . $https . '://www.youtube.com/embed/' . $id . '" />' . $newline;
@@ -372,7 +374,7 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
372
 
373
  $embed_url .= $id_paras;
374
  if ( strpos( $embed_url, '?' ) > 0 ) { $paras = '&' . substr( $paras, 1 ); }
375
- $embed_url .= $paras . '&wmode=' . $wmode;
376
 
377
  // Check length of URL to ensure it doesn't exceed 2000 characters
378
 
@@ -551,4 +553,4 @@ function vye_decode( $encoded ) {
551
 
552
  return $decoded;
553
  }
554
- ?>
297
  if ( $controls != 1 ) { $paras .= '&controls=' . $controls; }
298
  if ( strtolower( $color ) != 'red' ) { $paras .= '&color=' . strtolower( $color ); }
299
  if ( strtolower( $theme ) != 'dark' ) { $paras .= '&theme=' . strtolower( $theme ); }
300
+ if ( $wmode != 'window' ) { $paras .= '&wmode=' . $wmode; }
301
 
302
  // If not a playlist, add the playlist parameter
303
 
323
  }
324
  } else {
325
  $ttab = '';
326
+ $result = '';
327
  }
328
 
329
  // Add Metadata
332
 
333
  $result .= $ttab . '<meta itemprop="url" content="http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '" />' . $newline;
334
  $result .= $ttab . '<meta itemprop="name" content="' . get_the_title() . '" />' . $newline;
335
+ $result .= $ttab . '<meta itemprop="description" content="' . get_the_title() . '" />' . $newline;
336
  $result .= $ttab . '<meta itemprop="uploadDate" content="' . get_the_date( 'c' ) . '" />' . $newline;
337
  $result .= $ttab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/hqdefault.jpg" />' . $newline;
338
  $result .= $ttab . '<meta itemprop="embedUrl" content="http' . $https . '://www.youtube.com/embed/' . $id . '" />' . $newline;
374
 
375
  $embed_url .= $id_paras;
376
  if ( strpos( $embed_url, '?' ) > 0 ) { $paras = '&' . substr( $paras, 1 ); }
377
+ $embed_url .= $paras;
378
 
379
  // Check length of URL to ensure it doesn't exceed 2000 characters
380
 
553
 
554
  return $decoded;
555
  }
556
+ ?>
includes/shared-functions.php CHANGED
@@ -554,17 +554,16 @@ function vye_set_profile_defaults( $profile ) {
554
  $changed = true;
555
  }
556
  if ( !array_key_exists( 'height', $options ) ) { $options[ 'height' ] = 340; $changed = true; }
557
- if ( !array_key_exists( 'fullscreen', $options ) ) { $options[ 'fullscreen' ] = ''; $changed = true; }
558
  if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
559
  if ( !array_key_exists( 'autoplay', $options ) ) { $options[ 'autoplay' ] = ''; $changed = true; }
560
  if ( !array_key_exists( 'start', $options ) ) { $options[ 'start' ] = 0; $changed = true; }
561
  if ( !array_key_exists( 'loop', $options ) ) { $options[ 'loop' ] = ''; $changed = true; }
562
  if ( !array_key_exists( 'cc', $options ) ) { $options[ 'cc' ] = ''; $changed = true; }
563
  if ( !array_key_exists( 'annotation', $options ) ) { $options[ 'annotation' ] = 1; $changed = true; }
564
- if ( !array_key_exists( 'related', $options ) ) { $options[ 'related' ] = ''; $changed = true; }
565
  if ( !array_key_exists( 'info', $options ) ) { $options[ 'info' ] = 1; $changed = true; }
566
  if ( !array_key_exists( 'stop', $options ) ) { $options[ 'stop' ] = 0; $changed = true; }
567
- if ( !array_key_exists( 'type', $options ) ) { $options[ 'type' ] = 'v'; $changed = true; }
568
  if ( !array_key_exists( 'disablekb', $options ) ) { $options[ 'disablekb' ] = ''; $changed = true; }
569
  if ( !array_key_exists( 'autohide', $options ) ) { $options[ 'autohide' ] = 2; $changed = true; }
570
  if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = 1; $changed = true; }
@@ -572,8 +571,8 @@ function vye_set_profile_defaults( $profile ) {
572
  if ( !array_key_exists( 'style', $options ) ) { $options[ 'style' ] = ''; $changed = true; }
573
  if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
574
  if ( !array_key_exists( 'theme', $options ) ) { $options[ 'theme' ] = 'dark'; $changed = true; }
575
- if ( !array_key_exists( 'https', $options ) ) { $options[ 'https' ] = 0; $changed = true; }
576
- if ( !array_key_exists( 'modest', $options ) ) { $options[ 'modest' ] = 1; $changed = true; }
577
  if ( !array_key_exists( 'dynamic', $options ) ) { $options[ 'dynamic' ] = ''; $changed = true; }
578
  if ( !array_key_exists( 'fixed', $options ) ) { $options[ 'fixed' ] = ''; $changed = true; }
579
  if ( !array_key_exists( 'download', $options ) ) { $options[ 'download' ] = ''; $changed = true; }
554
  $changed = true;
555
  }
556
  if ( !array_key_exists( 'height', $options ) ) { $options[ 'height' ] = 340; $changed = true; }
557
+ if ( !array_key_exists( 'fullscreen', $options ) ) { $options[ 'fullscreen' ] = 1; $changed = true; }
558
  if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
559
  if ( !array_key_exists( 'autoplay', $options ) ) { $options[ 'autoplay' ] = ''; $changed = true; }
560
  if ( !array_key_exists( 'start', $options ) ) { $options[ 'start' ] = 0; $changed = true; }
561
  if ( !array_key_exists( 'loop', $options ) ) { $options[ 'loop' ] = ''; $changed = true; }
562
  if ( !array_key_exists( 'cc', $options ) ) { $options[ 'cc' ] = ''; $changed = true; }
563
  if ( !array_key_exists( 'annotation', $options ) ) { $options[ 'annotation' ] = 1; $changed = true; }
564
+ if ( !array_key_exists( 'related', $options ) ) { $options[ 'related' ] = 1; $changed = true; }
565
  if ( !array_key_exists( 'info', $options ) ) { $options[ 'info' ] = 1; $changed = true; }
566
  if ( !array_key_exists( 'stop', $options ) ) { $options[ 'stop' ] = 0; $changed = true; }
 
567
  if ( !array_key_exists( 'disablekb', $options ) ) { $options[ 'disablekb' ] = ''; $changed = true; }
568
  if ( !array_key_exists( 'autohide', $options ) ) { $options[ 'autohide' ] = 2; $changed = true; }
569
  if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = 1; $changed = true; }
571
  if ( !array_key_exists( 'style', $options ) ) { $options[ 'style' ] = ''; $changed = true; }
572
  if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
573
  if ( !array_key_exists( 'theme', $options ) ) { $options[ 'theme' ] = 'dark'; $changed = true; }
574
+ if ( !array_key_exists( 'https', $options ) ) { $options[ 'https' ] = 1; $changed = true; }
575
+ if ( !array_key_exists( 'modest', $options ) ) { $options[ 'modest' ] = ''; $changed = true; }
576
  if ( !array_key_exists( 'dynamic', $options ) ) { $options[ 'dynamic' ] = ''; $changed = true; }
577
  if ( !array_key_exists( 'fixed', $options ) ) { $options[ 'fixed' ] = ''; $changed = true; }
578
  if ( !array_key_exists( 'download', $options ) ) { $options[ 'download' ] = ''; $changed = true; }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://artiss.co.uk/donate
4
  Tags: annotations, artiss, chromecast, comments, download, embed, embedding, embedplus, flash, flv, hd, iframe, media, play, playlist, profile, responsive, seo, url, video, widget, youtube, youtuber
5
  Requires at least: 3.9
6
  Tested up to: 4.3.1
7
- Stable tag: 4.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -303,6 +303,10 @@ There is no way to specify this - YouTube makes the decision on which version to
303
 
304
  This is usually due to using a different ratio than the video was designed for. If you're not sure which ratio to use head to its page on YouTube, click on Share and then Embed and then Show More. A video size will be shown, which you can use to work out the correct ration for the video.
305
 
 
 
 
 
306
  = I have another issue or a request =
307
 
308
  Before reporting it please bear in mind that this plugin uses the standard YouTube API. Adding extra functionality to the player itself is not possible and there are [known issues](https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube "YouTube API Known Issues") with it. I would also recommend performing a Google search for your issue too first, as this will often resolve a lot of queries.
@@ -318,6 +322,12 @@ Before reporting it please bear in mind that this plugin uses the standard YouTu
318
 
319
  == Changelog ==
320
 
 
 
 
 
 
 
321
  = 4.0.1 =
322
  * Maintenance: Left some debug code in by mistake. Doh. Sometimes I'd forget my own head if it wasn't screwed on.... Apologies to those affected.
323
 
@@ -636,6 +646,9 @@ Before reporting it please bear in mind that this plugin uses the standard YouTu
636
 
637
  == Upgrade Notice ==
638
 
 
 
 
639
  = 4.0.1 =
640
  * Upgrade to remove some debug code
641
 
4
  Tags: annotations, artiss, chromecast, comments, download, embed, embedding, embedplus, flash, flv, hd, iframe, media, play, playlist, profile, responsive, seo, url, video, widget, youtube, youtuber
5
  Requires at least: 3.9
6
  Tested up to: 4.3.1
7
+ Stable tag: 4.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
303
 
304
  This is usually due to using a different ratio than the video was designed for. If you're not sure which ratio to use head to its page on YouTube, click on Share and then Embed and then Show More. A video size will be shown, which you can use to work out the correct ration for the video.
305
 
306
+ = The controls under the video don't display properly when using Firefox =
307
+
308
+ This is a bug in Firefox. Short term, switch on SSL in the Profiles screen and it will work. Longer term, I've [raised a bug report with Mozilla](https://bugzilla.mozilla.org/show_bug.cgi?id=1223515 "Bug 1223515 - Broken images in YouTube embedded player when not using SSL").
309
+
310
  = I have another issue or a request =
311
 
312
  Before reporting it please bear in mind that this plugin uses the standard YouTube API. Adding extra functionality to the player itself is not possible and there are [known issues](https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube "YouTube API Known Issues") with it. I would also recommend performing a Google search for your issue too first, as this will often resolve a lot of queries.
322
 
323
  == Changelog ==
324
 
325
+ = 4.0.2 =
326
+ * Maintenance: Not really a bug, but in some circumstances I wasn't initialising a variable used when generating the embed code. It worked fine but wasn't best practise so fixed. Sloppy.
327
+ * Maintenance: Modified the default parameters so new user videos should appear with the same options as on YouTube itself. Consistent.
328
+ * Maintenance: I ABSOLUTELY refuse to call this a bug. But I was calling get_the_excerpt() to build some of the video meta data. For some reason, still unknown to me, other plugins were crashing as a result of it. I've removed it for now but am investigating the cause. Frustrating.
329
+ * Enhancement: WMODE is now only added to the embed URL if it's anything other than the default. Shrinkage.
330
+
331
  = 4.0.1 =
332
  * Maintenance: Left some debug code in by mistake. Doh. Sometimes I'd forget my own head if it wasn't screwed on.... Apologies to those affected.
333
 
646
 
647
  == Upgrade Notice ==
648
 
649
+ = 4.0.2 =
650
+ * Minor bug fixes
651
+
652
  = 4.0.1 =
653
  * Upgrade to remove some debug code
654
 
youtube-embed.php CHANGED
@@ -3,10 +3,11 @@
3
  Plugin Name: YouTube Embed
4
  Plugin URI: https://wordpress.org/plugins/youtube-embed/
5
  Description: Embed YouTube Videos in WordPress
6
- Version: 4.0.1
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  Text Domain: youtube-embed
 
10
  */
11
 
12
  /**
@@ -18,7 +19,7 @@ Text Domain: youtube-embed
18
  * @since 2.0
19
  */
20
 
21
- define( 'youtube_embed_version', '4.0.1' );
22
 
23
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
24
 
3
  Plugin Name: YouTube Embed
4
  Plugin URI: https://wordpress.org/plugins/youtube-embed/
5
  Description: Embed YouTube Videos in WordPress
6
+ Version: 4.0.2
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  Text Domain: youtube-embed
10
+ Domain Path: /languages
11
  */
12
 
13
  /**
19
  * @since 2.0
20
  */
21
 
22
+ define( 'youtube_embed_version', '4.0.2' );
23
 
24
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
25