YouTube - Version 13.4.3

Version Description

Download this release

Release Info

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

Code changes from version 13.4.2 to 13.4.3

Files changed (4) hide show
  1. readme.txt +7 -3
  2. scripts/ytprefs.js +1 -1
  3. scripts/ytprefs.min.js +1 -1
  4. youtube.php +10 -10
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream ===
2
  Contributors: embedplus
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
- Tags: youtube gallery, minify css defer javascript, youtube channel, youtube live, youtube playlist
5
  Requires at least: 4.1
6
- Tested up to: 5.7
7
- Stable tag: 13.4.2
8
  License: GPLv3 or later
9
 
10
  YouTube Embed Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, YouTube live stream. With defer JavaScript options
@@ -151,6 +151,10 @@ You can also start and end each individual video at particular times. Like the a
151
 
152
  == Changelog ==
153
 
 
 
 
 
154
  = Embed Plus for YouTube WordPress Plugin 13.4.2 =
155
  * Compatible with latest jQuery updates
156
  * Compatible with WordPress 5.7+
1
  === Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream ===
2
  Contributors: embedplus
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
+ Tags: youtube gallery, video gallery, channel gallery, playlist gallery, defer css javascript, youtube channel, youtube live, youtube playlist, embed live chat, lazy load, non critical javascript
5
  Requires at least: 4.1
6
+ Tested up to: 5.8
7
+ Stable tag: 13.4.3
8
  License: GPLv3 or later
9
 
10
  YouTube Embed Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, YouTube live stream. With defer JavaScript options
151
 
152
  == Changelog ==
153
 
154
+ = Embed Plus for YouTube WordPress Plugin 13.4.3 =
155
+ * Automatically turn on default dimensions for new installations, to skip oEmbed width/height lookups. Improves performance (recommended for all users, given most YouTube videos are 16:9 ratio)
156
+ * Better compatibility with cookie compliance plugins that overtake the player with a placeholder
157
+
158
  = Embed Plus for YouTube WordPress Plugin 13.4.2 =
159
  * Compatible with latest jQuery updates
160
  * Compatible with WordPress 5.7+
