YouTube - Version 11.0.1

Version Description

Download this release

Release Info

Developer embedplus
Plugin Icon 128x128 YouTube
Version 11.0.1
Comparing to
See all releases

Code changes from version 11.0 to 11.0.1

Files changed (3) hide show
  1. readme.txt +4 -1
  2. scripts/_fitvids.js +0 -81
  3. youtube.php +13 -13
readme.txt CHANGED
@@ -4,7 +4,7 @@ Plugin Name: YouTube Embed
4
  Tags: youtube channel, video gallery, youtube galleries, channel gallery, gallery, playlist gallery, youtube gallery, accessibility, analytics, api, blocked youtube videos, cache, caching, channel, deleted youtube videos, effects, embed youtube, embedding youtube, featured image, get_locale, i18n, internationalization, l10n, language, lazy, lazy load, locale, localization, mute, no-cookie, oembed, page speed, playlist, playlists, plugin, Reddit, responsive, seo, short code, shortcode, ssl, subtitles, thumbnail, thumbnail image, thumbnails, tinymce, translate, translator, video, video analytics, video plugin, video seo, video shortcode, video thumbnails, view count, volume, widget, wordpress security, wordpress youtube embed, youtube, youtube api, youtube analytics, youtube embed, youtube impressions, youtube player, youtube playlist, youtube plugin, youtube shortcode, youtube snippets, youtube takedowns, youtube thumbnails, youtube plugin migration
5
  Requires at least: 3.3
6
  Tested up to: 4.4
7
- Stable tag: 11.0
8
  License: GPLv3 or later
9
 
10
  YouTube embed plugin. Embed a responsive video, YouTube channel gallery, or playlist gallery. Add video thumbnails, analytics, SEO, caching...
@@ -147,6 +147,9 @@ You can also start and end each individual video at particular times. Like the a
147
 
148
  == Changelog ==
149
 
 
 
 
150
  = YouTube Embed 11.0 =
151
  Improves playlist and gallery embedding functionality.
152
 
4
  Tags: youtube channel, video gallery, youtube galleries, channel gallery, gallery, playlist gallery, youtube gallery, accessibility, analytics, api, blocked youtube videos, cache, caching, channel, deleted youtube videos, effects, embed youtube, embedding youtube, featured image, get_locale, i18n, internationalization, l10n, language, lazy, lazy load, locale, localization, mute, no-cookie, oembed, page speed, playlist, playlists, plugin, Reddit, responsive, seo, short code, shortcode, ssl, subtitles, thumbnail, thumbnail image, thumbnails, tinymce, translate, translator, video, video analytics, video plugin, video seo, video shortcode, video thumbnails, view count, volume, widget, wordpress security, wordpress youtube embed, youtube, youtube api, youtube analytics, youtube embed, youtube impressions, youtube player, youtube playlist, youtube plugin, youtube shortcode, youtube snippets, youtube takedowns, youtube thumbnails, youtube plugin migration
5
  Requires at least: 3.3
6
  Tested up to: 4.4
7
+ Stable tag: 11.0.1
8
  License: GPLv3 or later
9
 
10
  YouTube embed plugin. Embed a responsive video, YouTube channel gallery, or playlist gallery. Add video thumbnails, analytics, SEO, caching...
147
 
148
  == Changelog ==
149
 
150
+ = YouTube Embed 11.0.1 =
151
+ Improves HTTPS support for structured data tags, and HTTPS support in Firefox.
152
+
153
  = YouTube Embed 11.0 =
154
  Improves playlist and gallery embedding functionality.
155
 
