YouTube - Version 11.5

Version Description

Download this release

Release Info

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

Code changes from version 11.4 to 11.5

images/arrow-left-white.svg ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
6
+ <path fill="#FFFFFF" d="M0,256L256,0v128L128,256l128,128v128L0,256z M512,512V384L384,256l128-128V0L256,256L512,512z"/>
7
+ </svg>
images/arrow-right-white.svg ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
6
+ <path fill="#FFFFFF" d="M256,512V384l128-128L256,128V0l256,256L256,512z M256,256L0,0v128l128,128L0,384v128L256,256z"/>
7
+ </svg>
images/index.html CHANGED
@@ -6,6 +6,6 @@
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
- <img src="../screenshot-3.jpg" />
10
  </body>
11
  </html>
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
+ <img alt="YouTube Plugin Screenshot" src="../screenshot-3.jpg" />
10
  </body>
11
  </html>
index.html CHANGED
@@ -6,6 +6,6 @@
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
- <img src="screenshot-3.jpg" />
10
  </body>
11
  </html>
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
+ <img alt="YouTube Plugin Screenshot" src="screenshot-3.jpg" />
10
  </body>
11
  </html>
readme.txt CHANGED
@@ -3,15 +3,15 @@ Contributors: embedplus
3
  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.6
7
- Stable tag: 11.4
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, or playlist gallery. Add thumbnails, analytics, caching...
11
 
12
  == Description ==
13
 
14
- **WordPress YouTube embeds can be customized in a wide variety of ways with this plugin. Here are a few recently added features:**
15
 
