YouTube - Version 11.4

Version Description

Download this release

Release Info

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

Code changes from version 11.3.1 to 11.4

readme.txt CHANGED
@@ -3,8 +3,8 @@ 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.5
7
- Stable tag: 11.3.1
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...
@@ -149,6 +149,10 @@ You can also start and end each individual video at particular times. Like the a
149
 
150
  == Changelog ==
151
 
 
 
 
 
152
  = WordPress YouTube Embed 11.3.1 =
153
  * (Free) improved debug mode messages
154
  * (Pro) autonext for popup lightbox galleries and hide clear cache button option
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...
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.
155
+
156
  = WordPress YouTube Embed 11.3.1 =
157
  * (Free) improved debug mode messages
158
  * (Pro) autonext for popup lightbox galleries and hide clear cache button option
scripts/ytprefs.js CHANGED
@@ -179,9 +179,9 @@
179
  });
180
  }
181
  },
182
- jp: function (q)
183
  {
184
- //debug
185
  },
186
  apiInit: function () {
187
  setTimeout(function ()
@@ -335,6 +335,7 @@
335
  $iframe.attr('src', vidSrc);
336
  var player = _EPADashboard_.setupevents($iframe.attr('id'));
337
 
 
338
 
339
  }
340
  else
@@ -348,6 +349,13 @@
348
 
349
  }
350
 
 
 
 
 
 
 
 
351
  });
352
 
353
  $container.on('mouseenter', '.epyt-gallery-list .epyt-gallery-thumb', function () {
179
  });
180
  }
181
  },
182
+ jp: function (q)
183
  {
184
+ // debug
185
  },
186
  apiInit: function () {
187
  setTimeout(function ()
335
  $iframe.attr('src', vidSrc);
336
  var player = _EPADashboard_.setupevents($iframe.attr('id'));
337
 
338
+ $('.lity-close').focus();
339
 
340
  }
341
  else
349
 
350
  }
351
 
352
+ }).on('keydown', '.epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton', function (e) {
353
+ var code = e.which;
354
+ if ((code === 13) || (code === 32)) {
355
+ e.preventDefault();
356
+ $(this).click();
357
+
358
+ }
359
  });
360
 
361
  $container.on('mouseenter', '.epyt-gallery-list .epyt-gallery-thumb', function () {
scripts/ytprefs.min.js CHANGED
@@ -1,16 +1,16 @@
1
- (function(a,b){a._EPYT_=a._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:!0,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',usingdefault:!0};document.querySelectorAll||(document.querySelectorAll=function(f){var b=document,c=b.documentElement.firstChild,d=b.createElement("STYLE");
2
- c.appendChild(d);b.__qsaels=[];d.styleSheet.cssText=f+"{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(f){try{if("undefined"!==typeof _EPYT_.epdovol&&_EPYT_.epdovol){var a=parseInt(f.target.getIframe().getAttribute("data-vol"));isNaN(a)||(0===a?f.target.mute():(f.target.isMuted()&&f.target.unMute(),f.target.setVolume(a)))}}catch(d){}try{var c=b(f.target.getIframe());
3
- c.hasClass("epyt-lbif")&&c.closest(".lity-content").length&&f.target.playVideo()}catch(d){}setTimeout(function(){try{var a=_EPADashboard_.justid(f.target.getVideoUrl());_EPADashboard_.jp("ytid="+a)}catch(b){}},1700)},onPlayerStateChange:function(a){var e=a.target.getIframe();if(a.data===YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===e.src.indexOf("autoplay=1")){a.target.ponce=!0;try{var c=_EPADashboard_.justid(a.target.getVideoUrl());_EPADashboard_.jp("ytid="+c+"&p=1")}catch(k){}}var d=b(e).closest(".epyt-gallery");
4
- d.length||(d=b("#"+b(e).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 g=a.find(" ~ .epyt-gallery-thumb").first();a=b("div.lity-wrap[data-lity-close]");g.length?a.length?(_EPADashboard_.lb.close(),setTimeout(function(){g.click()},1E3)):g.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 e=document.createElement("script");e.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(e);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(),f="content"+c.attr("id");b.find(".lity-hide").attr("id",f);var e=c.attr("src");e||(e=c.data("ep-src"));var h=a(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid"),e=e.replace(h,"GALLERYVIDEOID");c.data("ep-gallerysrc",e);var d=b.find(".epyt-gallery-list"),g=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(){g()},300);a(window).resize(g);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 e=c.data("ep-gallerysrc").replace("GALLERYVIDEOID",d),d=b.find(".epyt-pagebutton").first().data("thumbplay");"0"!==
12
- d&&0!==d&&(e=0<e.indexOf("autoplay")?e.replace("autoplay=0","autoplay=1"):e+"&autoplay=1");b.hasClass("epyt-lb")?(_EPADashboard_.lb("#"+f),e=e.replace("autoplay=1","autoplay=0"),c.attr("src",e),_EPADashboard_.setupevents(c.attr("id"))):a("html, body").animate({scrollTop:c.offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500,function(){c.attr("src",e);_EPADashboard_.setupevents(c.attr("id"))})});b.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).addClass("hover");if(d.hasClass("epyt-gallery-style-carousel")&&
13
- 1==b.find(".epyt-pagebutton").first().data("showtitle")){b.find(".epyt-pagenumbers").addClass("hide");var c=a(this).find(".epyt-gallery-notitle span").text();b.find(".epyt-gallery-rowtitle").text(c).addClass("hover")}});b.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).removeClass("hover");d.hasClass("epyt-gallery-style-carousel")&&1==b.find(".epyt-pagebutton").first().data("showtitle")&&(b.find(".epyt-gallery-rowtitle").text("").removeClass("hover"),0<b.find('.epyt-pagebutton[data-pagetoken!=""]').length&&
14
- b.find(".epyt-pagenumbers").removeClass("hide"))});b.on("click",".epyt-pagebutton",function(){var c={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:a(this).data("playlistid"),pageToken:a(this).data("pagetoken"),pageSize:a(this).data("pagesize"),columns:a(this).data("columns"),showTitle:a(this).data("showtitle"),showPaging:a(this).data("showpaging"),autonext:a(this).data("autonext"),style:a(this).data("style"),thumbcrop:a(this).data("thumbcrop"),thumbplay:a(this).data("thumbplay")}};
15
- a(this).data("showdsc")&&(c.options.showDsc=a(this).data("showdsc"));var d=a(this).hasClass("epyt-next"),e=parseInt(b.data("currpage")+"");b.data("currpage",e+(d?1:-1));b.find(".epyt-gallery-list").addClass("epyt-loading");a.post(_EPYT_.ajaxurl,c,function(c){b.find(".epyt-gallery-list").html(c);b.find(".epyt-current").each(function(){a(this).text(b.data("currpage"))});b.find('.epyt-gallery-thumb[data-videoid="'+b.data("currvid")+'"]').addClass("epyt-current-video");"1"==b.find(".epyt-pagebutton").first().data("autonext")&&
16
- b.find(".epyt-gallery-thumb").first().click()}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){b.find(".epyt-gallery-list").removeClass("epyt-loading");g()})})})})})(jQuery);
1
+ (function(a,b){a._EPYT_=a._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:!0,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',usingdefault:!0};document.querySelectorAll||(document.querySelectorAll=function(e){var b=document,c=b.documentElement.firstChild,d=b.createElement("STYLE");
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=
13
+ b.which;if(13===c||32===c)b.preventDefault(),a(this).click()});b.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).addClass("hover");if(d.hasClass("epyt-gallery-style-carousel")&&1==b.find(".epyt-pagebutton").first().data("showtitle")){b.find(".epyt-pagenumbers").addClass("hide");var c=a(this).find(".epyt-gallery-notitle span").text();b.find(".epyt-gallery-rowtitle").text(c).addClass("hover")}});b.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).removeClass("hover");
14
+ d.hasClass("epyt-gallery-style-carousel")&&1==b.find(".epyt-pagebutton").first().data("showtitle")&&(b.find(".epyt-gallery-rowtitle").text("").removeClass("hover"),0<b.find('.epyt-pagebutton[data-pagetoken!=""]').length&&b.find(".epyt-pagenumbers").removeClass("hide"))});b.on("click",".epyt-pagebutton",function(){var c={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:a(this).data("playlistid"),pageToken:a(this).data("pagetoken"),pageSize:a(this).data("pagesize"),columns:a(this).data("columns"),
15
+ showTitle:a(this).data("showtitle"),showPaging:a(this).data("showpaging"),autonext:a(this).data("autonext"),style:a(this).data("style"),thumbcrop:a(this).data("thumbcrop"),thumbplay:a(this).data("thumbplay")}};a(this).data("showdsc")&&(c.options.showDsc=a(this).data("showdsc"));var d=a(this).hasClass("epyt-next"),e=parseInt(b.data("currpage")+"");b.data("currpage",e+(d?1:-1));b.find(".epyt-gallery-list").addClass("epyt-loading");a.post(_EPYT_.ajaxurl,c,function(c){b.find(".epyt-gallery-list").html(c);
16
+ b.find(".epyt-current").each(function(){a(this).text(b.data("currpage"))});b.find('.epyt-gallery-thumb[data-videoid="'+b.data("currvid")+'"]').addClass("epyt-current-video");"1"==b.find(".epyt-pagebutton").first().data("autonext")&&b.find(".epyt-gallery-thumb").first().click()}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){b.find(".epyt-gallery-list").removeClass("epyt-loading");h()})})})})})(jQuery);
styles/ytprefs.css CHANGED
@@ -412,9 +412,11 @@ Carousel
412
  height: auto !important;