scripts/_fitvids.js DELETED
@@ -1,81 +0,0 @@
1
- function epdofitvids($)
2
- {
3
- if (_EPYT_.epresponsiveselector.constructor !== Array)
4
- {
5
- _EPYT_.epresponsiveselector = JSON.parse(_EPYT_.epresponsiveselector);
6
- }
7
-
8
- $.fn.fitVidsEP = function (options) {
9
- var settings = {
10
- customSelector: null
11
- };
12
-
13
- if (!document.getElementById('fit-vids-style')) {
14
-
15
- var div = document.createElement('div'),
16
- ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
17
- cssStyles = '&shy;<style>.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>';
18
-
19
- div.className = 'fit-vids-style';
20
- div.id = 'fit-vids-style';
21
- div.style.display = 'none';
22
- div.innerHTML = cssStyles;
23
-
24
- ref.parentNode.insertBefore(div, ref);
25
-
26
- }
27
-
28
- if (options) {
29
- $.extend(settings, options);
30
- }
31
-
32
- return this.each(function () {
33
- // var selectors = [
34
- // "iframe[src*='youtube.com']",
35
- // "iframe[src*='youtube-nocookie.com']"
36
- // ];
37
- var selectors = _EPYT_.epresponsiveselector;
38
-
39
- if (settings.customSelector) {
40
- selectors.push(settings.customSelector);
41
- }
42
-
43
- var $allVideos = $(this).find(selectors.join(','));
44
- $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
45
-
46
- $allVideos.each(function () {
47
- var $this = $(this);
48
- if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) {
49
- return;
50
- }
51
- var height = (this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10)))) ? parseInt($this.attr('height'), 10) : $this.height(),
52
- width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
53
- aspectRatio = height / width;
54
- if (!$this.attr('id')) {
55
- var videoID = 'fitvid' + Math.floor(Math.random() * 999999);
56
- $this.attr('id', videoID);
57
- }
58
- var fwvwrap = document.createElement('div');
59
- fwvwrap.className = 'fluid-width-video-wrapper';
60
- try {
61
- $this.wrap(fwvwrap).parent('.fluid-width-video-wrapper').attr('style', 'padding-top: ' + (aspectRatio * 100) + "% !important;");
62
- $this.removeAttr('height').removeAttr('width');
63
- }
64
- catch (wraperr) {
65
- }
66
- });
67
- });
68
- };
69
-
70
- $(document).ready(function () {
71
- $("body").fitVidsEP();
72
- });
73
- return true;
74
- }
75
-
76
- try {
77
- epdofitvids(window.jQuery);
78
- } catch (err) {
79
- }
80
-
81
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
youtube.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: YouTube
4
  Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
5
  Description: YouTube embed plugin. Embed a responsive YouTube video, playlist gallery, or channel gallery. Add video thumbnails, analytics, SEO, caching...
6
- Version: 11.0
7
  Author: EmbedPlus Team
8
  Author URI: http://www.embedplus.com
9
  */
@@ -32,7 +32,7 @@
32
  class YouTubePrefs