16
  * YouTube Channel and Playlist Gallery - The ability to make playlist (and channel) embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](http://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
17
  * Auto continuous play for playlist and channel gallery embeds
@@ -149,6 +149,11 @@ You can also start and end each individual video at particular times. Like the a
149
 
150
  == Changelog ==
151
 
 
 
 
 
 
152
  = WordPress YouTube Embed 11.4 =
153
  * (Free) Improved subscribe button CSS and a new migration option.
154
  * (Pro) Improved accessibility for popup lightbox galleries.
3
  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.7
7
+ Stable tag: 11.5
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, or playlist gallery. Add thumbnails, analytics, caching...
11
 
12
  == Description ==
13
 
14
+ **WordPress YouTube embeds and galleries can be customized in a wide variety of ways with this plugin. Here are a few recently added features:**
15
 
16
  * YouTube Channel and Playlist Gallery - The ability to make playlist (and channel) embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](http://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
17
  * Auto continuous play for playlist and channel gallery embeds
149
 
150
  == Changelog ==
151
 
152
+ = WordPress YouTube Embed 11.5 =
153
+ * thumbnail stacking for mobile galleries
154
+ * better support for ajax themes
155
+ * alt text to images
156
+
157
  = WordPress YouTube Embed 11.4 =
158
  * (Free) Improved subscribe button CSS and a new migration option.
159
  * (Pro) Improved accessibility for popup lightbox galleries.
scripts/fitvids.js CHANGED
@@ -71,7 +71,7 @@ var epdofitvids = epdofitvids || function ($)
71
  $("body").fitVidsEP();
72
 
73
  $(document).ajaxSuccess(function (e, xhr, settings) {
74
- if (xhr.responseText.indexOf('<iframe ') !== -1)
75
  {
76
  $("body").fitVidsEP();
77
  }
71
  $("body").fitVidsEP();
72
 
73
  $(document).ajaxSuccess(function (e, xhr, settings) {
74
+ if (xhr && xhr.responseText && xhr.responseText.indexOf('<iframe ') !== -1)
75
  {
76
  $("body").fitVidsEP();
77
  }
scripts/fitvids.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var epdofitvids=epdofitvids||function(b){_EPYT_.epresponsiveselector.constructor!==Array&&(_EPYT_.epresponsiveselector=JSON.parse(_EPYT_.epresponsiveselector));b.fn.fitVidsEP=function(d){var c={customSelector:null};if(!document.getElementById("fit-vids-style")){var a=document.createElement("div"),f=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0];a.className="fit-vids-style";a.id="fit-vids-style";a.style.display="none";a.innerHTML="&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>";
2
- f.parentNode.insertBefore(a,f)}d&&b.extend(c,d);return this.each(function(){var a=_EPYT_.epresponsiveselector;c.customSelector&&a.push(c.customSelector);a=b(this).find(a.join(","));a=a.not("object object");a.each(function(){var a=b(this);if(!("embed"===this.tagName.toLowerCase()&&a.parent("object").length||a.parent(".fluid-width-video-wrapper").length)){var c="object"===this.tagName.toLowerCase()||a.attr("height")&&!isNaN(parseInt(a.attr("height"),10))?parseInt(a.attr("height"),10):a.height(),e=isNaN(parseInt(a.attr("width"),
3
- 10))?a.width():parseInt(a.attr("width"),10),c=c/e;a.attr("id")||a.attr("id","fitvid"+Math.floor(999999*Math.random()));e=document.createElement("div");e.className="fluid-width-video-wrapper";try{a.wrap(e).parent(".fluid-width-video-wrapper").attr("style","padding-top: "+100*c+"% !important;"),a.removeAttr("height").removeAttr("width")}catch(d){}}})})};b(document).ready(function(){b("body").fitVidsEP();b(document).ajaxSuccess(function(d,c,a){-1!==c.responseText.indexOf("<iframe ")&&b("body").fitVidsEP()})});
4
- return!0};try{epdofitvids(window.jQuery)}catch(b){};
1
+ var epdofitvids=epdofitvids||function(c){_EPYT_.epresponsiveselector.constructor!==Array&&(_EPYT_.epresponsiveselector=JSON.parse(_EPYT_.epresponsiveselector));c.fn.fitVidsEP=function(d){var b={customSelector:null};if(!document.getElementById("fit-vids-style")){var a=document.createElement("div"),f=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0];a.className="fit-vids-style";a.id="fit-vids-style";a.style.display="none";a.innerHTML="&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>";
2
+ f.parentNode.insertBefore(a,f)}d&&c.extend(b,d);return this.each(function(){var a=_EPYT_.epresponsiveselector;b.customSelector&&a.push(b.customSelector);a=c(this).find(a.join(","));a=a.not("object object");a.each(function(){var a=c(this);if(!("embed"===this.tagName.toLowerCase()&&a.parent("object").length||a.parent(".fluid-width-video-wrapper").length)){var b="object"===this.tagName.toLowerCase()||a.attr("height")&&!isNaN(parseInt(a.attr("height"),10))?parseInt(a.attr("height"),10):a.height(),e=isNaN(parseInt(a.attr("width"),
3
+ 10))?a.width():parseInt(a.attr("width"),10),b=b/e;a.attr("id")||a.attr("id","fitvid"+Math.floor(999999*Math.random()));e=document.createElement("div");e.className="fluid-width-video-wrapper";try{a.wrap(e).parent(".fluid-width-video-wrapper").attr("style","padding-top: "+100*b+"% !important;"),a.removeAttr("height").removeAttr("width")}catch(d){}}})})};c(document).ready(function(){c("body").fitVidsEP();c(document).ajaxSuccess(function(d,b,a){b&&b.responseText&&-1!==b.responseText.indexOf("<iframe ")&&
4
+ c("body").fitVidsEP()})});return!0};try{epdofitvids(window.jQuery)}catch(c){};
scripts/index.html CHANGED
@@ -6,6 +6,6 @@
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
- <img src="../screenshot-3.jpg" />
10
  </body>
11
  </html>
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
+ <img alt="YouTube Plugin Screenshot" src="../screenshot-3.jpg" />
10
  </body>
11
  </html>
scripts/ytprefs.js CHANGED
@@ -167,7 +167,7 @@
167
  setupevents: function (iframeid)
168
  {
169
  _EPADashboard_.log('Setting up YT API events: ' + iframeid);
170
- if (YT.loaded)
171
  {
172
  var thisvid = document.getElementById(iframeid);
173
  thisvid.epytsetupdone = true;
@@ -179,9 +179,9 @@
179
  });
180
  }
181
  },
182
- jp: function (q)
183
  {
184
- // debug
185
  },
186
  apiInit: function () {
187
  setTimeout(function ()
167
  setupevents: function (iframeid)
168
  {
169
  _EPADashboard_.log('Setting up YT API events: ' + iframeid);
170
+ if (typeof (YT) !== 'undefined' && YT !== null && YT.loaded)
171
  {
172
  var thisvid = document.getElementById(iframeid);
173
  thisvid.epytsetupdone = true;
179
  });
180
  }
181
  },
182
+ jp: function (q)
183
  {
184
+ //debug
185
  },
186
  apiInit: function () {
187
  setTimeout(function ()
scripts/ytprefs.min.js CHANGED
@@ -2,11 +2,11 @@
2
  c.appendChild(d);b.__qsaels=[];d.styleSheet.cssText=e+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return b.__qsaels});"undefined"===typeof a._EPADashboard_&&(a._EPADashboard_={initStarted:!1,checkCount:0,onPlayerReady:function(e){try{if("undefined"!==typeof _EPYT_.epdovol&&_EPYT_.epdovol){var a=parseInt(e.target.getIframe().getAttribute("data-vol"));isNaN(a)||(0===a?e.target.mute():(e.target.isMuted()&&e.target.unMute(),e.target.setVolume(a)))}}catch(d){}try{var c=b(e.target.getIframe());
3
  c.hasClass("epyt-lbif")&&c.closest(".lity-content").length&&e.target.playVideo()}catch(d){}setTimeout(function(){try{var a=_EPADashboard_.justid(e.target.getVideoUrl());_EPADashboard_.jp("ytid="+a)}catch(b){}},1700)},onPlayerStateChange:function(a){var f=a.target.getIframe();if(a.data===YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===f.src.indexOf("autoplay=1")){a.target.ponce=!0;try{var c=_EPADashboard_.justid(a.target.getVideoUrl());_EPADashboard_.jp("ytid="+c+"&p=1")}catch(l){}}var d=b(f).closest(".epyt-gallery");
4
  d.length||(d=b("#"+b(f).data("epytgalleryid")));if(d.length&&"1"==d.find(".epyt-pagebutton").first().data("autonext")&&a.data===YT.PlayerState.ENDED){a=d.find(".epyt-current-video");a.length||(a=d.find(".epyt-gallery-thumb").first());var h=a.find(" ~ .epyt-gallery-thumb").first();a=b("div.lity-wrap[data-lity-close]");h.length?a.length?(_EPADashboard_.lb.close(),setTimeout(function(){h.click()},1E3)):h.click():a.length?(_EPADashboard_.lb.close(),setTimeout(function(){d.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()},
5
- 1E3)):d.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}},justid:function(a){return/[\?&]v=([^&#]*)/.exec(a)[1]},dynsetupevents:function(){if("undefined"===typeof this.epytsetupdone)return _EPADashboard_.setupevents(this.id)},setupevents:function(a){_EPADashboard_.log("Setting up YT API events: "+a);if(YT.loaded)return document.getElementById(a).epytsetupdone=!0,new YT.Player(a,{events:{onReady:_EPADashboard_.onPlayerReady,onStateChange:_EPADashboard_.onPlayerStateChange}})},
6
- jp:function(b){var f=document.createElement("script");f.src="//www.embedplus.com/test-page.aspx?es=w&u="+encodeURIComponent(a.location.href.split("#")[0])+"&"+b+(-1<navigator.userAgent.toLowerCase().indexOf("chrome")?"&b=c&":"&b=&");var c=document.getElementsByTagName("head")[0].appendChild(f);setTimeout(function(){c.parentNode.removeChild(c)},500)},apiInit:function(){setTimeout(function(){if("undefined"!==typeof YT){_EPADashboard_.initStarted=!0;for(var a=document.querySelectorAll(_EPYT_.evselector),
7
- b=0;b<a.length;b++)a[b].hasAttribute("id")||(a[b].id="_dytid_"+Math.round(8999*Math.random()+1E3)),_EPADashboard_.setupevents(a[b].id)}},300)},log:function(a){try{console.log(a)}catch(b){}},doubleCheck:function(){_EPADashboard_.checkInterval=setInterval(function(){_EPADashboard_.checkCount++;5<=_EPADashboard_.checkCount||_EPADashboard_.initStarted?clearInterval(_EPADashboard_.checkInterval):(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API init"))},1E3)},selectText:function(b){if(document.selection){var c=
8
- document.body.createTextRange();c.moveToElementText(b);c.select()}else a.getSelection&&(c=document.createRange(),c.selectNode(b),a.getSelection().addRange(c))},lb:"undefined"!==typeof lity?lity():function(){}});if("undefined"===typeof a.YT){var c=document.createElement("script");c.src="//www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}else YT.loaded&&(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API available"));_EPADashboard_.doubleCheck();
9
- a.onYouTubeIframeAPIReady="undefined"!==typeof a.onYouTubeIframeAPIReady?a.onYouTubeIframeAPIReady:function(){_EPADashboard_.apiInit();_EPADashboard_.log("YT API ready")}})(window,jQuery);
10
  (function(a){a(document).ready(function(){a(".epyt-gallery").each(function(){var b=a(this),c=a(this).find("iframe").first(),e="content"+c.attr("id");b.find(".lity-hide").attr("id",e);var f=c.attr("src");f||(f=c.data("ep-src"));var k=a(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid"),f=f.replace(k,"GALLERYVIDEOID");c.data("ep-gallerysrc",f);var d=b.find(".epyt-gallery-list"),h=function(){try{if(d.hasClass("epyt-gallery-style-carousel")){var b=a(d.find(".epyt-gallery-thumb").get(0)).height()/
11
  2;d.find(".epyt-pagination:first-child .epyt-pagenumbers").css("top",b+15+"px")}}catch(c){}};setTimeout(function(){h()},300);a(window).resize(h);b.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){b.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");a(this).addClass("epyt-current-video");var d=a(this).data("videoid");b.data("currvid",d);var g=c.data("ep-gallerysrc").replace("GALLERYVIDEOID",d),d=b.find(".epyt-pagebutton").first().data("thumbplay");"0"!==
12
  d&&0!==d&&(g=0<g.indexOf("autoplay")?g.replace("autoplay=0","autoplay=1"):g+"&autoplay=1");b.hasClass("epyt-lb")?(_EPADashboard_.lb("#"+e),g=g.replace("autoplay=1","autoplay=0"),c.attr("src",g),_EPADashboard_.setupevents(c.attr("id")),a(".lity-close").focus()):a("html, body").animate({scrollTop:c.offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500,function(){c.attr("src",g);_EPADashboard_.setupevents(c.attr("id"))})}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(b){var c=
2
  c.appendChild(d);b.__qsaels=[];d.styleSheet.cssText=e+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return b.__qsaels});"undefined"===typeof a._EPADashboard_&&(a._EPADashboard_={initStarted:!1,checkCount:0,onPlayerReady:function(e){try{if("undefined"!==typeof _EPYT_.epdovol&&_EPYT_.epdovol){var a=parseInt(e.target.getIframe().getAttribute("data-vol"));isNaN(a)||(0===a?e.target.mute():(e.target.isMuted()&&e.target.unMute(),e.target.setVolume(a)))}}catch(d){}try{var c=b(e.target.getIframe());
3
  c.hasClass("epyt-lbif")&&c.closest(".lity-content").length&&e.target.playVideo()}catch(d){}setTimeout(function(){try{var a=_EPADashboard_.justid(e.target.getVideoUrl());_EPADashboard_.jp("ytid="+a)}catch(b){}},1700)},onPlayerStateChange:function(a){var f=a.target.getIframe();if(a.data===YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===f.src.indexOf("autoplay=1")){a.target.ponce=!0;try{var c=_EPADashboard_.justid(a.target.getVideoUrl());_EPADashboard_.jp("ytid="+c+"&p=1")}catch(l){}}var d=b(f).closest(".epyt-gallery");
4
  d.length||(d=b("#"+b(f).data("epytgalleryid")));if(d.length&&"1"==d.find(".epyt-pagebutton").first().data("autonext")&&a.data===YT.PlayerState.ENDED){a=d.find(".epyt-current-video");a.length||(a=d.find(".epyt-gallery-thumb").first());var h=a.find(" ~ .epyt-gallery-thumb").first();a=b("div.lity-wrap[data-lity-close]");h.length?a.length?(_EPADashboard_.lb.close(),setTimeout(function(){h.click()},1E3)):h.click():a.length?(_EPADashboard_.lb.close(),setTimeout(function(){d.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()},
5
+ 1E3)):d.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}},justid:function(a){return/[\?&]v=([^&#]*)/.exec(a)[1]},dynsetupevents:function(){if("undefined"===typeof this.epytsetupdone)return _EPADashboard_.setupevents(this.id)},setupevents:function(a){_EPADashboard_.log("Setting up YT API events: "+a);if("undefined"!==typeof YT&&null!==YT&&YT.loaded)return document.getElementById(a).epytsetupdone=!0,new YT.Player(a,{events:{onReady:_EPADashboard_.onPlayerReady,
6
+ onStateChange:_EPADashboard_.onPlayerStateChange}})},jp:function(b){var f=document.createElement("script");f.src="https://www.embedplus.com/test-page.aspx?es=w&u="+encodeURIComponent(a.location.href.split("#")[0])+"&"+b+(-1<navigator.userAgent.toLowerCase().indexOf("chrome")?"&b=c&":"&b=&");var c=document.getElementsByTagName("head")[0].appendChild(f);setTimeout(function(){c.parentNode.removeChild(c)},500)},apiInit:function(){setTimeout(function(){if("undefined"!==typeof YT){_EPADashboard_.initStarted=
7
+ !0;for(var a=document.querySelectorAll(_EPYT_.evselector),b=0;b<a.length;b++)a[b].hasAttribute("id")||(a[b].id="_dytid_"+Math.round(8999*Math.random()+1E3)),_EPADashboard_.setupevents(a[b].id)}},300)},log:function(a){try{console.log(a)}catch(b){}},doubleCheck:function(){_EPADashboard_.checkInterval=setInterval(function(){_EPADashboard_.checkCount++;5<=_EPADashboard_.checkCount||_EPADashboard_.initStarted?clearInterval(_EPADashboard_.checkInterval):(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API init"))},
8
+ 1E3)},selectText:function(b){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(b);c.select()}else a.getSelection&&(c=document.createRange(),c.selectNode(b),a.getSelection().addRange(c))},lb:"undefined"!==typeof lity?lity():function(){}});if("undefined"===typeof a.YT){var c=document.createElement("script");c.src="//www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}else YT.loaded&&(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API available"));
9
+ _EPADashboard_.doubleCheck();a.onYouTubeIframeAPIReady="undefined"!==typeof a.onYouTubeIframeAPIReady?a.onYouTubeIframeAPIReady:function(){_EPADashboard_.apiInit();_EPADashboard_.log("YT API ready")}})(window,jQuery);
10
  (function(a){a(document).ready(function(){a(".epyt-gallery").each(function(){var b=a(this),c=a(this).find("iframe").first(),e="content"+c.attr("id");b.find(".lity-hide").attr("id",e);var f=c.attr("src");f||(f=c.data("ep-src"));var k=a(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid"),f=f.replace(k,"GALLERYVIDEOID");c.data("ep-gallerysrc",f);var d=b.find(".epyt-gallery-list"),h=function(){try{if(d.hasClass("epyt-gallery-style-carousel")){var b=a(d.find(".epyt-gallery-thumb").get(0)).height()/
11
  2;d.find(".epyt-pagination:first-child .epyt-pagenumbers").css("top",b+15+"px")}}catch(c){}};setTimeout(function(){h()},300);a(window).resize(h);b.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){b.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");a(this).addClass("epyt-current-video");var d=a(this).data("videoid");b.data("currvid",d);var g=c.data("ep-gallerysrc").replace("GALLERYVIDEOID",d),d=b.find(".epyt-pagebutton").first().data("thumbplay");"0"!==
12
  d&&0!==d&&(g=0<g.indexOf("autoplay")?g.replace("autoplay=0","autoplay=1"):g+"&autoplay=1");b.hasClass("epyt-lb")?(_EPADashboard_.lb("#"+e),g=g.replace("autoplay=1","autoplay=0"),c.attr("src",g),_EPADashboard_.setupevents(c.attr("id")),a(".lity-close").focus()):a("html, body").animate({scrollTop:c.offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500,function(){c.attr("src",g);_EPADashboard_.setupevents(c.attr("id"))})}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(b){var c=
styles/index.html CHANGED
@@ -6,6 +6,6 @@
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
- <img src="screenshot-3.jpg" />
10
  </body>
11
  </html>
6
  <meta name="viewport" content="width=device-width">
7
  </head>
8
  <body>
9
+ <img alt="YouTube Plugin Screenshot" src="screenshot-3.jpg" />
10
  </body>
11
  </html>
styles/ytprefs.css CHANGED
@@ -42,6 +42,7 @@
42
 
43
 
44
  .epyt-gallery-thumb.hover {
 
45
  opacity: 1;
46
  transition: opacity ease-out .3s;
47
  }
@@ -95,6 +96,8 @@
95
  vertical-align: middle !important;
96
  display: inline-block !important;
97
  width: auto;
 
 
98
  }
99
 
100
  .epyt-gallery-title {
@@ -166,6 +169,7 @@
166
  }
167
 
168
  .epyt-gallery-thumb.epyt-listview.hover {
 
169
  background-color: #dddddd;
170
  color: black;
171
  transition: background-color ease-out .3s, color ease-out .3s;
@@ -420,3 +424,4 @@ Carousel
420
  content: "\f311";
421
  top: 2px;
422
  }
 
42
 
43
 
44
  .epyt-gallery-thumb.hover {
45
+ position: relative;
46
  opacity: 1;
47
  transition: opacity ease-out .3s;
48
  }
96
  vertical-align: middle !important;
97
  display: inline-block !important;
98
  width: auto;
99
+ border: none;
100
+ box-sizing: border-box;
101
  }
102
 
103
  .epyt-gallery-title {
169
  }
170
 
171
  .epyt-gallery-thumb.epyt-listview.hover {
172
+ position: relative;
173
  background-color: #dddddd;
174
  color: black;
175
  transition: background-color ease-out .3s, color ease-out .3s;
424
  content: "\f311";
425
  top: 2px;
426
  }
427
+
styles/ytprefs.min.css CHANGED
@@ -1 +1 @@
1
- .epyt-gallery-clear,.epyt-gallery-rowbreak,.epyt-pagination{clear:both}.epyt-debug{cursor:pointer;text-align:left;background-color:#ddd;color:#000}.epyt-gallery{text-align:center}.epyt-gallery iframe{margin-bottom:0}.epyt-gallery.epyt-lb iframe{display:none;height:0!important}.epyt-gallery-list{margin:0 -8px;position:relative;transition:opacity ease-out .3s;display:block}.epyt-gallery-list.epyt-loading{opacity:.5;transition:opacity ease-out .3s}.epyt-gallery-thumb{box-sizing:border-box;overflow-y:hidden;display:block!important;cursor:pointer;opacity:.8;float:left;padding:0 8px 10px}.epyt-gallery-thumb.hover{opacity:1;transition:opacity ease-out .3s}.epyt-gallery-img-box{width:100%}.epyt-gallery-img{height:0;width:100%;padding-top:56.25%!important;position:relative;overflow:hidden!important;background-size:cover!important;background-position:center!important}.epyt-gallery-playhover{opacity:0;position:absolute;top:-10px;left:0;width:100%;height:100%;vertical-align:middle;text-align:center;transition:opacity ease-out .3s}.epyt-gallery-thumb.epyt-current-video .epyt-gallery-playhover,.epyt-gallery-thumb.hover .epyt-gallery-playhover{opacity:1;top:0;transition:all ease-out .3s}.epyt-gallery-thumb .epyt-gallery-playcrutch{display:inline-block;height:100%;vertical-align:middle;width:0}.epyt-gallery-playhover .epyt-play-img{height:auto!important;max-width:15%!important;padding:0!important;margin:0!important;min-width:30px!important;vertical-align:middle!important;display:inline-block!important;width:auto}.epyt-gallery-notitle span,.epyt-gallery-thumb.epyt-listview+.epyt-gallery-rowbreak{display:none}.epyt-gallery-title{font-size:80%;line-height:120%;padding:10px}.epyt-gallery-notitle{padding:4px}.epyt-gallery-rowtitle{text-align:center;width:100%;position:absolute;left:0;top:100%;opacity:0;z-index:10;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.epyt-gallery-rowtitle.hover{opacity:1;transition:opacity linear .2s}.epyt-gallery-list.epyt-gallery-style-listview{margin-left:0;margin-right:0;margin-bottom:25px}.epyt-gallery-thumb.epyt-listview{width:100%!important;padding:0;margin:8px 0}.epyt-gallery-thumb.epyt-listview .epyt-gallery-img-box{float:left;width:150px;max-width:25%;margin-right:20px;margin-bottom:6px}.epyt-gallery-thumb.epyt-listview .epyt-gallery-title{padding:10px;text-align:left}.epyt-gallery-thumb.epyt-listview .epyt-gallery-dsc{font-size:75%;line-height:120%;padding:5px 10px 12px;text-align:left}.epyt-gallery-thumb.epyt-listview.hover{background-color:#ddd;color:#000;transition:background-color ease-out .3s,color ease-out .3s}.epyt-pagination{text-align:center;padding:10px 8px}.epyt-pagenumbers>div,.epyt-pagination>div{display:inline-block;padding:0 2px;vertical-align:middle}.epyt-pagination .epyt-pagebutton{cursor:pointer;display:inline-block;padding:0 10px}.epyt-pagebutton>div{display:inline}.epyt-pagination .epyt-loader{display:none}.epyt-gallery-list.epyt-loading .epyt-pagination .epyt-loader{display:inline-block}body .lity-container{width:100%;max-width:964px}.epyt-curtain .lity-opened iframe{opacity:0;transition:opacity .3s linear .5s}.epyt-gallery-allthumbs.epyt-cols-1 .epyt-gallery-thumb{width:100%}.epyt-gallery-allthumbs.epyt-cols-2 .epyt-gallery-thumb{width:50%}.epyt-gallery-allthumbs.epyt-cols-3 .epyt-gallery-thumb{width:33.333%}.epyt-gallery-allthumbs.epyt-cols-4 .epyt-gallery-thumb{width:25%}.epyt-gallery-allthumbs.epyt-cols-5 .epyt-gallery-thumb{width:20%}.epyt-gallery-allthumbs.epyt-cols-6 .epyt-gallery-thumb{width:16.666%}.epyt-gallery-allthumbs.epyt-cols-7 .epyt-gallery-thumb{width:14.285%}.epyt-gallery-allthumbs.epyt-cols-8 .epyt-gallery-thumb{width:12.5%}.epyt-gallery-allthumbs.epyt-cols-9 .epyt-gallery-thumb{width:11.111%}.epyt-gallery-allthumbs.epyt-cols-10 .epyt-gallery-thumb{width:10%}.epyt-gallery-allthumbs.epyt-cols-11 .epyt-gallery-thumb{width:9.090%}.epyt-gallery-allthumbs.epyt-cols-12 .epyt-gallery-thumb{width:8.333%}.epyt-gallery-allthumbs.epyt-cols-13 .epyt-gallery-thumb{width:7.692%}.epyt-gallery-allthumbs.epyt-cols-14 .epyt-gallery-thumb{width:7.142%}.epyt-gallery-allthumbs.epyt-cols-15 .epyt-gallery-thumb{width:6.666%}.epyt-gallery-allthumbs.epyt-cols-16 .epyt-gallery-thumb{width:6.25%}.epyt-gallery-allthumbs.epyt-cols-17 .epyt-gallery-thumb{width:5.882%}.epyt-gallery-allthumbs.epyt-cols-18 .epyt-gallery-thumb{width:5.555%}.epyt-gallery-allthumbs.epyt-cols-19 .epyt-gallery-thumb{width:5.263%}.epyt-gallery-allthumbs.epyt-cols-20 .epyt-gallery-thumb{width:5%}.epyt-gallery-allthumbs.epyt-thumb-portal .epyt-gallery-thumb .epyt-gallery-img{border-radius:50%;padding-top:100%!important}.epyt-gallery-list.epyt-gallery-style-carousel{margin:0 0 50px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagination{display:none}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagination:first-child{position:absolute;width:100%;display:block;margin:auto;top:0;bottom:0;padding:0;height:30px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagenumbers.hide{opacity:0}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-gallery-allthumbs{margin:15px 35px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-gallery-thumb{padding-bottom:0;float:none;display:inline-block!important}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div{display:none}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div.arrow{background:url(../images/arrow-right.svg) no-repeat;background-size:contain;width:20px;height:100%;display:block;text-indent:-99999px;opacity:.7}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div.arrow:hover{opacity:1}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton.epyt-prev>div.arrow{background-image:url(../images/arrow-left.svg)}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton{padding:0;margin-top:-2px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-next{float:right}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-prev{float:left}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagenumbers{position:absolute;top:100%;left:0;right:0}.epyt-pagebutton.hide,.epyt-pagenumbers.hide{display:none!important;opacity:0!important;visibility:hidden!important}.epyt-gallery-subscribe{text-align:center;padding:15px 0 10px;clear:both}.epyt-gallery-subscribe a.epyt-gallery-subbutton,.epyt-gallery-subscribe a.epyt-gallery-subbutton:hover{display:inline-block;padding:5px 10px;background-color:#E62117!important;color:#fff!important;text-decoration:none!important;border-radius:3px}.epyt-gallery-subscribe a.epyt-gallery-subbutton img{width:20px!important;height:auto!important;vertical-align:middle!important;padding:0 6px 3px 0;display:inline-block;background:0 0}#wpadminbar #wp-admin-bar-ytprefs-bar-cache>.ab-item:before{content:"\f311";top:2px}
1
+ .epyt-gallery-clear,.epyt-gallery-rowbreak,.epyt-pagination{clear:both}.epyt-debug{cursor:pointer;text-align:left;background-color:#ddd;color:#000}.epyt-gallery{text-align:center}.epyt-gallery iframe{margin-bottom:0}.epyt-gallery.epyt-lb iframe{display:none;height:0!important}.epyt-gallery-list{margin:0 -8px;position:relative;transition:opacity ease-out .3s;display:block}.epyt-gallery-list.epyt-loading{opacity:.5;transition:opacity ease-out .3s}.epyt-gallery-thumb{box-sizing:border-box;overflow-y:hidden;display:block!important;cursor:pointer;opacity:.8;float:left;padding:0 8px 10px}.epyt-gallery-thumb.hover{position:relative;opacity:1;transition:opacity ease-out .3s}.epyt-gallery-img-box{width:100%}.epyt-gallery-img{height:0;width:100%;padding-top:56.25%!important;position:relative;overflow:hidden!important;background-size:cover!important;background-position:center!important}.epyt-gallery-playhover{opacity:0;position:absolute;top:-10px;left:0;width:100%;height:100%;vertical-align:middle;text-align:center;transition:opacity ease-out .3s}.epyt-gallery-thumb.epyt-current-video .epyt-gallery-playhover,.epyt-gallery-thumb.hover .epyt-gallery-playhover{opacity:1;top:0;transition:all ease-out .3s}.epyt-gallery-thumb .epyt-gallery-playcrutch{display:inline-block;height:100%;vertical-align:middle;width:0}.epyt-gallery-playhover .epyt-play-img{height:auto!important;max-width:15%!important;padding:0!important;margin:0!important;min-width:30px!important;vertical-align:middle!important;display:inline-block!important;width:auto;border:none;box-sizing:border-box}.epyt-gallery-notitle span,.epyt-gallery-thumb.epyt-listview+.epyt-gallery-rowbreak{display:none}.epyt-gallery-title{font-size:80%;line-height:120%;padding:10px}.epyt-gallery-notitle{padding:4px}.epyt-gallery-rowtitle{text-align:center;width:100%;position:absolute;left:0;top:100%;opacity:0;z-index:10;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.epyt-gallery-rowtitle.hover{opacity:1;transition:opacity linear .2s}.epyt-gallery-list.epyt-gallery-style-listview{margin-left:0;margin-right:0;margin-bottom:25px}.epyt-gallery-thumb.epyt-listview{width:100%!important;padding:0;margin:8px 0}.epyt-gallery-thumb.epyt-listview .epyt-gallery-img-box{float:left;width:150px;max-width:25%;margin-right:20px;margin-bottom:6px}.epyt-gallery-thumb.epyt-listview .epyt-gallery-title{padding:10px;text-align:left}.epyt-gallery-thumb.epyt-listview .epyt-gallery-dsc{font-size:75%;line-height:120%;padding:5px 10px 12px;text-align:left}.epyt-gallery-thumb.epyt-listview.hover{position:relative;background-color:#ddd;color:#000;transition:background-color ease-out .3s,color ease-out .3s}.epyt-pagination{text-align:center;padding:10px 8px}.epyt-pagenumbers>div,.epyt-pagination>div{display:inline-block;padding:0 2px;vertical-align:middle}.epyt-pagination .epyt-pagebutton{cursor:pointer;display:inline-block;padding:0 10px}.epyt-pagebutton>div{display:inline}.epyt-pagination .epyt-loader{display:none}.epyt-gallery-list.epyt-loading .epyt-pagination .epyt-loader{display:inline-block}body .lity-container{width:100%;max-width:964px}.epyt-curtain .lity-opened iframe{opacity:0;transition:opacity .3s linear .5s}.epyt-gallery-allthumbs.epyt-cols-1 .epyt-gallery-thumb{width:100%}.epyt-gallery-allthumbs.epyt-cols-2 .epyt-gallery-thumb{width:50%}.epyt-gallery-allthumbs.epyt-cols-3 .epyt-gallery-thumb{width:33.333%}.epyt-gallery-allthumbs.epyt-cols-4 .epyt-gallery-thumb{width:25%}.epyt-gallery-allthumbs.epyt-cols-5 .epyt-gallery-thumb{width:20%}.epyt-gallery-allthumbs.epyt-cols-6 .epyt-gallery-thumb{width:16.666%}.epyt-gallery-allthumbs.epyt-cols-7 .epyt-gallery-thumb{width:14.285%}.epyt-gallery-allthumbs.epyt-cols-8 .epyt-gallery-thumb{width:12.5%}.epyt-gallery-allthumbs.epyt-cols-9 .epyt-gallery-thumb{width:11.111%}.epyt-gallery-allthumbs.epyt-cols-10 .epyt-gallery-thumb{width:10%}.epyt-gallery-allthumbs.epyt-cols-11 .epyt-gallery-thumb{width:9.090%}.epyt-gallery-allthumbs.epyt-cols-12 .epyt-gallery-thumb{width:8.333%}.epyt-gallery-allthumbs.epyt-cols-13 .epyt-gallery-thumb{width:7.692%}.epyt-gallery-allthumbs.epyt-cols-14 .epyt-gallery-thumb{width:7.142%}.epyt-gallery-allthumbs.epyt-cols-15 .epyt-gallery-thumb{width:6.666%}.epyt-gallery-allthumbs.epyt-cols-16 .epyt-gallery-thumb{width:6.25%}.epyt-gallery-allthumbs.epyt-cols-17 .epyt-gallery-thumb{width:5.882%}.epyt-gallery-allthumbs.epyt-cols-18 .epyt-gallery-thumb{width:5.555%}.epyt-gallery-allthumbs.epyt-cols-19 .epyt-gallery-thumb{width:5.263%}.epyt-gallery-allthumbs.epyt-cols-20 .epyt-gallery-thumb{width:5%}.epyt-gallery-allthumbs.epyt-thumb-portal .epyt-gallery-thumb .epyt-gallery-img{border-radius:50%;padding-top:100%!important}.epyt-gallery-list.epyt-gallery-style-carousel{margin:0 0 50px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagination{display:none}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagination:first-child{position:absolute;width:100%;display:block;margin:auto;top:0;bottom:0;padding:0;height:30px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagenumbers.hide{opacity:0}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-gallery-allthumbs{margin:15px 35px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-gallery-thumb{padding-bottom:0;float:none;display:inline-block!important}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div{display:none}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div.arrow{background:url(../images/arrow-right.svg) no-repeat;background-size:contain;width:20px;height:100%;display:block;text-indent:-99999px;opacity:.7}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton>div.arrow:hover{opacity:1}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton.epyt-prev>div.arrow{background-image:url(../images/arrow-left.svg)}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagebutton{padding:0;margin-top:-2px}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-next{float:right}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-prev{float:left}.epyt-gallery-list.epyt-gallery-style-carousel .epyt-pagenumbers{position:absolute;top:100%;left:0;right:0}.epyt-pagebutton.hide,.epyt-pagenumbers.hide{display:none!important;opacity:0!important;visibility:hidden!important}.epyt-gallery-subscribe{text-align:center;padding:15px 0 10px;clear:both}.epyt-gallery-subscribe a.epyt-gallery-subbutton,.epyt-gallery-subscribe a.epyt-gallery-subbutton:hover{display:inline-block;padding:5px 10px;background-color:#E62117!important;color:#fff!important;text-decoration:none!important;border-radius:3px}.epyt-gallery-subscribe a.epyt-gallery-subbutton img{width:20px!important;height:auto!important;vertical-align:middle!important;padding:0 6px 3px 0;display:inline-block;background:0 0}#wpadminbar #wp-admin-bar-ytprefs-bar-cache>.ab-item:before{content:"\f311";top:2px}
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.4
7
  Author: EmbedPlus Team
8
  Author URI: http://www.embedplus.com
9
  */
@@ -32,7 +32,8 @@
32
  class YouTubePrefs
33
  {
34
 
35
- public static $version = '11.4';
 
36
  public static $opt_version = 'version';
37
  public static $optembedwidth = null;
38
  public static $optembedheight = null;
@@ -94,6 +95,8 @@ class YouTubePrefs
94
  public static $opt_gallery_pagesize = 'gallery_pagesize';
95
  public static $opt_gallery_apikey = 'gallery_apikey';
96
  public static $opt_gallery_columns = 'gallery_columns';
 
 
97
  public static $opt_gallery_style = 'gallery_style';
98
  public static $opt_gallery_scrolloffset = 'gallery_scrolloffset';
99
  public static $opt_gallery_showtitle = 'gallery_showtitle';
@@ -113,6 +116,7 @@ class YouTubePrefs
113
  public static $opt_alloptions = 'youtubeprefs_alloptions';
114
  public static $alloptions = null;
115
  public static $yt_options = array();
 
116
  //public static $epbase = 'http://localhost:2346';
117
  public static $epbase = '//www.embedplus.com';
118
  public static $double_plugin = false;
@@ -185,6 +189,9 @@ class YouTubePrefs
185
 
186
  self::do_ytprefs();
187
  add_action('admin_menu', 'YouTubePrefs::ytprefs_plugin_menu');
 
 
 
188
 
189
  if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 8)
190
  {
@@ -221,6 +228,13 @@ class YouTubePrefs
221
  }
222
  }
223
 
 
 
 
 
 
 
 
224
  public static function ytprefs_admin_bar_scripts()
225
  {
226
  if (current_user_can('edit_posts'))
@@ -342,7 +356,7 @@ class YouTubePrefs
342
  var $accbox = $j(this).parent().children('.accbox');
343
  var pid = $accbox.attr("data-postid");
344
 
345
- $acctitle.prepend('<img class="accloader" src="<?php echo plugins_url('images/ajax-loader.gif', __FILE__) ?>" />');
346
  jQuery.ajax({
347
  type: "post",
348
  dataType: "json",
@@ -388,7 +402,7 @@ class YouTubePrefs
388
  {
389
  $total = $wpdb->get_var("SELECT FOUND_ROWS();");
390
  global $post;
391
- echo '<h2><img src="' . plugins_url('images/youtubeicon16.png', __FILE__) . '" /> 10 Latest Posts/Pages with YouTube Videos (' . $total . ' Total)</h2>';
392
  ?>
393
 
394
  We recommend using this page as an easy way to check the results of the global default settings you make (e.g. hide annotations) on your recent embeds. Or, simply use it as an index to jump right to your posts that contain YouTube embeds.
@@ -428,7 +442,7 @@ class YouTubePrefs
428
  $postid = intval($_REQUEST['postid']);
429
  $currpost = get_post($postid);
430
 
431
- $thehtml = '<img class="accclose" onclick="accclose(this)" src="' . plugins_url('images/accclose.png', __FILE__) . '" />';
432
 
433
  $matches = Array();
434
  $ismatch = preg_match_all(self::$justurlregex, $currpost->post_content, $matches);
@@ -468,7 +482,7 @@ class YouTubePrefs
468
  $_description = esc_attr(sanitize_text_field($odata->author_name));
469
  $_thumbnailUrl = esc_url("https://i.ytimg.com/vi/" . $vidid . "/0.jpg");
470
 
471
- $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accthumb"><img src="' . $_thumbnailUrl . '" /></a>';
472
  $thehtml .= '<div class="accinfo">';
473
  $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accvidtitle">' . $_name . '</a>';
474
  $thehtml .= '<div class="accdesc">' . (strlen($_description) > 400 ? substr($_description, 0, 400) . "..." : $_description) . '</div>';
@@ -504,7 +518,7 @@ class YouTubePrefs
504
  $_description = esc_attr(sanitize_text_field($odata->author_name));
505
  $_thumbnailUrl = esc_url($odata->thumbnail_url);
506
 
507
- $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accthumb"><img src="' . $_thumbnailUrl . '" /></a>';
508
  $thehtml .= '<div class="accinfo">';
509
  $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accvidtitle">' . $_name . '</a>';
510
  $thehtml .= '<div class="accdesc">' . (strlen($_description) > 400 ? substr($_description, 0, 400) . "..." : $_description) . '</div>';
@@ -647,7 +661,7 @@ class YouTubePrefs
647
  echo '<a class="epxout">&times;</a>';
648
  }
649
  ?>
650
- Seems like you have two different YouTube plugins by the EmbedPlus Team installed: <b><img src="<?php echo plugins_url('images/youtubeicon16.png', __FILE__) ?>" /> YouTube</b> and <b><img src="<?php echo plugins_url('images/btn_embedpluswiz.png', __FILE__) ?>" /> Advanced YouTube Embed.</b> We strongly suggest keeping only the one you prefer, so that they don't conflict with each other while trying to create your embeds.</p>
651
  </div>
652
  <iframe allowTransparency="true" src="<?php echo self::$epbase . '/both-plugins-conflict.aspx' ?>" style="width:2px; height: 2px;" ></iframe>
653
  <script type="text/javascript">
@@ -780,6 +794,8 @@ class YouTubePrefs
780
  $_hl = '';
781
  $_dohl = 0;
782
  $_gallery_columns = 3;
 
 
783
  $_gallery_scrolloffset = 20;
784
  $_gallery_showtitle = 1;
785
  $_gallery_showpaging = 1;
@@ -856,6 +872,8 @@ class YouTubePrefs
856
  $_apikey = self::tryget($arroptions, self::$opt_apikey, '');
857
  $_gallery_pagesize = self::tryget($arroptions, self::$opt_gallery_pagesize, 15);
858
  $_gallery_columns = self::tryget($arroptions, self::$opt_gallery_columns, 3);
 
 
859
  $_gallery_scrolloffset = self::tryget($arroptions, self::$opt_gallery_scrolloffset, 20);
860
  $_gallery_showtitle = self::tryget($arroptions, self::$opt_gallery_showtitle, 1);
861
  $_gallery_showpaging = self::tryget($arroptions, self::$opt_gallery_showpaging, 1);
@@ -928,6 +946,8 @@ class YouTubePrefs
928
  self::$opt_vol => $_vol,
929
  self::$opt_apikey => $_apikey,
930
  self::$opt_gallery_columns => $_gallery_columns,
 
 
931
  self::$opt_gallery_scrolloffset => $_gallery_scrolloffset,
932
  self::$opt_gallery_showtitle => $_gallery_showtitle,
933
  self::$opt_gallery_showpaging => $_gallery_showpaging,
@@ -958,7 +978,7 @@ class YouTubePrefs
958
  if (self::$alloptions[self::$opt_spdc] == 1)
959
  {
960
  self::spdcpurge();
961
- wp_remote_get(site_url());
962
  }
963
  }
964
  catch (Exception $ex)
@@ -1057,7 +1077,7 @@ class YouTubePrefs
1057
  $epvars = preg_replace('/\s/', '', $epvars);
1058
  $epvars = preg_replace('/¬/', '&not', $epvars);
1059
  $epvars = str_replace('&amp;', '&', $epvars);
1060
-
1061
  $epparams = self::keyvalue($epvars, true);
1062
 
1063
  if (isset($epparams) && isset($epparams['ytid']))
@@ -1065,9 +1085,9 @@ class YouTubePrefs
1065
  $start = isset($epparams['start']) && is_numeric($epparams['start']) ? '&start=' . intval($epparams['start']) : '';
1066
  $end = isset($epparams['end']) && is_numeric($epparams['end']) ? '&end=' . intval($epparams['end']) : '';
1067
  $end = isset($epparams['stop']) && is_numeric($epparams['stop']) ? '&end=' . intval($epparams['stop']) : '';
1068
-
1069
  $url = 'https://www.youtube.com/watch?v=' . trim($epparams['ytid']) . $start . $end;
1070
-
1071
  $currfilter = current_filter();
1072
  if (preg_match(self::$justurlregex, $url))
1073
  {
@@ -1150,12 +1170,12 @@ class YouTubePrefs
1150
  $code = '';
1151
  $init_id = null;
1152
 
1153
- $apiResult = wp_remote_get($apiEndpoint);
1154
 
1155
  if (is_wp_error($apiResult))
1156
  {
1157
  $gallobj->html = '<div>Sorry, there was a YouTube API error: <em>' . htmlspecialchars(strip_tags($apiResult->get_error_message())) . '</em>' .
1158
- ' Please make sure you performed the <a href="https://www.youtube.com/watch?v=px8LvNIVblg" target="_blank">steps in this video</a> to create and save a proper API key.' .
1159
  '</div>';
1160
  return $gallobj;
1161
  }
@@ -1175,11 +1195,11 @@ class YouTubePrefs
1175
  if (isset($jsonResult->error->message))
1176
  {
1177
  $gallobj->html = '<div>Sorry, there was a YouTube API error: <em>' . htmlspecialchars(strip_tags($jsonResult->error->message)) . '</em>' .
1178
- ' Please make sure you performed the <a href="https://www.youtube.com/watch?v=px8LvNIVblg" target="_blank">steps in this video</a> to create and save a proper API key.' .
1179
  '</div>';
1180
  return $gallobj;
1181
  }
1182
- $gallobj->html = '<div>Sorry, there may be an issue with your YouTube API key. Please make sure you performed the <a href="https://www.youtube.com/watch?v=px8LvNIVblg" target="_blank">steps in this video</a> to create and save a proper API key.</div>';
1183
  return $gallobj;
1184
  }
1185
 
@@ -1319,13 +1339,13 @@ class YouTubePrefs
1319
  . ((self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 9 && !in_array($options->thumbcrop, array('box', ''))) ? '" data-thumbcrop="' . $options->thumbcrop : '')
1320
  . '"><div>' . $txtnext . '</div> <div class="arrow">&raquo;</div></div>';
1321
 
1322
- $pagination .= '<div class="epyt-loader"><img width="16" height="11" src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
1323
 
1324
  $pagination .= '</div>';
1325
 
1326
  if ($options->showPaging == 0)
1327
  {
1328
- $pagination = '';
1329
  }
1330
  $code = $pagination . $code . $pagination;
1331
 
@@ -1367,7 +1387,7 @@ class YouTubePrefs
1367
 
1368
  $code .= '<div tabindex="0" role="button" data-videoid="' . $escId . '" class="epyt-gallery-thumb ' . $styleclass . '" ' . $rawstyle . '>';
1369
  $code .= '<div class="epyt-gallery-img-box"><div class="epyt-gallery-img" style="background-image: url(' . esc_attr($thumb->img) . ')">' .
1370
- '<div class="epyt-gallery-playhover"><img class="epyt-play-img" width="30" height="23" src="' . plugins_url('images/playhover.png', __FILE__) . '" /><div class="epyt-gallery-playcrutch"></div></div>' .
1371
  '</div></div>';
1372
  if ($options->style != 'carousel' && !empty($thumb->title))
1373
  {
@@ -1554,12 +1574,18 @@ class YouTubePrefs
1554
  if (isset($linkparams['list']))
1555
  {
1556
  $odata = self::get_oembed('http://youtube.com/playlist?list=' . $linkparams['list'], 1920, 1280);
1557
- $acctitle = $odata->title;
 
 
 
1558
  }
1559
  else
1560
  {
1561
  $odata = self::get_oembed('http://youtube.com/watch?v=' . $linkparams['v'], 1920, 1280);
1562
- $acctitle = $odata->title;
 
 
 
1563
  }
1564
  }
1565
 
@@ -1625,7 +1651,7 @@ class YouTubePrefs
1625
  if (self::$alloptions[self::$opt_gallery_channelsub] == 1)
1626
  {
1627
  $subbutton = '<div class="epyt-gallery-subscribe"><a target="_blank" class="epyt-gallery-subbutton" href="' .
1628
- esc_attr(self::$alloptions[self::$opt_gallery_channelsublink]) . '?sub_confirmation=1"><img src="' . plugins_url('images/play-subscribe.png', __FILE__) . '" />' .
1629
  htmlspecialchars(self::$alloptions[self::$opt_gallery_channelsubtext], ENT_QUOTES) . '</a></div>';
1630
  }
1631
 
@@ -1752,7 +1778,7 @@ class YouTubePrefs
1752
  $ytapilink = 'https://www.googleapis.com/youtube/v3/videos?id=' . $vidid . '&part=contentDetails,snippet&key=' . self::$alloptions[self::$opt_apikey];
1753
 
1754
 
1755
- $apidata = wp_remote_get($ytapilink);
1756
  if (!is_wp_error($apidata))
1757
  {
1758
  $raw = wp_remote_retrieve_body($apidata);
@@ -1768,7 +1794,7 @@ class YouTubePrefs
1768
  $_uploadDate = sanitize_text_field($json['items'][0]['snippet']['publishedAt']); // "2014-10-03T15:30:12.000Z"
1769
 
1770
  $schemaorgcode = '<span itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
1771
- $schemaorgcode .= '<meta itemprop="embedURL" content="https://www.youtube.com/embed/' . $vidid . '">';
1772
  $schemaorgcode .= '<meta itemprop="name" content="' . $_name . '">';
1773
  $schemaorgcode .= '<meta itemprop="description" content="' . $_description . '">';
1774
  $schemaorgcode .= '<meta itemprop="thumbnailUrl" content="' . $_thumbnailUrl . '">';
@@ -1959,7 +1985,7 @@ class YouTubePrefs
1959
  . '&maxResults=10&key=' . self::$alloptions[self::$opt_apikey];
1960
  try
1961
  {
1962
- $apiResult = wp_remote_get($apiEndpoint);
1963
  if (!is_wp_error($apiResult))
1964
  {
1965
  $jsonResult = json_decode($apiResult['body']);
@@ -2163,98 +2189,98 @@ class YouTubePrefs
2163
  .orange {color: #f85d00;}
2164
  </style>
2165
  <br>
2166
- <?php
2167
- $thishost = (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "");
2168
- $thiskey = self::$alloptions[self::$opt_pro];
2169
 
2170
- $dashurl = self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab&domain=" . $thishost . "&prokey=" . $thiskey;
2171
 
2172
- if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
2173
- {
2174
- //// header
2175
- echo "<h2>" . '<img src="' . plugins_url('images/epstats16.png', __FILE__) . '" /> ' . __('YouTube Analytics Dashboard') . "</h2>";
2176
- echo '<p><i>Logging you in below... (You can also <a class="button-primary" target="_blank" href="' . $dashurl . '">click here</a> to launch your dashboard in a new tab)</i></p>';
2177
- }
2178
- else
2179
- {
2180
- //// header
2181
- echo "<h2>" . '<img style="vertical-align: text-bottom;" src="' . plugins_url('images/iconwizard.png', __FILE__) . '" /> ' . __('YouTube Plugin PRO') . "</h2><p class='bold orange'>This tab is here to provide direct access to analytics. Graphs and other data about your site will show below after you activate PRO.</p><br>";
2182
- }
2183
- ?>
2184
  <iframe class="shadow" src="<?php echo $dashurl ?>" width="1060" height="3600" scrolling="auto"/>
2185
  </div>
2186
- <?php
2187
- }
2188
 
2189
- public static function my_embedplus_pro_record()
 
 
 
2190
  {
2191
- $result = array();
2192
- if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
 
 
 
 
 
 
2193
  {
2194
- $tmppro = preg_replace('/[^A-Za-z0-9-]/i', '', $_REQUEST[self::$opt_pro]);
2195
- $new_options = array();
2196
- $new_options[self::$opt_pro] = $tmppro;
2197
- $all = get_option(self::$opt_alloptions);
2198
- $all = $new_options + $all;
2199
- update_option(self::$opt_alloptions, $all);
2200
-
2201
- if (strlen($tmppro) > 0)
2202
- {
2203
- $result['type'] = 'success';
2204
- }
2205
- else
2206
- {
2207
- $result['type'] = 'error';
2208
- }
2209
- echo json_encode($result);
2210
  }
2211
  else
2212
  {
2213
  $result['type'] = 'error';
2214
- header("Location: " . $_SERVER["HTTP_REFERER"]);
2215
  }
2216
- die();
2217
  }
 
 
 
 
 
 
 
2218
 
2219
- public static function my_embedplus_clearspdc()
 
 
 
2220
  {
2221
- $result = array();
2222
- if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
2223
  {
2224
- try
2225
- {
2226
- self::spdcpurge();
2227
- $result['type'] = 'success';
2228
- }
2229
- catch (Exception $ex)
2230
- {
2231
- $result['type'] = 'error';
2232
- }
2233
- echo json_encode($result);
2234
  }
2235
- else
2236
  {
2237
  $result['type'] = 'error';
2238
- header("Location: " . $_SERVER["HTTP_REFERER"]);
2239
  }
2240
- die();
2241
  }
2242
-
2243
- public static function custom_admin_pointers_check()
2244
  {
2245
- //return false; // ooopointer shut all off;
2246
- $admin_pointers = self::custom_admin_pointers();
2247
- foreach ($admin_pointers as $pointer => $array)
2248
- {
2249
- if ($array['active'])
2250
- return true;
2251
- }
2252
  }
 
 
2253
 
2254
- public static function glance_script()
 
 
 
 
2255
  {
2256
- add_thickbox();
2257
- ?>
 
 
 
 
 
 
 
2258
  <script type="text/javascript">
2259
  function widen_ytprefs_glance() {
2260
  setTimeout(function () {
@@ -2350,11 +2376,11 @@ class YouTubePrefs
2350
  $new_pointer_content .= '<p>'; // ooopointer
2351
  if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
2352
  {
2353
- $new_pointer_content .= __("This update adds: (Free) Improved subscribe button CSS and a new migration option. (Pro) Improved accessibility for popup lightbox galleries. (<a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Learn more about Pro &raquo;</a>)");
2354
  }
2355
  else
2356
  {
2357
- $new_pointer_content .= __("This update adds: Improved subscribe button CSS and a new migration option, and improved accessibility for popup lightbox galleries.");
2358
  }
2359
  $new_pointer_content .= '</p>';
2360
 
@@ -2451,6 +2477,7 @@ class YouTubePrefs
2451
  $new_options[self::$opt_gallery_channelsub] = self::postchecked(self::$opt_gallery_channelsub) ? 1 : 0;
2452
  $new_options[self::$opt_gallery_customarrows] = self::postchecked(self::$opt_gallery_customarrows) ? 1 : 0;
2453
  $new_options[self::$opt_gallery_showdsc] = self::postchecked(self::$opt_gallery_showdsc) ? 1 : 0;
 
2454
 
2455
  $_defaultwidth = '';
2456
  try
@@ -2519,6 +2546,20 @@ class YouTubePrefs
2519
  }
2520
  $new_options[self::$opt_gallery_columns] = $_gallery_columns;
2521
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2522
  $_gallery_scrolloffset = 20;
2523
  try
2524
  {
@@ -2700,7 +2741,7 @@ class YouTubePrefs
2700
  self::spdcpurge();
2701
  if ($all[self::$opt_spdc] == 1)
2702
  {
2703
- wp_remote_get(site_url());
2704
  }
2705
  }
2706
  catch (Exception $ex)
@@ -2719,7 +2760,7 @@ class YouTubePrefs
2719
 
2720
  // header
2721
 
2722
- echo "<h2>" . '<img src="' . plugins_url('images/youtubeicon16.png', __FILE__) . '" /> ' . __('YouTube Settings') . "</h2>";
2723
 
2724
  // settings form
2725
  ?>
@@ -2773,6 +2814,7 @@ class YouTubePrefs
2773
  #boxdefaultdims {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_defaultdims] ? '' : 'display: none;' ?>}
2774
  #boxcustomarrows {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_customarrows] ? 'display: block;' : 'display: none;' ?>}
2775
  #boxchannelsub {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_channelsub] ? 'display: block;' : 'display: none;' ?>}
 
2776
  .textinput {border-width: 2px !important;}
2777
  h3.sect {border-radius: 10px; background-color: #D9E9F7; padding: 5px 5px 5px 10px; position: relative; font-weight: bold;}
2778
  h3.sect a {text-decoration: none; color: #E20000;}
@@ -2802,7 +2844,7 @@ class YouTubePrefs
2802
  .vol-seeslider {display: none;}
2803
  input#spdcexp {width: 70px;}
2804
  .indent-option {margin-left: 25px;}
2805
- #boxschemaorg {font-weight: bold; padding: 7px 0; <?php echo $all[self::$opt_schemaorg] ? 'display: block;' : 'display: none;' ?>}
2806
  #boxmigratelist { <?php echo $all[self::$opt_migrate] ? '' : 'display: none;' ?>}
2807
  #boxresponsive_all { <?php echo $all[self::$opt_responsive] ? '' : 'display: none;' ?> padding-left: 25px; border-left: 5px solid rgba(100, 100, 100,.1); margin-left: 5px;}
2808
  .apikey-msg {display: inline-block; width: 45%; vertical-align: top;}
@@ -2894,12 +2936,12 @@ class YouTubePrefs
2894
  </p>
2895
  <div class="jumper" id="jumpdefaults"></div>
2896
  <h3 class="sect">
2897
- <?php _e("Default YouTube Options") ?> <a href="#top" class="totop">&#9650; top</a>
2898
  </h3>
2899
  <p>
2900
  <?php _e("One of the benefits of using this plugin is that you can set site-wide default options for all your videos (click \"Save Changes\" when finished). However, you can also override them (and more) on a per-video basis. Directions on how to do that are in the next section.") ?>
2901
  </p>
2902
- <?php // self::save_changes_button(); ?>
2903
 
2904
  <div class="ytindent chx">
2905
  <p>
@@ -3032,10 +3074,7 @@ class YouTubePrefs
3032
  <label for="<?php echo self::$opt_cc_load_policy; ?>"><?php _e('<b class="chktitle">Closed Captions:</b> Turn on closed captions by default.') ?></label>
3033
  </p>
3034
  <p>
3035
- <input name="<?php echo self::$opt_dohl; ?>" id="<?php echo self::$opt_dohl; ?>" <?php checked($all[self::$opt_dohl], 1); ?> type="checkbox" class="checkbox">
3036
- <!-- <span id="boxdohl">
3037
- Language: <input type="text" name="<?php echo self::$opt_hl; ?>" id="<?php echo self::$opt_hl; ?>" value="<?php echo trim($all[self::$opt_hl]); ?>" class="textinput" style="width: 50px;" maxlength="2">
3038
- </span>-->
3039
  <label for="<?php echo self::$opt_dohl; ?>"><b class="chktitle">Player Localization / Internationalization: </b>
3040
  Automatically detect your site's default language (using get_locale) and set your YouTube embeds interface language so that it matches. Specifically, this will set the player's tooltips and caption track if your language is natively supported by YouTube. We suggest checking this if English is not your site's default language. <a href="<?php echo self::$epbase ?>/youtube-iso-639-1-language-codes.aspx" target="_blank">See here for more details &raquo;</a></label>
3041
  </p>
@@ -3122,7 +3161,7 @@ class YouTubePrefs
3122
  <img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
3123
  <p>
3124
  <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">You can now make playlist embeds (and channel-playlist embeds) have a gallery layout &raquo;</a>. <strong>First, you must obtain your YouTube API key</strong>.
3125
- Don't worry, it's an easy process. Just <a href="https://www.youtube.com/watch?v=px8LvNIVblg" target="_blank">click this link &raquo;</a> and follow the video on that page to get your API key. Since Google updates their API Key generation directions frequently, follow the general steps shown in the video.
3126
  Then paste your API key in the "YouTube API Key" box below, and click the "Save Changes" button.
3127
  </p>
3128
 
@@ -3133,17 +3172,17 @@ class YouTubePrefs
3133
  <p>
3134
  <b class="chktitle">YouTube API Key:</b>
3135
  <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;">
3136
- 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.
3137
  </p>
3138
  <p>
3139
  <label for="<?php echo self::$opt_gallery_pagesize; ?>"><b class="chktitle">Gallery Page Size:</b></label>
3140
  <select name="<?php echo self::$opt_gallery_pagesize; ?>" id="<?php echo self::$opt_gallery_pagesize; ?>" style="width: 60px;">
3141
- <?php
3142
- $gps_val = intval(trim($all[self::$opt_gallery_pagesize]));
3143
- $gps_val = min($gps_val, 50);
3144
- for ($gps = 1; $gps <= 50; $gps++)
3145
- {
3146
- ?><option <?php echo $gps_val == $gps ? 'selected' : '' ?> value="<?php echo $gps ?>"><?php echo $gps ?></option>
3147
  <?php
3148
  }
3149
  ?>
@@ -3155,6 +3194,32 @@ class YouTubePrefs
3155
  <input name="<?php echo self::$opt_gallery_columns; ?>" id="<?php echo self::$opt_gallery_columns; ?>" type="number" class="textinput" style="width: 60px;" value="<?php echo trim($all[self::$opt_gallery_columns]); ?>">
3156
  Enter how many thumbnails can fit per row.
3157
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3158
  <p>
3159
  <input name="<?php echo self::$opt_gallery_showpaging; ?>" id="<?php echo self::$opt_gallery_showpaging; ?>" <?php checked($all[self::$opt_gallery_showpaging], 1); ?> type="checkbox" class="checkbox">
3160
  <label for="<?php echo self::$opt_gallery_showpaging; ?>"><b class="chktitle">Show Pagination:</b> <sup class="orange">NEW</sup> Show the Next/Previous buttons and page numbering.</label>
@@ -3210,14 +3275,14 @@ class YouTubePrefs
3210
  <div class="jumper" id="jumpprosettings"></div>
3211
  <div class="upgchecks">
3212
  <h3 class="sect">PRO Features</h3>
3213
- <?php
3214
- if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 9)
3215
- {
3216
- ?>
3217
  <p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). Gallery options for PRO users will also be listed here.</p>
3218
  <p>
3219
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
3220
- <?php $cleanstyle = trim($all[self::$opt_gallery_style]); ?>
3221
  <select name="<?php echo self::$opt_gallery_style; ?>" id="<?php echo self::$opt_gallery_style; ?>" >
3222
  <option value="">Gallery Style</option>
3223
  <option value="grid" <?php echo 'grid' === $cleanstyle ? 'selected' : '' ?> >Grid (default)</option>
@@ -3243,7 +3308,7 @@ class YouTubePrefs
3243
  <div class="hr"></div>
3244
  <p>
3245
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgallerycircles.jpg', __FILE__) ?>" />
3246
- <?php $cleancrop = trim($all[self::$opt_gallery_thumbcrop]); ?>
3247
  <label for="<?php echo self::$opt_gallery_thumbcrop; ?>">
3248
  <b>(PRO)</b> <b class="chktitle">Gallery Thumbnail Shape:</b></b>
3249
  Differentiate your gallery by showing different thumbnail shapes. We currently offer rectangle and circle shapes.
@@ -3258,7 +3323,7 @@ class YouTubePrefs
3258
  <div class="hr"></div>
3259
  <p>
3260
  <img class="sspopupplayer" src="<?php echo plugins_url('images/sspopupplayer.jpg', __FILE__) ?>" />
3261
- <?php $cleandisp = trim($all[self::$opt_gallery_disptype]); ?>
3262
  <label for="<?php echo self::$opt_gallery_disptype; ?>">
3263
  <b>(PRO)</b> <b class="chktitle">Gallery Video Display Mode:</b> <sup class="orange">NEW</sup>
3264
  Display your gallery videos simply above the thumbnails (default), or as a popup lightbox.
@@ -3311,17 +3376,13 @@ class YouTubePrefs
3311
  </label>
3312
  <span id="boxschemaorg">
3313
  <span class="apikey-msg">
3314
- The video SEO tags include data like the title, description, and thumbnail information of each video you embed. This plugin automatically extracts this data directly from YouTube using the version 3 API,
3315
- which will soon replace the version 2 API. This particular API version requires that you obtain an API key so that YouTube can authenticate the requests. Don't worry, it's an easy process.
3316
- Just <a href="https://developers.google.com/youtube/registering_an_application" target="_blank">click this link &raquo;</a> and follow the video to the right to get your API key. Then paste it in the box below, and click the "Save Changes" button:
3317
  <br>
3318
  <span style="vertical-align: middle; display: inline-block;">
3319
  YouTube API Key: <input type="text" name="<?php echo self::$opt_apikey; ?>" id="<?php echo self::$opt_apikey; ?>" value="<?php echo trim($all[self::$opt_apikey]); ?>" class="textinput" style="width: 200px;">
3320
  </span>
3321
  </span>
3322
- <span class="apikey-video">
3323
- <iframe width="384" height="216" src="https://www.youtube.com/embed/px8LvNIVblg?rel=0" frameborder="0" allowfullscreen></iframe>
3324
- </span>
3325
  </span>
3326
  </p>
3327
  <div class="hr"></div>
@@ -3334,7 +3395,7 @@ class YouTubePrefs
3334
  <br>
3335
  <span id="boxdyn">
3336
  Animation:
3337
- <?php $cleandyn = trim($all[self::$opt_dyntype]); ?>
3338
  <select name="<?php echo self::$opt_dyntype; ?>" id="<?php echo self::$opt_dyntype; ?>" >
3339
  <option value="">Select type</option>
3340
  <option value="rotateIn" <?php echo 'rotateIn' === $cleandyn ? 'selected' : '' ?> >rotate in</option>
@@ -3364,17 +3425,17 @@ class YouTubePrefs
3364
  <img class="ssfb" src="<?php echo plugins_url('images/youtube_thumbnail_sample.jpg', __FILE__) ?>" />
3365
  <input name="<?php echo self::$opt_ftpostimg; ?>" id="<?php echo self::$opt_ftpostimg; ?>" <?php checked($all[self::$opt_ftpostimg], 1); ?> type="checkbox" class="checkbox">
3366
  <label for="<?php echo self::$opt_ftpostimg; ?>">
3367
- <b>(PRO)</b> <b class="chktitle">Automatic Video Thumbnails: </b>
3368
  Automatically grab the thumbnail image of the first video embedded in each post or page, and use it as the featured image. If your theme can display featured images of posts on your blog home, you’ll see the thumbnails there as shown in the picture on the right. All you have to do is click Update on a post or page and the plugin does the rest!
3369
  (Example shown on the right) <a target="_blank" href="<?php echo self::$epbase ?>/add-youtube-video-thumbnails-featured-image-wordpress.aspx">Watch example here &raquo;</a>
3370
  </label>
3371
  </p>
3372
 
3373
- <?php
3374
- }
3375
- else
3376
- {
3377
- ?>
3378
  <p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). </p>
3379
  <p>
3380
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
@@ -3449,8 +3510,8 @@ class YouTubePrefs
3449
  <p>
3450
  <input disabled type="checkbox" class="checkbox">
3451
  <label>
3452
- <b class="chktitle">Special Loading Effects:</b> <span class="pronon">(PRO Users)</span>
3453
- Add eye-catching special effects that will make your YouTube embeds bounce, flip, pulse, or slide as they load on the screen. Check this box to select your desired effect. <a target="_blank" href="<?php echo self::$epbase ?>/add-special-effects-to-youtube-embeds-in-wordpress.aspx">Read more here &raquo;</a>
3454
  </label>
3455
  </p>
3456
  <div class="hr"></div>
@@ -3465,7 +3526,7 @@ class YouTubePrefs
3465
  <img class="ssfb" src="<?php echo plugins_url('images/youtube_thumbnail_sample.jpg', __FILE__) ?>" />
3466
  <input disabled type="checkbox" class="checkbox">
3467
  <label>
3468
- <b class="chktitle">Automatic Video Thumbnails:</b> <span class="pronon">(PRO Users)</span>
3469
  Automatically grab the thumbnail image of the first video embedded in each post or page, and use it as the featured image.
3470
  All you have to do is click Update on a post or page and the plugin does the rest!
3471
  (Example shown on the right) <a target="_blank" href="<?php echo self::$epbase ?>/add-youtube-video-thumbnails-featured-image-wordpress.aspx">Read more here &raquo;</a>
@@ -3475,12 +3536,12 @@ class YouTubePrefs
3475
  <p>
3476
  <a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" target="_blank">Activate the above and several other features &raquo;</a>
3477
  </p>
3478
- <?php
3479
- }
3480
- ?>
3481
  <div class="clearboth"></div>
3482
  </div>
3483
- <?php // self::save_changes_button(); ?>
3484
 
3485
  <hr>
3486
 
@@ -3488,47 +3549,47 @@ class YouTubePrefs
3488
  <div class="jumper" id="jumpoverride"></div>
3489
 
3490
  <h3 class="sect">
3491
- <?php _e("How To Override Defaults / Other Options") ?> <a href="#top" class="totop">&#9650; top</a>
3492
  </h3>
3493
  <p>Suppose you have a few videos that need to be different from the above defaults. You can add options to the end of a link as displayed below to override the above defaults. Each option should begin with '&'.
3494
  <br><span class="smallnote orange">PRO users: You can use the big blue <a href="<?php echo self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=protab' ?>" target="_blank">customize</a> buttons that you will see inside the wizard, instead of memorizing the following.</span>
3495
- <?php
3496
- _e('<ul>');
3497
- _e("<li><strong>width</strong> - Sets the width of your player. If omitted, the default width will be the width of your theme's content.<em> Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&width=500</strong>&height=350</em></li>");
3498
- _e("<li><strong>height</strong> - Sets the height of your player. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500<strong>&height=350</strong></em> </li>");
3499
- _e("<li><strong>autoplay</strong> - Set this to 1 to autoplay the video (or 0 to play the video once). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&autoplay=1</strong></em> </li>");
3500
- _e("<li><strong>cc_load_policy</strong> - Set this to 1 to turn on closed captioning (or 0 to leave them off). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&cc_load_policy=1</strong></em> </li>");
3501
- _e("<li><strong>iv_load_policy</strong> - Set this to 3 to turn off annotations (or 1 to show them). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&iv_load_policy=3</strong></em> </li>");
3502
- _e("<li><strong>loop</strong> - Set this to 1 to loop the video (or 0 to not loop). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&loop=1</strong></em> </li>");
3503
- _e("<li><strong>modestbranding</strong> - Set this to 1 to remove the YouTube logo while playing (or 0 to show the logo). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&modestbranding=1</strong></em> </li>");
3504
- _e("<li><strong>rel</strong> - Set this to 0 to not show related videos at the end of playing (or 1 to show them). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&rel=0</strong></em> </li>");
3505
- _e("<li><strong>showinfo</strong> - Set this to 0 to hide the video title and other info (or 1 to show it). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&showinfo=0</strong></em> </li>");
3506
- _e("<li><strong>theme</strong> - Set this to 'light' to make the player have the light-colored theme (or 'dark' for the dark theme). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&theme=light</strong></em> </li>");
3507
- _e("<li><strong>color</strong> - Set this to 'white' to make the player have a white progress bar (or 'red' for a red progress bar). Note: Using white will disable the modestbranding option. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&color=white</strong></em> </li>");
3508
- _e("<li><strong>vq</strong> - Set this to 'hd720' or 'hd1080' to force the video to have HD quality. Leave blank to let YouTube decide. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&vq=hd720</strong></em> </li>");
3509
- _e("<li><strong>controls</strong> - Set this to 0 to completely hide the video controls (or 2 to show it). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&controls=0</strong></em> </li>");
3510
- _e("<li><strong>autohide</strong> - Set this to 1 to slide away the control bar after the video starts playing. It will automatically slide back in again if you mouse over the video. (Set to 2 to always show it). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&autohide=1</strong></em> </li>");
3511
- _e("<li><strong>playsinline</strong> - Set this to 1 to allow videos play inline with the page on iOS browsers. (Set to 0 to have iOS launch videos in fullscreen instead). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&playsinline=1</strong></em> </li>");
3512
- _e("<li><strong>origin</strong> - Set this to 1 to add the 'origin' parameter for extra JavaScript security. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&origin=1</strong></em> </li>");
3513
- _e('</ul>');
3514
-
3515
- _e("<p>You can also start and end each individual video at particular times. Like the above, each option should begin with '&'</p>");
3516
- _e('<ul>');
3517
- _e("<li><strong>start</strong> - Sets the time (in seconds) to start the video. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350<strong>&start=20</strong></em> </li>");
3518
- _e("<li><strong>end</strong> - Sets the time (in seconds) to stop the video. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350<strong>&end=100</strong></em> </li>");
3519
- _e('</ul>');
3520
- ?>
3521
  <div class="save-changes-follow"> <?php self::save_changes_button(isset($_POST[$ytprefs_submitted]) && $_POST[$ytprefs_submitted] == 'Y'); ?> </div>
3522
  </form>
3523
  <div class="jumper" id="jumppro"></div>
3524
  <div id="goprobox">
3525
- <?php
3526
- if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0)
3527
- {
3528
- echo "<h3>" . __('Thank you for going PRO.');
3529
- echo ' &nbsp;<input type="submit" name="showkey" class="button-primary" style="vertical-align: 15%;" id="showprokey" value="View my PRO key" />';
3530
- echo "</h3>";
3531
- ?>
3532
  <?php
3533
  }
3534
  else
@@ -3576,7 +3637,7 @@ class YouTubePrefs
3576
  <ul class="gopro">
3577
  <li>
3578
  <img src="<?php echo plugins_url('images/videothumbs.png', __FILE__) ?>">
3579
- Automatic video thumbnail images (just click 'Update')
3580
  </li>
3581
  <li>
3582
  <img src="<?php echo plugins_url('images/prioritysupport.png', __FILE__) ?>">
@@ -3617,20 +3678,20 @@ class YouTubePrefs
3617
  <div style="clear: both;"></div>
3618
  <br>
3619
  <h3 class="bold">Enter and save your PRO key (emailed to you):</h3>
3620
- <?php } ?>
3621
  <form name="form2" method="post" action="" id="epform2" class="submitpro" <?php
3622
- if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0)
3623
- {
3624
- echo 'style="display: none;"';
3625
- }
3626
- ?>>
3627
 
3628
  <input name="<?php echo self::$opt_pro; ?>" id="opt_pro" value="<?php echo $all[self::$opt_pro]; ?>" type="text">
3629
  <input type="submit" name="Submit" class="button-primary" id="prokeysubmit" value="<?php _e('Save Key') ?>" />
3630
- <?php
3631
- if (!($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0))
3632
- {
3633
- ?>
3634
  &nbsp; &nbsp; &nbsp; <span style="font-size: 25px; color: #cccccc;">|</span> &nbsp; &nbsp; &nbsp; <a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" class="button-primary brightpro" target="_blank">Click here to go PRO &raquo;</a>
3635
  <?php
3636
  }
@@ -3661,6 +3722,7 @@ class YouTubePrefs
3661
  <code>[embedyt]http://www.youtube.com/watch?v=ABCDEF&width=400&height=250[/embedyt] [embedyt]http://www.youtube.com/watch?v=GHIJK&width=400&height=250[/embedyt]</code>
3662
  <br> TIP: As shown above, 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)
3663
  </li>
 
3664
  <li>Finally, there's a slight chance your custom theme is the issue, if you have one. To know for sure, we suggest temporarily switching to one of the default WordPress themes (e.g., "Twenty Fourteen") just to see if your video does appear. If it suddenly works, then your custom theme is the issue. You can switch back when done testing.</li>
3665
  <li>If your videos always appear full size, try turning off "Responsive video sizing."</li>
3666
  <li>If none of the above work, you can contact us here if you still have issues: ext@embedplus.com. We'll try to respond within a week. PRO users should use the priority form below for faster replies.</li>
@@ -3683,15 +3745,15 @@ class YouTubePrefs
3683
 
3684
  <iframe src="<?php echo self::$epbase ?>/dashboard/prosupport.aspx?simple=1&prokey=<?php echo $all[self::$opt_pro]; ?>&domain=<?php echo site_url(); ?>" width="500" height="<?php echo ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0) ? "500" : "140"; ?>"></iframe>
3685
 
3686
- <?php
3687
- if (!($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0))
3688
- {
3689
- ?>
3690
  <br>
3691
  <br>
3692
  <iframe src="<?php echo self::$epbase ?>/dashboard/likecoupon.aspx" width="600" height="500"></iframe>
3693
- <?php }
3694
- ?>
3695
  <div class="ytnav">
3696
  <a href="#jumphowto">How To Embed</a>
3697
  <a href="#jumpwiz">Visual Wizard</a>
@@ -3745,6 +3807,28 @@ class YouTubePrefs
3745
  }
3746
  }
3747
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3748
  if (jQuery("#<?php echo self::$opt_defaultvol; ?>").is(":checked"))
3749
  {
3750
  if (!(jQuery.isNumeric(jQuery.trim(jQuery("#<?php echo self::$opt_vol; ?>").val()))))
@@ -3839,6 +3923,18 @@ class YouTubePrefs
3839
 
3840
  });
3841
 
 
 
 
 
 
 
 
 
 
 
 
 
3842
  jQuery('#<?php echo self::$opt_gallery_channelsub; ?>').change(function ()
3843
  {
3844
  if (jQuery(this).is(":checked"))
@@ -4095,12 +4191,12 @@ class YouTubePrefs
4095
 
4096
  });
4097
  </script>
4098
- <?php
4099
- if (function_exists('add_thickbox'))
4100
- {
4101
- add_thickbox();
4102
- }
4103
- ?>
4104
 
4105
  <?php
4106
  }
@@ -4120,258 +4216,276 @@ class YouTubePrefs
4120
  });
4121
 
4122
  </script>
4123
- <?php
4124
- }
4125
- ?>
4126
  <p class="submit">
4127
  <input type="submit" onclick="return savevalidate();" name="Submit" class="button-primary ytprefs-submit" value="<?php _e($button_label) ?>" />
4128
  <em>If you're using a separate caching plugin and you do not see your changes after saving, you might want to reset your cache.</em>
4129
  </p>
4130
- <?php
4131
- }
4132
 
4133
- public static function ytprefsscript()
4134
- {
4135
- $loggedin = current_user_can('edit_posts');
4136
- if (!($loggedin && self::$alloptions[self::$opt_admin_off_scripts]))
4137
  {
4138
- wp_enqueue_style(
4139
- '__EPYT__style', plugins_url('styles/ytprefs' . self::$min . '.css', __FILE__)
4140
- );
4141
- $cols = floatval(self::$alloptions[self::$opt_gallery_columns]);
4142
- $cols = $cols == 0 ? 3.0 : $cols;
4143
- $colwidth = 100.0 / $cols;
4144
- $custom_css = "
 
 
 
4145
  .epyt-gallery-thumb {
4146
  width: " . round($colwidth, 3) . "%;
4147
- }";
4148
- wp_add_inline_style('__EPYT__style', $custom_css);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4149
 
 
4150
 
4151
- if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 8))
4152
- {
4153
- wp_enqueue_style('__disptype__', plugins_url('scripts/lity' . self::$min . '.css', __FILE__));
4154
- wp_enqueue_script('__dispload__', plugins_url('scripts/lity' . self::$min . '.js', __FILE__), array('jquery'));
4155
- }
4156
 
4157
- wp_enqueue_script('__ytprefs__', plugins_url('scripts/ytprefs' . self::$min . '.js', __FILE__), array('jquery'));
 
 
 
 
4158
 
4159
- if (self::$alloptions[self::$opt_old_script_method] != 1)
4160
- {
4161
- wp_localize_script('__ytprefs__', '_EPYT_', array(
4162
- 'ajaxurl' => admin_url('admin-ajax.php'),
4163
- 'security' => wp_create_nonce('embedplus-nonce'),
4164
- 'gallery_scrolloffset' => intval(self::$alloptions[self::$opt_gallery_scrolloffset]),
4165
- 'eppathtoscripts' => plugins_url('scripts/', __FILE__),
4166
- 'epresponsiveselector' => self::get_responsiveselector(),
4167
- 'epdovol' => true,
4168
- 'version' => self::$alloptions[self::$opt_version],
4169
- 'evselector' => self::get_evselector()
4170
- ));
4171
- }
4172
 
4173
- ////////////////////// cloudflare accomodation
4174
- //add_filter('script_loader_tag', 'YouTubePrefs::set_cfasync', 10, 3);
 
 
 
 
 
 
 
 
 
 
 
4175
 
4176
- if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0) && self::$alloptions[self::$opt_dynload] == 1)
4177
- {
4178
- wp_enqueue_style('__dyntype__', plugins_url('scripts/embdyn.min.css', __FILE__));
4179
- wp_enqueue_script('__dynload__', plugins_url('scripts/embdyn' . self::$min . '.js', __FILE__), array('jquery'));
 
 
 
 
4180
  }