413
  vertical-align: middle !important;
414
  padding: 0 6px 3px 0;
 
 
415
  }
416
 
417
  #wpadminbar #wp-admin-bar-ytprefs-bar-cache > .ab-item:before {
418
  content: "\f311";
419
  top: 2px;
420
- }
412
  height: auto !important;
413
  vertical-align: middle !important;
414
  padding: 0 6px 3px 0;
415
+ display: inline-block;
416
+ background: transparent;
417
  }
418
 
419
  #wpadminbar #wp-admin-bar-ytprefs-bar-cache > .ab-item:before {
420
  content: "\f311";
421
  top: 2px;
422
+ }
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}#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{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}
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.3.1
7
  Author: EmbedPlus Team
8
  Author URI: http://www.embedplus.com
9
  */
@@ -32,7 +32,7 @@
32
  class YouTubePrefs
33
  {
34
 
35
- public static $version = '11.3.1';
36
  public static $opt_version = 'version';
37
  public static $optembedwidth = null;
38
  public static $optembedheight = null;
@@ -86,6 +86,7 @@ class YouTubePrefs
86
  public static $opt_spdcexp = 'spdcexp';
87
  public static $opt_migrate = 'migrate';
88
  public static $opt_migrate_youtube = 'migrate_youtube';
 
89
  public static $spdcprefix = 'ytpref';
90
  public static $spdcall = 'youtubeprefs_spdcall';
91
  public static $opt_dynload = 'dynload';
@@ -753,6 +754,7 @@ class YouTubePrefs
753
  $_ogvideo = 0;
754
  $_migrate = 0;
755
  $_migrate_youtube = 0;
 
756
  $_controls = 2;
757
  $_oldspacing = 1;
758
  $_responsive = 0;
@@ -831,6 +833,7 @@ class YouTubePrefs
831
  $_ogvideo = self::tryget($arroptions, self::$opt_ogvideo, 0);
832
  $_migrate = self::tryget($arroptions, self::$opt_migrate, 0);
833
  $_migrate_youtube = self::tryget($arroptions, self::$opt_migrate_youtube, 0);
 
834
  $_controls = self::tryget($arroptions, self::$opt_controls, 2);
835
  $_autohide = self::tryget($arroptions, self::$opt_autohide, 2);
836
  $_oldspacing = self::tryget($arroptions, self::$opt_oldspacing, 1);
@@ -904,6 +907,7 @@ class YouTubePrefs
904
  self::$opt_ogvideo => $_ogvideo,
905
  self::$opt_migrate => $_migrate,
906
  self::$opt_migrate_youtube => $_migrate_youtube,
 
907
  self::$opt_controls => $_controls,
908
  self::$opt_oldspacing => $_oldspacing,
909
  self::$opt_responsive => $_responsive,
@@ -948,6 +952,19 @@ class YouTubePrefs
948
  update_option(self::$opt_alloptions, $all);
949
  update_option('embed_autourls', 1);
950
  self::$alloptions = get_option(self::$opt_alloptions);
 
 
 
 
 
 
 
 
 
 
 
 
 
951
  }
952
 
953
  public static function tryget($array, $key, $default = null)
@@ -980,6 +997,10 @@ class YouTubePrefs
980
  add_shortcode('youtube', array('YouTubePrefs', 'apply_prefs_shortcode_youtube'));
981
  add_shortcode('youtube_video', array('YouTubePrefs', 'apply_prefs_shortcode_youtube'));
982
  }
 
 
 
 
983
  }
984
  }
985
  else
@@ -1022,6 +1043,40 @@ class YouTubePrefs
1022
  return '';
1023
  }
1024
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1025
  public static function apply_prefs_content($content)
1026
  {
1027
  $content = preg_replace_callback(self::$ytregex, "YouTubePrefs::get_html_content", $content);
@@ -1108,7 +1163,7 @@ class YouTubePrefs
1108
  if (self::$alloptions[self::$opt_debugmode] == 1 && current_user_can('manage_options'))
1109
  {
1110
  $redactedEndpoint = preg_replace('@&key=[^&]+@i', '&key=PRIVATE', $apiEndpoint);
1111
- $gallobj->html = '<pre onclick="_EPADashboard_.selectText(this);" class="epyt-debug">CLICK this debug text to auto-select all. Then, COPY the selection.' . "\n\n" .
1112
  'THIS IS DEBUG MODE OUTPUT. UNCHECK THE OPTION IN THE SETTINGS PAGE ONCE YOU ARE DONE DEBUGGING TO PUT THINGS BACK TO NORMAL.' . "\n\n" . $redactedEndpoint . "\n\n" . print_r($apiResult, true) . '</pre>';
1113
  return $gallobj;
1114
  }
@@ -1232,7 +1287,7 @@ class YouTubePrefs
1232
  $pagination = '<div class="epyt-pagination">';
1233
 
1234
  $txtprev = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customprev] : _('Prev');