33
  {
34
 
35
- public static $version = '11.0';
36
  public static $opt_version = 'version';
37
  public static $optembedwidth = null;
38
  public static $optembedheight = null;
@@ -405,13 +405,13 @@ class YouTubePrefs
405
  {
406
  try
407
  {
408
- $odata = self::get_oembed('http://youtube.com/watch?v=' . $vidid, 1920, 1280);
409
  $postlink = get_permalink($postid);
410
  if ($odata != null && !is_wp_error($odata))
411
  {
412
  $_name = esc_attr(sanitize_text_field($odata->title));
413
  $_description = esc_attr(sanitize_text_field($odata->author_name));
414
- $_thumbnailUrl = esc_url("//i.ytimg.com/vi/" . $vidid . "/0.jpg");
415
 
416
  $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accthumb"><img src="' . $_thumbnailUrl . '" /></a>';
417
  $thehtml .= '<div class="accinfo">';
@@ -441,7 +441,7 @@ class YouTubePrefs
441
  // if playlist
442
  try
443
  {
444
- $odata = self::get_oembed('http://youtube.com/playlist?list=' . $linkparams['list'], 1920, 1280);
445
  $postlink = get_permalink($postid);
446
  if ($odata != null && !is_wp_error($odata))
447
  {
@@ -935,7 +935,7 @@ class YouTubePrefs
935
 
936
  public static function apply_prefs_shortcode_youtube($atts, $content = null)
937
  {
938
- $content = 'http://www.youtube.com/watch?v=' . trim($content);
939
  $currfilter = current_filter();
940
  if (preg_match(self::$justurlregex, $content))
941
  {
@@ -1431,7 +1431,7 @@ class YouTubePrefs
1431
  }
1432
 
1433
  $code1 = '<iframe ' . $dyntype . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
1434
- '" ' . $dynsrc . 'src="//www.' . $youtubebaseurl . '.com/embed/' . $videoseries . $videoidoutput . '?';
1435
  $code2 = '" frameborder="0" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
1436
  '"' . $voloutput . $acctitle . ' allowfullscreen ></iframe>' . $schemaorgoutput;
1437
 
@@ -1551,12 +1551,12 @@ class YouTubePrefs
1551
  {
1552
  $_name = esc_attr(sanitize_text_field(str_replace("@", "&#64;", $json['items'][0]['snippet']['title'])));
1553
  $_description = esc_attr(sanitize_text_field(str_replace("@", "&#64;", $json['items'][0]['snippet']['description'])));
1554
- $_thumbnailUrl = esc_url("http://i.ytimg.com/vi/" . $vidid . "/0.jpg");
1555
  $_duration = $json['items'][0]['contentDetails']['duration']; // "T0H9M35S" "PT9M35S"
1556
  $_uploadDate = sanitize_text_field($json['items'][0]['snippet']['publishedAt']); // "2014-10-03T15:30:12.000Z"
1557
 
1558
  $schemaorgcode = '<span itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
1559
- $schemaorgcode .= '<meta itemprop="embedURL" content="http://www.youtube.com/embed/' . $vidid . '">';
1560
  $schemaorgcode .= '<meta itemprop="name" content="' . $_name . '">';
1561
  $schemaorgcode .= '<meta itemprop="description" content="' . $_description . '">';
1562
  $schemaorgcode .= '<meta itemprop="thumbnailUrl" content="' . $_thumbnailUrl . '">';
@@ -2115,11 +2115,11 @@ class YouTubePrefs
2115
  $new_pointer_content .= '<p>'; // ooopointer
2116
  if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
2117
  {
2118
- $new_pointer_content .= __("This update improves support for gallery and playlist codes in Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions &raquo;</a>");
2119
  }
2120
  else
2121
  {
2122
- $new_pointer_content .= __("This update improves support for gallery and playlist codes in Free and Pro versions.");
2123
  }
2124
  $new_pointer_content .= '</p>';
2125
 
@@ -2546,7 +2546,7 @@ class YouTubePrefs
2546
  How to Insert a YouTube Video or Playlist &nbsp; <a class="smallnote" href="#jumpgallery">(For gallery directions, go here &raquo;)</a>
2547
  </h3>
2548
  <p>
2549
- <b>For videos:</b> <i>Method 1 - </i> Do you already have a URL to the video you want to embed in a post, page, or even a widget? All you have to do is paste it on its own line, as shown below (including the http:// part). Easy, eh?<br>
2550
  <i>Method 2 - </i> If you want to do some formatting (e.g. add HTML to center a video) or have two or more videos next to each other on the same line, wrap each link with the <code>[embedyt]...[/embedyt]</code> shortcode. <b>Tip for embedding videos on the same line:</b> As shown in the example image below, decrease the size of each video so that they fit together on the same line (See the "How To Override Defaults" section for height and width instructions).
2551
  </p>
2552
  <p>
@@ -2838,7 +2838,7 @@ class YouTubePrefs
2838
  <p>
2839
  <b class="chktitle">YouTube API Key:</b>
2840
  <input type="text" name="<?php echo self::$opt_gallery_apikey; ?>" id="<?php echo self::$opt_gallery_apikey; ?>" value="<?php echo trim($all[self::$opt_apikey]); ?>" class="textinput" style="width: 250px;">
2841
- Required so your site can get the thumbnails, title text, and other content from YouTubes servers that used to render galleries. <a href="https://www.youtube.com/watch?v=px8LvNIVblg" target="_blank">Click this link &raquo;</a> and follow the video to the right to get your API key.
2842
  </p>
2843
  <p>
2844
  <label for="<?php echo self::$opt_gallery_pagesize; ?>"><b class="chktitle">Gallery Page Size:</b></label>
3
  Plugin Name: YouTube
4
  Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
5
  Description: YouTube embed plugin. Embed a responsive YouTube video, playlist gallery, or channel gallery. Add video thumbnails, analytics, SEO, caching...
6
+ Version: 11.0.1
7
  Author: EmbedPlus Team
8
  Author URI: http://www.embedplus.com
9
  */
32
  class YouTubePrefs
33
  {
34
 
35
+ public static $version = '11.0.1';
36
  public static $opt_version = 'version';
37
  public static $optembedwidth = null;
38
  public static $optembedheight = null;
405
  {
406
  try
407
  {
408
+ $odata = self::get_oembed('https://youtube.com/watch?v=' . $vidid, 1920, 1280);
409
  $postlink = get_permalink($postid);
410
  if ($odata != null && !is_wp_error($odata))
411
  {
412
  $_name = esc_attr(sanitize_text_field($odata->title));
413
  $_description = esc_attr(sanitize_text_field($odata->author_name));
414
+ $_thumbnailUrl = esc_url("https://i.ytimg.com/vi/" . $vidid . "/0.jpg");
415
 
416
  $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accthumb"><img src="' . $_thumbnailUrl . '" /></a>';
417
  $thehtml .= '<div class="accinfo">';
441
  // if playlist
442
  try
443
  {
444
+ $odata = self::get_oembed('https://youtube.com/playlist?list=' . $linkparams['list'], 1920, 1280);
445
  $postlink = get_permalink($postid);
446
  if ($odata != null && !is_wp_error($odata))
447
  {
935
 
936
  public static function apply_prefs_shortcode_youtube($atts, $content = null)
937
  {
938
+ $content = 'https://www.youtube.com/watch?v=' . trim($content);
939
  $currfilter = current_filter();
940
  if (preg_match(self::$justurlregex, $content))
941
  {
1431
  }
1432
 
1433
  $code1 = '<iframe ' . $dyntype . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
1434
+ '" ' . $dynsrc . 'src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoseries . $videoidoutput . '?';
1435
  $code2 = '" frameborder="0" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
1436
  '"' . $voloutput . $acctitle . ' allowfullscreen ></iframe>' . $schemaorgoutput;
1437
 
1551
  {
1552
  $_name = esc_attr(sanitize_text_field(str_replace("@", "&#64;", $json['items'][0]['snippet']['title'])));
1553
  $_description = esc_attr(sanitize_text_field(str_replace("@", "&#64;", $json['items'][0]['snippet']['description'])));
1554
+ $_thumbnailUrl = esc_url("https://i.ytimg.com/vi/" . $vidid . "/0.jpg");
1555
  $_duration = $json['items'][0]['contentDetails']['duration']; // "T0H9M35S" "PT9M35S"
1556
  $_uploadDate = sanitize_text_field($json['items'][0]['snippet']['publishedAt']); // "2014-10-03T15:30:12.000Z"
1557
 
1558
  $schemaorgcode = '<span itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
1559
+ $schemaorgcode .= '<meta itemprop="embedURL" content="https://www.youtube.com/embed/' . $vidid . '">';
1560
  $schemaorgcode .= '<meta itemprop="name" content="' . $_name . '">';
1561
  $schemaorgcode .= '<meta itemprop="description" content="' . $_description . '">';
1562
  $schemaorgcode .= '<meta itemprop="thumbnailUrl" content="' . $_thumbnailUrl . '">';
2115
  $new_pointer_content .= '<p>'; // ooopointer
2116
  if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
2117
  {
2118
+ $new_pointer_content .= __("This update improves HTTPS support for both Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions &raquo;</a>");
2119
  }
2120
  else
2121
  {
2122
+ $new_pointer_content .= __("This update improves HTTPS support for both Free and Pro versions.");
2123
  }
2124
  $new_pointer_content .= '</p>';
2125
 
2546
  How to Insert a YouTube Video or Playlist &nbsp; <a class="smallnote" href="#jumpgallery">(For gallery directions, go here &raquo;)</a>
2547
  </h3>
2548
  <p>
2549
+ <b>For videos:</b> <i>Method 1 - </i> Do you already have a URL to the video you want to embed in a post, page, or even a widget? All you have to do is paste it on its own line, as shown below (including the https:// part). Easy, eh?<br>
2550
  <i>Method 2 - </i> If you want to do some formatting (e.g. add HTML to center a video) or have two or more videos next to each other on the same line, wrap each link with the <code>[embedyt]...[/embedyt]</code> shortcode. <b>Tip for embedding videos on the same line:</b> As shown in the example image below, decrease the size of each video so that they fit together on the same line (See the "How To Override Defaults" section for height and width instructions).
2551
  </p>
2552
  <p>
2838
  <p>
2839
  <b class="chktitle">YouTube API Key:</b>
2840
  <input type="text" name="<?php echo self::$opt_gallery_apikey; ?>" id="<?php echo self::$opt_gallery_apikey; ?>" value="<?php echo trim($all[self::$opt_apikey]); ?>" class="textinput" style="width: 250px;">
2841
+ Required so your site can get the thumbnails, title text, and other content from YouTube's servers that used to render galleries. <a href="https://www.youtube.com/watch?v=px8LvNIVblg" target="_blank">Click this link &raquo;</a> and follow the video to the right to get your API key.
2842
  </p>
2843
  <p>
2844
  <label for="<?php echo self::$opt_gallery_pagesize; ?>"><b class="chktitle">Gallery Page Size:</b></label>