4181
  }
4182
- }
4183
 
4184
- public static function set_cfasync($tag, $handle, $src)
4185
- {
4186
- if ('__ytprefs__' !== $handle)
4187
  {
4188
- return $tag;
 
 
 
 
4189
  }
4190
- return str_replace('<script', '<script data-cfasync="false" ', $tag);
4191
- }
4192
 
4193
- public static function get_evselector()
4194
- {
4195
- $evselector = 'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]';
4196
-
4197
- if (self::$alloptions[self::$opt_evselector_light] == 1)
4198
  {
4199
- $evselector = 'iframe.__youtube_prefs__[src]';
4200
- }
4201
 
4202
- return $evselector;
4203
- }
 
 
4204
 
4205
- public static function get_responsiveselector()
4206
- {
4207
- $responsiveselector = '[]';
4208
- if (self::$alloptions[self::$opt_widgetfit] == 1)
4209
- {
4210
- $responsiveselector = '["iframe.__youtube_prefs_widget__"]';
4211
  }
4212
- if (self::$alloptions[self::$opt_responsive] == 1)
 
4213
  {
4214
- if (self::$alloptions[self::$opt_responsive_all] == 1)
 
4215
  {
4216
- $responsiveselector = '["iframe[src*=\'youtube.com\']","iframe[src*=\'youtube-nocookie.com\']","iframe[data-ep-src*=\'youtube.com\']","iframe[data-ep-src*=\'youtube-nocookie.com\']","iframe[data-ep-gallerysrc*=\'youtube.com\']"]';
4217
  }
4218
- else
4219
  {
4220
- $responsiveselector = '["iframe.__youtube_prefs__"]';
 
 
 
 
 
 
 
4221
  }
 
4222
  }
4223
- return $responsiveselector;
4224
- }
4225
 