scripts/ytprefs.js CHANGED
@@ -294,7 +294,7 @@
294
  {
295
  if (typeof window.YT === 'undefined')
296
  {
297
- if (window._EPYT_.ytapi_load !== 'never' && (window._EPYT_.ytapi_load === 'always' || $('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"]').length))
298
  {
299
  var iapi = document.createElement('script');
300
  iapi.src = "https://www.youtube.com/iframe_api";
294
  {
295
  if (typeof window.YT === 'undefined')
296
  {
297
+ if (window._EPYT_.ytapi_load !== 'never' && (window._EPYT_.ytapi_load === 'always' || $('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"], .__youtube_prefs__').length))
298
  {
299
  var iapi = document.createElement('script');
300
  iapi.src = "https://www.youtube.com/iframe_api";
scripts/ytprefs.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- (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/",eppath:"/wp-content/plugins/youtube-embed-plus/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:true,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:true,ajax_compat:false,usingdefault:true,ytapi_load:"light",pause_others:false};a._EPYT_.touchmoved=false;a._EPYT_.apiVideos=a._EPYT_.apiVideos||{};if(a.location.toString().indexOf("https://")===0){a._EPYT_.ajaxurl=a._EPYT_.ajaxurl.replace("http://","https://")}a._EPYT_.pageLoaded=false;b(a).on("load._EPYT_",function(){a._EPYT_.pageLoaded=true});if(!document.querySelectorAll){document.querySelectorAll=function(d){var f=document,e=f.documentElement.firstChild,c=f.createElement("STYLE");e.appendChild(c);f.__qsaels=[];c.styleSheet.cssText=d+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return f.__qsaels}}if(typeof a._EPADashboard_==="undefined"){a._EPADashboard_={initStarted:false,checkCount:0,onPlayerReady:function(h){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var f=parseInt(h.target.getIframe().getAttribute("data-vol"));if(!isNaN(f)){if(f===0){h.target.mute()}else{if(h.target.isMuted()){h.target.unMute()}h.target.setVolume(f)}}}var e=parseInt(h.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(e)&&e===1){h.target.playVideo()}}catch(g){}try{var d=h.target.getIframe().getAttribute("id");a._EPYT_.apiVideos[d]=h.target}catch(c){}},onPlayerStateChange:function(f){var e=f.target.getIframe();if(a._EPYT_.pause_others&&f.data===a.YT.PlayerState.PLAYING){a._EPADashboard_.pauseOthers(f.target)}if(f.data===a.YT.PlayerState.PLAYING&&f.target.ponce!==true&&e.src.indexOf("autoplay=1")===-1){f.target.ponce=true}if(f.data===a.YT.PlayerState.ENDED&&b(e).data("relstop")=="1"){if(typeof f.target.stopVideo==="function"){f.target.stopVideo()}else{var g=b(e).clone(true).off();g.attr("src",a._EPADashboard_.cleanSrc(g.attr("src").replace("autoplay=1","autoplay=0")));b(e).replaceWith(g);a._EPADashboard_.setupevents(g.attr("id"));e=g.get(0)}}var c=b(e).closest(".epyt-gallery");if(!c.length){c=b("#"+b(e).data("epytgalleryid"))}if(c.length){var d=c.find(".epyt-pagebutton").first().data("autonext")=="1";if(d&&f.data===a.YT.PlayerState.ENDED){var h=c.find(".epyt-current-video");if(!h.length){h=c.find(".epyt-gallery-thumb").first()}var i=h.find(" ~ .epyt-gallery-thumb").first();if(i.length){i.trigger("click")}else{c.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().trigger("click")}}}},isMobile:function(){return/Mobi|Android/i.test(navigator.userAgent)},videoEqual:function(d,c){if(d.getIframe&&c.getIframe&&d.getIframe().id===c.getIframe().id){return true}return false},pauseOthers:function(e){if(!e){return}for(var d in a._EPYT_.apiVideos){var c=a._EPYT_.apiVideos[d];if(c&&typeof c.pauseVideo==="function"&&c!=e&&!_EPADashboard_.videoEqual(c,e)&&typeof c.getPlayerState==="function"&&[YT.PlayerState.BUFFERING,a.YT.PlayerState.PLAYING].indexOf(c.getPlayerState())>=0){c.pauseVideo()}}},justid:function(c){return new RegExp("[\\?&]v=([^&#]*)").exec(c)[1]},setupevents:function(e){if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var c=document.getElementById(e);if(!c.epytsetupdone){a._EPADashboard_.log("Setting up YT API events: "+e);c.epytsetupdone=true;var d={events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}};return new a.YT.Player(e,d)}}},apiInit:function(){if(typeof(a.YT)!=="undefined"){a._EPADashboard_.initStarted=true;var c=document.querySelectorAll(_EPYT_.evselector);for(var d=0;d<c.length;d++){if(!c[d].hasAttribute("id")){c[d].id="_dytid_"+Math.round(Math.random()*8999+1000)}a._EPADashboard_.setupevents(c[d].id)}}},log:function(d){try{console.log(d)}catch(c){}},doubleCheck:function(){a._EPADashboard_.checkInterval=setInterval(function(){a._EPADashboard_.checkCount++;if(a._EPADashboard_.checkCount>=5||a._EPADashboard_.initStarted){clearInterval(a._EPADashboard_.checkInterval)}else{a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API init check")}},1000)},selectText:function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}},setVidSrc:function(c,d){c.attr("src",a._EPADashboard_.cleanSrc(d));c.get(0).epytsetupdone=false;a._EPADashboard_.setupevents(c.attr("id"))},cleanSrc:function(d){var c=d.replace("enablejsapi=1?enablejsapi=1","enablejsapi=1");return c},loadYTAPI:function(){if(typeof a.YT==="undefined"){if(a._EPYT_.ytapi_load!=="never"&&(a._EPYT_.ytapi_load==="always"||b('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"]').length)){var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}}else{if(a.YT.loaded){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available 2")})}}}},pageReady:function(){b(".epyt-gallery").each(function(){var f=b(this);if(!f.data("epytevents")||!b("body").hasClass("block-editor-page")){f.data("epytevents","1");var e=b(this).find("iframe, div.__youtube_prefs_gdpr__").first();var c=e.data("src")||e.attr("src");if(!c){c=e.data("ep-src")}var d=b(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");if(typeof(c)!=="undefined"){c=c.replace(d,"GALLERYVIDEOID");f.data("ep-gallerysrc",c)}else{if(e.hasClass("__youtube_prefs_gdpr__")){f.data("ep-gallerysrc","")}}f.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(k){e=f.find("iframe, div.__youtube_prefs_gdpr__").first();if(a._EPYT_.touchmoved){return}if(!b(this).hasClass("epyt-current-video")){f.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");b(this).addClass("epyt-current-video");var g=b(this).data("videoid");f.data("currvid",g);var l=f.data("ep-gallerysrc").replace("GALLERYVIDEOID",g);var j=f.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(l.indexOf("autoplay")>0){l=l.replace("autoplay=0","autoplay=1")}else{l+="&autoplay=1"}e.addClass("epyt-thumbplay")}var h=Math.max(b("body").scrollTop(),b("html").scrollTop());var i=e.offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(h>i){b("html, body").animate({scrollTop:i},500,function(){a._EPADashboard_.setVidSrc(e,l)})}else{a._EPADashboard_.setVidSrc(e,l)}}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(h){var g=h.which;if((g===13)||(g===32)){h.preventDefault();b(this).trigger("click")}});f.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).addClass("hover")});f.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).removeClass("hover")});f.on("click touchend",".epyt-pagebutton",function(k){if(a._EPYT_.touchmoved){return}if(!f.find(".epyt-gallery-list").hasClass("epyt-loading")){f.find(".epyt-gallery-list").addClass("epyt-loading");var g=typeof(k.originalEvent)!=="undefined";var j={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:b(this).data("playlistid"),pageToken:b(this).data("pagetoken"),pageSize:b(this).data("pagesize"),columns:b(this).data("epcolumns"),showTitle:b(this).data("showtitle"),showPaging:b(this).data("showpaging"),autonext:b(this).data("autonext"),thumbplay:b(this).data("thumbplay")}};var h=b(this).hasClass("epyt-next");var i=parseInt(f.data("currpage")+"");i+=h?1:-1;f.data("currpage",i);b.post(_EPYT_.ajaxurl,j,function(l){f.find(".epyt-gallery-list").html(l);f.find(".epyt-current").each(function(){b(this).text(f.data("currpage"))});f.find('.epyt-gallery-thumb[data-videoid="'+f.data("currvid")+'"]').addClass("epyt-current-video");if(f.find(".epyt-pagebutton").first().data("autonext")=="1"&&!g){f.find(".epyt-gallery-thumb").first().trigger("click")}}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){f.find(".epyt-gallery-list").removeClass("epyt-loading");if(f.find(".epyt-pagebutton").first().data("autonext")!="1"){var l=Math.max(b("body").scrollTop(),b("html").scrollTop());var m=f.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(l>m){b("html, body").animate({scrollTop:m},500)}}})}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false})}});b("button.__youtube_prefs_gdpr__").on("click",function(c){c.preventDefault();if(b.cookie){b.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"});a.top.location.reload()}})}}}a.onYouTubeIframeAPIReady=typeof a.onYouTubeIframeAPIReady!=="undefined"?a.onYouTubeIframeAPIReady:function(){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready 2")})}};a._EPADashboard_.loadYTAPI();if(a._EPYT_.pageLoaded){a._EPADashboard_.doubleCheck()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.doubleCheck()})}b(document).ready(function(){a._EPADashboard_.pageReady();a._EPADashboard_.loadYTAPI();if(a._EPYT_.ajax_compat){b(a).on("load._EPYT_",function(){b(document).ajaxSuccess(function(d,f,c){if(f&&f.responseText&&f.responseText.indexOf("<iframe ")!==-1){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
1
 
2
+ (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/",eppath:"/wp-content/plugins/youtube-embed-plus/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:true,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:true,ajax_compat:false,usingdefault:true,ytapi_load:"light",pause_others:false};a._EPYT_.touchmoved=false;a._EPYT_.apiVideos=a._EPYT_.apiVideos||{};if(a.location.toString().indexOf("https://")===0){a._EPYT_.ajaxurl=a._EPYT_.ajaxurl.replace("http://","https://")}a._EPYT_.pageLoaded=false;b(a).on("load._EPYT_",function(){a._EPYT_.pageLoaded=true});if(!document.querySelectorAll){document.querySelectorAll=function(d){var f=document,e=f.documentElement.firstChild,c=f.createElement("STYLE");e.appendChild(c);f.__qsaels=[];c.styleSheet.cssText=d+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return f.__qsaels}}if(typeof a._EPADashboard_==="undefined"){a._EPADashboard_={initStarted:false,checkCount:0,onPlayerReady:function(h){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var f=parseInt(h.target.getIframe().getAttribute("data-vol"));if(!isNaN(f)){if(f===0){h.target.mute()}else{if(h.target.isMuted()){h.target.unMute()}h.target.setVolume(f)}}}var e=parseInt(h.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(e)&&e===1){h.target.playVideo()}}catch(g){}try{var d=h.target.getIframe().getAttribute("id");a._EPYT_.apiVideos[d]=h.target}catch(c){}},onPlayerStateChange:function(f){var e=f.target.getIframe();if(a._EPYT_.pause_others&&f.data===a.YT.PlayerState.PLAYING){a._EPADashboard_.pauseOthers(f.target)}if(f.data===a.YT.PlayerState.PLAYING&&f.target.ponce!==true&&e.src.indexOf("autoplay=1")===-1){f.target.ponce=true}if(f.data===a.YT.PlayerState.ENDED&&b(e).data("relstop")=="1"){if(typeof f.target.stopVideo==="function"){f.target.stopVideo()}else{var g=b(e).clone(true).off();g.attr("src",a._EPADashboard_.cleanSrc(g.attr("src").replace("autoplay=1","autoplay=0")));b(e).replaceWith(g);a._EPADashboard_.setupevents(g.attr("id"));e=g.get(0)}}var c=b(e).closest(".epyt-gallery");if(!c.length){c=b("#"+b(e).data("epytgalleryid"))}if(c.length){var d=c.find(".epyt-pagebutton").first().data("autonext")=="1";if(d&&f.data===a.YT.PlayerState.ENDED){var h=c.find(".epyt-current-video");if(!h.length){h=c.find(".epyt-gallery-thumb").first()}var i=h.find(" ~ .epyt-gallery-thumb").first();if(i.length){i.trigger("click")}else{c.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().trigger("click")}}}},isMobile:function(){return/Mobi|Android/i.test(navigator.userAgent)},videoEqual:function(d,c){if(d.getIframe&&c.getIframe&&d.getIframe().id===c.getIframe().id){return true}return false},pauseOthers:function(e){if(!e){return}for(var d in a._EPYT_.apiVideos){var c=a._EPYT_.apiVideos[d];if(c&&typeof c.pauseVideo==="function"&&c!=e&&!_EPADashboard_.videoEqual(c,e)&&typeof c.getPlayerState==="function"&&[YT.PlayerState.BUFFERING,a.YT.PlayerState.PLAYING].indexOf(c.getPlayerState())>=0){c.pauseVideo()}}},justid:function(c){return new RegExp("[\\?&]v=([^&#]*)").exec(c)[1]},setupevents:function(e){if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var c=document.getElementById(e);if(!c.epytsetupdone){a._EPADashboard_.log("Setting up YT API events: "+e);c.epytsetupdone=true;var d={events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}};return new a.YT.Player(e,d)}}},apiInit:function(){if(typeof(a.YT)!=="undefined"){a._EPADashboard_.initStarted=true;var c=document.querySelectorAll(_EPYT_.evselector);for(var d=0;d<c.length;d++){if(!c[d].hasAttribute("id")){c[d].id="_dytid_"+Math.round(Math.random()*8999+1000)}a._EPADashboard_.setupevents(c[d].id)}}},log:function(d){try{console.log(d)}catch(c){}},doubleCheck:function(){a._EPADashboard_.checkInterval=setInterval(function(){a._EPADashboard_.checkCount++;if(a._EPADashboard_.checkCount>=5||a._EPADashboard_.initStarted){clearInterval(a._EPADashboard_.checkInterval)}else{a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API init check")}},1000)},selectText:function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}},setVidSrc:function(c,d){c.attr("src",a._EPADashboard_.cleanSrc(d));c.get(0).epytsetupdone=false;a._EPADashboard_.setupevents(c.attr("id"))},cleanSrc:function(d){var c=d.replace("enablejsapi=1?enablejsapi=1","enablejsapi=1");return c},loadYTAPI:function(){if(typeof a.YT==="undefined"){if(a._EPYT_.ytapi_load!=="never"&&(a._EPYT_.ytapi_load==="always"||b('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"], .__youtube_prefs__').length)){var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}}else{if(a.YT.loaded){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available 2")})}}}},pageReady:function(){b(".epyt-gallery").each(function(){var f=b(this);if(!f.data("epytevents")||!b("body").hasClass("block-editor-page")){f.data("epytevents","1");var e=b(this).find("iframe, div.__youtube_prefs_gdpr__").first();var c=e.data("src")||e.attr("src");if(!c){c=e.data("ep-src")}var d=b(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");if(typeof(c)!=="undefined"){c=c.replace(d,"GALLERYVIDEOID");f.data("ep-gallerysrc",c)}else{if(e.hasClass("__youtube_prefs_gdpr__")){f.data("ep-gallerysrc","")}}f.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(k){e=f.find("iframe, div.__youtube_prefs_gdpr__").first();if(a._EPYT_.touchmoved){return}if(!b(this).hasClass("epyt-current-video")){f.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");b(this).addClass("epyt-current-video");var g=b(this).data("videoid");f.data("currvid",g);var l=f.data("ep-gallerysrc").replace("GALLERYVIDEOID",g);var j=f.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(l.indexOf("autoplay")>0){l=l.replace("autoplay=0","autoplay=1")}else{l+="&autoplay=1"}e.addClass("epyt-thumbplay")}var h=Math.max(b("body").scrollTop(),b("html").scrollTop());var i=e.offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(h>i){b("html, body").animate({scrollTop:i},500,function(){a._EPADashboard_.setVidSrc(e,l)})}else{a._EPADashboard_.setVidSrc(e,l)}}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(h){var g=h.which;if((g===13)||(g===32)){h.preventDefault();b(this).trigger("click")}});f.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).addClass("hover")});f.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).removeClass("hover")});f.on("click touchend",".epyt-pagebutton",function(k){if(a._EPYT_.touchmoved){return}if(!f.find(".epyt-gallery-list").hasClass("epyt-loading")){f.find(".epyt-gallery-list").addClass("epyt-loading");var g=typeof(k.originalEvent)!=="undefined";var j={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:b(this).data("playlistid"),pageToken:b(this).data("pagetoken"),pageSize:b(this).data("pagesize"),columns:b(this).data("epcolumns"),showTitle:b(this).data("showtitle"),showPaging:b(this).data("showpaging"),autonext:b(this).data("autonext"),thumbplay:b(this).data("thumbplay")}};var h=b(this).hasClass("epyt-next");var i=parseInt(f.data("currpage")+"");i+=h?1:-1;f.data("currpage",i);b.post(_EPYT_.ajaxurl,j,function(l){f.find(".epyt-gallery-list").html(l);f.find(".epyt-current").each(function(){b(this).text(f.data("currpage"))});f.find('.epyt-gallery-thumb[data-videoid="'+f.data("currvid")+'"]').addClass("epyt-current-video");if(f.find(".epyt-pagebutton").first().data("autonext")=="1"&&!g){f.find(".epyt-gallery-thumb").first().trigger("click")}}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){f.find(".epyt-gallery-list").removeClass("epyt-loading");if(f.find(".epyt-pagebutton").first().data("autonext")!="1"){var l=Math.max(b("body").scrollTop(),b("html").scrollTop());var m=f.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(l>m){b("html, body").animate({scrollTop:m},500)}}})}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false})}});b("button.__youtube_prefs_gdpr__").on("click",function(c){c.preventDefault();if(b.cookie){b.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"});a.top.location.reload()}})}}}a.onYouTubeIframeAPIReady=typeof a.onYouTubeIframeAPIReady!=="undefined"?a.onYouTubeIframeAPIReady:function(){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready 2")})}};a._EPADashboard_.loadYTAPI();if(a._EPYT_.pageLoaded){a._EPADashboard_.doubleCheck()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.doubleCheck()})}b(document).ready(function(){a._EPADashboard_.pageReady();a._EPADashboard_.loadYTAPI();if(a._EPYT_.ajax_compat){b(a).on("load._EPYT_",function(){b(document).ajaxSuccess(function(d,f,c){if(f&&f.responseText&&f.responseText.indexOf("<iframe ")!==-1){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
youtube.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
- Version: 13.4.2
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  */
@@ -34,7 +34,7 @@ class YouTubePrefs
34
 
35
  public static $folder_name = 'youtube-embed-plus';
36
  public static $curltimeout = 30;
37
- public static $version = '13.4.2';
38
  public static $opt_version = 'version';
39
  public static $optembedwidth = null;
40
  public static $optembedheight = null;
@@ -1885,9 +1885,9 @@ class YouTubePrefs
1885
  $_restrict_wizard_roles = self::$dft_roles;
1886
  $_ajax_compat = 0;
1887
  $_ytapi_load = 'light';
1888
- $_defaultdims = 0;
1889
- $_defaultwidth = '';
1890
- $_defaultheight = '';
1891
  $_playsinline = 0;
1892
  $_origin = 0;
1893
  $_pause_others = 0;
@@ -1984,9 +1984,9 @@ class YouTubePrefs
1984
  $_restrict_wizard_roles = self::tryget($arroptions, self::$opt_restrict_wizard_roles, self::$dft_roles);
1985
  $_ajax_compat = self::tryget($arroptions, self::$opt_ajax_compat, 0);
1986
  $_ytapi_load = self::tryget($arroptions, self::$opt_ytapi_load, $_ytapi_load);
1987
- $_defaultdims = self::tryget($arroptions, self::$opt_defaultdims, 0);
1988
- $_defaultwidth = self::tryget($arroptions, self::$opt_defaultwidth, '');
1989
- $_defaultheight = self::tryget($arroptions, self::$opt_defaultheight, '');
1990
  $_pause_others = self::tryget($arroptions, self::$opt_pause_others, $_pause_others);
1991
  $_defaultvol = self::tryget($arroptions, self::$opt_defaultvol, 0);
1992
  $_vol = self::tryget($arroptions, self::$opt_vol, '');
@@ -3182,7 +3182,7 @@ class YouTubePrefs
3182
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
3183
 
3184
  $new_pointer_content .= '<p>'; // ooopointer
3185
- $new_pointer_content .= "This update adds compatability for WordPress 5.7+ and the latest version of jQuery for both Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
3186
  if (self::vi_logged_in())
3187
  {
3188
  $new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version, so we recommend taking the vi ads down from your site. Please contact ext@embedplus.com for questions.";
@@ -3595,7 +3595,7 @@ class YouTubePrefs
3595
  Height: <input type="number" min="200" name="<?php echo self::$opt_defaultheight; ?>" id="<?php echo self::$opt_defaultheight; ?>" value="<?php echo esc_attr(trim($all[self::$opt_defaultheight])); ?>" class="textinput" style="width: 75px;">
3596
  </span>
3597
 
3598
- <label for="<?php echo self::$opt_defaultdims; ?>"><?php _e('<b class="chktitle">Default Dimensions:</b> Make your videos have a default size. Recommended: 800 x 450 (NOTE: If responsive sizing is also turned on, your videos will be responsive but also keep this aspect ratio.). Also, according to YouTube guidelines, the player must be a minimum of 200 x 200 (or recommended 480 x 270 for 16:9 ratio players) in order to display correctly.') ?></label>
3599
  </p>
3600
  <p>
3601
  <input name="<?php echo self::$opt_responsive; ?>" id="<?php echo self::$opt_responsive; ?>" <?php checked($all[self::$opt_responsive], 1); ?> type="checkbox" class="checkbox">
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
+ Version: 13.4.3
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  */
34
 
35
  public static $folder_name = 'youtube-embed-plus';
36
  public static $curltimeout = 30;
37
+ public static $version = '13.4.3';
38
  public static $opt_version = 'version';
39
  public static $optembedwidth = null;
40
  public static $optembedheight = null;
1885
  $_restrict_wizard_roles = self::$dft_roles;
1886
  $_ajax_compat = 0;
1887
  $_ytapi_load = 'light';
1888
+ $_defaultdims = 1;
1889
+ $_defaultwidth = isset($GLOBALS['content_width']) && is_numeric($GLOBALS['content_width']) ? intval($GLOBALS['content_width']) : 800;
1890
+ $_defaultheight = intval($_defaultwidth * 9.0 / 16.0);
1891
  $_playsinline = 0;
1892
  $_origin = 0;
1893
  $_pause_others = 0;
1984
  $_restrict_wizard_roles = self::tryget($arroptions, self::$opt_restrict_wizard_roles, self::$dft_roles);
1985
  $_ajax_compat = self::tryget($arroptions, self::$opt_ajax_compat, 0);
1986
  $_ytapi_load = self::tryget($arroptions, self::$opt_ytapi_load, $_ytapi_load);
1987
+ $_defaultdims = self::tryget($arroptions, self::$opt_defaultdims, $_defaultdims);
1988
+ $_defaultwidth = self::tryget($arroptions, self::$opt_defaultwidth, $_defaultwidth);
1989
+ $_defaultheight = self::tryget($arroptions, self::$opt_defaultheight, $_defaultheight);
1990
  $_pause_others = self::tryget($arroptions, self::$opt_pause_others, $_pause_others);
1991
  $_defaultvol = self::tryget($arroptions, self::$opt_defaultvol, 0);
1992
  $_vol = self::tryget($arroptions, self::$opt_vol, '');
3182
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
3183
 
3184
  $new_pointer_content .= '<p>'; // ooopointer
3185
+ $new_pointer_content .= "This update provides better gallery compatibility with cookie compliance plugins, and better oEmbed performance for both Free and Pro versions, as well as live stream chat on mobile devices for the <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro version</a>.";
3186
  if (self::vi_logged_in())
3187
  {
3188
  $new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version, so we recommend taking the vi ads down from your site. Please contact ext@embedplus.com for questions.";
3595
  Height: <input type="number" min="200" name="<?php echo self::$opt_defaultheight; ?>" id="<?php echo self::$opt_defaultheight; ?>" value="<?php echo esc_attr(trim($all[self::$opt_defaultheight])); ?>" class="textinput" style="width: 75px;">
3596
  </span>
3597
 
3598
+ <label for="<?php echo self::$opt_defaultdims; ?>"><?php _e('<b class="chktitle">Default Dimensions:</b> Make your videos have a default size, for better loading performance and consistency. Recommended: 800 x 450 (NOTE: If responsive sizing is also turned on, your videos will be responsive but also keep this aspect ratio.). Also, according to YouTube guidelines, the player must be a minimum of 200 x 200 (or recommended 480 x 270 for 16:9 ratio players) in order to display correctly.') ?></label>
3599
  </p>
3600
  <p>
3601
  <input name="<?php echo self::$opt_responsive; ?>" id="<?php echo self::$opt_responsive; ?>" <?php checked($all[self::$opt_responsive], 1); ?> type="checkbox" class="checkbox">