1235
- $pagination .= '<div class="epyt-pagebutton epyt-prev ' . (empty($prevPageToken) ? ' hide ' : '') . '" data-playlistid="' . esc_attr($options->playlistId)
1236
  . '" data-pagesize="' . intval($options->pageSize)
1237
  . '" data-pagetoken="' . esc_attr($prevPageToken)
1238
  . '" data-style="' . esc_attr($options->style)
@@ -1251,7 +1306,7 @@ class YouTubePrefs
1251
  $pagination .= '</div>';
1252
 
1253
  $txtnext = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customnext] : _('Next');
1254
- $pagination .= '<div class="epyt-pagebutton epyt-next' . (empty($nextPageToken) ? ' hide ' : '') . '" data-playlistid="' . esc_attr($options->playlistId)
1255
  . '" data-pagesize="' . intval($options->pageSize)
1256
  . '" data-pagetoken="' . esc_attr($nextPageToken)
1257
  . '" data-style="' . esc_attr($options->style)
@@ -1310,7 +1365,7 @@ class YouTubePrefs
1310
  }
1311
  }
1312
 
1313
- $code .= '<div data-videoid="' . $escId . '" class="epyt-gallery-thumb ' . $styleclass . '" ' . $rawstyle . '>';
1314
  $code .= '<div class="epyt-gallery-img-box"><div class="epyt-gallery-img" style="background-image: url(' . esc_attr($thumb->img) . ')">' .
1315
  '<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>' .
1316
  '</div></div>';
@@ -1562,7 +1617,7 @@ class YouTubePrefs
1562
  $gallery_options->style = $finalparams[self::$opt_gallery_style];
1563
  $gallery_options->thumbcrop = $finalparams[self::$opt_gallery_thumbcrop];
1564
  $gallery_options->apiKey = self::$alloptions[self::$opt_apikey];
1565
-
1566
  $galleryid = 'epyt_gallery_' . rand(10000, 99999);
1567
  $galleryid_ifm_data = ' data-epytgalleryid="' . $galleryid . '" ';
1568
 
@@ -1590,7 +1645,7 @@ class YouTubePrefs
1590
  $code1 = $beginlb . '<iframe ' . $dyntype . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
1591
  '" ' . $dynsrc . 'src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoseries . $videoidoutput . '?';
1592
  $code2 = '" frameborder="0" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') . $disptypeif .
1593
- '"' . $voloutput . $acctitle . $galleryid_ifm_data . ' allowfullscreen ></iframe>' . $endlb . $schemaorgoutput;
1594
 
1595
  $origin = '';
1596
 
@@ -2108,98 +2163,98 @@ class YouTubePrefs
2108
  .orange {color: #f85d00;}
2109
  </style>
2110
  <br>
2111
- <?php
2112
- $thishost = (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "");
2113
- $thiskey = self::$alloptions[self::$opt_pro];
2114
 
2115
- $dashurl = self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab&domain=" . $thishost . "&prokey=" . $thiskey;
2116
 
2117
- if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
2118
- {
2119
- //// header
2120
- echo "<h2>" . '<img src="' . plugins_url('images/epstats16.png', __FILE__) . '" /> ' . __('YouTube Analytics Dashboard') . "</h2>";
2121
- 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>';
2122
- }
2123
- else
2124
- {
2125
- //// header
2126
- 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>";
2127
- }
2128
- ?>
2129
  <iframe class="shadow" src="<?php echo $dashurl ?>" width="1060" height="3600" scrolling="auto"/>
2130
  </div>
2131
- <?php
2132
- }
2133
 
2134
- public static function my_embedplus_pro_record()
2135
- {
2136
- $result = array();
2137
- if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
2138
  {
2139
- $tmppro = preg_replace('/[^A-Za-z0-9-]/i', '', $_REQUEST[self::$opt_pro]);
2140
- $new_options = array();
2141
- $new_options[self::$opt_pro] = $tmppro;
2142
- $all = get_option(self::$opt_alloptions);
2143
- $all = $new_options + $all;
2144
- update_option(self::$opt_alloptions, $all);
2145
-
2146
- if (strlen($tmppro) > 0)
2147
  {
2148
- $result['type'] = 'success';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2149
  }
2150
  else
2151
  {
2152
  $result['type'] = 'error';
 
2153
  }
2154
- echo json_encode($result);
2155
- }
2156
- else
2157
- {
2158
- $result['type'] = 'error';
2159
- header("Location: " . $_SERVER["HTTP_REFERER"]);
2160
  }
2161
- die();
2162
- }
2163
 
2164
- public static function my_embedplus_clearspdc()
2165
- {
2166
- $result = array();
2167
- if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
2168
  {
2169
- try
 
2170
  {
2171
- self::spdcpurge();
2172
- $result['type'] = 'success';
 
 
 
 
 
 
 
 
2173
  }
2174
- catch (Exception $ex)
2175
  {
2176
  $result['type'] = 'error';
 
2177
  }
2178
- echo json_encode($result);
2179
- }
2180
- else
2181
- {
2182
- $result['type'] = 'error';
2183
- header("Location: " . $_SERVER["HTTP_REFERER"]);
2184
  }
2185
- die();
2186
- }
2187
 
2188
- public static function custom_admin_pointers_check()
2189
- {
2190
- //return false; // ooopointer shut all off;
2191
- $admin_pointers = self::custom_admin_pointers();
2192
- foreach ($admin_pointers as $pointer => $array)
2193
  {
2194
- if ($array['active'])
2195
- return true;
 
 
 
 
 
2196
  }
2197
- }
2198
 