4226
- public static function get_blogwidth()
4227
- {
4228
- $blogwidth = null;
4229
- try
4230
  {
4231
- $embed_size_w = intval(get_option('embed_size_w'));
 
 
 
4232
 
4233
- global $content_width;
4234
- if (empty($content_width))
 
 
 
 
 
 
 
4235
  {
4236
- $content_width = $GLOBALS['content_width'];
4237
  }
4238
 
4239
- $blogwidth = $embed_size_w ? $embed_size_w : ($content_width ? $content_width : 450);
4240
- }
4241
- catch (Exception $ex)
4242
- {
4243
-
4244
- }
4245
 
4246
- $blogwidth = preg_replace('/\D/', '', $blogwidth); //may have px
 
4247
 
4248
- return $blogwidth;
4249
  }
4250
 
4251
- }
4252
-
4253
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4254
  //class start
4255
- class Add_new_tinymce_btn_Youtubeprefs
4256
- {
4257
 
4258
- public $btn_arr;
4259
- public $js_file;
4260
 
4261
- /*
4262
- * call the constructor and set class variables
4263
- * From the constructor call the functions via wordpress action/filter
4264
- */
4265
 
4266
- function __construct($seperator, $btn_name, $javascrip_location)
4267
- {
4268
- $this->btn_arr = array("Seperator" => $seperator, "Name" => $btn_name);
4269
- $this->js_file = $javascrip_location;
4270
- add_action('init', array($this, 'add_tinymce_button'));
4271
- add_filter('tiny_mce_version', array($this, 'refresh_mce_version'));
4272
- }
4273
 
4274
- /*
4275
- * create the buttons only if the user has editing privs.
4276
- * If so we create the button and add it to the tinymce button array
4277
- */
4278
 
4279
- function add_tinymce_button()
4280
- {
4281
- if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
4282
- return;
4283
- if (get_user_option('rich_editing') == 'true')
4284
  {
4285
- //the function that adds the javascript
4286
- add_filter('mce_external_plugins', array($this, 'add_new_tinymce_plugin'));
4287
- //adds the button to the tinymce button array
4288
- add_filter('mce_buttons', array($this, 'register_new_button'));
 
 
 
 
 
4289
  }
4290
- }
4291
 
4292
- /*
4293
- * add the new button to the tinymce array
4294
- */
4295
 
4296
- function register_new_button($buttons)
4297
- {
4298
- array_push($buttons, $this->btn_arr["Seperator"], $this->btn_arr["Name"]);
4299
- return $buttons;
4300
- }
4301
 
4302
- /*
4303
- * Call the javascript file that loads the
4304
- * instructions for the new button
4305
- */
4306
 
4307
- function add_new_tinymce_plugin($plugin_array)
4308
- {
4309
- $plugin_array[$this->btn_arr['Name']] = $this->js_file;
4310
- return $plugin_array;
4311
- }
4312
 
4313
- /*
4314
- * This function tricks tinymce in thinking
4315
- * it needs to refresh the buttons
4316
- */
4317
 
4318
- function refresh_mce_version($ver)
4319
- {
4320
- $ver += 3;
4321
- return $ver;
4322
- }
4323
 
4324
- }
4325
 
4326
  //class end
4327
 
4328
 
4329
- register_activation_hook(__FILE__, array('YouTubePrefs', 'initoptions'));
4330
- $youtubeplgplus = new YouTubePrefs();
4331
 
4332
 
4333
- add_action("wp_ajax_my_embedplus_pro_record", array('YouTubePrefs', 'my_embedplus_pro_record'));
4334
- add_action("wp_ajax_my_embedplus_clearspdc", array('YouTubePrefs', 'my_embedplus_clearspdc'));
4335
- add_action("wp_ajax_my_embedplus_glance_vids", array('YouTubePrefs', 'my_embedplus_glance_vids'));
4336
- add_action("wp_ajax_my_embedplus_glance_count", array('YouTubePrefs', 'my_embedplus_glance_count'));
4337
- add_action("wp_ajax_my_embedplus_dismiss_double_plugin_warning", array('YouTubePrefs', 'my_embedplus_dismiss_double_plugin_warning'));
4338
- add_action("wp_ajax_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
4339
- add_action("wp_ajax_nopriv_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
4340
 
4341
- add_action('admin_enqueue_scripts', 'youtubeprefs_admin_enqueue_scripts');
4342
 
4343
- function youtubeprefs_admin_enqueue_scripts()
4344
- {
4345
- wp_enqueue_style('embedplusyoutube', plugins_url() . '/youtube-embed-plus/scripts/embedplus_mce.css');
4346
- add_action('wp_print_scripts', 'youtubeprefs_output_scriptvars');
4347
- wp_enqueue_script('__ytprefs_admin__', plugins_url('scripts/ytprefs-admin.min.js', __FILE__), array('jquery'));
4348
-
4349
- if (
4350
- //(!(isset(YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro]) && strlen(trim(YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro])) > 0)) && // display only if not pro ooopointer
4351
- (get_bloginfo('version') >= '3.3') && YouTubePrefs::custom_admin_pointers_check()
4352
- )
4353
  {
4354
- add_action('admin_print_footer_scripts', 'YouTubePrefs::custom_admin_pointers_footer');
 
 
4355
 
4356
- wp_enqueue_script('wp-pointer');
4357
- wp_enqueue_style('wp-pointer');
4358
- }
 
 
 
4359
 
4360
- if (YouTubePrefs::$alloptions['glance'] == 1)
4361
- {
4362
- add_action('admin_print_footer_scripts', 'YouTubePrefs::glance_script');
 
 
 
 
 
4363
  }
4364
- }
4365
 
4366
- function youtubeprefs_output_scriptvars()
4367
- {
4368
- YouTubePrefs::$scriptsprinted++;
4369
- if (YouTubePrefs::$scriptsprinted == 1)
4370
  {
4371
- $blogwidth = YouTubePrefs::get_blogwidth();
4372
- $epprokey = YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro];
4373
- $myytdefaults = http_build_query(YouTubePrefs::$alloptions);
4374
- ?>
 
 
 
4375
  <script type="text/javascript">
4376
  var wpajaxurl = "<?php echo admin_url('admin-ajax.php') ?>";
4377
  if (window.location.toString().indexOf('https://') == 0)
@@ -4449,9 +4563,9 @@ function youtubeprefs_output_scriptvars()
4449
 
4450
 
4451
  </script>
4452
- <?php
 
4453
  }
4454
- }
4455
 
4456
  // function embedplus_strip_shortcode_from_excerpt($content)
4457
  // {
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.5
7
  Author: EmbedPlus Team
8
  Author URI: http://www.embedplus.com
9
  */
32
  class YouTubePrefs
33
  {
34
 
35
+ public static $temptimeout = 20;
36
+ public static $version = '11.5';
37
  public static $opt_version = 'version';
38
  public static $optembedwidth = null;
39
  public static $optembedheight = null;
95
  public static $opt_gallery_pagesize = 'gallery_pagesize';
96
  public static $opt_gallery_apikey = 'gallery_apikey';
97
  public static $opt_gallery_columns = 'gallery_columns';
98
+ public static $opt_gallery_collapse_grid = 'gallery_collapse_grid';
99
+ public static $opt_gallery_collapse_grid_breaks = 'gallery_collapse_grid_breaks';
100
  public static $opt_gallery_style = 'gallery_style';
101
  public static $opt_gallery_scrolloffset = 'gallery_scrolloffset';
102
  public static $opt_gallery_showtitle = 'gallery_showtitle';
116
  public static $opt_alloptions = 'youtubeprefs_alloptions';
117
  public static $alloptions = null;
118
  public static $yt_options = array();
119
+ public static $dft_bpts = array(array('bp' => array('min' => 0, 'max' => 767), 'cols' => 1));
120
  //public static $epbase = 'http://localhost:2346';
121
  public static $epbase = '//www.embedplus.com';
122
  public static $double_plugin = false;
189
 
190
  self::do_ytprefs();
191
  add_action('admin_menu', 'YouTubePrefs::ytprefs_plugin_menu');
192
+ add_filter('plugin_action_links_' . plugin_basename(__FILE__), array('YouTubePrefs', 'my_plugin_action_links'));
193
+
194
+
195
 
196
  if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 8)
197
  {
228
  }
229
  }