2199
- public static function glance_script()
2200
- {
2201
- add_thickbox();
2202
- ?>
2203
  <script type="text/javascript">
2204
  function widen_ytprefs_glance() {
2205
  setTimeout(function () {
@@ -2295,11 +2350,11 @@ class YouTubePrefs
2295
  $new_pointer_content .= '<p>'; // ooopointer
2296
  if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
2297
  {
2298
- $new_pointer_content .= __("This update adds: (Free) Improved debug mode messages, and (Pro) Autonext for popup lightbox galleries. (<a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Learn more about Pro &raquo;</a>)");
2299
  }
2300
  else
2301
  {
2302
- $new_pointer_content .= __("This update adds: (Free) Improved debug mode messages, and (Pro) Autonext for popup lightbox galleries.");
2303
  }
2304
  $new_pointer_content .= '</p>';
2305
 
@@ -2375,6 +2430,7 @@ class YouTubePrefs
2375
  $new_options[self::$opt_ogvideo] = self::postchecked(self::$opt_ogvideo) ? 1 : 0;
2376
  $new_options[self::$opt_migrate] = self::postchecked(self::$opt_migrate) ? 1 : 0;
2377
  $new_options[self::$opt_migrate_youtube] = self::postchecked(self::$opt_migrate_youtube) ? 1 : 0;
 
2378
  //$new_options[self::$opt_ssl] = self::postchecked(self::$opt_ssl) ? 1 : 0;
2379
  $new_options[self::$opt_oldspacing] = self::postchecked(self::$opt_oldspacing) ? 1 : 0;
2380
  $new_options[self::$opt_responsive] = self::postchecked(self::$opt_responsive) ? 1 : 0;
@@ -2828,9 +2884,6 @@ class YouTubePrefs
2828
  Click the "Search" button to view the results. Each result will have an <span class="button-primary cuz">&#9660; Insert Into Editor</span> button that
2829
  you can click to directly embed the desired video link to your post without having to copy and paste.
2830
  </p>
2831
- <p>
2832
- The ability to read the latest Internet discussions about the videos you want to embed is now free to all users.
2833
- </p>
2834
  <p>
2835
  <b class="orange">Even more options are available to PRO users!</b> Simply click the <a href="<?php echo self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=protab' ?>" target="_blank" class="button-primary cuz">&#9658; Customize</a> button on the wizard to further personalize your embeds without having to enter special codes yourself.
2836
  <br>
@@ -2841,12 +2894,12 @@ class YouTubePrefs
2841
  </p>
2842
  <div class="jumper" id="jumpdefaults"></div>
2843
  <h3 class="sect">
2844
- <?php _e("Default YouTube Options") ?> <a href="#top" class="totop">&#9650; top</a>
2845
  </h3>
2846
  <p>
2847
  <?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.") ?>
2848
  </p>
2849
- <?php // self::save_changes_button(); ?>
2850
 
2851
  <div class="ytindent chx">
2852
  <p>
@@ -3010,7 +3063,7 @@ class YouTubePrefs
3010
  <div class="jumper" id="jumpcompat"></div>
3011
  <h3 class="sect">Compatibility Settings <a href="#top" class="totop">&#9650; top</a></h3>
3012
  <p>
3013
- With thousands of active users, our plugin may not work with every plugin out there. Below are some settings you may wish to try out.
3014
  </p>
3015
  <div class="ytindent chx">
3016
  <p>
@@ -3031,11 +3084,12 @@ class YouTubePrefs
3031
  <p>
3032
  <input name="<?php echo self::$opt_migrate; ?>" id="<?php echo self::$opt_migrate; ?>" <?php checked($all[self::$opt_migrate], 1); ?> type="checkbox" class="checkbox">
3033
  <label for="<?php echo self::$opt_migrate; ?>">
3034
- <b class="chktitle">Migrate Shortcodes: </b> Inherit other shortcodes.
3035
  </label>
3036
  <div id="boxmigratelist">
3037
  <ul>
3038
- <li><input name="<?php echo self::$opt_migrate_youtube; ?>" id="<?php echo self::$opt_migrate_youtube; ?>" <?php checked($all[self::$opt_migrate_youtube], 1); ?> type="checkbox" class="checkbox"><label for="<?php echo self::$opt_migrate_youtube; ?>">"Youtube Embed" : <code>youtube</code> and <code>youtube_video</code> shortcodes</label></li>
 
3039
  <li class="smallnote orange" style="list-style: none;">This feature is beta. More shortcodes coming.</li>
3040
  </ul>
3041
 
@@ -3068,13 +3122,10 @@ class YouTubePrefs
3068
  <img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
3069
  <p>
3070
  <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>.
3071
- 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. Then paste it in the "YouTube API Key" box below, and click the "Save Changes" button.
 
3072
  </p>
3073
 
3074
-
3075
- <p class="smallnote">
3076
- Note: The PRO wizard has steps to visually create and customize playlist, channel, and gallery codes like the above.
3077
- </p>
3078
  <p>
3079
  Below are the settings for galleries:
3080
  </p>
@@ -3087,12 +3138,12 @@ class YouTubePrefs
3087
  <p>
3088
  <label for="<?php echo self::$opt_gallery_pagesize; ?>"><b class="chktitle">Gallery Page Size:</b></label>
3089
  <select name="<?php echo self::$opt_gallery_pagesize; ?>" id="<?php echo self::$opt_gallery_pagesize; ?>" style="width: 60px;">
3090
- <?php
3091
- $gps_val = intval(trim($all[self::$opt_gallery_pagesize]));
3092
- $gps_val = min($gps_val, 50);
3093
- for ($gps = 1; $gps <= 50; $gps++)
3094
- {
3095
- ?><option <?php echo $gps_val == $gps ? 'selected' : '' ?> value="<?php echo $gps ?>"><?php echo $gps ?></option>
3096
  <?php
3097
  }
3098
  ?>
@@ -3159,14 +3210,14 @@ class YouTubePrefs
3159
  <div class="jumper" id="jumpprosettings"></div>
3160
  <div class="upgchecks">
3161
  <h3 class="sect">PRO Features</h3>
3162
- <?php
3163
- if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 9)
3164
- {
3165
- ?>
3166
  <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>
3167
  <p>
3168
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
3169
- <?php $cleanstyle = trim($all[self::$opt_gallery_style]); ?>
3170
  <select name="<?php echo self::$opt_gallery_style; ?>" id="<?php echo self::$opt_gallery_style; ?>" >
3171
  <option value="">Gallery Style</option>
3172
  <option value="grid" <?php echo 'grid' === $cleanstyle ? 'selected' : '' ?> >Grid (default)</option>
@@ -3192,7 +3243,7 @@ class YouTubePrefs
3192
  <div class="hr"></div>
3193
  <p>
3194
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgallerycircles.jpg', __FILE__) ?>" />
3195
- <?php $cleancrop = trim($all[self::$opt_gallery_thumbcrop]); ?>
3196
  <label for="<?php echo self::$opt_gallery_thumbcrop; ?>">
3197
  <b>(PRO)</b> <b class="chktitle">Gallery Thumbnail Shape:</b></b>
3198
  Differentiate your gallery by showing different thumbnail shapes. We currently offer rectangle and circle shapes.
@@ -3207,7 +3258,7 @@ class YouTubePrefs
3207
  <div class="hr"></div>
3208
  <p>
3209
  <img class="sspopupplayer" src="<?php echo plugins_url('images/sspopupplayer.jpg', __FILE__) ?>" />
3210
- <?php $cleandisp = trim($all[self::$opt_gallery_disptype]); ?>
3211
  <label for="<?php echo self::$opt_gallery_disptype; ?>">
3212
  <b>(PRO)</b> <b class="chktitle">Gallery Video Display Mode:</b> <sup class="orange">NEW</sup>
3213
  Display your gallery videos simply above the thumbnails (default), or as a popup lightbox.
@@ -3242,12 +3293,12 @@ class YouTubePrefs
3242
  </label>
3243
  <br>
3244
  <br>
3245
- <label>
3246
- <input name="<?php echo self::$opt_spdcab; ?>" id="<?php echo self::$opt_spdcab; ?>" <?php checked($all[self::$opt_spdcab], 1); ?> type="checkbox" class="checkbox">
3247
- <b class="chktitle">Show "Clear YouTube Cache" Admin Bar Button: </b> <sup class="orange">NEW</sup>
3248
  This will display the "Clear YouTube Cache" button conveniently in the top admin bar. Uncheck this if you wish to hide the button.
3249
  </label>
3250
-
3251
  </div>
3252
  </div>
3253
  </p>
@@ -3283,7 +3334,7 @@ class YouTubePrefs
3283
  <br>
3284
  <span id="boxdyn">
3285
  Animation:
3286
- <?php $cleandyn = trim($all[self::$opt_dyntype]); ?>
3287
  <select name="<?php echo self::$opt_dyntype; ?>" id="<?php echo self::$opt_dyntype; ?>" >
3288
  <option value="">Select type</option>
3289
  <option value="rotateIn" <?php echo 'rotateIn' === $cleandyn ? 'selected' : '' ?> >rotate in</option>
@@ -3319,11 +3370,11 @@ class YouTubePrefs
3319
  </label>
3320
  </p>
3321
 
3322
- <?php
3323
- }
3324
- else
3325
- {
3326
- ?>
3327
  <p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). </p>
3328
  <p>
3329
  <img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgalleryall.jpg', __FILE__) ?>" />
@@ -3424,12 +3475,12 @@ class YouTubePrefs
3424
  <p>
3425
  <a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" target="_blank">Activate the above and several other features &raquo;</a>
3426
  </p>
3427
- <?php
3428
- }
3429
- ?>
3430
  <div class="clearboth"></div>
3431
  </div>
3432
- <?php // self::save_changes_button(); ?>
3433
 
3434
  <hr>
3435
 
@@ -3437,47 +3488,47 @@ class YouTubePrefs
3437
  <div class="jumper" id="jumpoverride"></div>
3438
 
3439
  <h3 class="sect">
3440
- <?php _e("How To Override Defaults / Other Options") ?> <a href="#top" class="totop">&#9650; top</a>
3441
  </h3>
3442
  <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 '&'.
3443
  <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>
3444
- <?php
3445
- _e('<ul>');
3446
- _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>");
3447
- _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>");
3448
- _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>");
3449
- _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>");
3450
- _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>");
3451
- _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>");
3452
- _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>");
3453
- _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>");
3454
- _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>");
3455
- _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>");
3456
- _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>");
3457
- _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>");
3458
- _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>");
3459
- _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>");
3460
- _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>");
3461
- _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>");
3462
- _e('</ul>');
3463
-
3464
- _e("<p>You can also start and end each individual video at particular times. Like the above, each option should begin with '&'</p>");
3465
- _e('<ul>');
3466
- _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>");
3467
- _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>");
3468
- _e('</ul>');
3469
- ?>
3470
  <div class="save-changes-follow"> <?php self::save_changes_button(isset($_POST[$ytprefs_submitted]) && $_POST[$ytprefs_submitted] == 'Y'); ?> </div>
3471
  </form>
3472
  <div class="jumper" id="jumppro"></div>
3473
  <div id="goprobox">
3474
- <?php
3475
- if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0)
3476
- {
3477
- echo "<h3>" . __('Thank you for going PRO.');
3478
- echo ' &nbsp;<input type="submit" name="showkey" class="button-primary" style="vertical-align: 15%;" id="showprokey" value="View my PRO key" />';
3479
- echo "</h3>";
3480
- ?>
3481
  <?php
3482
  }
3483
  else
@@ -3566,20 +3617,20 @@ class YouTubePrefs
3566
  <div style="clear: both;"></div>
3567
  <br>
3568
  <h3 class="bold">Enter and save your PRO key (emailed to you):</h3>
3569
- <?php } ?>
3570
  <form name="form2" method="post" action="" id="epform2" class="submitpro" <?php