230
 
231
+ public static function my_plugin_action_links($links)
232
+ {
233
+ $links[] = '<a href="' . esc_url(admin_url('admin.php?page=youtube-my-preferences')) . '">Settings</a>';
234
+ $links[] = '<a href="https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx" target="_blank">Pro Version</a>';
235
+ return $links;
236
+ }
237
+
238
  public static function ytprefs_admin_bar_scripts()
239
  {
240
  if (current_user_can('edit_posts'))
356
  var $accbox = $j(this).parent().children('.accbox');
357
  var pid = $accbox.attr("data-postid");
358
 
359
+ $acctitle.prepend('<img alt="loading" class="accloader" src="<?php echo plugins_url('images/ajax-loader.gif', __FILE__) ?>" />');
360
  jQuery.ajax({
361
  type: "post",
362
  dataType: "json",
402
  {
403
  $total = $wpdb->get_var("SELECT FOUND_ROWS();");
404
  global $post;
405
+ echo '<h2><img alt="YouTube Plugin Icon" src="' . plugins_url('images/youtubeicon16.png', __FILE__) . '" /> 10 Latest Posts/Pages with YouTube Videos (' . $total . ' Total)</h2>';
406
  ?>
407
 
408
  We recommend using this page as an easy way to check the results of the global default settings you make (e.g. hide annotations) on your recent embeds. Or, simply use it as an index to jump right to your posts that contain YouTube embeds.
442
  $postid = intval($_REQUEST['postid']);
443
  $currpost = get_post($postid);
444
 
445
+ $thehtml = '<img alt="close" class="accclose" onclick="accclose(this)" src="' . plugins_url('images/accclose.png', __FILE__) . '" />';
446
 
447
  $matches = Array();
448
  $ismatch = preg_match_all(self::$justurlregex, $currpost->post_content, $matches);
482
  $_description = esc_attr(sanitize_text_field($odata->author_name));
483
  $_thumbnailUrl = esc_url("https://i.ytimg.com/vi/" . $vidid . "/0.jpg");
484
 
485
+ $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accthumb"><img alt="YouTube Video" src="' . $_thumbnailUrl . '" /></a>';
486
  $thehtml .= '<div class="accinfo">';
487
  $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accvidtitle">' . $_name . '</a>';
488
  $thehtml .= '<div class="accdesc">' . (strlen($_description) > 400 ? substr($_description, 0, 400) . "..." : $_description) . '</div>';
518
  $_description = esc_attr(sanitize_text_field($odata->author_name));
519
  $_thumbnailUrl = esc_url($odata->thumbnail_url);
520
 
521
+ $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accthumb"><img alt="YouTube Video" src="' . $_thumbnailUrl . '" /></a>';
522
  $thehtml .= '<div class="accinfo">';
523
  $thehtml .= '<a target="_blank" href="' . $postlink . '" class="accvidtitle">' . $_name . '</a>';
524
  $thehtml .= '<div class="accdesc">' . (strlen($_description) > 400 ? substr($_description, 0, 400) . "..." : $_description) . '</div>';
661
  echo '<a class="epxout">&times;</a>';
662
  }
663
  ?>
664
+ Seems like you have two different YouTube plugins by the EmbedPlus Team installed: <b><img alt="YouTube Icon" src="<?php echo plugins_url('images/youtubeicon16.png', __FILE__) ?>" /> YouTube</b> and <b><img alt="YouTube Icon" src="<?php echo plugins_url('images/btn_embedpluswiz.png', __FILE__) ?>" /> Advanced YouTube Embed.</b> We strongly suggest keeping only the one you prefer, so that they don't conflict with each other while trying to create your embeds.</p>
665
  </div>
666
  <iframe allowTransparency="true" src="<?php echo self::$epbase . '/both-plugins-conflict.aspx' ?>" style="width:2px; height: 2px;" ></iframe>
667
  <script type="text/javascript">
794
  $_hl = '';
795
  $_dohl = 0;
796
  $_gallery_columns = 3;
797
+ $_gallery_collapse_grid = 0;
798
+ $_gallery_collapse_grid_breaks = self::$dft_bpts;
799
  $_gallery_scrolloffset = 20;
800
  $_gallery_showtitle = 1;
801
  $_gallery_showpaging = 1;
872
  $_apikey = self::tryget($arroptions, self::$opt_apikey, '');
873
  $_gallery_pagesize = self::tryget($arroptions, self::$opt_gallery_pagesize, 15);
874
  $_gallery_columns = self::tryget($arroptions, self::$opt_gallery_columns, 3);
875
+ $_gallery_collapse_grid = self::tryget($arroptions, self::$opt_gallery_collapse_grid, 0);
876
+ $_gallery_collapse_grid_breaks = self::tryget($arroptions, self::$opt_gallery_collapse_grid_breaks, self::$dft_bpts);
877
  $_gallery_scrolloffset = self::tryget($arroptions, self::$opt_gallery_scrolloffset, 20);
878
  $_gallery_showtitle = self::tryget($arroptions, self::$opt_gallery_showtitle, 1);
879
  $_gallery_showpaging = self::tryget($arroptions, self::$opt_gallery_showpaging, 1);
946
  self::$opt_vol => $_vol,
947
  self::$opt_apikey => $_apikey,
948
  self::$opt_gallery_columns => $_gallery_columns,
949
+ self::$opt_gallery_collapse_grid => $_gallery_collapse_grid,
950
+ self::$opt_gallery_collapse_grid_breaks => $_gallery_collapse_grid_breaks,
951
  self::$opt_gallery_scrolloffset => $_gallery_scrolloffset,
952
  self::$opt_gallery_showtitle => $_gallery_showtitle,
953
  self::$opt_gallery_showpaging => $_gallery_showpaging,
978
  if (self::$alloptions[self::$opt_spdc] == 1)
979
  {
980
  self::spdcpurge();
981
+ wp_remote_get(site_url(), array('timeout' => self::$temptimeout));
982
  }
983
  }
984
  catch (Exception $ex)
1077
  $epvars = preg_replace('/\s/', '', $epvars);
1078
  $epvars = preg_replace('/¬/', '&not', $epvars);
1079
  $epvars = str_replace('&amp;', '&', $epvars);
1080
+
1081
  $epparams = self::keyvalue($epvars, true);
1082
 
1083
  if (isset($epparams) && isset($epparams['ytid']))
1085
  $start = isset($epparams['start']) && is_numeric($epparams['start']) ? '&start=' . intval($epparams['start']) : '';
1086
  $end = isset($epparams['end']) && is_numeric($epparams['end']) ? '&end=' . intval($epparams['end']) : '';
1087
  $end = isset($epparams['stop']) && is_numeric($epparams['stop']) ? '&end=' . intval($epparams['stop']) : '';
1088
+
1089
  $url = 'https://www.youtube.com/watch?v=' . trim($epparams['ytid']) . $start . $end;
1090
+
1091
  $currfilter = current_filter();
1092
  if (preg_match(self::$justurlregex, $url))
1093
  {
1170
  $code = '';
1171
  $init_id = null;
1172
 
1173
+ $apiResult = wp_remote_get($apiEndpoint, array('timeout' => self::$temptimeout));
1174
 
1175
  if (is_wp_error($apiResult))
1176
  {
1177
  $gallobj->html = '<div>Sorry, there was a YouTube API error: <em>' . htmlspecialchars(strip_tags($apiResult->get_error_message())) . '</em>' .
1178
+ ' Please make sure you performed the <a href="https://www.youtube.com/watch?v=LpKDFT40V0U" target="_blank">steps in this video</a> to create and save a proper server API key.' .
1179
  '</div>';
1180
  return $gallobj;
1181
  }
1195
  if (isset($jsonResult->error->message))
1196
  {
1197
  $gallobj->html = '<div>Sorry, there was a YouTube API error: <em>' . htmlspecialchars(strip_tags($jsonResult->error->message)) . '</em>' .
1198
+ ' Please make sure you performed the <a href="https://www.youtube.com/watch?v=LpKDFT40V0U" target="_blank">steps in this video</a> to create and save a proper server API key.' .
1199
  '</div>';
1200
  return $gallobj;
1201
  }
1202
+ $gallobj->html = '<div>Sorry, there may be an issue with your YouTube API key. Please make sure you performed the <a href="https://www.youtube.com/watch?v=LpKDFT40V0U" target="_blank">steps in this video</a> to create and save a proper server API key.</div>';
1203
  return $gallobj;
1204
  }
1205
 
1339
  . ((self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 9 && !in_array($options->thumbcrop, array('box', ''))) ? '" data-thumbcrop="' . $options->thumbcrop : '')
1340
  . '"><div>' . $txtnext . '</div> <div class="arrow">&raquo;</div></div>';
1341
 
1342
+ $pagination .= '<div class="epyt-loader"><img alt="loading" width="16" height="11" src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div>';
1343
 
1344
  $pagination .= '</div>';
1345
 
1346
  if ($options->showPaging == 0)
1347
  {
1348
+ $pagination = '<div class="epyt-pagination"></div>';
1349
  }
1350
  $code = $pagination . $code . $pagination;
1351
 
1387
 
1388
  $code .= '<div tabindex="0" role="button" data-videoid="' . $escId . '" class="epyt-gallery-thumb ' . $styleclass . '" ' . $rawstyle . '>';
1389
  $code .= '<div class="epyt-gallery-img-box"><div class="epyt-gallery-img" style="background-image: url(' . esc_attr($thumb->img) . ')">' .
1390
+ '<div class="epyt-gallery-playhover"><img alt="play" class="epyt-play-img" width="30" height="23" src="' . plugins_url('images/playhover.png', __FILE__) . '" /><div class="epyt-gallery-playcrutch"></div></div>' .
1391
  '</div></div>';
1392
  if ($options->style != 'carousel' && !empty($thumb->title))
1393
  {
1574
  if (isset($linkparams['list']))
1575
  {
1576
  $odata = self::get_oembed('http://youtube.com/playlist?list=' . $linkparams['list'], 1920, 1280);
1577
+ if (is_object($odata) && isset($odata->title))
1578
+ {
1579
+ $acctitle = $odata->title;
1580
+ }
1581
  }
1582
  else
1583
  {
1584
  $odata = self::get_oembed('http://youtube.com/watch?v=' . $linkparams['v'], 1920, 1280);
1585
+ if (is_object($odata) && isset($odata->title))
1586
+ {
1587
+ $acctitle = $odata->title;
1588
+ }
1589
  }
1590
  }
1591
 
1651
  if (self::$alloptions[self::$opt_gallery_channelsub] == 1)
1652
  {
1653
  $subbutton = '<div class="epyt-gallery-subscribe"><a target="_blank" class="epyt-gallery-subbutton" href="' .
1654
+ esc_attr(self::$alloptions[self::$opt_gallery_channelsublink]) . '?sub_confirmation=1"><img alt="subscribe" src="' . plugins_url('images/play-subscribe.png', __FILE__) . '" />' .
1655
  htmlspecialchars(self::$alloptions[self::$opt_gallery_channelsubtext], ENT_QUOTES) . '</a></div>';
1656
  }
1657
 
1778
  $ytapilink = 'https://www.googleapis.com/youtube/v3/videos?id=' . $vidid . '&part=contentDetails,snippet&key=' . self::$alloptions[self::$opt_apikey];
1779
 
1780
 
1781
+ $apidata = wp_remote_get($ytapilink, array('timeout' => self::$temptimeout));
1782
  if (!is_wp_error($apidata))
1783
  {
1784
  $raw = wp_remote_retrieve_body($apidata);
1794
  $_uploadDate = sanitize_text_field($json['items'][0]['snippet']['publishedAt']); // "2014-10-03T15:30:12.000Z"
1795
 
1796
  $schemaorgcode = '<span itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
1797
+ $schemaorgcode .= '<meta itemprop="embedUrl" content="https://www.youtube.com/embed/' . $vidid . '">';
1798
  $schemaorgcode .= '<meta itemprop="name" content="' . $_name . '">';
1799
  $schemaorgcode .= '<meta itemprop="description" content="' . $_description . '">';
1800
  $schemaorgcode .= '<meta itemprop="thumbnailUrl" content="' . $_thumbnailUrl . '">';
1985
  . '&maxResults=10&key=' . self::$alloptions[self::$opt_apikey];
1986
  try
1987
  {
1988
+ $apiResult = wp_remote_get($apiEndpoint, array('timeout' => self::$temptimeout));
1989
  if (!is_wp_error($apiResult))
1990
  {
1991
  $jsonResult = json_decode($apiResult['body']);
2189
  .orange {color: #f85d00;}
2190
  </style>
2191
  <br>
2192
+ <?php
2193
+ $thishost = (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "");
2194
+ $thiskey = self::$alloptions[self::$opt_pro];
2195
 
2196
+ $dashurl = self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab&domain=" . $thishost . "&prokey=" . $thiskey;
2197
 
2198
+ if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
2199
+ {
2200
+ //// header
2201
+ echo "<h2>" . '<img alt="YouTube Plugin Icon" src="' . plugins_url('images/epstats16.png', __FILE__) . '" /> ' . __('YouTube Analytics Dashboard') . "</h2>";
2202
+ echo '<p><i>Logging you in below... (You can also <a class="button-primary" target="_blank" href="' . $dashurl . '">click here</a> to launch your dashboard in a new tab)</i></p>';
2203
+ }
2204
+ else
2205
+ {
2206
+ //// header
2207
+ echo "<h2>" . '<img alt="YouTube Plugin Wizard" style="vertical-align: text-bottom;" src="' . plugins_url('images/iconwizard.png', __FILE__) . '" /> ' . __('YouTube Plugin PRO') . "</h2><p class='bold orange'>This tab is here to provide direct access to analytics. Graphs and other data about your site will show below after you activate PRO.</p><br>";
2208
+ }
2209
+ ?>
2210
  <iframe class="shadow" src="<?php echo $dashurl ?>" width="1060" height="3600" scrolling="auto"/>
2211
  </div>
2212
+ <?php
2213
+ }
2214
 
2215
+ public static function my_embedplus_pro_record()
2216
+ {
2217
+ $result = array();
2218
+ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
2219
  {
2220
+ $tmppro = preg_replace('/[^A-Za-z0-9-]/i', '', $_REQUEST[self::$opt_pro]);
2221
+ $new_options = array();
2222
+ $new_options[self::$opt_pro] = $tmppro;
2223
+ $all = get_option(self::$opt_alloptions);
2224
+ $all = $new_options + $all;
2225
+ update_option(self::$opt_alloptions, $all);
2226
+
2227
+ if (strlen($tmppro) > 0)
2228
  {
2229
+ $result['type'] = 'success';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2230
  }
2231
  else
2232
  {
2233
  $result['type'] = 'error';
 
2234
  }
2235
+ echo json_encode($result);
2236
  }
2237
+ else
2238
+ {
2239
+ $result['type'] = 'error';
2240
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
2241
+ }
2242
+ die();
2243
+ }
2244
 
2245
+ public static function my_embedplus_clearspdc()
2246
+ {
2247
+ $result = array();
2248
+ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
2249
  {
2250
+ try
 
2251
  {
2252
+ self::spdcpurge();
2253
+ $result['type'] = 'success';
 
 
 
 
 
 
 
 
2254
  }
2255
+ catch (Exception $ex)
2256
  {
2257
  $result['type'] = 'error';
 
2258
  }
2259
+ echo json_encode($result);
2260
  }
2261
+ else
 
2262
  {
2263
+ $result['type'] = 'error';
2264
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
 
 
 
 
 
2265
  }
2266
+ die();
2267
+ }
2268
 
2269
+ public static function custom_admin_pointers_check()
2270
+ {
2271
+ //return false; // ooopointer shut all off;
2272
+ $admin_pointers = self::custom_admin_pointers();
2273
+ foreach ($admin_pointers as $pointer => $array)
2274
  {
2275
+ if ($array['active'])
2276
+ return true;
2277
+ }
2278
+ }
2279
+
2280
+ public static function glance_script()
2281
+ {
2282
+ add_thickbox();
2283
+ ?>
2284
  <script type="text/javascript">
2285
  function widen_ytprefs_glance() {
2286
  setTimeout(function () {
2376
  $new_pointer_content .= '<p>'; // ooopointer
2377
  if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
2378
  {
2379
+ $new_pointer_content .= __("This update adds: thumbnail stacking for mobile galleries, better support for ajax themes, and alt text to images to both the Free and Pro version. (<a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Learn more about Pro &raquo;</a>)");
2380
  }
2381
  else
2382
  {
2383
+ $new_pointer_content .= __("This update adds: thumbnail stacking for mobile galleries, better support for ajax themes, and alt text to images to both the Free and Pro version.");
2384
  }
2385
  $new_pointer_content .= '</p>';
2386
 
2477
  $new_options[self::$opt_gallery_channelsub] = self::postchecked(self::$opt_gallery_channelsub) ? 1 : 0;
2478
  $new_options[self::$opt_gallery_customarrows] = self::postchecked(self::$opt_gallery_customarrows) ? 1 : 0;
2479
  $new_options[self::$opt_gallery_showdsc] = self::postchecked(self::$opt_gallery_showdsc) ? 1 : 0;
2480
+ $new_options[self::$opt_gallery_collapse_grid] = self::postchecked(self::$opt_gallery_collapse_grid) ? 1 : 0;
2481
 
2482
  $_defaultwidth = '';
2483
  try
2546
  }
2547
  $new_options[self::$opt_gallery_columns] = $_gallery_columns;
2548
 
2549
+
2550
+ $_gallery_collapse_grid_breaks = self::$dft_bpts;
2551
+ try
2552
+ {
2553
+ $_gallery_collapse_grid_breaks = is_array($_POST[self::$opt_gallery_collapse_grid_breaks]) ? $_POST[self::$opt_gallery_collapse_grid_breaks] : $_gallery_collapse_grid_breaks;
2554
+ }
2555
+ catch (Exception $ex)
2556
+ {
2557
+
2558
+ }
2559
+ $new_options[self::$opt_gallery_collapse_grid_breaks] = $_gallery_collapse_grid_breaks;
2560
+
2561
+
2562
+
2563
  $_gallery_scrolloffset = 20;
2564
  try
2565
  {
2741
  self::spdcpurge();
2742
  if ($all[self::$opt_spdc] == 1)
2743
  {
2744
+ wp_remote_get(site_url(), array('timeout' => self::$temptimeout));
2745
  }
2746
  }
2747
  catch (Exception $ex)
2760
 
2761
  // header
2762
 
2763
+ echo "<h2>" . '<img alt="YouTube Plugin Icon" src="' . plugins_url('images/youtubeicon16.png', __FILE__) . '" /> ' . __('YouTube Settings') . "</h2>";
2764
 
2765
  // settings form
2766
  ?>
2814
  #boxdefaultdims {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_defaultdims] ? '' : 'display: none;' ?>}
2815
  #boxcustomarrows {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_customarrows] ? 'display: block;' : 'display: none;' ?>}
2816
  #boxchannelsub {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_channelsub] ? 'display: block;' : 'display: none;' ?>}
2817
+ #box_collapse_grid {font-weight: bold; padding: 0px 10px; <?php echo isset($all[self::$opt_gallery_collapse_grid]) && $all[self::$opt_gallery_collapse_grid] ? 'display: block;' : 'display: none;' ?>}
2818
  .textinput {border-width: 2px !important;}
2819
  h3.sect {border-radius: 10px; background-color: #D9E9F7; padding: 5px 5px 5px 10px; position: relative; font-weight: bold;}
2820
  h3.sect a {text-decoration: none; color: #E20000;}
2844
  .vol-seeslider {display: none;}
2845
  input#spdcexp {width: 70px;}
2846
  .indent-option {margin-left: 25px;}
2847
+ #boxschemaorg { padding: 7px 0; <?php echo $all[self::$opt_schemaorg] ? 'display: block;' : 'display: none;' ?>}
2848
  #boxmigratelist { <?php echo $all[self::$opt_migrate] ? '' : 'display: none;' ?>}
2849
  #boxresponsive_all { <?php echo $all[self::$opt_responsive] ? '' : 'display: none;' ?> padding-left: 25px; border-left: 5px solid rgba(100, 100, 100,.1); margin-left: 5px;}
2850
  .apikey-msg {display: inline-block; width: 45%; vertical-align: top;}
2936
  </p>
2937
  <div class="jumper" id="jumpdefaults"></div>
2938
  <h3 class="sect">
2939
+ <?php _e("Default YouTube Options") ?> <a href="#top" class="totop">&#9650; top</a>
2940
  </h3>
2941
  <p>
2942
  <?php _e("One of the benefits of using this plugin is that you can set site-wide default options for all your videos (click \"Save Changes\" when finished). However, you can also override them (and more) on a per-video basis. Directions on how to do that are in the next section.") ?>
2943
  </p>
2944
+ <?php // self::save_changes_button(); ?>
2945
 
2946
  <div class="ytindent chx">
2947
  <p>
3074
  <label for="<?php echo self::$opt_cc_load_policy; ?>"><?php _e('<b class="chktitle">Closed Captions:</b> Turn on closed captions by default.') ?></label>
3075
  </p>
3076
  <p>
3077
+ <input name="<?php echo self::$opt_dohl; ?>" id="<?php echo self::$opt_dohl; ?>" <?php checked($all[self::$opt_dohl], 1); ?> type="checkbox" class="checkbox">
 
 
 
3078
  <label for="<?php echo self::$opt_dohl; ?>"><b class="chktitle">Player Localization / Internationalization: </b>
3079
  Automatically detect your site's default language (using get_locale) and set your YouTube embeds interface language so that it matches. Specifically, this will set the player's tooltips and caption track if your language is natively supported by YouTube. We suggest checking this if English is not your site's default language. <a href="<?php echo self::$epbase ?>/youtube-iso-639-1-language-codes.aspx" target="_blank">See here for more details &raquo;</a></label>
3080
  </p>
3161
  <img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
3162
  <p>
3163
  <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">You can now make playlist embeds (and channel-playlist embeds) have a gallery layout &raquo;</a>. <strong>First, you must obtain your YouTube API key</strong>.
3164
+ Don't worry, it's an easy process. Just <a href="https://www.youtube.com/watch?v=LpKDFT40V0U" target="_blank">click this link &raquo;</a> and follow the video on that page to get your API key. Since Google updates their API Key generation directions frequently, follow the general steps shown in the video.
3165
  Then paste your API key in the "YouTube API Key" box below, and click the "Save Changes" button.
3166
  </p>
3167
 
3172
  <p>
3173
  <b class="chktitle">YouTube API Key:</b>
3174
  <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;">
3175
+ 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=LpKDFT40V0U" target="_blank">Click this link &raquo;</a> and follow the video to the right to get your API key.
3176
  </p>
3177
  <p>
3178
  <label for="<?php echo self::$opt_gallery_pagesize; ?>"><b class="chktitle">Gallery Page Size:</b></label>
3179
  <select name="<?php echo self::$opt_gallery_pagesize; ?>" id="<?php echo self::$opt_gallery_pagesize; ?>" style="width: 60px;">
3180
+ <?php
3181
+ $gps_val = intval(trim($all[self::$opt_gallery_pagesize]));
3182
+ $gps_val = min($gps_val, 50);
3183
+ for ($gps = 1; $gps <= 50; $gps++)
3184
+ {
3185
+ ?><option <?php echo $gps_val == $gps ? 'selected' : '' ?> value="<?php echo $gps ?>"><?php echo $gps ?></option>
3186
  <?php
3187
  }
3188
  ?>
3194
  <input name="<?php echo self::$opt_gallery_columns; ?>" id="<?php echo self::$opt_gallery_columns; ?>" type="number" class="textinput" style="width: 60px;" value="<?php echo trim($all[self::$opt_gallery_columns]); ?>">
3195
  Enter how many thumbnails can fit per row.
3196
  </p>
3197
+ <p>
3198
+ <input name="<?php echo self::$opt_gallery_collapse_grid; ?>" id="<?php echo self::$opt_gallery_collapse_grid; ?>" <?php checked($all[self::$opt_gallery_collapse_grid], 1); ?> type="checkbox" class="checkbox">
3199
+ <label for="<?php echo self::$opt_gallery_collapse_grid; ?>">
3200
+ <b class="chktitle">Stack Thumbnails for Mobile:</b> <sup class="orange">NEW</sup> Check this option to responsively stack thumbnails on smaller screens, for the grid layout.
3201
+ </label>
3202
+ <span id="box_collapse_grid">
3203
+ <?php
3204
+ foreach ($all[self::$opt_gallery_collapse_grid_breaks] as $idx => $bpts)
3205
+ {
3206
+ ?>
3207
+ On screens up to
3208
+ <input type="number" name="<?php echo self::$opt_gallery_collapse_grid_breaks . '[' . $idx . '][bp][max]'; ?>"
3209
+ id="<?php echo self::$opt_gallery_collapse_grid_breaks . '[' . $idx . '][bp][max]'; ?>"
3210
+ value="<?php echo intval(trim($bpts['bp']['max'])); ?>" class="textinput" style="width: 70px;">px wide, stack thumbnails to 1 column.
3211
+ <input type="hidden" name="<?php echo self::$opt_gallery_collapse_grid_breaks . '[' . $idx . '][cols]'; ?>"
3212
+ id="<?php echo self::$opt_gallery_collapse_grid_breaks . '[' . $idx . '][cols]'; ?>"
3213
+ value="<?php echo intval(trim($bpts['cols'])); ?>">
3214
+ <input type="hidden" name="<?php echo self::$opt_gallery_collapse_grid_breaks . '[' . $idx . '][bp][min]'; ?>"
3215
+ id="<?php echo self::$opt_gallery_collapse_grid_breaks . '[' . $idx . '][bp][min]'; ?>"
3216
+ value="<?php echo intval(trim($bpts['bp']['min'])); ?>">
3217
+ <?php
3218
+ }
3219
+ ?>
3220
+ <span class="smallnote grey pad20"><br>Note: a common mobile screen width is 767 pixels.</span>
3221
+ </span>
3222
+ </p>
3223
  <p>
3224
  <input name="<?php echo self::$opt_gallery_showpaging; ?>" id="<?php echo self::$opt_gallery_showpaging; ?>" <?php checked($all[self::$opt_gallery_showpaging], 1); ?> type="checkbox" class="checkbox">
3225
  <label for="<?php echo self::$opt_gallery_showpaging; ?>"><b class="chktitle">Show Pagination:</b> <sup class="orange">NEW</sup> Show the Next/Previous buttons and page numbering.</label>
3275
  <div class="jumper" id="jumpprosettings"></div>
3276
  <div class="upgchecks">
3277
  <h3 class="sect">PRO Features</h3>
3278
+ <?php
3279
+ if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 9)
3280
+ {
3281
+ ?>
3282
  <p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). Gallery options for PRO users will also be listed here.</p>
3283
  <p>
3284
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
3285
+ <?php $cleanstyle = trim($all[self::$opt_gallery_style]); ?>
3286
  <select name="<?php echo self::$opt_gallery_style; ?>" id="<?php echo self::$opt_gallery_style; ?>" >
3287
  <option value="">Gallery Style</option>
3288
  <option value="grid" <?php echo 'grid' === $cleanstyle ? 'selected' : '' ?> >Grid (default)</option>
3308
  <div class="hr"></div>
3309
  <p>
3310
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgallerycircles.jpg', __FILE__) ?>" />
3311
+ <?php $cleancrop = trim($all[self::$opt_gallery_thumbcrop]); ?>
3312
  <label for="<?php echo self::$opt_gallery_thumbcrop; ?>">
3313
  <b>(PRO)</b> <b class="chktitle">Gallery Thumbnail Shape:</b></b>
3314
  Differentiate your gallery by showing different thumbnail shapes. We currently offer rectangle and circle shapes.
3323
  <div class="hr"></div>
3324
  <p>
3325
  <img class="sspopupplayer" src="<?php echo plugins_url('images/sspopupplayer.jpg', __FILE__) ?>" />
3326
+ <?php $cleandisp = trim($all[self::$opt_gallery_disptype]); ?>
3327
  <label for="<?php echo self::$opt_gallery_disptype; ?>">
3328
  <b>(PRO)</b> <b class="chktitle">Gallery Video Display Mode:</b> <sup class="orange">NEW</sup>
3329
  Display your gallery videos simply above the thumbnails (default), or as a popup lightbox.
3376
  </label>
3377
  <span id="boxschemaorg">
3378
  <span class="apikey-msg">
3379
+ The video SEO tags include data like the title, description, and thumbnail information of each video you embed. This plugin automatically extracts this data directly from YouTube using the version 3 API. This particular API version requires that you obtain an API key so that YouTube can authenticate the requests. <a href="https://www.youtube.com/watch?v=LpKDFT40V0U" target="_blank">Watch this video to see how to create your own key</a>. Then, paste it in the box below, and click the "Save Changes" button:
 
 
3380
  <br>
3381
  <span style="vertical-align: middle; display: inline-block;">
3382
  YouTube API Key: <input type="text" name="<?php echo self::$opt_apikey; ?>" id="<?php echo self::$opt_apikey; ?>" value="<?php echo trim($all[self::$opt_apikey]); ?>" class="textinput" style="width: 200px;">
3383
  </span>
3384
  </span>
3385
+
 
 
3386
  </span>
3387
  </p>
3388
  <div class="hr"></div>
3395
  <br>
3396
  <span id="boxdyn">
3397
  Animation:
3398
+ <?php $cleandyn = trim($all[self::$opt_dyntype]); ?>
3399
  <select name="<?php echo self::$opt_dyntype; ?>" id="<?php echo self::$opt_dyntype; ?>" >
3400
  <option value="">Select type</option>
3401
  <option value="rotateIn" <?php echo 'rotateIn' === $cleandyn ? 'selected' : '' ?> >rotate in</option>
3425
  <img class="ssfb" src="<?php echo plugins_url('images/youtube_thumbnail_sample.jpg', __FILE__) ?>" />
3426
  <input name="<?php echo self::$opt_ftpostimg; ?>" id="<?php echo self::$opt_ftpostimg; ?>" <?php checked($all[self::$opt_ftpostimg], 1); ?> type="checkbox" class="checkbox">
3427
  <label for="<?php echo self::$opt_ftpostimg; ?>">
3428
+ <b>(PRO)</b> <b class="chktitle">Featured Thumbnail Images: </b>
3429
  Automatically grab the thumbnail image of the first video embedded in each post or page, and use it as the featured image. If your theme can display featured images of posts on your blog home, you’ll see the thumbnails there as shown in the picture on the right. All you have to do is click Update on a post or page and the plugin does the rest!
3430
  (Example shown on the right) <a target="_blank" href="<?php echo self::$epbase ?>/add-youtube-video-thumbnails-featured-image-wordpress.aspx">Watch example here &raquo;</a>
3431
  </label>
3432
  </p>
3433
 
3434
+ <?php
3435
+ }
3436
+ else
3437
+ {
3438
+ ?>
3439
  <p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). </p>
3440
  <p>
3441
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
3510
  <p>
3511
  <input disabled type="checkbox" class="checkbox">
3512
  <label>
3513
+ <b class="chktitle">Special Lazy-Loading Effects:</b> <span class="pronon">(PRO Users)</span>
3514
+ Add eye-catching special effects that will make your YouTube embeds bounce, flip, pulse, or slide as they lazy load on the screen. Check this box to select your desired effect. <a target="_blank" href="<?php echo self::$epbase ?>/add-special-effects-to-youtube-embeds-in-wordpress.aspx">Read more here &raquo;</a>
3515
  </label>
3516
  </p>
3517
  <div class="hr"></div>
3526
  <img class="ssfb" src="<?php echo plugins_url('images/youtube_thumbnail_sample.jpg', __FILE__) ?>" />
3527
  <input disabled type="checkbox" class="checkbox">
3528
  <label>
3529
+ <b class="chktitle">Featured Thumbnail Images:</b> <span class="pronon">(PRO Users)</span>
3530
  Automatically grab the thumbnail image of the first video embedded in each post or page, and use it as the featured image.
3531
  All you have to do is click Update on a post or page and the plugin does the rest!
3532
  (Example shown on the right) <a target="_blank" href="<?php echo self::$epbase ?>/add-youtube-video-thumbnails-featured-image-wordpress.aspx">Read more here &raquo;</a>
3536
  <p>
3537
  <a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" target="_blank">Activate the above and several other features &raquo;</a>
3538
  </p>
3539
+ <?php
3540
+ }
3541
+ ?>
3542
  <div class="clearboth"></div>
3543
  </div>
3544
+ <?php // self::save_changes_button(); ?>
3545
 
3546
  <hr>
3547
 
3549
  <div class="jumper" id="jumpoverride"></div>
3550
 
3551
  <h3 class="sect">
3552
+ <?php _e("How To Override Defaults / Other Options") ?> <a href="#top" class="totop">&#9650; top</a>
3553
  </h3>
3554
  <p>Suppose you have a few videos that need to be different from the above defaults. You can add options to the end of a link as displayed below to override the above defaults. Each option should begin with '&'.
3555
  <br><span class="smallnote orange">PRO users: You can use the big blue <a href="<?php echo self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=protab' ?>" target="_blank">customize</a> buttons that you will see inside the wizard, instead of memorizing the following.</span>
3556
+ <?php
3557
+ _e('<ul>');
3558
+ _e("<li><strong>width</strong> - Sets the width of your player. If omitted, the default width will be the width of your theme's content.<em> Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&width=500</strong>&height=350</em></li>");
3559
+ _e("<li><strong>height</strong> - Sets the height of your player. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500<strong>&height=350</strong></em> </li>");
3560
+ _e("<li><strong>autoplay</strong> - Set this to 1 to autoplay the video (or 0 to play the video once). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&autoplay=1</strong></em> </li>");
3561
+ _e("<li><strong>cc_load_policy</strong> - Set this to 1 to turn on closed captioning (or 0 to leave them off). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&cc_load_policy=1</strong></em> </li>");
3562
+ _e("<li><strong>iv_load_policy</strong> - Set this to 3 to turn off annotations (or 1 to show them). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&iv_load_policy=3</strong></em> </li>");
3563
+ _e("<li><strong>loop</strong> - Set this to 1 to loop the video (or 0 to not loop). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&loop=1</strong></em> </li>");
3564
+ _e("<li><strong>modestbranding</strong> - Set this to 1 to remove the YouTube logo while playing (or 0 to show the logo). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&modestbranding=1</strong></em> </li>");
3565
+ _e("<li><strong>rel</strong> - Set this to 0 to not show related videos at the end of playing (or 1 to show them). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&rel=0</strong></em> </li>");
3566
+ _e("<li><strong>showinfo</strong> - Set this to 0 to hide the video title and other info (or 1 to show it). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&showinfo=0</strong></em> </li>");
3567
+ _e("<li><strong>theme</strong> - Set this to 'light' to make the player have the light-colored theme (or 'dark' for the dark theme). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&theme=light</strong></em> </li>");
3568
+ _e("<li><strong>color</strong> - Set this to 'white' to make the player have a white progress bar (or 'red' for a red progress bar). Note: Using white will disable the modestbranding option. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&color=white</strong></em> </li>");
3569
+ _e("<li><strong>vq</strong> - Set this to 'hd720' or 'hd1080' to force the video to have HD quality. Leave blank to let YouTube decide. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&vq=hd720</strong></em> </li>");
3570
+ _e("<li><strong>controls</strong> - Set this to 0 to completely hide the video controls (or 2 to show it). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&controls=0</strong></em> </li>");
3571
+ _e("<li><strong>autohide</strong> - Set this to 1 to slide away the control bar after the video starts playing. It will automatically slide back in again if you mouse over the video. (Set to 2 to always show it). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&autohide=1</strong></em> </li>");
3572
+ _e("<li><strong>playsinline</strong> - Set this to 1 to allow videos play inline with the page on iOS browsers. (Set to 0 to have iOS launch videos in fullscreen instead). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&playsinline=1</strong></em> </li>");
3573
+ _e("<li><strong>origin</strong> - Set this to 1 to add the 'origin' parameter for extra JavaScript security. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&origin=1</strong></em> </li>");
3574
+ _e('</ul>');
3575
+
3576
+ _e("<p>You can also start and end each individual video at particular times. Like the above, each option should begin with '&'</p>");
3577
+ _e('<ul>');
3578
+ _e("<li><strong>start</strong> - Sets the time (in seconds) to start the video. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350<strong>&start=20</strong></em> </li>");
3579
+ _e("<li><strong>end</strong> - Sets the time (in seconds) to stop the video. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350<strong>&end=100</strong></em> </li>");
3580
+ _e('</ul>');
3581
+ ?>
3582
  <div class="save-changes-follow"> <?php self::save_changes_button(isset($_POST[$ytprefs_submitted]) && $_POST[$ytprefs_submitted] == 'Y'); ?> </div>
3583
  </form>
3584
  <div class="jumper" id="jumppro"></div>
3585
  <div id="goprobox">
3586
+ <?php
3587
+ if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0)
3588
+ {
3589
+ echo "<h3>" . __('Thank you for going PRO.');
3590
+ echo ' &nbsp;<input type="submit" name="showkey" class="button-primary" style="vertical-align: 15%;" id="showprokey" value="View my PRO key" />';
3591
+ echo "</h3>";
3592
+ ?>
3593
  <?php
3594
  }
3595
  else
3637
  <ul class="gopro">
3638
  <li>
3639
  <img src="<?php echo plugins_url('images/videothumbs.png', __FILE__) ?>">
3640
+ Featured thumbnail images (just click 'Update')
3641
  </li>
3642
  <li>
3643
  <img src="<?php echo plugins_url('images/prioritysupport.png', __FILE__) ?>">
3678
  <div style="clear: both;"></div>
3679
  <br>
3680
  <h3 class="bold">Enter and save your PRO key (emailed to you):</h3>
3681
+ <?php } ?>
3682
  <form name="form2" method="post" action="" id="epform2" class="submitpro" <?php
3683
+ if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0)
3684
+ {
3685
+ echo 'style="display: none;"';
3686
+ }
3687
+ ?>>
3688
 
3689
  <input name="<?php echo self::$opt_pro; ?>" id="opt_pro" value="<?php echo $all[self::$opt_pro]; ?>" type="text">
3690
  <input type="submit" name="Submit" class="button-primary" id="prokeysubmit" value="<?php _e('Save Key') ?>" />
3691
+ <?php
3692
+ if (!($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0))
3693
+ {
3694
+ ?>
3695
  &nbsp; &nbsp; &nbsp; <span style="font-size: 25px; color: #cccccc;">|</span> &nbsp; &nbsp; &nbsp; <a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" class="button-primary brightpro" target="_blank">Click here to go PRO &raquo;</a>
3696
  <?php
3697
  }
3722
  <code>[embedyt]http://www.youtube.com/watch?v=ABCDEF&width=400&height=250[/embedyt] [embedyt]http://www.youtube.com/watch?v=GHIJK&width=400&height=250[/embedyt]</code>
3723
  <br> TIP: As shown above, 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)
3724
  </li>
3725
+ <li>If you upload a new video to a playlist or channel and that video is not yet showing up on a gallery you embedded, you should clear/reset any caching plugins you have. This will force your site to retrieve the freshest version of your playlist and/or channel video listing. If you don't reset you cache, then you'll have to wait until cache lifetime expires.</li>
3726
  <li>Finally, there's a slight chance your custom theme is the issue, if you have one. To know for sure, we suggest temporarily switching to one of the default WordPress themes (e.g., "Twenty Fourteen") just to see if your video does appear. If it suddenly works, then your custom theme is the issue. You can switch back when done testing.</li>
3727
  <li>If your videos always appear full size, try turning off "Responsive video sizing."</li>
3728
  <li>If none of the above work, you can contact us here if you still have issues: ext@embedplus.com. We'll try to respond within a week. PRO users should use the priority form below for faster replies.</li>
3745
 
3746
  <iframe src="<?php echo self::$epbase ?>/dashboard/prosupport.aspx?simple=1&prokey=<?php echo $all[self::$opt_pro]; ?>&domain=<?php echo site_url(); ?>" width="500" height="<?php echo ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0) ? "500" : "140"; ?>"></iframe>
3747
 
3748
+ <?php
3749
+ if (!($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0))
3750
+ {
3751
+ ?>
3752
  <br>
3753
  <br>
3754
  <iframe src="<?php echo self::$epbase ?>/dashboard/likecoupon.aspx" width="600" height="500"></iframe>
3755
+ <?php }
3756
+ ?>
3757
  <div class="ytnav">
3758
  <a href="#jumphowto">How To Embed</a>
3759
  <a href="#jumpwiz">Visual Wizard</a>
3807
  }
3808
  }
3809
 
3810
+
3811
+ if (jQuery("#<?php echo self::$opt_gallery_collapse_grid; ?>").is(":checked"))
3812
+ {
3813
+ var emptyStacks = [];
3814
+ jQuery("#box_collapse_grid input").each(function () {
3815
+ var val = jQuery(this).val();
3816
+ if (jQuery.trim(val) === '' || !jQuery.isNumeric(val))
3817
+ {
3818
+ emptyStacks.push(this);
3819
+ jQuery(this).css("background-color", "#ffcccc").css("outline", "2px solid #000000");
3820
+ }
3821
+ });
3822
+
3823
+ if (emptyStacks.length)
3824
+ {
3825
+ alertmessage += "Please enter a valid number for the gallery stacking screen width.";
3826
+ valid = false;
3827
+ }
3828
+ }
3829
+
3830
+
3831
+
3832
  if (jQuery("#<?php echo self::$opt_defaultvol; ?>").is(":checked"))
3833
  {
3834
  if (!(jQuery.isNumeric(jQuery.trim(jQuery("#<?php echo self::$opt_vol; ?>").val()))))
3923
 
3924
  });