3571
- if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0)
3572
- {
3573
- echo 'style="display: none;"';
3574
- }
3575
- ?>>
3576
 
3577
  <input name="<?php echo self::$opt_pro; ?>" id="opt_pro" value="<?php echo $all[self::$opt_pro]; ?>" type="text">
3578
  <input type="submit" name="Submit" class="button-primary" id="prokeysubmit" value="<?php _e('Save Key') ?>" />
3579
- <?php
3580
- if (!($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0))
3581
- {
3582
- ?>
3583
  &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>
3584
  <?php
3585
  }
@@ -3632,15 +3683,15 @@ class YouTubePrefs
3632
 
3633
  <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>
3634
 
3635
- <?php
3636
- if (!($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0))
3637
- {
3638
- ?>
3639
  <br>
3640
  <br>
3641
  <iframe src="<?php echo self::$epbase ?>/dashboard/likecoupon.aspx" width="600" height="500"></iframe>
3642
- <?php }
3643
- ?>
3644
  <div class="ytnav">
3645
  <a href="#jumphowto">How To Embed</a>
3646
  <a href="#jumpwiz">Visual Wizard</a>
@@ -4044,12 +4095,12 @@ class YouTubePrefs
4044
 
4045
  });
4046
  </script>
4047
- <?php
4048
- if (function_exists('add_thickbox'))
4049
- {
4050
- add_thickbox();
4051
- }
4052
- ?>
4053
 
4054
  <?php
4055
  }
@@ -4069,260 +4120,258 @@ class YouTubePrefs
4069
  });
4070
 
4071
  </script>
4072
- <?php
4073
- }
4074
- ?>
4075
  <p class="submit">
4076
  <input type="submit" onclick="return savevalidate();" name="Submit" class="button-primary ytprefs-submit" value="<?php _e($button_label) ?>" />
4077
  <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>
4078
  </p>
4079
- <?php
4080
- }
4081
 
4082
- public static function ytprefsscript()
 
 
 
4083
  {
4084
- $loggedin = current_user_can('edit_posts');
4085
- if (!($loggedin && self::$alloptions[self::$opt_admin_off_scripts]))
4086
- {
4087
- wp_enqueue_style(
4088
- '__EPYT__style', plugins_url('styles/ytprefs' . self::$min . '.css', __FILE__)
4089
- );
4090
- $cols = floatval(self::$alloptions[self::$opt_gallery_columns]);
4091
- $cols = $cols == 0 ? 3.0 : $cols;
4092
- $colwidth = 100.0 / $cols;
4093
- $custom_css = "
4094
  .epyt-gallery-thumb {
4095
  width: " . round($colwidth, 3) . "%;
4096
  }";
4097
- wp_add_inline_style('__EPYT__style', $custom_css);
4098
-
4099
-
4100
- if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 8))
4101
- {
4102
- wp_enqueue_style('__disptype__', plugins_url('scripts/lity' . self::$min . '.css', __FILE__));
4103
- wp_enqueue_script('__dispload__', plugins_url('scripts/lity' . self::$min . '.js', __FILE__), array('jquery'));
4104
- }
4105
-
4106
- wp_enqueue_script('__ytprefs__', plugins_url('scripts/ytprefs' . self::$min . '.js', __FILE__), array('jquery'));
4107
 
4108
- if (self::$alloptions[self::$opt_old_script_method] != 1)
4109
- {
4110
- wp_localize_script('__ytprefs__', '_EPYT_', array(
4111
- 'ajaxurl' => admin_url('admin-ajax.php'),
4112
- 'security' => wp_create_nonce('embedplus-nonce'),
4113
- 'gallery_scrolloffset' => intval(self::$alloptions[self::$opt_gallery_scrolloffset]),
4114
- 'eppathtoscripts' => plugins_url('scripts/', __FILE__),
4115
- 'epresponsiveselector' => self::get_responsiveselector(),
4116
- 'epdovol' => true,
4117
- 'version' => self::$alloptions[self::$opt_version],
4118
- 'evselector' => self::get_evselector()
4119
- ));
4120
- }
4121
 
4122
- ////////////////////// cloudflare accomodation
4123
- //add_filter('script_loader_tag', 'YouTubePrefs::set_cfasync', 10, 3);
 
 
 
4124
 
4125
- if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0) && self::$alloptions[self::$opt_dynload] == 1)
4126
- {
4127
- wp_enqueue_style('__dyntype__', plugins_url('scripts/embdyn.min.css', __FILE__));
4128
- wp_enqueue_script('__dynload__', plugins_url('scripts/embdyn' . self::$min . '.js', __FILE__), array('jquery'));
4129
- }
4130
 
4131
-
 
 
 
 
 
 
 
 
 
 
 
4132
  }
4133
- }
4134
 
4135
- public static function set_cfasync($tag, $handle, $src)
4136
- {
4137
- if ('__ytprefs__' !== $handle)
 
4138
  {
4139
- return $tag;
 
4140
  }
4141
- return str_replace('<script', '<script data-cfasync="false" ', $tag);
4142
  }
 
4143
 
4144
- public static function get_evselector()
 
 
4145
  {
4146
- $evselector = 'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]';
 
 
 
4147
 
4148
- if (self::$alloptions[self::$opt_evselector_light] == 1)
4149
- {
4150
- $evselector = 'iframe.__youtube_prefs__[src]';
4151
- }
4152
 
4153
- return $evselector;
 
 
4154
  }
4155
 
4156
- public static function get_responsiveselector()
 
 
 
 
 
 
4157
  {
4158
- $responsiveselector = '[]';
4159
- if (self::$alloptions[self::$opt_widgetfit] == 1)
 
 
 
4160
  {
4161
- $responsiveselector = '["iframe.__youtube_prefs_widget__"]';
4162
  }
4163
- if (self::$alloptions[self::$opt_responsive] == 1)
4164
  {
4165
- if (self::$alloptions[self::$opt_responsive_all] == 1)
4166
- {
4167
- $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\']"]';
4168
- }
4169
- else
4170
- {
4171
- $responsiveselector = '["iframe.__youtube_prefs__"]';
4172
- }
4173
  }
4174
- return $responsiveselector;
4175
  }
 
 
4176
 
4177
- public static function get_blogwidth()
 
 
 
4178
  {
4179
- $blogwidth = null;
4180
- try
4181
- {
4182
- $embed_size_w = intval(get_option('embed_size_w'));
4183
 
4184
- global $content_width;
4185
- if (empty($content_width))
4186
- {
4187
- $content_width = $GLOBALS['content_width'];
4188
- }
4189
-
4190
- $blogwidth = $embed_size_w ? $embed_size_w : ($content_width ? $content_width : 450);
4191
- }
4192
- catch (Exception $ex)
4193
  {
4194
-
4195
  }
4196
 
4197
- $blogwidth = preg_replace('/\D/', '', $blogwidth); //may have px
4198
-
4199
- return $blogwidth;
4200
  }
 
 
 
 
 
 
4201
 
 
4202
  }
4203
 
 
 
4204
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4205
  //class start
4206
- class Add_new_tinymce_btn_Youtubeprefs
4207
- {
4208
 
4209
- public $btn_arr;
4210
- public $js_file;
4211
 
4212
- /*
4213
- * call the constructor and set class variables
4214
- * From the constructor call the functions via wordpress action/filter
4215
- */
4216
 
4217
- function __construct($seperator, $btn_name, $javascrip_location)
4218
- {
4219
- $this->btn_arr = array("Seperator" => $seperator, "Name" => $btn_name);
4220
- $this->js_file = $javascrip_location;
4221
- add_action('init', array($this, 'add_tinymce_button'));
4222
- add_filter('tiny_mce_version', array($this, 'refresh_mce_version'));
4223
- }
4224
 
4225
- /*
4226
- * create the buttons only if the user has editing privs.
4227
- * If so we create the button and add it to the tinymce button array
4228
- */
4229
 
4230
- function add_tinymce_button()
 
 
 
 
4231
  {
4232
- if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
4233
- return;
4234
- if (get_user_option('rich_editing') == 'true')
4235
- {
4236
- //the function that adds the javascript
4237
- add_filter('mce_external_plugins', array($this, 'add_new_tinymce_plugin'));
4238
- //adds the button to the tinymce button array
4239
- add_filter('mce_buttons', array($this, 'register_new_button'));
4240
- }
4241
  }
 
4242
 
4243
- /*
4244
- * add the new button to the tinymce array
4245
- */
4246
 
4247
- function register_new_button($buttons)
4248
- {
4249
- array_push($buttons, $this->btn_arr["Seperator"], $this->btn_arr["Name"]);
4250
- return $buttons;
4251
- }
4252
 
4253
- /*
4254
- * Call the javascript file that loads the
4255
- * instructions for the new button
4256
- */
4257
 
4258
- function add_new_tinymce_plugin($plugin_array)
4259
- {
4260
- $plugin_array[$this->btn_arr['Name']] = $this->js_file;
4261
- return $plugin_array;
4262
- }
4263
-
4264
- /*
4265
- * This function tricks tinymce in thinking
4266
- * it needs to refresh the buttons
4267
- */
4268
 
4269
- function refresh_mce_version($ver)
4270
- {
4271
- $ver += 3;
4272
- return $ver;
4273
- }
4274
 
 
 
 
 
4275
  }
4276
 
 
 
4277
  //class end
4278
 
4279
 
4280
- register_activation_hook(__FILE__, array('YouTubePrefs', 'initoptions'));
4281
- $youtubeplgplus = new YouTubePrefs();
4282
 
4283
 