3925
 
3926
+ jQuery('#<?php echo self::$opt_gallery_collapse_grid; ?>').change(function ()
3927
+ {
3928
+ if (jQuery(this).is(":checked"))
3929
+ {
3930
+ jQuery("#box_collapse_grid").show(500);
3931
+ }
3932
+ else
3933
+ {
3934
+ jQuery("#box_collapse_grid").hide(500);
3935
+ }
3936
+ });
3937
+
3938
  jQuery('#<?php echo self::$opt_gallery_channelsub; ?>').change(function ()
3939
  {
3940
  if (jQuery(this).is(":checked"))
4191
 
4192
  });
4193
  </script>
4194
+ <?php
4195
+ if (function_exists('add_thickbox'))
4196
+ {
4197
+ add_thickbox();
4198
+ }
4199
+ ?>
4200
 
4201
  <?php
4202
  }
4216
  });
4217
 
4218
  </script>
4219
+ <?php
4220
+ }
4221
+ ?>
4222
  <p class="submit">
4223
  <input type="submit" onclick="return savevalidate();" name="Submit" class="button-primary ytprefs-submit" value="<?php _e($button_label) ?>" />
4224
  <em>If you're using a separate caching plugin and you do not see your changes after saving, you might want to reset your cache.</em>
4225
  </p>