4284
- add_action("wp_ajax_my_embedplus_pro_record", array('YouTubePrefs', 'my_embedplus_pro_record'));
4285
- add_action("wp_ajax_my_embedplus_clearspdc", array('YouTubePrefs', 'my_embedplus_clearspdc'));
4286
- add_action("wp_ajax_my_embedplus_glance_vids", array('YouTubePrefs', 'my_embedplus_glance_vids'));
4287
- add_action("wp_ajax_my_embedplus_glance_count", array('YouTubePrefs', 'my_embedplus_glance_count'));
4288
- add_action("wp_ajax_my_embedplus_dismiss_double_plugin_warning", array('YouTubePrefs', 'my_embedplus_dismiss_double_plugin_warning'));
4289
- add_action("wp_ajax_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
4290
- add_action("wp_ajax_nopriv_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
4291
 
4292
- add_action('admin_enqueue_scripts', 'youtubeprefs_admin_enqueue_scripts');
4293
 
4294
- function youtubeprefs_admin_enqueue_scripts()
 
 
 
 
 
 
 
 
 
4295
  {
4296
- wp_enqueue_style('embedplusyoutube', plugins_url() . '/youtube-embed-plus/scripts/embedplus_mce.css');
4297
- add_action('wp_print_scripts', 'youtubeprefs_output_scriptvars');
4298
- wp_enqueue_script('__ytprefs_admin__', plugins_url('scripts/ytprefs-admin.min.js', __FILE__), array('jquery'));
4299
-
4300
- if (
4301
- //(!(isset(YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro]) && strlen(trim(YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro])) > 0)) && // display only if not pro ooopointer
4302
- (get_bloginfo('version') >= '3.3') && YouTubePrefs::custom_admin_pointers_check()
4303
- )
4304
- {
4305
- add_action('admin_print_footer_scripts', 'YouTubePrefs::custom_admin_pointers_footer');
4306
 
4307
- wp_enqueue_script('wp-pointer');
4308
- wp_enqueue_style('wp-pointer');
4309
- }
4310
 
4311
- if (YouTubePrefs::$alloptions['glance'] == 1)
4312
- {
4313
- add_action('admin_print_footer_scripts', 'YouTubePrefs::glance_script');
4314
- }
4315
  }
 
4316
 
4317
- function youtubeprefs_output_scriptvars()
 
 
 
4318
  {
4319
- YouTubePrefs::$scriptsprinted++;
4320
- if (YouTubePrefs::$scriptsprinted == 1)
4321
- {
4322
- $blogwidth = YouTubePrefs::get_blogwidth();
4323
- $epprokey = YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro];
4324
- $myytdefaults = http_build_query(YouTubePrefs::$alloptions);
4325
- ?>
4326
  <script type="text/javascript">
4327
  var wpajaxurl = "<?php echo admin_url('admin-ajax.php') ?>";
4328
  if (window.location.toString().indexOf('https://') == 0)
@@ -4400,9 +4449,9 @@ class YouTubePrefs
4400
 
4401
 
4402
  </script>
4403
- <?php
4404
- }
4405
  }
 
4406
 
4407
  // function embedplus_strip_shortcode_from_excerpt($content)
4408
  // {
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
  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;
86
  public static $opt_spdcexp = 'spdcexp';
87
  public static $opt_migrate = 'migrate';
88
  public static $opt_migrate_youtube = 'migrate_youtube';
89
+ public static $opt_migrate_embedplusvideo = 'migrate_embedplusvideo';
90
  public static $spdcprefix = 'ytpref';
91
  public static $spdcall = 'youtubeprefs_spdcall';
92
  public static $opt_dynload = 'dynload';
754
  $_ogvideo = 0;
755
  $_migrate = 0;
756
  $_migrate_youtube = 0;
757
+ $_migrate_embedplusvideo = 0;
758
  $_controls = 2;
759
  $_oldspacing = 1;
760
  $_responsive = 0;
833
  $_ogvideo = self::tryget($arroptions, self::$opt_ogvideo, 0);
834
  $_migrate = self::tryget($arroptions, self::$opt_migrate, 0);
835
  $_migrate_youtube = self::tryget($arroptions, self::$opt_migrate_youtube, 0);
836
+ $_migrate_embedplusvideo = self::tryget($arroptions, self::$opt_migrate_embedplusvideo, 0);
837
  $_controls = self::tryget($arroptions, self::$opt_controls, 2);
838
  $_autohide = self::tryget($arroptions, self::$opt_autohide, 2);
839
  $_oldspacing = self::tryget($arroptions, self::$opt_oldspacing, 1);
907
  self::$opt_ogvideo => $_ogvideo,
908
  self::$opt_migrate => $_migrate,
909
  self::$opt_migrate_youtube => $_migrate_youtube,
910
+ self::$opt_migrate_embedplusvideo => $_migrate_embedplusvideo,
911
  self::$opt_controls => $_controls,
912
  self::$opt_oldspacing => $_oldspacing,
913
  self::$opt_responsive => $_responsive,
952
  update_option(self::$opt_alloptions, $all);
953
  update_option('embed_autourls', 1);
954
  self::$alloptions = get_option(self::$opt_alloptions);
955
+
956
+ try
957
+ {
958
+ if (self::$alloptions[self::$opt_spdc] == 1)
959
+ {
960
+ self::spdcpurge();
961
+ wp_remote_get(site_url());
962
+ }
963
+ }
964
+ catch (Exception $ex)
965
+ {
966
+
967
+ }
968
  }
969
 
970
  public static function tryget($array, $key, $default = null)
997
  add_shortcode('youtube', array('YouTubePrefs', 'apply_prefs_shortcode_youtube'));
998
  add_shortcode('youtube_video', array('YouTubePrefs', 'apply_prefs_shortcode_youtube'));
999
  }
1000
+ if (self::$alloptions[self::$opt_migrate_embedplusvideo] == 1)
1001
+ {
1002
+ add_shortcode('embedplusvideo', array('YouTubePrefs', 'apply_prefs_shortcode_embedplusvideo'));
1003
+ }
1004
  }
1005
  }
1006
  else
1043
  return '';
1044
  }
1045
 
1046
+ public static function apply_prefs_shortcode_embedplusvideo($atts, $content = null)
1047
+ {
1048
+ $atts = shortcode_atts(array(
1049
+ "height" => self::$defaultheight,
1050
+ "width" => self::$defaultwidth,
1051
+ "vars" => "",
1052
+ "standard" => "",
1053
+ "id" => "ep" . rand(10000, 99999)
1054
+ ), $atts);
1055
+
1056
+ $epvars = $atts['vars'];
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']))
1064
+ {
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
+ {
1074
+ return self::get_html(array($url), $currfilter == 'widget_text' ? false : true);
1075
+ }
1076
+ }
1077
+ return '';
1078
+ }
1079
+
1080
  public static function apply_prefs_content($content)
1081
  {
1082
  $content = preg_replace_callback(self::$ytregex, "YouTubePrefs::get_html_content", $content);
1163
  if (self::$alloptions[self::$opt_debugmode] == 1 && current_user_can('manage_options'))
1164
  {
1165
  $redactedEndpoint = preg_replace('@&key=[^&]+@i', '&key=PRIVATE', $apiEndpoint);
1166
+ $gallobj->html = '<pre onclick="_EPADashboard_.selectText(this);" class="epyt-debug">CLICK this debug text to auto-select all. Then, COPY the selection.' . "\n\n" .
1167
  'THIS IS DEBUG MODE OUTPUT. UNCHECK THE OPTION IN THE SETTINGS PAGE ONCE YOU ARE DONE DEBUGGING TO PUT THINGS BACK TO NORMAL.' . "\n\n" . $redactedEndpoint . "\n\n" . print_r($apiResult, true) . '</pre>';
1168
  return $gallobj;
1169
  }
1287
  $pagination = '<div class="epyt-pagination">';
1288
 
1289
  $txtprev = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customprev] : _('Prev');
1290
+ $pagination .= '<div tabindex="0" role="button" class="epyt-pagebutton epyt-prev ' . (empty($prevPageToken) ? ' hide ' : '') . '" data-playlistid="' . esc_attr($options->playlistId)
1291
  . '" data-pagesize="' . intval($options->pageSize)
1292
  . '" data-pagetoken="' . esc_attr($prevPageToken)
1293
  . '" data-style="' . esc_attr($options->style)
1306
  $pagination .= '</div>';
1307
 
1308
  $txtnext = self::$alloptions[self::$opt_gallery_customarrows] ? self::$alloptions[self::$opt_gallery_customnext] : _('Next');
1309
+ $pagination .= '<div tabindex="0" role="button" class="epyt-pagebutton epyt-next' . (empty($nextPageToken) ? ' hide ' : '') . '" data-playlistid="' . esc_attr($options->playlistId)
1310
  . '" data-pagesize="' . intval($options->pageSize)
1311
  . '" data-pagetoken="' . esc_attr($nextPageToken)
1312
  . '" data-style="' . esc_attr($options->style)
1365
  }
1366
  }
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>';
1617
  $gallery_options->style = $finalparams[self::$opt_gallery_style];
1618
  $gallery_options->thumbcrop = $finalparams[self::$opt_gallery_thumbcrop];
1619
  $gallery_options->apiKey = self::$alloptions[self::$opt_apikey];
1620
+
1621
  $galleryid = 'epyt_gallery_' . rand(10000, 99999);
1622
  $galleryid_ifm_data = ' data-epytgalleryid="' . $galleryid . '" ';
1623
 
1645
  $code1 = $beginlb . '<iframe ' . $dyntype . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
1646
  '" ' . $dynsrc . 'src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoseries . $videoidoutput . '?';
1647
  $code2 = '" frameborder="0" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') . $disptypeif .
1648
+ '"' . $voloutput . $acctitle . $galleryid_ifm_data . ' allowfullscreen data-no-lazy="1"></iframe>' . $endlb . $schemaorgoutput;
1649
 
1650
  $origin = '';
1651
 
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
  $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
 
2430
  $new_options[self::$opt_ogvideo] = self::postchecked(self::$opt_ogvideo) ? 1 : 0;
2431
  $new_options[self::$opt_migrate] = self::postchecked(self::$opt_migrate) ? 1 : 0;
2432
  $new_options[self::$opt_migrate_youtube] = self::postchecked(self::$opt_migrate_youtube) ? 1 : 0;
2433
+ $new_options[self::$opt_migrate_embedplusvideo] = self::postchecked(self::$opt_migrate_embedplusvideo) ? 1 : 0;
2434
  //$new_options[self::$opt_ssl] = self::postchecked(self::$opt_ssl) ? 1 : 0;
2435
  $new_options[self::$opt_oldspacing] = self::postchecked(self::$opt_oldspacing) ? 1 : 0;
2436
  $new_options[self::$opt_responsive] = self::postchecked(self::$opt_responsive) ? 1 : 0;
2884
  Click the "Search" button to view the results. Each result will have an <span class="button-primary cuz">&#9660; Insert Into Editor</span> button that
2885
  you can click to directly embed the desired video link to your post without having to copy and paste.
2886
  </p>
 
 
 
2887
  <p>
2888
  <b class="orange">Even more options are available to PRO users!</b> Simply click the <a href="<?php echo self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=protab' ?>" target="_blank" class="button-primary cuz">&#9658; Customize</a> button on the wizard to further personalize your embeds without having to enter special codes yourself.
2889
  <br>
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>
3063
  <div class="jumper" id="jumpcompat"></div>
3064
  <h3 class="sect">Compatibility Settings <a href="#top" class="totop">&#9650; top</a></h3>
3065
  <p>
3066
+ With tens of thousands of active users, our plugin may not work with every plugin out there. Below are some settings you may wish to try out.
3067
  </p>
3068
  <div class="ytindent chx">
3069
  <p>
3084
  <p>
3085
  <input name="<?php echo self::$opt_migrate; ?>" id="<?php echo self::$opt_migrate; ?>" <?php checked($all[self::$opt_migrate], 1); ?> type="checkbox" class="checkbox">
3086
  <label for="<?php echo self::$opt_migrate; ?>">
3087
+ <b class="chktitle">Migrate Shortcodes: </b> Inherit shortcodes from other plugins. This is useful for when a plugin becomes deprecated, or you simply prefer this plugin's features.
3088
  </label>
3089
  <div id="boxmigratelist">
3090
  <ul>
3091
+ <li><input name="<?php echo self::$opt_migrate_embedplusvideo; ?>" id="<?php echo self::$opt_migrate_embedplusvideo; ?>" <?php checked($all[self::$opt_migrate_embedplusvideo], 1); ?> type="checkbox" class="checkbox"><label for="<?php echo self::$opt_migrate_embedplusvideo; ?>"><b>"YouTube Advanced Embed":</b> <sup class="orange">NEW</sup> <code>[embedplusvideo]</code> shortcode</label></li>
3092
+ <li><input name="<?php echo self::$opt_migrate_youtube; ?>" id="<?php echo self::$opt_migrate_youtube; ?>" <?php checked($all[self::$opt_migrate_youtube], 1); ?> type="checkbox" class="checkbox"><label for="<?php echo self::$opt_migrate_youtube; ?>"><b>"YouTube Embed":</b> <code>[youtube]</code> and <code>[youtube_video]</code> shortcodes</label></li>
3093
  <li class="smallnote orange" style="list-style: none;">This feature is beta. More shortcodes coming.</li>
3094
  </ul>
3095
 
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
 
 
 
 
 
3129
  <p>
3130
  Below are the settings for galleries:
3131
  </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
  ?>
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
  <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
  <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.
3293
  </label>
3294
  <br>
3295
  <br>
3296
+ <label>
3297
+ <input name="<?php echo self::$opt_spdcab; ?>" id="<?php echo self::$opt_spdcab; ?>" <?php checked($all[self::$opt_spdcab], 1); ?> type="checkbox" class="checkbox">
3298
+ <b class="chktitle">Show "Clear YouTube Cache" Admin Bar Button: </b> <sup class="orange">NEW</sup>
3299
  This will display the "Clear YouTube Cache" button conveniently in the top admin bar. Uncheck this if you wish to hide the button.
3300
  </label>
3301
+
3302
  </div>
3303
  </div>
3304
  </p>
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>
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__) ?>" />
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
  <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
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
  }
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>
4095
 
4096
  });
4097
  </script>
4098
+ <?php
4099
+ if (function_exists('add_thickbox'))
4100
+ {
4101
+ add_thickbox();
4102
+ }
4103
+ ?>
4104
 
4105
  <?php
4106
  }
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
 
4450
 
4451
  </script>
4452
+ <?php
 
4453
  }
4454
+ }
4455
 
4456
  // function embedplus_strip_shortcode_from_excerpt($content)
4457
  // {