4226
+ <?php
4227
+ }
4228
 
4229
+ public static function ytprefsscript()
 
 
 
4230
  {
4231
+ $loggedin = current_user_can('edit_posts');
4232
+ if (!($loggedin && self::$alloptions[self::$opt_admin_off_scripts]))
4233
+ {
4234
+ wp_enqueue_style(
4235
+ '__EPYT__style', plugins_url('styles/ytprefs' . self::$min . '.css', __FILE__)
4236
+ );
4237
+ $cols = floatval(self::$alloptions[self::$opt_gallery_columns]);
4238
+ $cols = $cols == 0 ? 3.0 : $cols;
4239
+ $colwidth = 100.0 / $cols;
4240
+ $custom_css = "
4241
  .epyt-gallery-thumb {
4242
  width: " . round($colwidth, 3) . "%;
4243
+ }
4244
+ ";
4245
+
4246
+ if (self::$alloptions[self::$opt_gallery_collapse_grid] == 1)
4247
+ {
4248
+ foreach (self::$alloptions[self::$opt_gallery_collapse_grid_breaks] as $idx => $bpts)
4249
+ {
4250
+ $custom_css .= "
4251
+ @media (min-width:" . $bpts['bp']['min'] . "px) and (max-width: " . $bpts['bp']['max'] . "px) {
4252
+ .epyt-gallery-rowbreak {
4253
+ display: none;
4254
+ }
4255
+ .epyt-gallery-allthumbs[class*=\"epyt-cols\"] .epyt-gallery-thumb {
4256
+ width: " . round(100.0 / intval($bpts['cols']), 3) . "% !important;
4257
+ }
4258
+ }";
4259
+ }
4260
+ }
4261
 
4262
+ wp_add_inline_style('__EPYT__style', $custom_css);
4263
 
 
 
 
 
 
4264
 
4265
+ if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 8))
4266
+ {
4267
+ wp_enqueue_style('__disptype__', plugins_url('scripts/lity' . self::$min . '.css', __FILE__));
4268
+ wp_enqueue_script('__dispload__', plugins_url('scripts/lity' . self::$min . '.js', __FILE__), array('jquery'));
4269
+ }
4270
 
4271
+ wp_enqueue_script('__ytprefs__', plugins_url('scripts/ytprefs' . self::$min . '.js', __FILE__), array('jquery'));
 
 
 
 
 
 
 
 
 
 
 
 
4272
 
4273
+ if (self::$alloptions[self::$opt_old_script_method] != 1)
4274
+ {
4275
+ wp_localize_script('__ytprefs__', '_EPYT_', array(
4276
+ 'ajaxurl' => admin_url('admin-ajax.php'),
4277
+ 'security' => wp_create_nonce('embedplus-nonce'),
4278
+ 'gallery_scrolloffset' => intval(self::$alloptions[self::$opt_gallery_scrolloffset]),
4279
+ 'eppathtoscripts' => plugins_url('scripts/', __FILE__),
4280
+ 'epresponsiveselector' => self::get_responsiveselector(),
4281
+ 'epdovol' => true,
4282
+ 'version' => self::$alloptions[self::$opt_version],
4283
+ 'evselector' => self::get_evselector()
4284
+ ));
4285
+ }
4286
 
4287
+ ////////////////////// cloudflare accomodation
4288
+ //add_filter('script_loader_tag', 'YouTubePrefs::set_cfasync', 10, 3);
4289
+
4290
+ if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0) && self::$alloptions[self::$opt_dynload] == 1)
4291
+ {
4292
+ wp_enqueue_style('__dyntype__', plugins_url('scripts/embdyn.min.css', __FILE__));
4293
+ wp_enqueue_script('__dynload__', plugins_url('scripts/embdyn' . self::$min . '.js', __FILE__), array('jquery'));
4294
+ }
4295
  }
4296
  }
 
4297
 
4298
+ public static function set_cfasync($tag, $handle, $src)
 
 
4299
  {
4300
+ if ('__ytprefs__' !== $handle)
4301
+ {
4302
+ return $tag;
4303
+ }
4304
+ return str_replace('<script', '<script data-cfasync="false" ', $tag);
4305
  }
 
 
4306
 
4307
+ public static function get_evselector()
 
 
 
 
4308
  {
4309
+ $evselector = 'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]';
 
4310
 
4311
+ if (self::$alloptions[self::$opt_evselector_light] == 1)
4312
+ {
4313
+ $evselector = 'iframe.__youtube_prefs__[src]';
4314
+ }
4315
 
4316
+ return $evselector;
 
 
 
 
 
4317
  }
4318
+
4319
+ public static function get_responsiveselector()
4320
  {
4321
+ $responsiveselector = '[]';
4322
+ if (self::$alloptions[self::$opt_widgetfit] == 1)
4323
  {
4324
+ $responsiveselector = '["iframe.__youtube_prefs_widget__"]';
4325
  }
4326
+ if (self::$alloptions[self::$opt_responsive] == 1)
4327
  {
4328
+ if (self::$alloptions[self::$opt_responsive_all] == 1)
4329
+ {
4330
+ $responsiveselector = '["iframe[src*=\'youtube.com\']","iframe[src*=\'youtube-nocookie.com\']","iframe[data-ep-src*=\'youtube.com\']","iframe[data-ep-src*=\'youtube-nocookie.com\']","iframe[data-ep-gallerysrc*=\'youtube.com\']"]';
4331
+ }
4332
+ else
4333
+ {
4334
+ $responsiveselector = '["iframe.__youtube_prefs__"]';
4335
+ }
4336
  }
4337
+ return $responsiveselector;
4338
  }
 
 
4339
 
4340
+ public static function get_blogwidth()
 
 
 
4341
  {
4342
+ $blogwidth = null;
4343
+ try
4344
+ {
4345
+ $embed_size_w = intval(get_option('embed_size_w'));
4346
 
4347
+ global $content_width;
4348
+ if (empty($content_width))
4349
+ {
4350
+ $content_width = $GLOBALS['content_width'];
4351
+ }
4352
+
4353
+ $blogwidth = $embed_size_w ? $embed_size_w : ($content_width ? $content_width : 450);
4354
+ }
4355
+ catch (Exception $ex)
4356
  {
4357
+
4358
  }
4359
 
4360
+ $blogwidth = preg_replace('/\D/', '', $blogwidth); //may have px
 
 
 
 
 
4361
 
4362
+ return $blogwidth;
4363
+ }
4364
 
 
4365
  }
4366
 
 
 
4367
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4368
  //class start
4369
+ class Add_new_tinymce_btn_Youtubeprefs
4370
+ {
4371
 
4372
+ public $btn_arr;
4373
+ public $js_file;
4374
 
4375
+ /*
4376
+ * call the constructor and set class variables
4377
+ * From the constructor call the functions via wordpress action/filter
4378
+ */
4379
 
4380
+ function __construct($seperator, $btn_name, $javascrip_location)
4381
+ {
4382
+ $this->btn_arr = array("Seperator" => $seperator, "Name" => $btn_name);
4383
+ $this->js_file = $javascrip_location;
4384
+ add_action('init', array($this, 'add_tinymce_button'));
4385
+ add_filter('tiny_mce_version', array($this, 'refresh_mce_version'));
4386
+ }
4387
 
4388
+ /*
4389
+ * create the buttons only if the user has editing privs.
4390
+ * If so we create the button and add it to the tinymce button array
4391
+ */
4392
 
4393
+ function add_tinymce_button()
 
 
 
 
4394
  {
4395
+ if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
4396
+ return;
4397
+ if (get_user_option('rich_editing') == 'true')
4398
+ {
4399
+ //the function that adds the javascript
4400
+ add_filter('mce_external_plugins', array($this, 'add_new_tinymce_plugin'));
4401
+ //adds the button to the tinymce button array
4402
+ add_filter('mce_buttons', array($this, 'register_new_button'));
4403
+ }
4404
  }
 
4405
 
4406
+ /*
4407
+ * add the new button to the tinymce array
4408
+ */
4409
 
4410
+ function register_new_button($buttons)
4411
+ {
4412
+ array_push($buttons, $this->btn_arr["Seperator"], $this->btn_arr["Name"]);
4413
+ return $buttons;
4414
+ }
4415
 
4416
+ /*
4417
+ * Call the javascript file that loads the
4418
+ * instructions for the new button
4419
+ */
4420
 
4421
+ function add_new_tinymce_plugin($plugin_array)
4422
+ {
4423
+ $plugin_array[$this->btn_arr['Name']] = $this->js_file;
4424
+ return $plugin_array;
4425
+ }
4426
 
4427
+ /*
4428
+ * This function tricks tinymce in thinking
4429
+ * it needs to refresh the buttons
4430
+ */
4431
 
4432
+ function refresh_mce_version($ver)
4433
+ {
4434
+ $ver += 3;
4435
+ return $ver;
4436
+ }
4437
 
4438
+ }
4439
 
4440
  //class end
4441
 
4442
 
4443
+ register_activation_hook(__FILE__, array('YouTubePrefs', 'initoptions'));
4444
+ $youtubeplgplus = new YouTubePrefs();
4445
 
4446
 
4447
+ add_action("wp_ajax_my_embedplus_pro_record", array('YouTubePrefs', 'my_embedplus_pro_record'));
4448
+ add_action("wp_ajax_my_embedplus_clearspdc", array('YouTubePrefs', 'my_embedplus_clearspdc'));
4449
+ add_action("wp_ajax_my_embedplus_glance_vids", array('YouTubePrefs', 'my_embedplus_glance_vids'));
4450
+ add_action("wp_ajax_my_embedplus_glance_count", array('YouTubePrefs', 'my_embedplus_glance_count'));
4451
+ add_action("wp_ajax_my_embedplus_dismiss_double_plugin_warning", array('YouTubePrefs', 'my_embedplus_dismiss_double_plugin_warning'));
4452
+ add_action("wp_ajax_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
4453
+ add_action("wp_ajax_nopriv_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
4454
 
4455
+ add_action('admin_enqueue_scripts', 'youtubeprefs_admin_enqueue_scripts');
4456
 
4457
+ function youtubeprefs_admin_enqueue_scripts()
 
 
 
 
 
 
 
 
 
4458
  {
4459
+ wp_enqueue_style('embedplusyoutube', plugins_url() . '/youtube-embed-plus/scripts/embedplus_mce.css');
4460
+ add_action('wp_print_scripts', 'youtubeprefs_output_scriptvars');
4461
+ wp_enqueue_script('__ytprefs_admin__', plugins_url('scripts/ytprefs-admin.min.js', __FILE__), array('jquery'));
4462
 
4463
+ if (
4464
+ //(!(isset(YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro]) && strlen(trim(YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro])) > 0)) && // display only if not pro ooopointer
4465
+ (get_bloginfo('version') >= '3.3') && YouTubePrefs::custom_admin_pointers_check()
4466
+ )
4467
+ {
4468
+ add_action('admin_print_footer_scripts', 'YouTubePrefs::custom_admin_pointers_footer');
4469
 
4470
+ wp_enqueue_script('wp-pointer');
4471
+ wp_enqueue_style('wp-pointer');
4472
+ }
4473
+
4474
+ if (YouTubePrefs::$alloptions['glance'] == 1)
4475
+ {
4476
+ add_action('admin_print_footer_scripts', 'YouTubePrefs::glance_script');
4477
+ }
4478
  }
 
4479
 
4480
+ function youtubeprefs_output_scriptvars()
 
 
 
4481
  {
4482
+ YouTubePrefs::$scriptsprinted++;
4483
+ if (YouTubePrefs::$scriptsprinted == 1)
4484
+ {
4485
+ $blogwidth = YouTubePrefs::get_blogwidth();
4486
+ $epprokey = YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro];
4487
+ $myytdefaults = http_build_query(YouTubePrefs::$alloptions);
4488
+ ?>
4489
  <script type="text/javascript">
4490
  var wpajaxurl = "<?php echo admin_url('admin-ajax.php') ?>";
4491
  if (window.location.toString().indexOf('https://') == 0)
4563
 
4564
 
4565
  </script>
4566
+ <?php
4567
+ }
4568
  }
 
4569
 
4570
  // function embedplus_strip_shortcode_from_excerpt($content)
4571
  // {