YouTube Channel - Version 3.0.12

Version Description

(20201107) = * Add: link video title to YouTube playback page opened in new tab/window * Cleanup: remove deprecated parameters theme (themelight), showinfo (noinfo, hideinfo) * Improve: code for widget * Add: widget parameter skip * (20201014) Add: shortcode parameter skip to skip requested number of items

Download this release

Release Info

Developer urkekg
Plugin Icon YouTube Channel
Version 3.0.12
Comparing to
See all releases

Code changes from version 3.0.11.8 to 3.0.12

assets/css/admin.css CHANGED
@@ -1 +1 @@
1
- i.mce-i-ytc{font:normal 20px/1 'dashicons';padding:0;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-left:-2px;padding-right:2px}i.mce-i-ytc:before{content:'\f236'}div[id*='_youtube-channel-'] .widget-content p{width:100%;clear:both}div[id*='_youtube-channel-'] .widget-content p.half{width:49%}div[id*='_youtube-channel-'] .widget-content p.half.left{float:left;clear:left}div[id*='_youtube-channel-'] .widget-content p.half.right{float:right;clear:right}div[id*='_youtube-channel-'] .widget-content p.glue-top{margin-top:0}div[id*='_youtube-channel-'] .widget-content p.hidden{display:none}div[id*='_youtube-channel-'] .widget-content p.visible{display:block}@media screen and (max-width:782px){div[id*='_youtube-channel-'] .widget-content p.half.left,div[id*='_youtube-channel-'] .widget-content p.half.right{width:100%;float:none;clear:none}}.nav-tab.nav-tab-hidden{display:none}.subnav-tab-wrapper{margin-bottom:0}.subnav-tab-wrapper .nav-tab{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.subnav-tab-wrapper .nav-tab:focus{-webkit-box-shadow:initial;box-shadow:initial}.tab-content-ytc{display:none}.tab-content-ytc.tab-content-active{display:block;border-color:#ccc;border-width:0 1px 1px 1px;border-style:solid;padding:10px}/*# sourceMappingURL=admin.css.map */
1
+ i.mce-i-ytc{font:normal 20px/1 'dashicons';padding:0;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-left:-2px;padding-right:2px}i.mce-i-ytc:before{content:'\f236'}div[id*='_youtube-channel-'] .widget-content p{width:100%;clear:both}div[id*='_youtube-channel-'] .widget-content p.half{width:49%}div[id*='_youtube-channel-'] .widget-content p.half.left{float:left;clear:left}div[id*='_youtube-channel-'] .widget-content p.half.right{float:right;clear:right}div[id*='_youtube-channel-'] .widget-content p.glue-top{margin-top:0}div[id*='_youtube-channel-'] .widget-content p.hidden{display:none}div[id*='_youtube-channel-'] .widget-content p.visible{display:block}@media screen and (max-width:782px){div[id*='_youtube-channel-'] .widget-content p.half.left,div[id*='_youtube-channel-'] .widget-content p.half.right{width:100%;float:none;clear:none}}.nav-tab.nav-tab-hidden{display:none}.subnav-tab-wrapper{margin-bottom:0}.subnav-tab-wrapper .nav-tab{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.subnav-tab-wrapper .nav-tab:focus{-webkit-box-shadow:initial;box-shadow:initial}.tab-content-ytc{display:none}.tab-content-ytc.tab-content-active{display:block;border-color:#ccc;border-width:0 1px 1px 1px;border-style:solid;padding:10px}
assets/lib/magnific-popup/jquery.magnific-popup.js CHANGED
@@ -1014,7 +1014,6 @@ $.magnificPopupAU.registerModule(IFRAME_NS, {
1014
  id: 'v=',
1015
  rel: 'rel=',
1016
  modestbranding: 'modestbranding=',
1017
- theme: 'theme=',
1018
  controls: 'controls=',
1019
  playsinline: 'playsinline=',
1020
  enhanceprivacy: 'enhanceprivacy=',
1014
  id: 'v=',
1015
  rel: 'rel=',
1016
  modestbranding: 'modestbranding=',
 
1017
  controls: 'controls=',
1018
  playsinline: 'playsinline=',
1019
  enhanceprivacy: 'enhanceprivacy=',
assets/lib/magnific-popup/jquery.magnific-popup.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(e){var t,n,i,s,o,a,r="Close",c="BeforeClose",l="AfterClose",p="BeforeAppend",d="MarkupParse",f="Open",u="Change",m="ytc-mfp",h="."+m,y="ytc-mfp-ready",g="ytc-mfp-removing",v="ytc-mfp-prevent-close",b=function(){},C=!!window.jQuery,O=e(window),x=function(e,n){t.ev.on(m+e+h,n)},w=function(t,n,i,s){var o=document.createElement("div");return o.className="ytc-mfp-"+t,i&&(o.innerHTML=i),s?n&&n.appendChild(o):(o=e(o),n&&o.appendTo(n)),o},P=function(n,i){t.ev.triggerHandler(m+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},k=function(n){return n===a&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),a=n),t.currTemplate.closeBtn},I=function(){e.magnificPopupAU.instance||(t=new b,t.init(),e.magnificPopupAU.instance=t)},E=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};b.prototype={constructor:b,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=E(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),i=e(document),t.popupsCache={}},open:function(n){var s;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var a,r=n.items;for(s=0;s<r.length;s++)if(a=r[s],a.parsed&&(a=a.el[0]),a===n.el[0]){t.index=s;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return void t.updateItemHTML();t.types=[],o="",t.ev=n.mainEl&&n.mainEl.length?n.mainEl.eq(0):i,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopupAU.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=w("bg").on("click"+h,function(){t.close()}),t.wrap=w("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=w("container",t.wrap)),t.contentContainer=w("content"),t.st.preloader&&(t.preloader=w("preloader",t.container,t.st.tLoading));var c=e.magnificPopupAU.modules;for(s=0;s<c.length;s++){var l=c[s];l=l.charAt(0).toUpperCase()+l.slice(1),t["init"+l].call(t)}P("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(d,function(e,t,n,i){n.close_replaceWith=k(i.type)}),o+=" ytc-mfp-close-btn-in"):t.wrap.append(k())),t.st.alignTop&&(o+=" ytc-mfp-align-top"),t.wrap.css(t.fixedContentPos?{overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}:{top:O.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:i.height(),position:"absolute"}),t.st.enableEscapeKey&&i.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),O.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(o+=" ytc-mfp-auto-cursor"),o&&t.wrap.addClass(o);var p=t.wH=O.height(),u={};if(t.fixedContentPos&&t._hasScrollBar(p)){var m=t._getScrollbarSize();m&&(u.marginRight=m)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):u.overflow="hidden");var g=t.st.mainClass;return t.isIE7&&(g+=" ytc-mfp-ie7"),g&&t._addClassToMFP(g),t.updateItemHTML(),P("BuildControls"),e("html").css(u),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||e(document.body)),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(y),t._setFocus()):t.bgOverlay.addClass(y),i.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(p),P(f),n},close:function(){t.isOpen&&(P(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(g),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){P(r);var n=g+" "+y+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var s={marginRight:""};t.isIE7?e("body, html").css("overflow",""):s.overflow="",e("html").css(s)}i.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","ytc-mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","ytc-mfp-bg"),t.container.attr("class","ytc-mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,P(l)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||O.height();t.fixedContentPos||t.wrap.css("height",t.wH),P("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(P("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=t.st[i]?t.st[i].markup:!1;P("FirstMarkupParse",o),t.currTemplate[i]=o?e(o):!0}s&&s!==n.type&&t.container.removeClass("ytc-mfp-"+s+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,P(u,n),s=n.type,t.container.prepend(t.contentContainer),P("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".ytc-mfp-close").length||t.content.append(k()):t.content=e:t.content="",P(p),t.container.addClass("ytc-mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,s=t.items[n];if(s.tagName?s={el:e(s)}:(i=s.type,s={data:s,src:s.src}),s.el){for(var o=t.types,a=0;a<o.length;a++)if(s.el.hasClass("ytc-mfp-"+o[a])){i=o[a];break}s.src=s.el.attr("data-ytc-mfp-src"),s.src||(s.src=s.el.attr("href"))}return s.type=i||t.st.type||"inline",s.index=n,s.parsed=!0,t.items[n]=s,P("ElementParse",s),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var s="click.magnificPopupAU";n.mainEl=e,n.items?(n.isObj=!0,e.off(s).on(s,i)):(n.isObj=!1,n.delegate?e.off(s).on(s,n.delegate,i):(n.items=e,e.off(s).on(s,i)))},_openClick:function(n,i,s){var o=void 0!==s.midClick?s.midClick:e.magnificPopupAU.defaults.midClick;if(o||!(2===n.which||n.ctrlKey||n.metaKey||n.altKey||n.shiftKey)){var a=void 0!==s.disableOn?s.disableOn:e.magnificPopupAU.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(O.width()<a)return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),s.el=e(n.mfpEl),s.delegate&&(s.items=i.find(s.delegate)),t.open(s)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("ytc-mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var s={status:e,text:i};P("UpdateStatus",s),e=s.status,i=s.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("ytc-mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(v)){var i=t.st.closeOnContentClick,s=t.st.closeOnBgClick;if(i&&s)return!0;if(!t.content||e(n).hasClass("ytc-mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(s&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?i.height():document.body.scrollHeight)>(e||O.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){return n.target===t.wrap[0]||e.contains(t.wrap[0],n.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,n,i){var s;i.data&&(n=e.extend(i.data,n)),P(d,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(s=e.split("_"),s.length>1){var i=t.find(h+"-"+s[0]);if(i.length>0){var o=s[1];"replaceWith"===o?i[0]!==n[0]&&i.replaceWith(n):"img"===o?i.is("img")?i.attr("src",n):i.replaceWith('<img src="'+n+'" class="'+i.attr("class")+'" />'):i.attr(s[1],n)}}else t.find(h+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopupAU={instance:null,proto:b.prototype,modules:[],open:function(t,n){return I(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopupAU.instance&&e.magnificPopupAU.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopupAU.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="ytc-mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopupAU=function(n){I();var i=e(this);if("string"==typeof n)if("open"===n){var s,o=C?i.data("magnificPopupAU"):i[0].magnificPopupAU,a=parseInt(arguments[1],10)||0;o.items?s=o.items[a]:(s=i,o.delegate&&(s=s.find(o.delegate)),s=s.eq(a)),t._openClick({mfpEl:s},i,o)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),C?i.data("magnificPopupAU",n):i[0].magnificPopupAU=n,t.addGroup(i,n);return i};var T="iframe",A="//about:blank",_=function(e){if(t.currTemplate[T]){var n=t.currTemplate[T].find("iframe");n.length&&(e||(n[0].src=A),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopupAU.registerModule(T,{options:{markup:'<div class="ytc-mfp-iframe-scaler"><div class="ytc-mfp-close"></div><iframe class="ytc-mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",rel:"rel=",modestbranding:"modestbranding=",theme:"theme=",controls:"controls=",playsinline:"playsinline=",enhanceprivacy:"enhanceprivacy=",src:"//www.youtube.com/embed/%id%?autoplay=1&rel=%rel%&modestbranding=%modestbranding%&controls=%controls%&playsinline=%playsinline%"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(T),x("BeforeChange",function(e,t,n){t!==n&&(t===T?_():n===T&&_(!0))}),x(r+"."+T,function(){_()})},getIframe:function(n,i){var s=n.src,o=n.src,a=n.src,r=n.src,c=n.src,l=t.st.iframe;e.each(l.patterns,function(){return s.indexOf(this.index)>-1?(this.enhanceprivacy&&"string"==typeof this.enhanceprivacy&&s.indexOf(this.enhanceprivacy)>0&&(enhancePrivacy=s.substr(s.lastIndexOf(this.enhanceprivacy)+this.enhanceprivacy.length,s.length),enhancePrivacy.indexOf("&")>0&&(enhancePrivacy=enhancePrivacy.substr(0,enhancePrivacy.indexOf("&"))),1==enhancePrivacy&&this.src.indexOf("youtube.com")>0&&(this.src=this.src.replace("youtube.com","youtube-nocookie.com"))),this.id&&("string"==typeof this.id?(s=s.substr(s.lastIndexOf(this.id)+this.id.length,s.length),s.indexOf("&")>0&&(s=s.substr(0,s.indexOf("&")))):s=this.id.call(this,s)),this.rel&&("string"==typeof this.rel&&o.indexOf(this.rel)>0?(o=o.substr(o.lastIndexOf(this.rel)+this.rel.length,o.length),o.indexOf("&")>0&&(o=o.substr(0,o.indexOf("&")))):o="1"),this.modestbranding&&("string"==typeof this.modestbranding&&a.indexOf(this.modestbranding)>0?(a=a.substr(a.lastIndexOf(this.modestbranding)+this.modestbranding.length,a.length),a.indexOf("&")>0&&(a=a.substr(0,a.indexOf("&")))):a="0"),this.controls&&("string"==typeof this.controls&&r.indexOf(this.controls)>0?(r=r.substr(r.lastIndexOf(this.controls)+this.controls.length,r.length),r.indexOf("&")>0&&(r=r.substr(0,r.indexOf("&")))):r="1"),this.playsinline&&("string"==typeof this.playsinline&&c.indexOf(this.playsinline)>0?(c=c.substr(c.lastIndexOf(this.playsinline)+this.playsinline.length,c.length),c.indexOf("&")>0&&(c=c.substr(0,c.indexOf("&")))):c="0"),s=this.src.replace("%id%",s).replace("%rel%",o).replace("%modestbranding%",a).replace("%controls%",r).replace("%playsinline%",c),!1):void 0});var p={};return l.srcAction&&(p[l.srcAction]=s),t._parseMarkup(i,p,n),t.updateStatus("ready"),i}}}),I()});
1
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(e){var t,n,i,s,o,a,r="ytc-mfp",c="."+r,l=function(){},p=!!window.jQuery,d=e(window),f=function(e,n){t.ev.on(r+e+c,n)},u=function(t,n,i,s){var o=document.createElement("div");return o.className="ytc-mfp-"+t,i&&(o.innerHTML=i),s?n&&n.appendChild(o):(o=e(o),n&&o.appendTo(n)),o},m=function(n,i){t.ev.triggerHandler(r+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},h=function(n){return n===a&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),a=n),t.currTemplate.closeBtn},y=function(){e.magnificPopupAU.instance||((t=new l).init(),e.magnificPopupAU.instance=t)};l.prototype={constructor:l,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),i=e(document),t.popupsCache={}},open:function(n){var s;if(!1===n.isObj){t.items=n.items.toArray(),t.index=0;var a,r=n.items;for(s=0;s<r.length;s++)if((a=r[s]).parsed&&(a=a.el[0]),a===n.el[0]){t.index=s;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;{if(!t.isOpen){t.types=[],o="",n.mainEl&&n.mainEl.length?t.ev=n.mainEl.eq(0):t.ev=i,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopupAU.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=u("bg").on("click.ytc-mfp",function(){t.close()}),t.wrap=u("wrap").attr("tabindex",-1).on("click.ytc-mfp",function(e){t._checkIfClose(e.target)&&t.close()}),t.container=u("container",t.wrap)),t.contentContainer=u("content"),t.st.preloader&&(t.preloader=u("preloader",t.container,t.st.tLoading));var c=e.magnificPopupAU.modules;for(s=0;s<c.length;s++){var l=c[s];l=l.charAt(0).toUpperCase()+l.slice(1),t["init"+l].call(t)}m("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(f("MarkupParse",function(e,t,n,i){n.close_replaceWith=h(i.type)}),o+=" ytc-mfp-close-btn-in"):t.wrap.append(h())),t.st.alignTop&&(o+=" ytc-mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:d.scrollTop(),position:"absolute"}),(!1===t.st.fixedBgPos||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:i.height(),position:"absolute"}),t.st.enableEscapeKey&&i.on("keyup.ytc-mfp",function(e){27===e.keyCode&&t.close()}),d.on("resize.ytc-mfp",function(){t.updateSize()}),t.st.closeOnContentClick||(o+=" ytc-mfp-auto-cursor"),o&&t.wrap.addClass(o);var p=t.wH=d.height(),y={};if(t.fixedContentPos&&t._hasScrollBar(p)){var g=t._getScrollbarSize();g&&(y.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):y.overflow="hidden");var v=t.st.mainClass;return t.isIE7&&(v+=" ytc-mfp-ie7"),v&&t._addClassToMFP(v),t.updateItemHTML(),m("BuildControls"),e("html").css(y),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||e(document.body)),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP("ytc-mfp-ready"),t._setFocus()):t.bgOverlay.addClass("ytc-mfp-ready"),i.on("focusin.ytc-mfp",t._onFocusIn)},16),t.isOpen=!0,t.updateSize(p),m("Open"),n}t.updateItemHTML()}},close:function(){t.isOpen&&(m("BeforeClose"),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP("ytc-mfp-removing"),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){m("Close");var n="ytc-mfp-removing ytc-mfp-ready ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var s={marginRight:""};t.isIE7?e("body, html").css("overflow",""):s.overflow="",e("html").css(s)}i.off("keyup.ytc-mfp focusin.ytc-mfp"),t.ev.off(c),t.wrap.attr("class","ytc-mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","ytc-mfp-bg"),t.container.attr("class","ytc-mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&!0!==t.currTemplate[t.currItem.type]||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,m("AfterClose")},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||d.height();t.fixedContentPos||t.wrap.css("height",t.wH),m("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(m("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=!!t.st[i]&&t.st[i].markup;m("FirstMarkupParse",o),t.currTemplate[i]=!o||e(o)}s&&s!==n.type&&t.container.removeClass("ytc-mfp-"+s+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,m("Change",n),s=n.type,t.container.prepend(t.contentContainer),m("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&!0===t.currTemplate[n]?t.content.find(".ytc-mfp-close").length||t.content.append(h()):t.content=e:t.content="",m("BeforeAppend"),t.container.addClass("ytc-mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,s=t.items[n];if(s.tagName?s={el:e(s)}:(i=s.type,s={data:s,src:s.src}),s.el){for(var o=t.types,a=0;a<o.length;a++)if(s.el.hasClass("ytc-mfp-"+o[a])){i=o[a];break}s.src=s.el.attr("data-ytc-mfp-src"),s.src||(s.src=s.el.attr("href"))}return s.type=i||t.st.type||"inline",s.index=n,s.parsed=!0,t.items[n]=s,m("ElementParse",s),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var s="click.magnificPopupAU";n.mainEl=e,n.items?(n.isObj=!0,e.off(s).on(s,i)):(n.isObj=!1,n.delegate?e.off(s).on(s,n.delegate,i):(n.items=e,e.off(s).on(s,i)))},_openClick:function(n,i,s){if((void 0!==s.midClick?s.midClick:e.magnificPopupAU.defaults.midClick)||!(2===n.which||n.ctrlKey||n.metaKey||n.altKey||n.shiftKey)){var o=void 0!==s.disableOn?s.disableOn:e.magnificPopupAU.defaults.disableOn;if(o)if(e.isFunction(o)){if(!o.call(t))return!0}else if(d.width()<o)return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),s.el=e(n.mfpEl),s.delegate&&(s.items=i.find(s.delegate)),t.open(s)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("ytc-mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var s={status:e,text:i};m("UpdateStatus",s),e=s.status,i=s.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("ytc-mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass("ytc-mfp-prevent-close")){var i=t.st.closeOnContentClick,s=t.st.closeOnBgClick;if(i&&s)return!0;if(!t.content||e(n).hasClass("ytc-mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(s&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?i.height():document.body.scrollHeight)>(e||d.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){if(n.target!==t.wrap[0]&&!e.contains(t.wrap[0],n.target))return t._setFocus(),!1},_parseMarkup:function(t,n,i){var s;i.data&&(n=e.extend(i.data,n)),m("MarkupParse",[t,n,i]),e.each(n,function(e,n){if(void 0===n||!1===n)return!0;if((s=e.split("_")).length>1){var i=t.find(".ytc-mfp-"+s[0]);if(i.length>0){var o=s[1];"replaceWith"===o?i[0]!==n[0]&&i.replaceWith(n):"img"===o?i.is("img")?i.attr("src",n):i.replaceWith('<img src="'+n+'" class="'+i.attr("class")+'" />'):i.attr(s[1],n)}}else t.find(".ytc-mfp-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopupAU={instance:null,proto:l.prototype,modules:[],open:function(t,n){return y(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopupAU.instance&&e.magnificPopupAU.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopupAU.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="ytc-mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopupAU=function(n){y();var i=e(this);if("string"==typeof n)if("open"===n){var s,o=p?i.data("magnificPopupAU"):i[0].magnificPopupAU,a=parseInt(arguments[1],10)||0;o.items?s=o.items[a]:(s=i,o.delegate&&(s=s.find(o.delegate)),s=s.eq(a)),t._openClick({mfpEl:s},i,o)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),p?i.data("magnificPopupAU",n):i[0].magnificPopupAU=n,t.addGroup(i,n);return i};var g=function(e){if(t.currTemplate.iframe){var n=t.currTemplate.iframe.find("iframe");n.length&&(e||(n[0].src="//about:blank"),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopupAU.registerModule("iframe",{options:{markup:'<div class="ytc-mfp-iframe-scaler"><div class="ytc-mfp-close"></div><iframe class="ytc-mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",rel:"rel=",modestbranding:"modestbranding=",controls:"controls=",playsinline:"playsinline=",enhanceprivacy:"enhanceprivacy=",src:"//www.youtube.com/embed/%id%?autoplay=1&rel=%rel%&modestbranding=%modestbranding%&controls=%controls%&playsinline=%playsinline%"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push("iframe"),f("BeforeChange",function(e,t,n){t!==n&&("iframe"===t?g():"iframe"===n&&g(!0))}),f("Close.iframe",function(){g()})},getIframe:function(n,i){var s=n.src,o=n.src,a=n.src,r=n.src,c=n.src,l=t.st.iframe;e.each(l.patterns,function(){if(s.indexOf(this.index)>-1)return this.enhanceprivacy&&"string"==typeof this.enhanceprivacy&&s.indexOf(this.enhanceprivacy)>0&&(enhancePrivacy=s.substr(s.lastIndexOf(this.enhanceprivacy)+this.enhanceprivacy.length,s.length),enhancePrivacy.indexOf("&")>0&&(enhancePrivacy=enhancePrivacy.substr(0,enhancePrivacy.indexOf("&"))),1==enhancePrivacy&&this.src.indexOf("youtube.com")>0&&(this.src=this.src.replace("youtube.com","youtube-nocookie.com"))),this.id&&("string"==typeof this.id?(s=s.substr(s.lastIndexOf(this.id)+this.id.length,s.length)).indexOf("&")>0&&(s=s.substr(0,s.indexOf("&"))):s=this.id.call(this,s)),this.rel&&("string"==typeof this.rel&&o.indexOf(this.rel)>0?(o=o.substr(o.lastIndexOf(this.rel)+this.rel.length,o.length)).indexOf("&")>0&&(o=o.substr(0,o.indexOf("&"))):o="1"),this.modestbranding&&("string"==typeof this.modestbranding&&a.indexOf(this.modestbranding)>0?(a=a.substr(a.lastIndexOf(this.modestbranding)+this.modestbranding.length,a.length)).indexOf("&")>0&&(a=a.substr(0,a.indexOf("&"))):a="0"),this.controls&&("string"==typeof this.controls&&r.indexOf(this.controls)>0?(r=r.substr(r.lastIndexOf(this.controls)+this.controls.length,r.length)).indexOf("&")>0&&(r=r.substr(0,r.indexOf("&"))):r="1"),this.playsinline&&("string"==typeof this.playsinline&&c.indexOf(this.playsinline)>0?(c=c.substr(c.lastIndexOf(this.playsinline)+this.playsinline.length,c.length)).indexOf("&")>0&&(c=c.substr(0,c.indexOf("&"))):c="0"),s=this.src.replace("%id%",s).replace("%rel%",o).replace("%modestbranding%",a).replace("%controls%",r).replace("%playsinline%",c),!1});var p={};return l.srcAction&&(p[l.srcAction]=s),t._parseMarkup(i,p,n),t.updateStatus("ready"),i}}}),y()});
changelog_legacy.txt CHANGED
@@ -1,5 +1,235 @@
1
  == ChangeLog for old releases ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 2.4.2.1 (2015-04-24) =
4
  * Fix: devicesupport workaround strip 1st video from playlist and favourites and apply only for channel
5
 
@@ -212,3 +442,20 @@
212
 
213
  = 0.1.0 =
214
  * Initial release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  == ChangeLog for old releases ==
2
 
3
+ = 3.0.10.5 (20170225) =
4
+ * Remove: FMVD opt-in because of general plugin guideline violation rule #9
5
+
6
+ = 3.0.10.4 (20170123) =
7
+ * Fix: once enabled FMVD notice has not auto dismissed.
8
+ * Change: input type for YouTube Data API Key from password to text so key is visible by webmaster and prevent messing with autofill browser extensions
9
+
10
+ = 3.0.10.3 (20170114) =
11
+ * Add opt-in option Freemage Video Downloader
12
+ * Code cleanup: delete unused admin.js file
13
+ * UI cleanup: enhance checkbox control in settings
14
+ * UI cleanup: update option names like 'What to show' is now 'Embed as', 'Hide related videos' to 'No related videos' , etc
15
+
16
+ = 3.0.10.2 (20170110) =
17
+ * Add option to select Title HTML tag (default to H3)
18
+
19
+ = 3.0.10.1 (20170110) =
20
+ * Fix Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ')' in /plugins/youtube-channel/inc/settings.php on line 218
21
+
22
+ = 3.0.10 (20161231) =
23
+ * (20161225) Optimize: Remove `extract()` from shortcode parser
24
+ * Code cleanup and fixing to be compliant with WordPress Core coding standards
25
+ * Test compatibility with WordPreee 4.7 and PHP 7.0.14
26
+ * (20161224) Change: Update notification for missing YouTube Data API Key
27
+ * Change: Do not display shortcode options changes for fresh installation
28
+ * (20160824) Change: HTTP to HTTPS links and open remote links on settings page in new tab/window
29
+ * Change: Disable deprecated notification related to old v2.4 of plugin
30
+ * (20160419) Fix: resource from globals used if in widget set to use User uploads as resource.
31
+ * Enhance: Implemented Selective Refresh Support for Widget (WP 4.5)
32
+ * (20160131) Fix: prevent PHP Notices for Settings page.
33
+ * Fix: `Cache feed` option in widget can't be disabled (always revert to default).
34
+ * Fix: `Open link in` option in widget always revert to default.
35
+ * Security: prevent direct loading of settings and widget files.
36
+ * (20160120) Optimize: replace yt_play.png with optimized image.
37
+
38
+ = 3.0.9 =
39
+ * Fix: broken autoplay when start to play all videos instead only first in YTC block set
40
+ * Fix: remove $_SESSION variable and replace with class variable to avoid duplicate sets of JS code
41
+
42
+ = 3.0.8.9 =
43
+ * Fix: Set `Hide link` for `Link to` option for `Link to Channel` in global setting does not work (reported by drweby2).
44
+ * Change: Set minumal required WordPress version 4.0
45
+ * Update: Supported WordPress Version to 4.4
46
+
47
+ = 3.0.8.8 =
48
+ * Fix: Link to channel enabled in Widget not shown if related link ID has not set in Widget (ignored general settings).
49
+ * Fix: Undefined notices
50
+
51
+ = 3.0.8.7 =
52
+ * Enhance: Merge two improvements for MagnificPopupAU fork from core library (commit 60d5aa4 and 1d0f697)
53
+ * Fix: TinyMCE button does not have icon when new post/page is created
54
+ * Fix: Strip non-number characters entered in shortcode TinyMCE creator for Fetch, Show, Initial Width and Description length attributes.
55
+ * Fix: make sure that Initial Width is always in pixels (if user enter width in percentage, strip percent sign and threat value as pixel value)
56
+
57
+ = 3.0.8.6 =
58
+ * Fix: Broken Enhanced Privacy on small screens in forked MagnificPopupAU library
59
+ * Enhanced: Finished making code compliant to WordPress Core coding standards
60
+
61
+ = 3.0.8.5 =
62
+ * Enhanced: Settings page made compliant to WordPress Core Coding Standard
63
+ * Fix: Wrong links to external resources on Settings page
64
+ * Fix: Opening external resources links on Settings page in new tab
65
+ * Change: Replace PayPal donation links to prevent account limitations if plugin is used on website that violates PayPal's Acceptable Use Policy
66
+
67
+ = 3.0.8.4 (2015-06-10/16/17/18/19-07/10) =
68
+ * Fix: (6/19) Undefined notice for apikey
69
+ * Fix: (6/18) Wrong name of widgets page on Help tab
70
+ * Fix: (6/17) Do not load empty JS asset to prevent clash with VisualComposer and invisible rows wit enabled strtching
71
+ * Fix: (6/16) Initiate .MagnificPopupAU() on window load event, not on DOM ready event
72
+ * Fix: Lost some settings during igration from old to new options in settings and widgets
73
+ * Add: (7/13) New global option **Disable TinyMCE** added to **General** tab. Enabled by default, disable to remove TinyMCE icon from post/page Visual Editor
74
+ * Add: (7/10) New global option **Enable Full Screen** added to **Video** tab. Disabled by default, enable fullscreen option for embedded playlist
75
+ * Add: (6/18) Support to initiate .MagnificPopupAU() on .ajaxComplete() and support dynamically loaded YTC within AJAX
76
+ * Add: New global option **Play inline on iOS** added to **Video** tab. Disabled by default, provide support for playsinline parameter.
77
+ * Add: Support for (playsinline)[https://developers.google.com/youtube/player_parameters#playsinline] player option in MagnificPopup library to play video on mobile devices in page instead in device player (disabled by default)
78
+ * Add: Default option settings for nolightbox and
79
+ * Cleanup: Removed unused modules from MagnificPopup library
80
+ * Change: Help tab now have shortcode parameters distributed to subtabs
81
+ * Change: Lightbox classes by prepending `ytc-` in front of all MagnificPopup classes
82
+ * Change: Reduce minimal screen width from 700px to 320px when lightbox will not be used and will open video directly on YouTube website.
83
+ * Improve: Updated strings for localization support
84
+ * Improve: Updated FAQ with new question about play button on thumbnails
85
+ * Updated Serbian localization
86
+
87
+ = 3.0.8.3 (2015-06-09) =
88
+ * Add: Support for enhanced privacy videos in lightbox (MagnificPopupAU tweak)
89
+
90
+ = 3.0.8.2 (2015-06-08) =
91
+ * Fix: Async HTML5 has broken when debug is disabled because single comments before JS code compression
92
+
93
+ = 3.0.8.1 (2015-06-07) =
94
+ * Fix: Migrate deprecated widget options
95
+ * Add: Notice about changed shortcode parameters
96
+ * Add: Message if access to resource is forbidden (private Liked or Favourited videos)
97
+
98
+ = 3.0.8 (2015-06-07) =
99
+ * Fix: Undefined and deprecated global options
100
+ * Add: Global option to disable builtin Lightbox (Video tab)
101
+ * Add: Link to Support forums on Plugins page
102
+ * Add: Visible error in YTC block for Administrator, Oops for visitors and lower members
103
+ * Add: Filename of debug JSON
104
+ * Add: Video title classes `ytc_title_above`/`ytc_title_below`
105
+ * Add: Button `Clear All YTC Cache` on `Tools` tab to quick purge all cached YTC feeds
106
+ * Improve: Do not include YT `iframe_api` if already included by other plugin and make YTC iframe2 to work even if other plugin uses `iframe_api`
107
+ * Improve: Remove `Playlist Only` checkbox (`only_pl=1` shortcode parameter) and integrate as new Display:Embedded Playlist option (`display=playlist` shortcode parameter)
108
+ * Improve: Remove `Show title below` checkbox (titlebelow) and integrate to `Show video title` (showtitle) as dropdown
109
+ * Improve: Remove `Show link to channel` checkbox (showgoto) and integrate option `None` to `What to link` (link_to)
110
+ * Improve: Move JS code to initiate Magnific popup to inline print on wp_footer
111
+ * Improve: LESS stylesheet for easier maintenance
112
+ * Remove: `Et cetera` (descappend) option and always use `...` for shortened description
113
+ * Remove: Macro templates for Link to channel title
114
+ * Change: Values for `showtitle` and `link_to` are changed from integer to string (check Shortcodes section)
115
+ * Change: Move `Hide annotations` and `Hide video info` from `Content` to `Video` tab on settings page
116
+ * Change: Play icon to be like original YT play shape
117
+ * Change: Make responsive enabled by default in new widgets
118
+ * Optimize: DRY of visible errors for Administrator and visitors (Oops message)
119
+ * Optimize: Faster empty defaults for channel, vanity, legacy and playlist in global settings
120
+ * Optimize: Minify inline JS code
121
+ * Optimize: Remove call to fitVids() function
122
+ * Cleanup: Remove $yt_url and $yt_video variables
123
+ * Cleanup: Remove unused function to clean playlist ID
124
+
125
+ = 3.0.7.3 (2015-05-29) =
126
+ * Add: TinyMCE button to easy configure and insert shortcode to post/page content
127
+ * Add: Report about zero videos in resource
128
+ * Add: Helper method to generate resource nice name (DRY)
129
+
130
+ = 3.0.7.2 (2015-05-24) =
131
+ * Add: Error report if we have broken feed on record
132
+ * Add: Report about failed HTTP connections and other problems ocurred when we try to fetch feed
133
+ * Add: DRY of visible errors for Administrator and visitors (Oops message)
134
+
135
+ = 3.0.7.1 (2015-05-17/18) =
136
+ * Fix: Plugin version number not updated in DB
137
+ * Fix: Magnific Popup appear under header on Twenty Eleven theme
138
+ * Fix: .clearfix break layout if used as class on content division
139
+
140
+ = 3.0.7 (2015-05-17) =
141
+ * Fix: Uncaught TypeError: e(...).fitVids is not a function
142
+ * Change: Remove plugin default Channel ID, Vanity custom name, Legacy username and Playlist ID; leave them empty by default and allow them to be empty parameters; throw error if required value not provided. All this to prevent questions like *Why I see your videos on my website* or *Why my website link to your channel*
143
+ * Cleanup: Deprecated widget toggler for Playlist Only depending on selected Resource
144
+ * Cleanup: Deprecated 16:10 styles
145
+ * Optimize: Minimize admin style for widget layout
146
+
147
+ = 3.0.6.2 (2015-05-15) =
148
+ * Fix: Fatal error: Cannot unset string offsets in update.php on line 229 (introduced in 3.0.6.1)
149
+ * Add: Helpfull links to plugin settings page
150
+
151
+ = 3.0.6.1 (2015-05-14) =
152
+ * Fix: Undefined index: random
153
+ * Fix: Unremoved only_pl from global settings
154
+ * Add: Box sizing of .youtube_channel element for crappy themes
155
+
156
+ = 3.0.6 (2015-05-13/14) =
157
+
158
+ * Fix: Prevent Fatal error on PHP<5.3 because required __DIR__ for updater replaced with dirname(__FILE__)
159
+ * Fix: No retrieved or missing videos from some channels so switch `search` to `playlistItems` API call (kudos to @[mmirus](https://wordpress.org/support/profile/mmirus))
160
+ * Add: Embed As Playlist for all resources
161
+ * Add: Clearfix for crappy themes where clearfix does not exists
162
+ * Add: Option to move video title below video (boolean shortcode parameter `titlebelow`)
163
+ * Add: PayPal donate button to settings page
164
+ * Improved: Move YouTube Data API Key to plugin settings and add notification to remove YOUTUBE_DATA_API_KEY from wp-config.php (optional)
165
+ * Improved: Updated shortcode explanation in README and Help tab in plugin settings.
166
+ * Improved: Better tips for 'Oops, something went wrong' message.
167
+ * Change: Wording `Ups` to `Oops`
168
+ * Remove: Options `Embed standard playlist` and `Show random video` from global settings as this should be off by default
169
+ * Remove: Loading of fitVids JS library for test before final removing.
170
+
171
+ = 3.0.5 (2015-05-11/12) =
172
+
173
+ * Fix: Setting back dropdown options with `0` ID does not work on Settings page (Channel as resource to use, Cache timeout, Aspect ratio, What to show, Open link to, Link to)
174
+ * Add: Option to export global settings to JSON and add to Tools tab in settings button to download global settings JSON
175
+ * Change: Update plugin features
176
+ * Improved: Retrieve only fields which will be used for output w/o unused items to reduce
177
+ * Improved: More micro optimizations
178
+
179
+ = 3.0.4 (2015-05-11) =
180
+
181
+ * Add: Tip what to do if error ocurred with YouTube Data API Key printed inside YTC ERROR comment
182
+ * Change: Where to ask for support links in widget
183
+ * Change: Timeout for getting feed increased from 2 to 5 seconds
184
+ * Change: Update FAQ sections in readme file
185
+ * Remove: Check for Redux Framework in debug JSON generator
186
+
187
+ = 3.0.3 (2015-05-10) =
188
+
189
+ * Fix: "Oops, something went wrong." when Playlist selected as resource because wrong switch
190
+ * Fix: Jumping thumbnails in responsive wall on hover in Twenty Fifteen theme because border-bottom for anchors
191
+ * Fix: Another deprecated shortcode attribute backward compatibility (`use_res`)
192
+ * Add: Example of dynamic responsive wall (1 large + 6 small thumbnails) (to [Description](https://wordpress.org/plugins/youtube-channel/))
193
+
194
+ = 3.0.2 (2015-05-10) =
195
+
196
+ * Fix: (typo - experiencing on frontend when no API Key set) PHP Fatal error: Call to undefined function __sprintf() in youtube-channel.php on line 445
197
+ * Fix: shortcode deprecated params `res` and `show` not backward compatibile
198
+
199
+ = 3.0.1 (2015-05-10) =
200
+
201
+ * Fix: Fatal error: Using $this when not in object context in youtube-channel.php on line 89
202
+ * Fix: Link to channel not visible on Twenty Fifteen theme
203
+
204
+ = 3.0.0 (2015-05-07/08/09/10) =
205
+
206
+ * Fix: Migraton of global and widget settings to v3.0.0
207
+ * Add: New Global Settings page as replacement of Redux Framework solution
208
+ * Add: Non-Dismissable Dashboard notice if YouTube Data API Key missing with link to explanation page
209
+ * Change: Option key `ytc_version` to `youtube_channel_version`
210
+ * Change: Shortcode parameters: `res` to `resource`, `show` to `display`; but leave old parameter names for backward compatibility
211
+ * Enhance: Various plugin core micro optimizations
212
+ * Enhance: Dashboard notices
213
+ * Enhance: Proper options migration on plugin update
214
+ * Remove: Redux Framework mentioning from core plugin
215
+ * Remove: Redux Framework config.php
216
+ * Remove: chromeless.swf asset
217
+ * Remove: option `Fix height taken by controls` as now YouTube displays control bar only when video is hovered
218
+
219
+ = 3.0.0alpha2 (2015-03-07/22/24) =
220
+
221
+ * Add: Rewrite plugin to work with YouTube Data API v3
222
+ * Add: Vanity link as option to Link to channel (now supports Legacy username, Channel and Vanity URL) with cleanup Vanity ID routine
223
+ * Add: Liked videos as resource (now support channel, playlists, favourites and liked videos)
224
+ * Add: Admin notification in widget output on front-end if no YouTube Data API Key is defined to prevent errors
225
+ * Add: Dismissable Dashboard notice if PHP version is lower than 5.3 as YTC maybe will not work with older versions.
226
+ * Change: Global and widget option names: `use_res` to `resource`, `cache_time` to `cache`, `maxrnd` to `fetch`, `vidqty` to `num`, `getrnd` to `random`, `to_show` to `display`, `showvidesc` to `showdesc`, `enhprivacy` to `privacy`, `videsclen` to `desclen`,
227
+ * Change: Widget settings functionality, two column options, better toggle for playlist and GoTo section
228
+ * Enhance: Caching routine (reduce possibility of failed feed fetch)
229
+ * Remove: Chromeless and Flash player - leave only Thumbnail and HTML5
230
+ * Remove: Aspect Ration 16:10 (so support only 16:9 and 4:3, same as modern YouTube)
231
+ * Remove: "Fix No Item" option - not required for YouTube API 3.0
232
+
233
  = 2.4.2.1 (2015-04-24) =
234
  * Fix: devicesupport workaround strip 1st video from playlist and favourites and apply only for channel
235
 
442
 
443
  = 0.1.0 =
444
  * Initial release
445
+
446
+ == Upgrade Notice ==
447
+
448
+ = 3.0.8 =
449
+ Bugfixes, optimizations and improvements.
450
+
451
+ = 3.0.7.3 =
452
+ User experience improved with Shortcode generator for TinyMCE
453
+
454
+ = 3.0.7.2 =
455
+ Added report for user if any HTTP error occured
456
+
457
+ = 3.0.7,1 =
458
+ Quick fix for clearfix class
459
+
460
+ = 3.0.7 =
461
+ Cleanup and optimization release
inc/settings-usage-shortcode.php CHANGED
@@ -31,6 +31,7 @@ printf(
31
  <li><code>cache</code> <em>(int)</em> Period in seconds for caching feed. You can disable caching by setting this option to <code>0</code>, but if you have a lot of visits, consider at least short caching (couple minutes).</li>
32
 
33
  <li><code>fetch</code> <em>(int)</em> Number of videos that will be used as stack for random pick (min 2, max 50)</li>
 
34
  <li><code>num</code> <em>(int)</em> Number of videos to display per YTC block.</li>
35
 
36
  <li><code>random</code> <em>(bool)</em> Option to randomize videos on every page load. [<strong>Individual option, does not exists in global plugin settings!</strong>]</li>
@@ -63,7 +64,6 @@ printf(
63
  </ul></li>
64
 
65
  <li><code>no_thumb_title</code> <em>(bool)</em> By default YouTube thumbnail will have tooltip with info about video title and date of publishing. By setting this option to <code>1</code> or <code>true</code> you can hide tooltip</li>
66
- <li><code>themelight</code> <em>(bool)</em> By default YouTube have dark play controls theme. By setting this option to <code>1</code> or <code>true</code> you can get light theme in player (HTML5 and Flash)</li>
67
  <li><code>controls</code> <em>(bool)</em> Set this option to <code>1</code> or <code>true</code> to hide playback controls. To display controls set this option to <code>0</code> or <code>false</code>.</li>
68
  <li><code>autoplay</code> <em>(bool)</em> Enable autoplay of first video in YTC video stack by setting this option to <code>1</code> or <code>true</code></li>
69
  <li><code>mute</code> <em>(bool)</em> Set this option to <code>1</code> or <code>true</code> to mute videos set to autoplay on load</li>
@@ -84,9 +84,9 @@ printf(
84
  <li>&bullet; <code>inside_b</code> to show bottom aligned title inside thumbnail; if <code>display</code> is not <code>thumbnail</code> then treat as <code>below</code></li>
85
  </ul>
86
  </li>
 
87
  <li><code>showdesc</code> <em>(bool)</em> Set to <code>1</code> or <code>true</code> to show video description.</li>
88
  <li><code>desclen</code> <em>(int)</em> Set number of characters to cut down length of video description. Set to <code>0</code> to use full length description.</li>
89
- <li><code>noinfo</code> <em>(bool)</em> Set to <code>1</code> or <code>true</code> to hide overlay video infos (from embedded player)</li>
90
  <li><code>noanno</code> <em>(bool)</em> Set to <code>1</code> or <code>true</code> to hide overlay video annotations (from embedded player)</li>
91
  </ul>
92
  </div>
31
  <li><code>cache</code> <em>(int)</em> Period in seconds for caching feed. You can disable caching by setting this option to <code>0</code>, but if you have a lot of visits, consider at least short caching (couple minutes).</li>
32
 
33
  <li><code>fetch</code> <em>(int)</em> Number of videos that will be used as stack for random pick (min 2, max 50)</li>
34
+ <li><code>skip</code> <em>(int)</em> Number of videos to skip (not applicable for embedable playlist and random pick (min 0, max 49, default 0) [<strong>Individual option, does not exists in global plugin settings!</strong>]</li>
35
  <li><code>num</code> <em>(int)</em> Number of videos to display per YTC block.</li>
36
 
37
  <li><code>random</code> <em>(bool)</em> Option to randomize videos on every page load. [<strong>Individual option, does not exists in global plugin settings!</strong>]</li>
64
  </ul></li>
65
 
66
  <li><code>no_thumb_title</code> <em>(bool)</em> By default YouTube thumbnail will have tooltip with info about video title and date of publishing. By setting this option to <code>1</code> or <code>true</code> you can hide tooltip</li>
 
67
  <li><code>controls</code> <em>(bool)</em> Set this option to <code>1</code> or <code>true</code> to hide playback controls. To display controls set this option to <code>0</code> or <code>false</code>.</li>
68
  <li><code>autoplay</code> <em>(bool)</em> Enable autoplay of first video in YTC video stack by setting this option to <code>1</code> or <code>true</code></li>
69
  <li><code>mute</code> <em>(bool)</em> Set this option to <code>1</code> or <code>true</code> to mute videos set to autoplay on load</li>
84
  <li>&bullet; <code>inside_b</code> to show bottom aligned title inside thumbnail; if <code>display</code> is not <code>thumbnail</code> then treat as <code>below</code></li>
85
  </ul>
86
  </li>
87
+ <li><code>linktitle</code> <em>(bool)</em> Set to <code>1</code> or <code>true</code> to link title to vlideo.</li>
88
  <li><code>showdesc</code> <em>(bool)</em> Set to <code>1</code> or <code>true</code> to show video description.</li>
89
  <li><code>desclen</code> <em>(int)</em> Set number of characters to cut down length of video description. Set to <code>0</code> to use full length description.</li>
 
90
  <li><code>noanno</code> <em>(bool)</em> Set to <code>1</code> or <code>true</code> to hide overlay video annotations (from embedded player)</li>
91
  </ul>
92
  </div>
inc/settings.php CHANGED
@@ -521,20 +521,6 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL_SETTINGS' ) ) {
521
  ) // args
522
  );
523
 
524
- // Light Theme
525
- add_settings_field(
526
- $this->option_name . 'themelight', // id
527
- __( 'Light Theme', 'youtube-channel' ), // Title
528
- array( &$this, 'settings_field_checkbox' ), // Callback
529
- $this->slug . '_video', // Page
530
- 'ytc_video', // section
531
- array(
532
- 'field' => $this->option_name . '[themelight]',
533
- 'description' => __( 'Enable this option to use light theme for playback controls instead dark.', 'youtube-channel' ),
534
- 'class' => 'checkbox',
535
- 'value' => isset( $this->defaults['themelight'] ) ? $this->defaults['themelight'] : '0',
536
- ) // args
537
- );
538
  // No Player Controls
539
  add_settings_field(
540
  $this->option_name . 'controls', // id
@@ -578,16 +564,16 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL_SETTINGS' ) ) {
578
  'value' => isset( $this->defaults['autoplay_mute'] ) ? $this->defaults['autoplay_mute'] : '0',
579
  ) // args
580
  );
581
- // No related videos
582
  add_settings_field(
583
  $this->option_name . 'norel', // id
584
- __( 'No related videos', 'youtube-channel' ), // Title
585
  array( &$this, 'settings_field_checkbox' ), // Callback
586
  $this->slug . '_video', // Page
587
  'ytc_video', // section
588
  array(
589
  'field' => $this->option_name . '[norel]',
590
- 'description' => __( 'Enable this option to hide related videos after finished playback', 'youtube-channel' ),
591
  'class' => 'checkbox',
592
  'value' => isset( $this->defaults['norel'] ) ? $this->defaults['norel'] : '0',
593
  ) // args
@@ -606,20 +592,6 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL_SETTINGS' ) ) {
606
  'value' => isset( $this->defaults['hideanno'] ) ? $this->defaults['hideanno'] : '0',
607
  ) // args
608
  );
609
- // Hide Video Info
610
- add_settings_field(
611
- $this->option_name . 'hideinfo', // id
612
- __( 'No video info', 'youtube-channel' ), // Title
613
- array( &$this, 'settings_field_checkbox' ), // Callback
614
- $this->slug . '_video', // Page
615
- 'ytc_video', // section
616
- array(
617
- 'field' => $this->option_name . '[hideinfo]',
618
- 'description' => __( 'Enable this option to hide informations about video before play start (video title and uploader in overlay)', 'youtube-channel' ),
619
- 'class' => 'checkbox',
620
- 'value' => isset( $this->defaults['hideinfo'] ) ? $this->defaults['hideinfo'] : '0',
621
- ) // args
622
- );
623
  // Hide YT logo
624
  add_settings_field(
625
  $this->option_name . 'modestbranding', // id
@@ -672,6 +644,21 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL_SETTINGS' ) ) {
672
  ),
673
  ) // args
674
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
675
  // Video Title HTML Tag
676
  add_settings_field(
677
  $this->option_name . 'titletag', // id
@@ -1110,19 +1097,18 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL_SETTINGS' ) ) {
1110
  $sanitized['playsinline'] = ( ! empty( $options['playsinline'] ) && $options['playsinline'] ) ? 1 : 0;
1111
  $sanitized['nolightbox'] = ( ! empty( $options['nolightbox'] ) && $options['nolightbox'] ) ? 1 : 0;
1112
  $sanitized['fullscreen'] = ( ! empty( $options['fullscreen'] ) && $options['fullscreen'] ) ? 1 : 0;
1113
- $sanitized['themelight'] = ( ! empty( $options['themelight'] ) && $options['themelight'] ) ? 1 : 0;
1114
  $sanitized['controls'] = ( ! empty( $options['controls'] ) && $options['controls'] ) ? 1 : 0;
1115
  $sanitized['autoplay'] = ( ! empty( $options['autoplay'] ) && $options['autoplay'] ) ? 1 : 0;
1116
  $sanitized['autoplay_mute'] = ( ! empty( $options['autoplay_mute'] ) && $options['autoplay_mute'] ) ? 1 : 0;
1117
  $sanitized['norel'] = ( ! empty( $options['norel'] ) && $options['norel'] ) ? 1 : 0;
1118
  $sanitized['modestbranding'] = ( ! empty( $options['modestbranding'] ) && $options['modestbranding'] ) ? 1 : 0;
1119
  $sanitized['hideanno'] = ( ! empty( $options['hideanno'] ) && $options['hideanno'] ) ? 1 : 0;
1120
- $sanitized['hideinfo'] = ( ! empty( $options['hideinfo'] ) && $options['hideinfo'] ) ? 1 : 0;
1121
  break; // Video
1122
 
1123
  // --- Content ---
1124
  case 'ytc_content':
1125
  $sanitized['showtitle'] = ( ! empty( $options['showtitle'] ) ) ? $options['showtitle'] : $this->defaults['showtitle'];
 
1126
  $sanitized['titletag'] = ( ! empty( $options['titletag'] ) ) ? strtolower( $options['titletag'] ) : strtolower( $this->defaults['titletag'] );
1127
  $sanitized['showdesc'] = ( ! empty( $options['showdesc'] ) && $options['showdesc'] ) ? 1 : 0;
1128
  $sanitized['desclen'] = ( ! empty( $options['desclen'] ) ) ? intval( $options['desclen'] ) : $this->defaults['desclen'];
521
  ) // args
522
  );
523
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  // No Player Controls
525
  add_settings_field(
526
  $this->option_name . 'controls', // id
564
  'value' => isset( $this->defaults['autoplay_mute'] ) ? $this->defaults['autoplay_mute'] : '0',
565
  ) // args
566
  );
567
+ // Only channel related videos
568
  add_settings_field(
569
  $this->option_name . 'norel', // id
570
+ __( 'Only channel related videos', 'youtube-channel' ), // Title
571
  array( &$this, 'settings_field_checkbox' ), // Callback
572
  $this->slug . '_video', // Page
573
  'ytc_video', // section
574
  array(
575
  'field' => $this->option_name . '[norel]',
576
+ 'description' => __( 'Enable this option to show after finished playback only related videos that come from the same channel as the video that was just played', 'youtube-channel' ),
577
  'class' => 'checkbox',
578
  'value' => isset( $this->defaults['norel'] ) ? $this->defaults['norel'] : '0',
579
  ) // args
592
  'value' => isset( $this->defaults['hideanno'] ) ? $this->defaults['hideanno'] : '0',
593
  ) // args
594
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  // Hide YT logo
596
  add_settings_field(
597
  $this->option_name . 'modestbranding', // id
644
  ),
645
  ) // args
646
  );
647
+ // Link Video Title
648
+ add_settings_field(
649
+ $this->option_name . 'linktitle', // id
650
+ __( 'Link Title to Video', 'youtube-channel' ), // Title
651
+ array( &$this, 'settings_field_checkbox' ), // Callback
652
+ $this->slug . '_content', // Page
653
+ 'ytc_content', // section
654
+ array(
655
+ 'field' => $this->option_name . '[linktitle]',
656
+ 'description' => __( 'Enable this option to link outside title to video.', 'youtube-channel' ),
657
+ 'class' => 'checkbox',
658
+ 'value' => isset( $this->defaults['linktitle'] ) ? $this->defaults['linktitle'] : '0',
659
+ ) // args
660
+ );
661
+
662
  // Video Title HTML Tag
663
  add_settings_field(
664
  $this->option_name . 'titletag', // id
1097
  $sanitized['playsinline'] = ( ! empty( $options['playsinline'] ) && $options['playsinline'] ) ? 1 : 0;
1098
  $sanitized['nolightbox'] = ( ! empty( $options['nolightbox'] ) && $options['nolightbox'] ) ? 1 : 0;
1099
  $sanitized['fullscreen'] = ( ! empty( $options['fullscreen'] ) && $options['fullscreen'] ) ? 1 : 0;
 
1100
  $sanitized['controls'] = ( ! empty( $options['controls'] ) && $options['controls'] ) ? 1 : 0;
1101
  $sanitized['autoplay'] = ( ! empty( $options['autoplay'] ) && $options['autoplay'] ) ? 1 : 0;
1102
  $sanitized['autoplay_mute'] = ( ! empty( $options['autoplay_mute'] ) && $options['autoplay_mute'] ) ? 1 : 0;
1103
  $sanitized['norel'] = ( ! empty( $options['norel'] ) && $options['norel'] ) ? 1 : 0;
1104
  $sanitized['modestbranding'] = ( ! empty( $options['modestbranding'] ) && $options['modestbranding'] ) ? 1 : 0;
1105
  $sanitized['hideanno'] = ( ! empty( $options['hideanno'] ) && $options['hideanno'] ) ? 1 : 0;
 
1106
  break; // Video
1107
 
1108
  // --- Content ---
1109
  case 'ytc_content':
1110
  $sanitized['showtitle'] = ( ! empty( $options['showtitle'] ) ) ? $options['showtitle'] : $this->defaults['showtitle'];
1111
+ $sanitized['linktitle'] = ( ! empty( $options['linktitle'] ) && $options['linktitle'] ) ? 1 : 0;
1112
  $sanitized['titletag'] = ( ! empty( $options['titletag'] ) ) ? strtolower( $options['titletag'] ) : strtolower( $this->defaults['titletag'] );
1113
  $sanitized['showdesc'] = ( ! empty( $options['showdesc'] ) && $options['showdesc'] ) ? 1 : 0;
1114
  $sanitized['desclen'] = ( ! empty( $options['desclen'] ) ) ? intval( $options['desclen'] ) : $this->defaults['desclen'];
inc/tinymce/plugin.js CHANGED
@@ -127,6 +127,13 @@
127
  value: '10',
128
  tooltip: 'Number of videos that will be used for random pick (min 2, max 50, default 25)'
129
  },
 
 
 
 
 
 
 
130
  {
131
  type: 'textbox',
132
  name: 'num',
@@ -240,13 +247,6 @@
240
  label: 'Hide thumbnail tooltip',
241
  checked: false
242
  },
243
- {
244
- type: 'checkbox',
245
- name: 'themelight',
246
- label: 'Use light theme',
247
- tooltip: 'Default theme is dark',
248
- checked: false
249
- },
250
  {
251
  type: 'checkbox',
252
  name: 'controls',
@@ -300,6 +300,12 @@
300
  ],
301
  value : 'none'
302
  },
 
 
 
 
 
 
303
  {
304
  type: 'listbox',
305
  name: 'titletag',
@@ -334,12 +340,6 @@
334
  label: 'Hide annotations',
335
  checked: true
336
  },
337
- {
338
- type: 'checkbox',
339
- name: 'noinfo',
340
- label: 'Hide video info',
341
- checked: true
342
- },
343
  ]
344
  },
345
 
@@ -385,6 +385,7 @@
385
  if ( e.data.privacy ) shortcode += ' privacy=1';
386
  if ( e.data.random ) shortcode += ' random=1';
387
  if ( e.data.fetch ) shortcode += ' fetch=' + e.data.fetch.replace(/[^0-9.]/g, '') +'';
 
388
  if ( e.data.num ) shortcode += ' num=' + e.data.num.replace(/[^0-9.]/g, '') +'';
389
 
390
  // Video Settings
@@ -395,7 +396,6 @@
395
  if ( e.data.thumb_quality ) shortcode += ' thumb_quality=' + e.data.thumb_quality + '';
396
  // if ( e.data.cols ) shortcode += ' cols=' + e.data.cols + '';
397
  if ( e.data.no_thumb_title ) shortcode += ' no_thumb_title=1';
398
- if ( e.data.themelight ) shortcode += ' themelight=1';
399
  if ( e.data.controls ) shortcode += ' controls=1';
400
  if ( e.data.autoplay ) shortcode += ' autoplay=1';
401
  if ( e.data.mute ) shortcode += ' mute=1';
@@ -406,11 +406,11 @@
406
 
407
  // Content Layout
408
  if ( e.data.showtitle ) shortcode += ' showtitle=' + e.data.showtitle + '';
 
409
  if ( e.data.titletag ) shortcode += ' titletag=' + e.data.titletag + '';
410
  if ( e.data.showdesc ) shortcode += ' showdesc=1';
411
  if ( e.data.desclen ) shortcode += ' desclen=' + e.data.desclen.replace(/[^0-9.]/g, '') + '';
412
  if ( e.data.noanno ) shortcode += ' noanno=1';
413
- if ( e.data.noinfo ) shortcode += ' noinfo=1';
414
 
415
  // Link to Channel
416
  if ( e.data.link_to ) shortcode += ' link_to=' + e.data.link_to + '';
127
  value: '10',
128
  tooltip: 'Number of videos that will be used for random pick (min 2, max 50, default 25)'
129
  },
130
+ {
131
+ type: 'textbox',
132
+ name: 'skip',
133
+ label: 'Skip',
134
+ value: '0',
135
+ tooltip: 'Number of videos to skip (not applicable for embedded playlist and random pick (min 0, max 49, default 0)'
136
+ },
137
  {
138
  type: 'textbox',
139
  name: 'num',
247
  label: 'Hide thumbnail tooltip',
248
  checked: false
249
  },
 
 
 
 
 
 
 
250
  {
251
  type: 'checkbox',
252
  name: 'controls',
300
  ],
301
  value : 'none'
302
  },
303
+ {
304
+ type: 'checkbox',
305
+ name: 'linktitle',
306
+ label: 'Link outside title to video',
307
+ checked: false
308
+ },
309
  {
310
  type: 'listbox',
311
  name: 'titletag',
340
  label: 'Hide annotations',
341
  checked: true
342
  },
 
 
 
 
 
 
343
  ]
344
  },
345
 
385
  if ( e.data.privacy ) shortcode += ' privacy=1';
386
  if ( e.data.random ) shortcode += ' random=1';
387
  if ( e.data.fetch ) shortcode += ' fetch=' + e.data.fetch.replace(/[^0-9.]/g, '') +'';
388
+ if ( e.data.skip ) shortcode += ' skip=' + e.data.skip.replace(/[^0-9.]/g, '') +'';
389
  if ( e.data.num ) shortcode += ' num=' + e.data.num.replace(/[^0-9.]/g, '') +'';
390
 
391
  // Video Settings
396
  if ( e.data.thumb_quality ) shortcode += ' thumb_quality=' + e.data.thumb_quality + '';
397
  // if ( e.data.cols ) shortcode += ' cols=' + e.data.cols + '';
398
  if ( e.data.no_thumb_title ) shortcode += ' no_thumb_title=1';
 
399
  if ( e.data.controls ) shortcode += ' controls=1';
400
  if ( e.data.autoplay ) shortcode += ' autoplay=1';
401
  if ( e.data.mute ) shortcode += ' mute=1';
406
 
407
  // Content Layout
408
  if ( e.data.showtitle ) shortcode += ' showtitle=' + e.data.showtitle + '';
409
+ if ( e.data.linktitle ) shortcode += ' linktitle=1';
410
  if ( e.data.titletag ) shortcode += ' titletag=' + e.data.titletag + '';
411
  if ( e.data.showdesc ) shortcode += ' showdesc=1';
412
  if ( e.data.desclen ) shortcode += ' desclen=' + e.data.desclen.replace(/[^0-9.]/g, '') + '';
413
  if ( e.data.noanno ) shortcode += ' noanno=1';
 
414
 
415
  // Link to Channel
416
  if ( e.data.link_to ) shortcode += ' link_to=' + e.data.link_to + '';
inc/tinymce/plugin.min.js CHANGED
@@ -1 +1 @@
1
- tinymce.PluginManager.add("youtube_channel",function(e,t){e.addButton("youtube_channel_shortcode",{tooltip:"YouTube Channel",icon:"ytc",onclick:function(){e.windowManager.open({title:"YouTube Channel",bodyType:"tabpanel",buttons:[{text:"Insert Shortcode",onclick:"submit",classes:"widget btn primary",minWidth:130},{text:"Cancel",onclick:"close"}],body:[{title:"General Settings",type:"form",items:[{type:"textbox",name:"class",label:"Custom CSS Class",value:"",tooltip:"Enter custom class for YTC block, if you wish to target block styling"},{type:"textbox",name:"vanity",label:"Vanity/Custom ID",value:""},{type:"textbox",name:"channel",label:"YouTube Channel ID",value:""},{type:"textbox",name:"legacy",label:"Legacy Username",value:""},{type:"textbox",name:"playlist",label:"Playlist ID",value:""},{type:"listbox",name:"resource",label:"Resource to use",tooltip:"",values:[{text:"Channel (User Uploads)",value:"0"},{text:"Favourited videos",value:"1"},{text:"Liked videos",value:"3"},{text:"Playlist",value:"2"}],value:"0"},{type:"listbox",name:"cache",label:"Cache feed",tooltip:"",values:[{text:"Do not cache",value:"0"},{text:"1 minute",value:"60"},{text:"5 minutes",value:"300"},{text:"15 minutes",value:"900"},{text:"30 minutes",value:"1800"},{text:"1 hour",value:"3600"},{text:"2 hours",value:"7200"},{text:"5 hours",value:"18000"},{text:"10 hours",value:"36000"},{text:"12 hours",value:"43200"},{text:"18 hours",value:"64800"},{text:"1 day",value:"86400"},{text:"2 days",value:"172800"},{text:"3 days",value:"259200"},{text:"4 days",value:"345600"},{text:"5 days",value:"432000"},{text:"6 days",value:"518400"},{text:"1 week",value:"604800"},{text:"2 weeks",value:"1209600"},{text:"3 weeks",value:"1814400"},{text:"1 month",value:"2419200"}],value:"300"},{type:"textbox",name:"fetch",label:"Fetch",value:"10",tooltip:"Number of videos that will be used for random pick (min 2, max 50, default 25)"},{type:"textbox",name:"num",label:"Show",value:"1",tooltip:"Number of videos to display"},{type:"checkbox",name:"privacy",label:"Use Enhanced Privacy",tooltip:"Enable this option to protect your visitors privacy",checked:!1},{type:"checkbox",name:"random",label:"Random video",tooltip:'Show random video from resource (Have no effect if "Embed as" has been set to "Embedded Playlist")',checked:!1}]},{title:"Video Settings",type:"form",items:[{type:"listbox",name:"ratio",label:"Aspect Ratio",values:[{text:"Widescreen (16:9)",value:"3"},{text:"Standard TV (4:3)",value:"1"}],value:"3"},{type:"checkbox",name:"responsive",label:"Responsive video",tooltip:"Make video responsive (distribute one full width video per row)",checked:!0},{type:"textbox",name:"width",label:"Initial width (px)",value:"306",tooltip:"Set initial width for video or thumbnail (in pixels)"},{type:"listbox",name:"display",label:"Embed as",tooltip:"",values:[{text:"Thumbnail",value:"thumbnail"},{text:"HTML5 (iframe)",value:"iframe"},{text:"HTML5 (iframe) Asynchronous",value:"iframe2"},{text:"Embedded Playlist",value:"playlist"}],value:"thumbnail"},{type:"listbox",name:"thumb_quality",label:"Thumbnail Quality",tooltip:"",values:[{text:"Default Quality (120x90px)",value:"default"},{text:"Medium Quality (320x180px)",value:"mqdefault"},{text:"High Quality (480x360px)",value:"hqdefault"},{text:"Standard Definition (640x480px)",value:"sddefault"},{text:"Maximum Resolution (1280x720px)",value:"maxresdefault"}],value:"hqdefault"},{type:"checkbox",name:"nolightbox",label:"Disable YTC lightbox",tooltip:"This will work only for Thumbnail",checked:!1},{type:"listbox",name:"target",label:"Open thumbnail anchor",tooltip:"If you select Thumbnail and enable Disable lightbox, you can open thumbnail anchor in new window/tab",values:[{text:"Default",value:""},{text:"New window/tab",value:"_blank"}]},{type:"checkbox",name:"no_thumb_title",label:"Hide thumbnail tooltip",checked:!1},{type:"checkbox",name:"themelight",label:"Use light theme",tooltip:"Default theme is dark",checked:!1},{type:"checkbox",name:"controls",label:"Hide player controls",checked:!1},{type:"checkbox",name:"autoplay",label:"Autoplay video/playlist",checked:!1},{type:"checkbox",name:"mute",label:"Mute video on autoplay",checked:!1},{type:"checkbox",name:"norel",label:"Hide related videos",checked:!0},{type:"checkbox",name:"nobrand",label:"Hide YT Logo",tooltip:"Does not work for all videos",checked:!0}]},{title:"Content Layout",type:"form",items:[{type:"listbox",name:"showtitle",label:"Show video title",tooltip:"",values:[{text:"Hide title",value:"none"},{text:"Above video/thumbnail",value:"above"},{text:"Below video/thumbnail",value:"below"},{text:"Inside thumbnail, top aligned",value:"inside"},{text:"Inside thumbnail, bottom aligned",value:"inside_b"}],value:"none"},{type:"listbox",name:"titletag",label:"Title HTML tag",tooltip:"Select which HTML tag to use for title wrapper.",values:[{text:"h3",value:"h3"},{text:"h4",value:"h4"},{text:"h5",value:"h5"},{text:"div",value:"div"},{text:"span",value:"span"},{text:"strong",value:"strong"}],value:"none"},{type:"checkbox",name:"showdesc",label:"Show video description",checked:!1},{type:"textbox",name:"desclen",label:"Description length",value:"0",tooltip:"Set number of characters to cut down video description to (0 means full length)"},{type:"checkbox",name:"noanno",label:"Hide annotations",checked:!0},{type:"checkbox",name:"noinfo",label:"Hide video info",checked:!0}]},{title:"Link to Channel",type:"form",items:[{type:"listbox",name:"link_to",label:"Link to",values:[{text:"Hide link",value:"none"},{text:"Vanity/Custom URL",value:"vanity"},{text:"Channel page URL",value:"channel"},{text:"Legacy username URL",value:"legacy"}],value:"none"},{type:"textbox",name:"goto_txt",label:"Title for link",value:"Visit our YouTube channel"}]}],onsubmit:function(t){var a="[youtube_channel";t.data.vanity&&(a+=" vanity="+t.data.vanity),t.data.channel&&(a+=" channel="+t.data.channel),t.data.legacy&&(a+=" legacy="+t.data.legacy),t.data.playlist&&(a+=" playlist="+t.data.playlist),t.data.resource&&(a+=" resource="+t.data.resource),t.data.cache&&(a+=" cache="+t.data.cache),t.data.privacy&&(a+=" privacy=1"),t.data.random&&(a+=" random=1"),t.data.fetch&&(a+=" fetch="+t.data.fetch.replace(/[^0-9.]/g,"")),t.data.num&&(a+=" num="+t.data.num.replace(/[^0-9.]/g,"")),t.data.ratio&&(a+=" ratio="+t.data.ratio),t.data.responsive&&(a+=" responsive=1"),t.data.width&&(a+=" width="+t.data.width.replace(/[^0-9.]/g,"")),t.data.display&&(a+=" display="+t.data.display),t.data.thumb_quality&&(a+=" thumb_quality="+t.data.thumb_quality),t.data.no_thumb_title&&(a+=" no_thumb_title=1"),t.data.themelight&&(a+=" themelight=1"),t.data.controls&&(a+=" controls=1"),t.data.autoplay&&(a+=" autoplay=1"),t.data.mute&&(a+=" mute=1"),t.data.norel&&(a+=" norel=1"),t.data.nobrand&&(a+=" nobrand=1"),t.data.nolightbox&&(a+=" nolightbox=1"),t.data.target&&(a+=" target="+t.data.target),t.data.showtitle&&(a+=" showtitle="+t.data.showtitle),t.data.titletag&&(a+=" titletag="+t.data.titletag),t.data.showdesc&&(a+=" showdesc=1"),t.data.desclen&&(a+=" desclen="+t.data.desclen.replace(/[^0-9.]/g,"")),t.data.noanno&&(a+=" noanno=1"),t.data.noinfo&&(a+=" noinfo=1"),t.data.link_to&&(a+=" link_to="+t.data.link_to),t.data.goto_txt&&(a+=' goto_txt="'+t.data.goto_txt+'"'),t.data.class&&(a+=" class="+t.data.class),a+="]",e.insertContent(a)}})}})});
1
+ tinymce.PluginManager.add("youtube_channel",function(e,t){e.addButton("youtube_channel_shortcode",{tooltip:"YouTube Channel",icon:"ytc",onclick:function(){e.windowManager.open({title:"YouTube Channel",bodyType:"tabpanel",buttons:[{text:"Insert Shortcode",onclick:"submit",classes:"widget btn primary",minWidth:130},{text:"Cancel",onclick:"close"}],body:[{title:"General Settings",type:"form",items:[{type:"textbox",name:"class",label:"Custom CSS Class",value:"",tooltip:"Enter custom class for YTC block, if you wish to target block styling"},{type:"textbox",name:"vanity",label:"Vanity/Custom ID",value:""},{type:"textbox",name:"channel",label:"YouTube Channel ID",value:""},{type:"textbox",name:"legacy",label:"Legacy Username",value:""},{type:"textbox",name:"playlist",label:"Playlist ID",value:""},{type:"listbox",name:"resource",label:"Resource to use",tooltip:"",values:[{text:"Channel (User Uploads)",value:"0"},{text:"Favourited videos",value:"1"},{text:"Liked videos",value:"3"},{text:"Playlist",value:"2"}],value:"0"},{type:"listbox",name:"cache",label:"Cache feed",tooltip:"",values:[{text:"Do not cache",value:"0"},{text:"1 minute",value:"60"},{text:"5 minutes",value:"300"},{text:"15 minutes",value:"900"},{text:"30 minutes",value:"1800"},{text:"1 hour",value:"3600"},{text:"2 hours",value:"7200"},{text:"5 hours",value:"18000"},{text:"10 hours",value:"36000"},{text:"12 hours",value:"43200"},{text:"18 hours",value:"64800"},{text:"1 day",value:"86400"},{text:"2 days",value:"172800"},{text:"3 days",value:"259200"},{text:"4 days",value:"345600"},{text:"5 days",value:"432000"},{text:"6 days",value:"518400"},{text:"1 week",value:"604800"},{text:"2 weeks",value:"1209600"},{text:"3 weeks",value:"1814400"},{text:"1 month",value:"2419200"}],value:"300"},{type:"textbox",name:"fetch",label:"Fetch",value:"10",tooltip:"Number of videos that will be used for random pick (min 2, max 50, default 25)"},{type:"textbox",name:"skip",label:"Skip",value:"0",tooltip:"Number of videos to skip (not applicable for embedded playlist and random pick (min 0, max 49, default 0)"},{type:"textbox",name:"num",label:"Show",value:"1",tooltip:"Number of videos to display"},{type:"checkbox",name:"privacy",label:"Use Enhanced Privacy",tooltip:"Enable this option to protect your visitors privacy",checked:!1},{type:"checkbox",name:"random",label:"Random video",tooltip:'Show random video from resource (Have no effect if "Embed as" has been set to "Embedded Playlist")',checked:!1}]},{title:"Video Settings",type:"form",items:[{type:"listbox",name:"ratio",label:"Aspect Ratio",values:[{text:"Widescreen (16:9)",value:"3"},{text:"Standard TV (4:3)",value:"1"}],value:"3"},{type:"checkbox",name:"responsive",label:"Responsive video",tooltip:"Make video responsive (distribute one full width video per row)",checked:!0},{type:"textbox",name:"width",label:"Initial width (px)",value:"306",tooltip:"Set initial width for video or thumbnail (in pixels)"},{type:"listbox",name:"display",label:"Embed as",tooltip:"",values:[{text:"Thumbnail",value:"thumbnail"},{text:"HTML5 (iframe)",value:"iframe"},{text:"HTML5 (iframe) Asynchronous",value:"iframe2"},{text:"Embedded Playlist",value:"playlist"}],value:"thumbnail"},{type:"listbox",name:"thumb_quality",label:"Thumbnail Quality",tooltip:"",values:[{text:"Default Quality (120x90px)",value:"default"},{text:"Medium Quality (320x180px)",value:"mqdefault"},{text:"High Quality (480x360px)",value:"hqdefault"},{text:"Standard Definition (640x480px)",value:"sddefault"},{text:"Maximum Resolution (1280x720px)",value:"maxresdefault"}],value:"hqdefault"},{type:"checkbox",name:"nolightbox",label:"Disable YTC lightbox",tooltip:"This will work only for Thumbnail",checked:!1},{type:"listbox",name:"target",label:"Open thumbnail anchor",tooltip:"If you select Thumbnail and enable Disable lightbox, you can open thumbnail anchor in new window/tab",values:[{text:"Default",value:""},{text:"New window/tab",value:"_blank"}]},{type:"checkbox",name:"no_thumb_title",label:"Hide thumbnail tooltip",checked:!1},{type:"checkbox",name:"controls",label:"Hide player controls",checked:!1},{type:"checkbox",name:"autoplay",label:"Autoplay video/playlist",checked:!1},{type:"checkbox",name:"mute",label:"Mute video on autoplay",checked:!1},{type:"checkbox",name:"norel",label:"Hide related videos",checked:!0},{type:"checkbox",name:"nobrand",label:"Hide YT Logo",tooltip:"Does not work for all videos",checked:!0}]},{title:"Content Layout",type:"form",items:[{type:"listbox",name:"showtitle",label:"Show video title",tooltip:"",values:[{text:"Hide title",value:"none"},{text:"Above video/thumbnail",value:"above"},{text:"Below video/thumbnail",value:"below"},{text:"Inside thumbnail, top aligned",value:"inside"},{text:"Inside thumbnail, bottom aligned",value:"inside_b"}],value:"none"},{type:"checkbox",name:"linktitle",label:"Link outside title to video",checked:!1},{type:"listbox",name:"titletag",label:"Title HTML tag",tooltip:"Select which HTML tag to use for title wrapper.",values:[{text:"h3",value:"h3"},{text:"h4",value:"h4"},{text:"h5",value:"h5"},{text:"div",value:"div"},{text:"span",value:"span"},{text:"strong",value:"strong"}],value:"none"},{type:"checkbox",name:"showdesc",label:"Show video description",checked:!1},{type:"textbox",name:"desclen",label:"Description length",value:"0",tooltip:"Set number of characters to cut down video description to (0 means full length)"},{type:"checkbox",name:"noanno",label:"Hide annotations",checked:!0}]},{title:"Link to Channel",type:"form",items:[{type:"listbox",name:"link_to",label:"Link to",values:[{text:"Hide link",value:"none"},{text:"Vanity/Custom URL",value:"vanity"},{text:"Channel page URL",value:"channel"},{text:"Legacy username URL",value:"legacy"}],value:"none"},{type:"textbox",name:"goto_txt",label:"Title for link",value:"Visit our YouTube channel"}]}],onsubmit:function(t){var a="[youtube_channel";t.data.vanity&&(a+=" vanity="+t.data.vanity),t.data.channel&&(a+=" channel="+t.data.channel),t.data.legacy&&(a+=" legacy="+t.data.legacy),t.data.playlist&&(a+=" playlist="+t.data.playlist),t.data.resource&&(a+=" resource="+t.data.resource),t.data.cache&&(a+=" cache="+t.data.cache),t.data.privacy&&(a+=" privacy=1"),t.data.random&&(a+=" random=1"),t.data.fetch&&(a+=" fetch="+t.data.fetch.replace(/[^0-9.]/g,"")),t.data.skip&&(a+=" skip="+t.data.skip.replace(/[^0-9.]/g,"")),t.data.num&&(a+=" num="+t.data.num.replace(/[^0-9.]/g,"")),t.data.ratio&&(a+=" ratio="+t.data.ratio),t.data.responsive&&(a+=" responsive=1"),t.data.width&&(a+=" width="+t.data.width.replace(/[^0-9.]/g,"")),t.data.display&&(a+=" display="+t.data.display),t.data.thumb_quality&&(a+=" thumb_quality="+t.data.thumb_quality),t.data.no_thumb_title&&(a+=" no_thumb_title=1"),t.data.controls&&(a+=" controls=1"),t.data.autoplay&&(a+=" autoplay=1"),t.data.mute&&(a+=" mute=1"),t.data.norel&&(a+=" norel=1"),t.data.nobrand&&(a+=" nobrand=1"),t.data.nolightbox&&(a+=" nolightbox=1"),t.data.target&&(a+=" target="+t.data.target),t.data.showtitle&&(a+=" showtitle="+t.data.showtitle),t.data.linktitle&&(a+=" linktitle=1"),t.data.titletag&&(a+=" titletag="+t.data.titletag),t.data.showdesc&&(a+=" showdesc=1"),t.data.desclen&&(a+=" desclen="+t.data.desclen.replace(/[^0-9.]/g,"")),t.data.noanno&&(a+=" noanno=1"),t.data.link_to&&(a+=" link_to="+t.data.link_to),t.data.goto_txt&&(a+=' goto_txt="'+t.data.goto_txt+'"'),t.data.class&&(a+=" class="+t.data.class),a+="]",e.insertContent(a)}})}})});
inc/widget.php CHANGED
@@ -14,7 +14,7 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
14
  // Initialize Widget
15
  parent::__construct(
16
  $wpau_youtube_channel->plugin_slug,
17
- __( 'YouTube Channel' , 'youtube-channel' ),
18
  array(
19
  'description' => __(
20
  'Serve YouTube videos from channel or playlist right to widget area',
@@ -65,6 +65,7 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
65
 
66
  $fetch = ! empty( $instance['fetch'] ) ? intval( $instance['fetch'] ) : intval( $defaults['fetch'] ); // items to fetch
67
  $num = ! empty( $instance['num'] ) ? intval( $instance['num'] ) : intval( $defaults['num'] ); // number of items to show
 
68
 
69
  $privacy = ! empty( $instance['privacy'] ) ? esc_attr( $instance['privacy'] ) : 0;
70
  $random = ! empty( $instance['random'] ) ? esc_attr( $instance['random'] ) : 0;
@@ -78,7 +79,6 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
78
  $thumb_quality = ! empty( $instance['thumb_quality'] ) ? esc_attr( $instance['thumb_quality'] ) : trim( $defaults['thumb_quality'] );
79
  $no_thumb_title = ! empty( $instance['no_thumb_title'] ) ? esc_attr( $instance['no_thumb_title'] ) : 0;
80
 
81
- $themelight = ! empty( $instance['themelight'] ) ? esc_attr( $instance['themelight'] ) : '';
82
  $controls = ! empty( $instance['controls'] ) ? esc_attr( $instance['controls'] ) : '';
83
  $autoplay = ! empty( $instance['autoplay'] ) ? esc_attr( $instance['autoplay'] ) : '';
84
  $autoplay_mute = ! empty( $instance['autoplay_mute'] ) ? esc_attr( $instance['autoplay_mute'] ) : '';
@@ -86,13 +86,13 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
86
 
87
  // Content Layout
88
  $showtitle = ! empty( $instance['showtitle'] ) ? esc_attr( $instance['showtitle'] ) : 'none';
 
89
  $titletag = ! empty( $instance['titletag'] ) ? strtolower( esc_attr( $instance['titletag'] ) ) : 'h3';
90
  $showdesc = ! empty( $instance['showdesc'] ) ? esc_attr( $instance['showdesc'] ) : '';
91
  $modestbranding = ! empty( $instance['modestbranding'] ) ? esc_attr( $instance['modestbranding'] ) : '';
92
  $desclen = ! empty( $instance['desclen'] ) ? esc_attr( $instance['desclen'] ) : 0;
93
 
94
  $hideanno = ! empty( $instance['hideanno'] ) ? esc_attr( $instance['hideanno'] ) : '';
95
- $hideinfo = ! empty( $instance['hideinfo'] ) ? esc_attr( $instance['hideinfo'] ) : '';
96
 
97
  // Link to Channel
98
  $link_to = ! empty( $instance['link_to'] ) ? esc_attr( $instance['link_to'] ) : 'none';
@@ -118,7 +118,7 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
118
  'Get your %1$s and %2$s from <a href="%3$s" target="_blank">here</a>.',
119
  'youtube-channel'
120
  ),
121
- array( 'a' => array( 'href' => array() ) )
122
  ),
123
  __( 'Channel ID', 'youtube-channel' ),
124
  __( 'Custom ID', 'youtube-channel' ),
@@ -127,37 +127,43 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
127
  ?>
128
  </p>
129
  <p class="half left glue-top">
130
- <label for="<?php echo $this->get_field_id( 'vanity' ); ?>"><?php _e( 'Vanity/Custom ID', 'youtube-channel' ); ?>
131
- <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'vanity' ); ?>" name="<?php echo $this->get_field_name( 'vanity' ); ?>" value="<?php echo $vanity; ?>" title="<?php _e( 'YouTube Vanity/Custom ID from URL (part after /c/)', 'youtube-channel' ); ?>" />
 
132
  </label>
133
  </p>
134
  <p class="half right glue-top">
135
- <label for="<?php echo $this->get_field_id( 'channel' ); ?>"><?php _e( 'Channel ID', 'youtube-channel' ); ?>
136
- <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'channel' ); ?>" name="<?php echo $this->get_field_name( 'channel' ); ?>" value="<?php echo $channel; ?>" title="<?php _e( 'Find Channel ID behind My Channel menu item in YouTube (ID have UC at the beginning)', 'youtube-channel' ); ?>" />
 
137
  </label>
138
  </p>
139
  <p class="half left glue-top">
140
- <label for="<?php echo $this->get_field_id( 'username' ); ?>"><?php _e( 'Legacy Username', 'youtube-channel' ); ?>
141
- <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'username' ); ?>" name="<?php echo $this->get_field_name( 'username' ); ?>" value="<?php echo $username; ?>" title="<?php _e( 'Legacy YouTube username located behind /user/ part of channel URL (available only on old YouTube accounts)', 'youtube-channel' ); ?>" />
 
142
  </label>
143
  </p>
144
  <p class="half right glue-top">
145
- <label for="<?php echo $this->get_field_id( 'playlist' ); ?>"><?php _e( 'Playlist ID', 'youtube-channel' ); ?>
146
- <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'playlist' ); ?>" name="<?php echo $this->get_field_name( 'playlist' ); ?>" value="<?php echo $playlist; ?>" title="<?php _e( 'Find Playlist ID in your playlists (ID have PL at the beginning)', 'youtube-channel' ); ?>" />
 
147
  </label>
148
  </p>
149
  <p class="half left glue-top">
150
- <label for="<?php echo $this->get_field_id( 'resource' ); ?>"><?php _e( 'Resource to use', 'youtube-channel' ); ?>
151
- <select class="widefat" id="<?php echo $this->get_field_id( 'resource' ); ?>" name="<?php echo $this->get_field_name( 'resource' ); ?>">
 
152
  <option value="0"<?php selected( $resource, 0 ); ?>><?php _e( 'Channel (User Uploads)', 'youtube-channel' ); ?></option>
153
- <option value="1"<?php selected( $resource, 1 ); ?>><?php _e( 'Favourites', 'youtube-channel' ); ?></option>
154
- <option value="3"<?php selected( $resource, 3 ); ?>><?php _e( 'Liked Videos', 'youtube-channel' ); ?></option>
155
- <option value="2"<?php selected( $resource, 2 ); ?>><?php _e( 'Playlist', 'youtube-channel' ); ?></option>
156
- </select>
157
  </label>
158
  </p>
159
  <p class="half right glue-top">
160
- <label for="<?php echo $this->get_field_id( 'cache' ); ?>"><?php _e( 'Cache feed', 'youtube-channel' ); ?>
 
161
  <select class="widefat" id="<?php echo $this->get_field_id( 'cache' ); ?>" name="<?php echo $this->get_field_name( 'cache' ); ?>">
162
  <option value="0"<?php selected( $cache, 0 ); ?>><?php _e( 'Do not cache', 'youtube-channel' ); ?></option>
163
  <?php echo $wpau_youtube_channel->cache_time( $cache ); ?>
@@ -165,118 +171,198 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
165
  </label>
166
  </p>
167
  <p class="half left glue-top">
168
- <label for="<?php echo $this->get_field_id( 'fetch' ); ?>"><?php _e( 'Fetch', 'youtube-channel' ); ?> <input class="small-text" id="<?php echo $this->get_field_id( 'fetch' ); ?>" name="<?php echo $this->get_field_name( 'fetch' ); ?>" type="number" min="2" value="<?php echo $fetch; ?>" title="<?php _e( 'Number of videos that will be used for random pick (min 2, max 50, default 25)', 'youtube-channel' ); ?>" /> <?php _e( 'video(s)', 'youtube-channel' ); ?></label>
 
 
 
 
169
  </p>
170
  <p class="half right glue-top">
171
- <label for="<?php echo $this->get_field_id( 'num' ); ?>"><?php _e( 'Show', 'youtube-channel' ); ?></label> <input class="small-text" id="<?php echo $this->get_field_id( 'num' ); ?>" name="<?php echo $this->get_field_name( 'num' ); ?>" type="number" min="1" value="<?php echo ( $num ) ? $num : '1'; ?>" title="<?php _e( 'Number of videos to display', 'youtube-channel' ); ?>" /> <?php _e( 'video(s)', 'youtube-channel' ); ?>
 
 
 
 
 
 
 
 
 
 
 
172
  </p>
173
  <p>
174
- <input class="checkbox" type="checkbox" <?php checked( (bool) $privacy, true ); ?> id="<?php echo $this->get_field_id( 'privacy' ); ?>" name="<?php echo $this->get_field_name( 'privacy' ); ?>" title="<?php _e( 'Enable this option to protect your visitors privacy', 'youtube-channel' ); ?>" /> <label for="<?php echo $this->get_field_id( 'privacy' ); ?>"><?php printf( __( 'Enable <a href="%s" target="_blank">privacy-enhanced mode</a>', 'youtube-channel' ), 'https://support.google.com/youtube/bin/answer.py?hl=en-GB&answer=171780' ); ?></label>
 
 
 
175
  <br />
176
- <input class="checkbox" type="checkbox" <?php checked( (bool) $random, true ); ?> id="<?php echo $this->get_field_id( 'random' ); ?>" name="<?php echo $this->get_field_name( 'random' ); ?>" title="<?php _e( 'Get random videos of all fetched from channel or playlist', 'youtube-channel' ); ?>" /> <label for="<?php echo $this->get_field_id( 'random' ); ?>"><?php _e( 'Show random video from resource <small>(Have no effect if "What to show?" has been set to "Embedded Playlist")</small>', 'youtube-channel' ); ?></label>
 
 
 
 
 
177
  </p>
178
 
179
  <h4><?php _e( 'Video Settings', 'youtube-channel' ); ?></h4>
180
- <p><label for="<?php echo $this->get_field_id( 'ratio' ); ?>"><?php _e( 'Aspect ratio', 'youtube-channel' ); ?></label>
181
- <select class="widefat" id="<?php echo $this->get_field_id( 'ratio' ); ?>" name="<?php echo $this->get_field_name( 'ratio' ); ?>">
182
- <option value="3"<?php selected( $ratio, 3 ); ?>>16:9</option>
183
- <option value="1"<?php selected( $ratio, 1 ); ?>>4:3</option>
184
- </select><br />
185
- <input class="checkbox" type="checkbox" <?php checked( (bool) $responsive, true ); ?> id="<?php echo $this->get_field_id( 'responsive' ); ?>" name="<?php echo $this->get_field_name( 'responsive' ); ?>" /> <label for="<?php echo $this->get_field_id( 'responsive' ); ?>"><?php _e( 'Responsive video <small>(distribute one full width item per row)</small>', 'youtube-channel' ); ?></label>
 
 
 
 
 
 
 
186
  </p>
187
  <p>
188
- <label for="<?php echo $this->get_field_id( 'width' ); ?>"><?php _e( 'Initial width', 'youtube-channel' ); ?></label> <input class="small-text" id="<?php echo $this->get_field_id( 'width' ); ?>" name="<?php echo $this->get_field_name( 'width' ); ?>" type="number" min="32" value="<?php echo $width; ?>" title="<?php _e( 'Set video width in pixels', 'youtube-channel' ); ?>" /> px (<?php _e( 'default', 'youtube-channel' ); ?> 306)
 
 
 
 
189
  </p>
190
  <p>
191
  <label for="<?php echo $this->get_field_id( 'display' ); ?>">
192
  <?php _e( 'What to display?', 'youtube-channel' ); ?>
 
 
 
 
 
 
193
  </label>
194
- <select class="widefat" id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>">
195
- <option value="thumbnail"<?php selected( $display, 'thumbnail' ); ?>><?php _e( 'Thumbnail', 'youtube-channel' ); ?></option>
196
- <option value="iframe"<?php selected( $display, 'iframe' ); ?>><?php _e( 'HTML5 (iframe)', 'youtube-channel' ); ?></option>
197
- <option value="iframe2"<?php selected( $display, 'iframe2' ); ?>><?php _e( 'HTML5 (iframe) Asynchronous', 'youtube-channel' ); ?></option>
198
- <option value="playlist"<?php selected( $display, 'playlist' ); ?>><?php _e( 'Embedded Playlist', 'youtube-channel' ); ?></option>
199
- </select>
200
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  <label for="<?php echo $this->get_field_id( 'thumb_quality' ); ?>">
202
  <?php _e( 'Thumbnail Quality', 'youtube-channel' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  </label>
204
- <select class="widefat" id="<?php echo $this->get_field_id( 'thumb_quality' ); ?>" name="<?php echo $this->get_field_name( 'thumb_quality' ); ?>">
205
- <option value="default"<?php selected( $thumb_quality, 'default' ); ?>><?php _e( 'Default Quality (120x90px)', 'youtube-channel' ); ?></option>
206
- <option value="mqdefault"<?php selected( $thumb_quality, 'mqdefault' ); ?>><?php _e( 'Medium Quality (320x180px)', 'youtube-channel' ); ?></option>
207
- <option value="hqdefault"<?php selected( $thumb_quality, 'hqdefault' ); ?>><?php _e( 'High Quality (480x360px)', 'youtube-channel' ); ?></option>
208
- <option value="sddefault"<?php selected( $thumb_quality, 'sddefault' ); ?>><?php _e( 'Standard Definition (640x480px)', 'youtube-channel' ); ?></option>
209
- <option value="maxresdefault"<?php selected( $thumb_quality, 'maxresdefault' ); ?>><?php _e( 'Maximum Resolution (1280x720px)', 'youtube-channel' ); ?></option>
210
- </select>
211
-
212
-
213
- <input class="checkbox" type="checkbox" <?php checked( (bool) $no_thumb_title, true ); ?> id="<?php echo $this->get_field_id( 'no_thumb_title' ); ?>" name="<?php echo $this->get_field_name( 'no_thumb_title' ); ?>" /> <label for="<?php echo $this->get_field_id( 'no_thumb_title' ); ?>"><?php _e( 'Hide thumbnail tooltip', 'youtube-channel' ); ?></label><br />
214
- <input class="checkbox" type="checkbox" <?php checked( (bool) $themelight, true ); ?> id="<?php echo $this->get_field_id( 'themelight' ); ?>" name="<?php echo $this->get_field_name( 'themelight' ); ?>" /> <label for="<?php echo $this->get_field_id( 'themelight' ); ?>"><?php _e( 'Use light theme (default is dark)', 'youtube-channel' ); ?></label><br />
215
- <input class="checkbox" type="checkbox" <?php checked( (bool) $controls, true ); ?> id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" /> <label for="<?php echo $this->get_field_id( 'controls' ); ?>"><?php _e( 'Hide player controls', 'youtube-channel' ); ?></label><br />
216
- <input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay, true ); ?> id="<?php echo $this->get_field_id( 'autoplay' ); ?>" name="<?php echo $this->get_field_name( 'autoplay' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay' ); ?>"><?php _e( 'Autoplay video or playlist', 'youtube-channel' ); ?></label><br />
217
- <input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay_mute, true ); ?> id="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>" name="<?php echo $this->get_field_name( 'autoplay_mute' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>"><?php _e( 'Mute video on autoplay', 'youtube-channel' ); ?></label><br />
218
- <input class="checkbox" type="checkbox" <?php checked( (bool) $norel, true ); ?> id="<?php echo $this->get_field_id( 'norel' ); ?>" name="<?php echo $this->get_field_name( 'norel' ); ?>" /> <label for="<?php echo $this->get_field_id( 'norel' ); ?>"><?php _e( 'Hide related videos', 'youtube-channel' ); ?></label><br />
219
- <input class="checkbox" type="checkbox" <?php checked( (bool) $modestbranding, true ); ?> id="<?php echo $this->get_field_id( 'modestbranding' ); ?>" name="<?php echo $this->get_field_name( 'modestbranding' ); ?>" /> <label for="<?php echo $this->get_field_id( 'modestbranding' ); ?>"><?php _e( 'Hide YT Logo (does not work for all videos)', 'youtube-channel' ); ?></label><br />
220
  </p>
221
 
222
  <h4><?php _e( 'Content Layout', 'youtube-channel' ); ?></h4>
223
  <p>
224
  <label for="<?php echo $this->get_field_id( 'showtitle' ); ?>">
225
  <?php _e( 'Show video title', 'youtube-channel' ); ?>
 
 
 
 
 
 
 
226
  </label>
227
- <select class="widefat" id="<?php echo $this->get_field_id( 'showtitle' ); ?>" name="<?php echo $this->get_field_name( 'showtitle' ); ?>">
228
- <option value="none"<?php selected( $showtitle, 'none' ); ?>><?php _e( 'Hide title', 'youtube-channel' ); ?></option>
229
- <option value="above"<?php selected( $showtitle, 'above' ); ?>><?php _e( 'Above video/thumbnail', 'youtube-channel' ); ?></option>
230
- <option value="below"<?php selected( $showtitle, 'below' ); ?>><?php _e( 'Below video/thumbnail', 'youtube-channel' ); ?></option>
231
- <option value="inside"<?php selected( $showtitle, 'inside' ); ?>><?php _e( 'Inside thumbnail, top aligned', 'youtube-channel' ); ?></option>
232
- <option value="inside_b"<?php selected( $showtitle, 'inside_b' ); ?>><?php _e( 'Inside thumbnail, bototm aligned', 'youtube-channel' ); ?></option>
233
- </select><br />
234
  <label for="<?php echo $this->get_field_id( 'titletag' ); ?>">
235
  <?php _e( 'Title HTML tag', 'youtube-channel' ); ?>
 
 
 
 
 
 
 
 
 
 
 
236
  </label>
237
- <select class="widefat" id="<?php echo $this->get_field_id( 'titletag' ); ?>" name="<?php echo $this->get_field_name( 'titletag' ); ?>">
238
- <?php
239
- foreach ( array( 'h3', 'h4', 'h5', 'div', 'span', 'strong' ) as $tag ) {
240
- printf(
241
- '<option value="%1$s" %2$s>%1$s</option>',
242
- $tag,
243
- selected( $titletag, $tag )
244
- );
245
- }
246
- ?>
247
- </select><br />
248
- <label for="<?php echo $this->get_field_id( 'showdesc' ); ?>">
249
- <input class="checkbox" type="checkbox" <?php checked( (bool) $showdesc, true ); ?> id="<?php echo $this->get_field_id( 'showdesc' ); ?>" name="<?php echo $this->get_field_name( 'showdesc' ); ?>" /> <?php _e( 'Show video description', 'youtube-channel' ); ?>
250
- </label><br />
251
- <label for="<?php echo $this->get_field_id( 'desclen' ); ?>"><?php _e( 'Description length', 'youtube-channel' ); ?>
252
- <input class="small-text" id="<?php echo $this->get_field_id( 'desclen' ); ?>" name="<?php echo $this->get_field_name( 'desclen' ); ?>" type="number" value="<?php echo $desclen; ?>" title="<?php _e( 'Set number of characters to cut down video description to (0 means full length)', 'youtube-channel' );?>" /> (0 = full)
253
- </label><br />
254
  <label for="<?php echo $this->get_field_id( 'hideanno' ); ?>">
255
- <input class="checkbox" type="checkbox" <?php checked( (bool) $hideanno, true ); ?> id="<?php echo $this->get_field_id( 'hideanno' ); ?>" name="<?php echo $this->get_field_name( 'hideanno' ); ?>" /> <?php _e( 'Hide annotations from video', 'youtube-channel' ); ?>
256
- </label><br />
257
- <label for="<?php echo $this->get_field_id( 'hideinfo' ); ?>" title="<?php _e( 'Enabling this option causes the player to not display information like the video title and uploader before the video starts playing.' ); ?>">
258
- <input class="checkbox" type="checkbox" <?php checked( (bool) $hideinfo, true ); ?> id="<?php echo $this->get_field_id( 'hideinfo' ); ?>" name="<?php echo $this->get_field_name( 'hideinfo' ); ?>" /> <?php _e( 'Hide video info', 'youtube-channel' ); ?>
 
 
 
 
 
 
 
 
 
 
259
  </label>
260
  </p>
261
 
262
  <h4><?php _e( 'Link to Channel', 'youtube-channel' ); ?></h4>
263
  <p class="glue-top">
264
- <input class="widefat" id="<?php echo $this->get_field_id( 'goto_txt' ); ?>" name="<?php echo $this->get_field_name( 'goto_txt' ); ?>" type="text" value="<?php echo $goto_txt; ?>" title="<?php sprintf( __( 'Default: Visit our YouTube channel. You can use placeholders %1$s, %2$s and %3$s.', 'youtube-channel' ), '%vanity%', '%channel%', '%username%' ); ?>" placeholder="<?php _e( 'Visit our YouTube channel', 'youtube-channel' ); ?>" />
 
 
 
265
  </p>
266
  <p class="half left glue-top">
267
- <select class="widefat" id="<?php echo $this->get_field_id( 'link_to' ); ?>" name="<?php echo $this->get_field_name( 'link_to' ); ?>">
268
- <option value="none"<?php selected( $link_to, 'none' ); ?>><?php _e( 'Hide link', 'youtube-channel' ); ?></option>
269
- <option value="vanity"<?php selected( $link_to, 'vanity' ); ?>><?php _e( 'Link to Vanity customized URL', 'youtube-channel' ); ?></option>
270
- <option value="channel"<?php selected( $link_to, 'channel' ); ?>><?php _e( 'Link to Channel page URL', 'youtube-channel' ); ?></option>
271
- <option value="legacy"<?php selected( $link_to, 'legacy' ); ?>><?php _e( 'Link to Legacy username page', 'youtube-channel' ); ?></option>
272
- </select>
 
 
 
273
  </p>
274
  <p class="half right glue-top">
275
- <select class="widefat" id="<?php echo $this->get_field_id( 'popup_goto' ); ?>" name="<?php echo $this->get_field_name( 'popup_goto' ); ?>">
276
- <option value="0"<?php selected( $popup_goto, 0 ); ?>><?php _e( 'Open link in same window', 'youtube-channel' ); ?></option>
277
- <option value="1"<?php selected( $popup_goto, 1 ); ?>><?php _e( 'Open link in new window (JavaScript)', 'youtube-channel' ); ?></option>
278
- <option value="2"<?php selected( $popup_goto, 2 ); ?>><?php _e( 'Open link in new window (target="blank")', 'youtube-channel' ); ?></option>
279
- </select>
 
 
 
280
  </p>
281
 
282
  <h4><?php _e( 'Does not work?', 'youtube-channel' ); ?></h4>
@@ -296,10 +382,10 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
296
  "?ytc_debug_json_for={$this->number}",
297
  'https://wordpress.org/support/plugin/youtube-channel',
298
  'https://wordpress.org/support/topic/ytc3-read-before-you-post-support-question-or-report-bug'
299
- ); ?>
 
300
  </small>
301
  </p>
302
-
303
  <?php
304
  } // END public function form()
305
 
@@ -314,6 +400,7 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
314
  $instance['playlist'] = strip_tags( $new_instance['playlist'] );
315
  $instance['vanity'] = strip_tags( $new_instance['vanity'] );
316
  $instance['num'] = $new_instance['num'];
 
317
  $instance['resource'] = $new_instance['resource'];
318
  $instance['cache'] = $new_instance['cache'];
319
  $instance['random'] = isset( $new_instance['random'] ) ? $new_instance['random'] : false;
@@ -324,6 +411,7 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
324
  $instance['link_to'] = $new_instance['link_to'];
325
 
326
  $instance['showtitle'] = isset( $new_instance['showtitle'] ) ? $new_instance['showtitle'] : 'none';
 
327
  $instance['titletag'] = isset( $new_instance['titletag'] ) ? $new_instance['titletag'] : 'h3';
328
  $instance['showdesc'] = isset( $new_instance['showdesc'] ) ? $new_instance['showdesc'] : false;
329
  $instance['desclen'] = strip_tags( $new_instance['desclen'] );
@@ -340,9 +428,7 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
340
 
341
  $instance['ratio'] = strip_tags( $new_instance['ratio'] );
342
  $instance['controls'] = isset( $new_instance['controls'] ) ? $new_instance['controls'] : false;
343
- $instance['hideinfo'] = isset( $new_instance['hideinfo'] ) ? $new_instance['hideinfo'] : '';
344
  $instance['hideanno'] = isset( $new_instance['hideanno'] ) ? $new_instance['hideanno'] : '';
345
- $instance['themelight'] = isset( $new_instance['themelight'] ) ? $new_instance['themelight'] : '';
346
  $instance['privacy'] = isset( $new_instance['privacy'] ) ? $new_instance['privacy'] : '';
347
 
348
  return $instance;
14
  // Initialize Widget
15
  parent::__construct(
16
  $wpau_youtube_channel->plugin_slug,
17
+ __( 'YouTube Channel', 'youtube-channel' ),
18
  array(
19
  'description' => __(
20
  'Serve YouTube videos from channel or playlist right to widget area',
65
 
66
  $fetch = ! empty( $instance['fetch'] ) ? intval( $instance['fetch'] ) : intval( $defaults['fetch'] ); // items to fetch
67
  $num = ! empty( $instance['num'] ) ? intval( $instance['num'] ) : intval( $defaults['num'] ); // number of items to show
68
+ $skip = isset( $instance['skip'] ) ? intval( $instance['skip'] ) : 0; // number of items to skip
69
 
70
  $privacy = ! empty( $instance['privacy'] ) ? esc_attr( $instance['privacy'] ) : 0;
71
  $random = ! empty( $instance['random'] ) ? esc_attr( $instance['random'] ) : 0;
79
  $thumb_quality = ! empty( $instance['thumb_quality'] ) ? esc_attr( $instance['thumb_quality'] ) : trim( $defaults['thumb_quality'] );
80
  $no_thumb_title = ! empty( $instance['no_thumb_title'] ) ? esc_attr( $instance['no_thumb_title'] ) : 0;
81
 
 
82
  $controls = ! empty( $instance['controls'] ) ? esc_attr( $instance['controls'] ) : '';
83
  $autoplay = ! empty( $instance['autoplay'] ) ? esc_attr( $instance['autoplay'] ) : '';
84
  $autoplay_mute = ! empty( $instance['autoplay_mute'] ) ? esc_attr( $instance['autoplay_mute'] ) : '';
86
 
87
  // Content Layout
88
  $showtitle = ! empty( $instance['showtitle'] ) ? esc_attr( $instance['showtitle'] ) : 'none';
89
+ $linktitle = ! empty( $instance['linktitle'] ) ? esc_attr( $instance['linktitle'] ) : 0;
90
  $titletag = ! empty( $instance['titletag'] ) ? strtolower( esc_attr( $instance['titletag'] ) ) : 'h3';
91
  $showdesc = ! empty( $instance['showdesc'] ) ? esc_attr( $instance['showdesc'] ) : '';
92
  $modestbranding = ! empty( $instance['modestbranding'] ) ? esc_attr( $instance['modestbranding'] ) : '';
93
  $desclen = ! empty( $instance['desclen'] ) ? esc_attr( $instance['desclen'] ) : 0;
94
 
95
  $hideanno = ! empty( $instance['hideanno'] ) ? esc_attr( $instance['hideanno'] ) : '';
 
96
 
97
  // Link to Channel
98
  $link_to = ! empty( $instance['link_to'] ) ? esc_attr( $instance['link_to'] ) : 'none';
118
  'Get your %1$s and %2$s from <a href="%3$s" target="_blank">here</a>.',
119
  'youtube-channel'
120
  ),
121
+ array( 'a' => array( 'href' => array(), 'target' => [] ) )
122
  ),
123
  __( 'Channel ID', 'youtube-channel' ),
124
  __( 'Custom ID', 'youtube-channel' ),
127
  ?>
128
  </p>
129
  <p class="half left glue-top">
130
+ <label for="<?php echo $this->get_field_id( 'vanity' ); ?>">
131
+ <?php _e( 'Vanity/Custom ID', 'youtube-channel' ); ?>
132
+ <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'vanity' ); ?>" name="<?php echo $this->get_field_name( 'vanity' ); ?>" value="<?php echo $vanity; ?>" title="<?php _e( 'YouTube Vanity/Custom ID from URL (part after /c/)', 'youtube-channel' ); ?>" />
133
  </label>
134
  </p>
135
  <p class="half right glue-top">
136
+ <label for="<?php echo $this->get_field_id( 'channel' ); ?>">
137
+ <?php _e( 'Channel ID', 'youtube-channel' ); ?>
138
+ <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'channel' ); ?>" name="<?php echo $this->get_field_name( 'channel' ); ?>" value="<?php echo $channel; ?>" title="<?php _e( 'Find Channel ID behind My Channel menu item in YouTube (ID have UC at the beginning)', 'youtube-channel' ); ?>" />
139
  </label>
140
  </p>
141
  <p class="half left glue-top">
142
+ <label for="<?php echo $this->get_field_id( 'username' ); ?>">
143
+ <?php _e( 'Legacy Username', 'youtube-channel' ); ?>
144
+ <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'username' ); ?>" name="<?php echo $this->get_field_name( 'username' ); ?>" value="<?php echo $username; ?>" title="<?php _e( 'Legacy YouTube username located behind /user/ part of channel URL (available only on old YouTube accounts)', 'youtube-channel' ); ?>" />
145
  </label>
146
  </p>
147
  <p class="half right glue-top">
148
+ <label for="<?php echo $this->get_field_id( 'playlist' ); ?>">
149
+ <?php _e( 'Playlist ID', 'youtube-channel' ); ?>
150
+ <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'playlist' ); ?>" name="<?php echo $this->get_field_name( 'playlist' ); ?>" value="<?php echo $playlist; ?>" title="<?php _e( 'Find Playlist ID in your playlists (ID have PL at the beginning)', 'youtube-channel' ); ?>" />
151
  </label>
152
  </p>
153
  <p class="half left glue-top">
154
+ <label for="<?php echo $this->get_field_id( 'resource' ); ?>">
155
+ <?php _e( 'Resource to use', 'youtube-channel' ); ?>
156
+ <select class="widefat" id="<?php echo $this->get_field_id( 'resource' ); ?>" name="<?php echo $this->get_field_name( 'resource' ); ?>">
157
  <option value="0"<?php selected( $resource, 0 ); ?>><?php _e( 'Channel (User Uploads)', 'youtube-channel' ); ?></option>
158
+ <option value="1"<?php selected( $resource, 1 ); ?>><?php _e( 'Favourites', 'youtube-channel' ); ?></option>
159
+ <option value="3"<?php selected( $resource, 3 ); ?>><?php _e( 'Liked Videos', 'youtube-channel' ); ?></option>
160
+ <option value="2"<?php selected( $resource, 2 ); ?>><?php _e( 'Playlist', 'youtube-channel' ); ?></option>
161
+ </select>
162
  </label>
163
  </p>
164
  <p class="half right glue-top">
165
+ <label for="<?php echo $this->get_field_id( 'cache' ); ?>">
166
+ <?php _e( 'Cache feed', 'youtube-channel' ); ?>
167
  <select class="widefat" id="<?php echo $this->get_field_id( 'cache' ); ?>" name="<?php echo $this->get_field_name( 'cache' ); ?>">
168
  <option value="0"<?php selected( $cache, 0 ); ?>><?php _e( 'Do not cache', 'youtube-channel' ); ?></option>
169
  <?php echo $wpau_youtube_channel->cache_time( $cache ); ?>
171
  </label>
172
  </p>
173
  <p class="half left glue-top">
174
+ <label for="<?php echo $this->get_field_id( 'fetch' ); ?>">
175
+ <?php _e( 'Fetch', 'youtube-channel' ); ?>
176
+ <input class="small-text" id="<?php echo $this->get_field_id( 'fetch' ); ?>" name="<?php echo $this->get_field_name( 'fetch' ); ?>" type="number" min="2" value="<?php echo $fetch; ?>" title="<?php _e( 'Number of videos that will be used for random pick (min 2, max 50, default 25)', 'youtube-channel' ); ?>" />
177
+ <small><?php _e( 'video(s)', 'youtube-channel' ); ?></small>
178
+ </label>
179
  </p>
180
  <p class="half right glue-top">
181
+ <label for="<?php echo $this->get_field_id( 'num' ); ?>">
182
+ <?php _e( 'Show', 'youtube-channel' ); ?>
183
+ <input class="small-text" id="<?php echo $this->get_field_id( 'num' ); ?>" name="<?php echo $this->get_field_name( 'num' ); ?>" type="number" min="1" value="<?php echo ( $num ) ? $num : '1'; ?>" title="<?php _e( 'Number of videos to display', 'youtube-channel' ); ?>" />
184
+ <small><?php _e( 'video(s)', 'youtube-channel' ); ?></small>
185
+ </label>
186
+ </p>
187
+ <p class="half left glue-top">
188
+ <label for="<?php echo $this->get_field_id( 'skip' ); ?>">
189
+ <?php _e( 'Skip', 'youtube-channel' ); ?>
190
+ <input class="small-text" id="<?php echo $this->get_field_id( 'skip' ); ?>" name="<?php echo $this->get_field_name( 'skip' ); ?>" type="number" min="0" max="49" value="<?php echo ( $skip ) ? $skip : '0'; ?>" title="<?php _e( 'Number of videos to skip', 'youtube-channel' ); ?>" />
191
+ <small><?php _e( 'video(s)', 'youtube-channel' ); ?></small>
192
+ </label>
193
  </p>
194
  <p>
195
+ <label for="<?php echo $this->get_field_id( 'privacy' ); ?>">
196
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $privacy, true ); ?> id="<?php echo $this->get_field_id( 'privacy' ); ?>" name="<?php echo $this->get_field_name( 'privacy' ); ?>" title="<?php _e( 'Enable this option to protect your visitors privacy', 'youtube-channel' ); ?>" />
197
+ <?php printf( __( 'Enable <a href="%s" target="_blank">privacy-enhanced mode</a>', 'youtube-channel' ), 'https://support.google.com/youtube/bin/answer.py?hl=en-GB&answer=171780' ); ?>
198
+ </label>
199
  <br />
200
+ <label for="<?php echo $this->get_field_id( 'random' ); ?>">
201
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $random, true ); ?> id="<?php echo $this->get_field_id( 'random' ); ?>" name="<?php echo $this->get_field_name( 'random' ); ?>" title="<?php _e( 'Get random videos of all fetched from channel or playlist', 'youtube-channel' ); ?>" />
202
+ <?php _e( 'Show random video from resource', 'youtube-channel' ); ?>
203
+ <br />
204
+ <small>(<?php _e( 'Ignored if you set "Embedded Playlist" for "What to display?"', 'youtube-channel' ); ?>)</small>
205
+ </label>
206
  </p>
207
 
208
  <h4><?php _e( 'Video Settings', 'youtube-channel' ); ?></h4>
209
+ <p>
210
+ <label for="<?php echo $this->get_field_id( 'ratio' ); ?>">
211
+ <?php _e( 'Aspect ratio', 'youtube-channel' ); ?>
212
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ratio' ); ?>" name="<?php echo $this->get_field_name( 'ratio' ); ?>">
213
+ <option value="3"<?php selected( $ratio, 3 ); ?>>16:9</option>
214
+ <option value="1"<?php selected( $ratio, 1 ); ?>>4:3</option>
215
+ </select>
216
+ </label>
217
+ <br />
218
+ <label for="<?php echo $this->get_field_id( 'responsive' ); ?>">
219
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $responsive, true ); ?> id="<?php echo $this->get_field_id( 'responsive' ); ?>" name="<?php echo $this->get_field_name( 'responsive' ); ?>" />
220
+ <?php _e( 'Responsive video <small>(distribute one full width item per row)</small>', 'youtube-channel' ); ?>
221
+ </label>
222
  </p>
223
  <p>
224
+ <label for="<?php echo $this->get_field_id( 'width' ); ?>">
225
+ <?php _e( 'Initial width', 'youtube-channel' ); ?>
226
+ <input class="small-text" id="<?php echo $this->get_field_id( 'width' ); ?>" name="<?php echo $this->get_field_name( 'width' ); ?>" type="number" min="32" value="<?php echo $width; ?>" title="<?php _e( 'Set video width in pixels', 'youtube-channel' ); ?>" />
227
+ <small>px (<?php _e( 'default', 'youtube-channel' ); ?> 306)</small>
228
+ </label>
229
  </p>
230
  <p>
231
  <label for="<?php echo $this->get_field_id( 'display' ); ?>">
232
  <?php _e( 'What to display?', 'youtube-channel' ); ?>
233
+ <select class="widefat" id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>" onchange="ytcToggle('display', '<?php echo $this->get_field_id(''); ?>');">
234
+ <option value="thumbnail"<?php selected( $display, 'thumbnail' ); ?>><?php _e( 'Thumbnail', 'youtube-channel' ); ?></option>
235
+ <option value="iframe"<?php selected( $display, 'iframe' ); ?>><?php _e( 'HTML5 (iframe)', 'youtube-channel' ); ?></option>
236
+ <option value="iframe2"<?php selected( $display, 'iframe2' ); ?>><?php _e( 'HTML5 (iframe) Asynchronous', 'youtube-channel' ); ?></option>
237
+ <option value="playlist"<?php selected( $display, 'playlist' ); ?>><?php _e( 'Embedded Playlist', 'youtube-channel' ); ?></option>
238
+ </select>
239
  </label>
240
+ </p>
241
+ <p>
242
+ <label for="<?php echo $this->get_field_id( 'controls' ); ?>">
243
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $controls, true ); ?> id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" />
244
+ <?php _e( 'Hide player controls', 'youtube-channel' ); ?>
245
+ </label>
246
+ <br />
247
+ <label for="<?php echo $this->get_field_id( 'modestbranding' ); ?>" title="<?php _e( "Hide a YouTube logo from YouTube player control bar. Note that a small YouTube text label will still display in the upper-right corner of a paused video when the user's mouse pointer hovers over the player.", 'youtube-channel' ); ?>">
248
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $modestbranding, true ); ?> id="<?php echo $this->get_field_id( 'modestbranding' ); ?>" name="<?php echo $this->get_field_name( 'modestbranding' ); ?>" />
249
+ <?php _e( 'Hide YouTube Logo (does not work for all videos)', 'youtube-channel' ); ?>
250
+ </label>
251
+ <br />
252
+ <label for="<?php echo $this->get_field_id( 'norel' ); ?>" title="<?php _e( 'Enable this option to show after finished playback only related videos that come from the same channel as the video that was just played', 'youtube-channel' ); ?>">
253
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $norel, true ); ?> id="<?php echo $this->get_field_id( 'norel' ); ?>" name="<?php echo $this->get_field_name( 'norel' ); ?>" />
254
+ <?php _e( 'Allow only channel related videos', 'youtube-channel' ); ?>
255
+ </label>
256
+ <br />
257
+ <label for="<?php echo $this->get_field_id( 'autoplay' ); ?>">
258
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay, true ); ?> id="<?php echo $this->get_field_id( 'autoplay' ); ?>" name="<?php echo $this->get_field_name( 'autoplay' ); ?>" />
259
+ <?php _e( 'Autoplay video or playlist', 'youtube-channel' ); ?>
260
+ </label>
261
+ <br />
262
+ <label for="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>">
263
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay_mute, true ); ?> id="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>" name="<?php echo $this->get_field_name( 'autoplay_mute' ); ?>" />
264
+ <?php _e( 'Mute video on autoplay', 'youtube-channel' ); ?>
265
+ </label>
266
+ </p>
267
+ <p>
268
  <label for="<?php echo $this->get_field_id( 'thumb_quality' ); ?>">
269
  <?php _e( 'Thumbnail Quality', 'youtube-channel' ); ?>
270
+ <select class="widefat" id="<?php echo $this->get_field_id( 'thumb_quality' ); ?>" name="<?php echo $this->get_field_name( 'thumb_quality' ); ?>">
271
+ <option value="default"<?php selected( $thumb_quality, 'default' ); ?>><?php _e( 'Default Quality (120x90px)', 'youtube-channel' ); ?></option>
272
+ <option value="mqdefault"<?php selected( $thumb_quality, 'mqdefault' ); ?>><?php _e( 'Medium Quality (320x180px)', 'youtube-channel' ); ?></option>
273
+ <option value="hqdefault"<?php selected( $thumb_quality, 'hqdefault' ); ?>><?php _e( 'High Quality (480x360px)', 'youtube-channel' ); ?></option>
274
+ <option value="sddefault"<?php selected( $thumb_quality, 'sddefault' ); ?>><?php _e( 'Standard Definition (640x480px)', 'youtube-channel' ); ?></option>
275
+ <option value="maxresdefault"<?php selected( $thumb_quality, 'maxresdefault' ); ?>><?php _e( 'Maximum Resolution (1280x720px)', 'youtube-channel' ); ?></option>
276
+ </select>
277
+ </label>
278
+ </p>
279
+ <p>
280
+ <label for="<?php echo $this->get_field_id( 'no_thumb_title' ); ?>">
281
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $no_thumb_title, true ); ?> id="<?php echo $this->get_field_id( 'no_thumb_title' ); ?>" name="<?php echo $this->get_field_name( 'no_thumb_title' ); ?>" />
282
+ <?php _e( 'Disable thumbnail tooltip', 'youtube-channel' ); ?>
283
  </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  </p>
285
 
286
  <h4><?php _e( 'Content Layout', 'youtube-channel' ); ?></h4>
287
  <p>
288
  <label for="<?php echo $this->get_field_id( 'showtitle' ); ?>">
289
  <?php _e( 'Show video title', 'youtube-channel' ); ?>
290
+ <select class="widefat" id="<?php echo $this->get_field_id( 'showtitle' ); ?>" name="<?php echo $this->get_field_name( 'showtitle' ); ?>" onchange="ytcToggle('title', '<?php echo $this->get_field_id(''); ?>');">
291
+ <option value="none"<?php selected( $showtitle, 'none' ); ?>><?php _e( 'Hide title', 'youtube-channel' ); ?></option>
292
+ <option value="above"<?php selected( $showtitle, 'above' ); ?>><?php _e( 'Above video/thumbnail', 'youtube-channel' ); ?></option>
293
+ <option value="below"<?php selected( $showtitle, 'below' ); ?>><?php _e( 'Below video/thumbnail', 'youtube-channel' ); ?></option>
294
+ <option value="inside"<?php selected( $showtitle, 'inside' ); ?>><?php _e( 'Inside thumbnail, top aligned', 'youtube-channel' ); ?></option>
295
+ <option value="inside_b"<?php selected( $showtitle, 'inside_b' ); ?>><?php _e( 'Inside thumbnail, bototm aligned', 'youtube-channel' ); ?></option>
296
+ </select>
297
  </label>
298
+ <br />
299
+ <label for="<?php echo $this->get_field_id( 'linktitle' ); ?>">
300
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $linktitle, true ); ?> id="<?php echo $this->get_field_id( 'linktitle' ); ?>" name="<?php echo $this->get_field_name( 'linktitle' ); ?>" title="<?php _e( 'Enable this option to link outside title to video', 'youtube-channel' ); ?>" />
301
+ <?php _e( 'Link outside title to video', 'youtube-channel' ); ?>
302
+ </label>
303
+ </p>
304
+ <p>
305
  <label for="<?php echo $this->get_field_id( 'titletag' ); ?>">
306
  <?php _e( 'Title HTML tag', 'youtube-channel' ); ?>
307
+ <select class="widefat" id="<?php echo $this->get_field_id( 'titletag' ); ?>" name="<?php echo $this->get_field_name( 'titletag' ); ?>">
308
+ <?php
309
+ foreach ( array( 'h3', 'h4', 'h5', 'div', 'span', 'strong' ) as $tag ) {
310
+ printf(
311
+ '<option value="%1$s" %2$s>%1$s</option>',
312
+ $tag,
313
+ selected( $titletag, $tag )
314
+ );
315
+ }
316
+ ?>
317
+ </select>
318
  </label>
319
+ </p>
320
+ <p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  <label for="<?php echo $this->get_field_id( 'hideanno' ); ?>">
322
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $hideanno, true ); ?> id="<?php echo $this->get_field_id( 'hideanno' ); ?>" name="<?php echo $this->get_field_name( 'hideanno' ); ?>" />
323
+ <?php _e( 'Hide annotations from video', 'youtube-channel' ); ?>
324
+ </label>
325
+ <br />
326
+ <label for="<?php echo $this->get_field_id( 'showdesc' ); ?>">
327
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $showdesc, true ); ?> id="<?php echo $this->get_field_id( 'showdesc' ); ?>" name="<?php echo $this->get_field_name( 'showdesc' ); ?>" />
328
+ <?php _e( 'Show video description', 'youtube-channel' ); ?>
329
+ </label>
330
+ </p>
331
+ <p>
332
+ <label for="<?php echo $this->get_field_id( 'desclen' ); ?>">
333
+ <?php _e( 'Description length', 'youtube-channel' ); ?>
334
+ <input class="small-text" id="<?php echo $this->get_field_id( 'desclen' ); ?>" name="<?php echo $this->get_field_name( 'desclen' ); ?>" type="number" value="<?php echo $desclen; ?>" title="<?php _e( 'Set number of characters to cut down video description to (0 means full length)', 'youtube-channel' ); ?>" />
335
+ <small>(0 = full)</small>
336
  </label>
337
  </p>
338
 
339
  <h4><?php _e( 'Link to Channel', 'youtube-channel' ); ?></h4>
340
  <p class="glue-top">
341
+ <label for="<?php echo $this->get_field_id( 'goto_txt' ); ?>">
342
+ <?php _e( 'Link text', 'youtube-channel' ); ?>
343
+ <input class="widefat" id="<?php echo $this->get_field_id( 'goto_txt' ); ?>" name="<?php echo $this->get_field_name( 'goto_txt' ); ?>" type="text" value="<?php echo $goto_txt; ?>" title="<?php sprintf( __( 'Default: Visit our YouTube channel. You can use placeholders %1$s, %2$s and %3$s.', 'youtube-channel' ), '%vanity%', '%channel%', '%username%' ); ?>" placeholder="<?php _e( 'Visit our YouTube channel', 'youtube-channel' ); ?>" />
344
+ </label>
345
  </p>
346
  <p class="half left glue-top">
347
+ <label for="<?php echo $this->get_field_id( 'link_to' ); ?>">
348
+ <?php _e( 'Link type', 'youtube-channel' ); ?>
349
+ <select class="widefat" id="<?php echo $this->get_field_id( 'link_to' ); ?>" name="<?php echo $this->get_field_name( 'link_to' ); ?>">
350
+ <option value="none"<?php selected( $link_to, 'none' ); ?>><?php _e( 'Hide link', 'youtube-channel' ); ?></option>
351
+ <option value="vanity"<?php selected( $link_to, 'vanity' ); ?>><?php _e( 'Link to Vanity customized URL', 'youtube-channel' ); ?></option>
352
+ <option value="channel"<?php selected( $link_to, 'channel' ); ?>><?php _e( 'Link to Channel page URL', 'youtube-channel' ); ?></option>
353
+ <option value="legacy"<?php selected( $link_to, 'legacy' ); ?>><?php _e( 'Link to Legacy username page', 'youtube-channel' ); ?></option>
354
+ </select>
355
+ </label>
356
  </p>
357
  <p class="half right glue-top">
358
+ <label for="<?php echo $this->get_field_id( 'popup_goto' ); ?>">
359
+ <?php _e( 'Link behaviour', 'youtube-channel' ); ?>
360
+ <select class="widefat" id="<?php echo $this->get_field_id( 'popup_goto' ); ?>" name="<?php echo $this->get_field_name( 'popup_goto' ); ?>">
361
+ <option value="0"<?php selected( $popup_goto, 0 ); ?>><?php _e( 'Open link in same window', 'youtube-channel' ); ?></option>
362
+ <option value="1"<?php selected( $popup_goto, 1 ); ?>><?php _e( 'Open link in new window (JavaScript)', 'youtube-channel' ); ?></option>
363
+ <option value="2"<?php selected( $popup_goto, 2 ); ?>><?php _e( 'Open link in new window (target="blank")', 'youtube-channel' ); ?></option>
364
+ </select>
365
+ </label>
366
  </p>
367
 
368
  <h4><?php _e( 'Does not work?', 'youtube-channel' ); ?></h4>
382
  "?ytc_debug_json_for={$this->number}",
383
  'https://wordpress.org/support/plugin/youtube-channel',
384
  'https://wordpress.org/support/topic/ytc3-read-before-you-post-support-question-or-report-bug'
385
+ );
386
+ ?>
387
  </small>
388
  </p>
 
389
  <?php
390
  } // END public function form()
391
 
400
  $instance['playlist'] = strip_tags( $new_instance['playlist'] );
401
  $instance['vanity'] = strip_tags( $new_instance['vanity'] );
402
  $instance['num'] = $new_instance['num'];
403
+ $instance['skip'] = $new_instance['skip'];
404
  $instance['resource'] = $new_instance['resource'];
405
  $instance['cache'] = $new_instance['cache'];
406
  $instance['random'] = isset( $new_instance['random'] ) ? $new_instance['random'] : false;
411
  $instance['link_to'] = $new_instance['link_to'];
412
 
413
  $instance['showtitle'] = isset( $new_instance['showtitle'] ) ? $new_instance['showtitle'] : 'none';
414
+ $instance['linktitle'] = isset( $new_instance['linktitle'] ) ? $new_instance['linktitle'] : false;
415
  $instance['titletag'] = isset( $new_instance['titletag'] ) ? $new_instance['titletag'] : 'h3';
416
  $instance['showdesc'] = isset( $new_instance['showdesc'] ) ? $new_instance['showdesc'] : false;
417
  $instance['desclen'] = strip_tags( $new_instance['desclen'] );
428
 
429
  $instance['ratio'] = strip_tags( $new_instance['ratio'] );
430
  $instance['controls'] = isset( $new_instance['controls'] ) ? $new_instance['controls'] : false;
 
431
  $instance['hideanno'] = isset( $new_instance['hideanno'] ) ? $new_instance['hideanno'] : '';
 
432
  $instance['privacy'] = isset( $new_instance['privacy'] ) ? $new_instance['privacy'] : '';
433
 
434
  return $instance;
languages/youtube-channel-sr_RS.mo CHANGED
Binary file
languages/youtube-channel-sr_RS.po CHANGED
@@ -14,14 +14,14 @@ msgstr ""
14
  "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
15
  "X-Poedit-KeywordsList: __;_e\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Generator: Poedit 1.8.5\n"
18
  "X-Poedit-Basepath: ..\n"
19
  "X-Poedit-SearchPath-0: languages\n"
20
  "X-Poedit-SearchPath-1: .\n"
21
 
22
  #: inc/settings-template.php:6
23
  msgid " Settings"
24
- msgstr "Поставке"
25
 
26
  #: inc/settings-template.php:12 inc/settings-usage-shortcode.php:104
27
  #: inc/settings.php:38
14
  "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
15
  "X-Poedit-KeywordsList: __;_e\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Generator: Poedit 2.4\n"
18
  "X-Poedit-Basepath: ..\n"
19
  "X-Poedit-SearchPath-0: languages\n"
20
  "X-Poedit-SearchPath-1: .\n"
21
 
22
  #: inc/settings-template.php:6
23
  msgid " Settings"
24
+ msgstr " поставке"
25
 
26
  #: inc/settings-template.php:12 inc/settings-usage-shortcode.php:104
27
  #: inc/settings.php:38
readme.txt CHANGED
@@ -1,10 +1,11 @@
1
  === YouTube Channel ===
2
- Contributors: urkekg
3
  Donate link: https://urosevic.net/wordpress/donate/?donate_for=youtube-channel
4
- Tags: youtube, channel, playlist, single, widget, widgets, youtube player, feed, video, thumbnail, embed, sidebar, iframe, html5, responsive
5
- Requires at least: 4.0
6
- Tested up to: 4.9.8
7
- Stable tag: 3.0.11.8
 
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -16,6 +17,8 @@ When you need to display sidebar widget with latest or random video from some Yo
16
 
17
  Simply insert widget to sidebar or shortcode to content, set Channel or Playlist ID, select resource to use and if you wish leave all other options on default. You will get latest video from chosen YouTube channel or playlist embedded on location of widget/shortcode, with optional link to channel at the bottom of the YTC block.
18
 
 
 
19
  If you like our plugin and you find it useful, please [write review and rate it](https://wordpress.org/support/view/plugin-reviews/youtube-channel).
20
 
21
  For manual set of videos from YouTube check out [Easy YouTube Gallery](https://wordpress.org/plugins/easy-youtube-gallery/).
@@ -183,12 +186,12 @@ Four parameters are provided:
183
  * `cache`
184
  * `fetch`
185
  * `num`
 
186
  * `privacy`
187
  * `ratio`
188
  * `width`
189
  * `responsive`
190
  * `display`
191
- * `themelight`
192
  * `fullscreen`
193
  * `controls`
194
  * `autoplay`
@@ -201,7 +204,6 @@ Four parameters are provided:
201
  * `desclen`
202
  * `modestbranding`
203
  * `hideanno`
204
- * `hideinfo`
205
  * `goto_txt`
206
  * `popup_goto`
207
  * `link_to`
@@ -440,8 +442,17 @@ If you really need that missing feature ASAP, feel free to [contact me](urosevic
440
  If you don't wish to pay for enhancements (then you don't care would that be implemented in a week, month, year or so), then send new [Support topic](https://wordpress.org/support/plugin/youtube-channel) with *Topic title* in format **[Feature Request] ...**
441
 
442
  == Changelog ==
443
- = 3.0.11.8 (20190719) =
444
- * Fix: referrer is wrong for protected API keys (thanks to @hmmux)
 
 
 
 
 
 
 
 
 
445
 
446
  = 3.0.11.7 (20180906) =
447
  * Add: Global option `sslverify` to disable SSL Verification
@@ -479,252 +490,10 @@ If you don't wish to pay for enhancements (then you don't care would that be imp
479
  * Fix: added all 3 parameters to `widget_title` filter (reported by @squarestar)
480
  * (20170301) Add: New shortcode options `nolightbox` and `target`, to make available opening thumbnail anchors in new tab/window (requested by @bakercreative)
481
 
482
- = 3.0.10.5 (20170225) =
483
- * Remove: FMVD opt-in because of general plugin guideline violation rule #9
484
-
485
- = 3.0.10.4 (20170123) =
486
- * Fix: once enabled FMVD notice has not auto dismissed.
487
- * Change: input type for YouTube Data API Key from password to text so key is visible by webmaster and prevent messing with autofill browser extensions
488
-
489
- = 3.0.10.3 (20170114) =
490
- * Add opt-in option Freemage Video Downloader
491
- * Code cleanup: delete unused admin.js file
492
- * UI cleanup: enhance checkbox control in settings
493
- * UI cleanup: update option names like 'What to show' is now 'Embed as', 'Hide related videos' to 'No related videos' , etc
494
-
495
- = 3.0.10.2 (20170110) =
496
- * Add option to select Title HTML tag (default to H3)
497
-
498
- = 3.0.10.1 (20170110) =
499
- * Fix Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ')' in /plugins/youtube-channel/inc/settings.php on line 218
500
-
501
- = 3.0.10 (20161231) =
502
- * (20161225) Optimize: Remove `extract()` from shortcode parser
503
- * Code cleanup and fixing to be compliant with WordPress Core coding standards
504
- * Test compatibility with WordPreee 4.7 and PHP 7.0.14
505
- * (20161224) Change: Update notification for missing YouTube Data API Key
506
- * Change: Do not display shortcode options changes for fresh installation
507
- * (20160824) Change: HTTP to HTTPS links and open remote links on settings page in new tab/window
508
- * Change: Disable deprecated notification related to old v2.4 of plugin
509
- * (20160419) Fix: resource from globals used if in widget set to use User uploads as resource.
510
- * Enhance: Implemented Selective Refresh Support for Widget (WP 4.5)
511
- * (20160131) Fix: prevent PHP Notices for Settings page.
512
- * Fix: `Cache feed` option in widget can't be disabled (always revert to default).
513
- * Fix: `Open link in` option in widget always revert to default.
514
- * Security: prevent direct loading of settings and widget files.
515
- * (20160120) Optimize: replace yt_play.png with optimized image.
516
-
517
- = 3.0.9 =
518
- * Fix: broken autoplay when start to play all videos instead only first in YTC block set
519
- * Fix: remove $_SESSION variable and replace with class variable to avoid duplicate sets of JS code
520
-
521
- = 3.0.8.9 =
522
- * Fix: Set `Hide link` for `Link to` option for `Link to Channel` in global setting does not work (reported by drweby2).
523
- * Change: Set minumal required WordPress version 4.0
524
- * Update: Supported WordPress Version to 4.4
525
-
526
- = 3.0.8.8 =
527
- * Fix: Link to channel enabled in Widget not shown if related link ID has not set in Widget (ignored general settings).
528
- * Fix: Undefined notices
529
-
530
- = 3.0.8.7 =
531
- * Enhance: Merge two improvements for MagnificPopupAU fork from core library (commit 60d5aa4 and 1d0f697)
532
- * Fix: TinyMCE button does not have icon when new post/page is created
533
- * Fix: Strip non-number characters entered in shortcode TinyMCE creator for Fetch, Show, Initial Width and Description length attributes.
534
- * Fix: make sure that Initial Width is always in pixels (if user enter width in percentage, strip percent sign and threat value as pixel value)
535
-
536
- = 3.0.8.6 =
537
- * Fix: Broken Enhanced Privacy on small screens in forked MagnificPopupAU library
538
- * Enhanced: Finished making code compliant to WordPress Core coding standards
539
-
540
- = 3.0.8.5 =
541
- * Enhanced: Settings page made compliant to WordPress Core Coding Standard
542
- * Fix: Wrong links to external resources on Settings page
543
- * Fix: Opening external resources links on Settings page in new tab
544
- * Change: Replace PayPal donation links to prevent account limitations if plugin is used on website that violates PayPal's Acceptable Use Policy
545
-
546
- = 3.0.8.4 (2015-06-10/16/17/18/19-07/10) =
547
- * Fix: (6/19) Undefined notice for apikey
548
- * Fix: (6/18) Wrong name of widgets page on Help tab
549
- * Fix: (6/17) Do not load empty JS asset to prevent clash with VisualComposer and invisible rows wit enabled strtching
550
- * Fix: (6/16) Initiate .MagnificPopupAU() on window load event, not on DOM ready event
551
- * Fix: Lost some settings during igration from old to new options in settings and widgets
552
- * Add: (7/13) New global option **Disable TinyMCE** added to **General** tab. Enabled by default, disable to remove TinyMCE icon from post/page Visual Editor
553
- * Add: (7/10) New global option **Enable Full Screen** added to **Video** tab. Disabled by default, enable fullscreen option for embedded playlist
554
- * Add: (6/18) Support to initiate .MagnificPopupAU() on .ajaxComplete() and support dynamically loaded YTC within AJAX
555
- * Add: New global option **Play inline on iOS** added to **Video** tab. Disabled by default, provide support for playsinline parameter.
556
- * Add: Support for (playsinline)[https://developers.google.com/youtube/player_parameters#playsinline] player option in MagnificPopup library to play video on mobile devices in page instead in device player (disabled by default)
557
- * Add: Default option settings for nolightbox and
558
- * Cleanup: Removed unused modules from MagnificPopup library
559
- * Change: Help tab now have shortcode parameters distributed to subtabs
560
- * Change: Lightbox classes by prepending `ytc-` in front of all MagnificPopup classes
561
- * Change: Reduce minimal screen width from 700px to 320px when lightbox will not be used and will open video directly on YouTube website.
562
- * Improve: Updated strings for localization support
563
- * Improve: Updated FAQ with new question about play button on thumbnails
564
- * Updated Serbian localization
565
-
566
- = 3.0.8.3 (2015-06-09) =
567
- * Add: Support for enhanced privacy videos in lightbox (MagnificPopupAU tweak)
568
-
569
- = 3.0.8.2 (2015-06-08) =
570
- * Fix: Async HTML5 has broken when debug is disabled because single comments before JS code compression
571
-
572
- = 3.0.8.1 (2015-06-07) =
573
- * Fix: Migrate deprecated widget options
574
- * Add: Notice about changed shortcode parameters
575
- * Add: Message if access to resource is forbidden (private Liked or Favourited videos)
576
-
577
- = 3.0.8 (2015-06-07) =
578
- * Fix: Undefined and deprecated global options
579
- * Add: Global option to disable builtin Lightbox (Video tab)
580
- * Add: Link to Support forums on Plugins page
581
- * Add: Visible error in YTC block for Administrator, Oops for visitors and lower members
582
- * Add: Filename of debug JSON
583
- * Add: Video title classes `ytc_title_above`/`ytc_title_below`
584
- * Add: Button `Clear All YTC Cache` on `Tools` tab to quick purge all cached YTC feeds
585
- * Improve: Do not include YT `iframe_api` if already included by other plugin and make YTC iframe2 to work even if other plugin uses `iframe_api`
586
- * Improve: Remove `Playlist Only` checkbox (`only_pl=1` shortcode parameter) and integrate as new Display:Embedded Playlist option (`display=playlist` shortcode parameter)
587
- * Improve: Remove `Show title below` checkbox (titlebelow) and integrate to `Show video title` (showtitle) as dropdown
588
- * Improve: Remove `Show link to channel` checkbox (showgoto) and integrate option `None` to `What to link` (link_to)
589
- * Improve: Move JS code to initiate Magnific popup to inline print on wp_footer
590
- * Improve: LESS stylesheet for easier maintenance
591
- * Remove: `Et cetera` (descappend) option and always use `...` for shortened description
592
- * Remove: Macro templates for Link to channel title
593
- * Change: Values for `showtitle` and `link_to` are changed from integer to string (check Shortcodes section)
594
- * Change: Move `Hide annotations` and `Hide video info` from `Content` to `Video` tab on settings page
595
- * Change: Play icon to be like original YT play shape
596
- * Change: Make responsive enabled by default in new widgets
597
- * Optimize: DRY of visible errors for Administrator and visitors (Oops message)
598
- * Optimize: Faster empty defaults for channel, vanity, legacy and playlist in global settings
599
- * Optimize: Minify inline JS code
600
- * Optimize: Remove call to fitVids() function
601
- * Cleanup: Remove $yt_url and $yt_video variables
602
- * Cleanup: Remove unused function to clean playlist ID
603
-
604
- = 3.0.7.3 (2015-05-29) =
605
- * Add: TinyMCE button to easy configure and insert shortcode to post/page content
606
- * Add: Report about zero videos in resource
607
- * Add: Helper method to generate resource nice name (DRY)
608
-
609
- = 3.0.7.2 (2015-05-24) =
610
- * Add: Error report if we have broken feed on record
611
- * Add: Report about failed HTTP connections and other problems ocurred when we try to fetch feed
612
- * Add: DRY of visible errors for Administrator and visitors (Oops message)
613
-
614
- = 3.0.7.1 (2015-05-17/18) =
615
- * Fix: Plugin version number not updated in DB
616
- * Fix: Magnific Popup appear under header on Twenty Eleven theme
617
- * Fix: .clearfix break layout if used as class on content division
618
-
619
- = 3.0.7 (2015-05-17) =
620
- * Fix: Uncaught TypeError: e(...).fitVids is not a function
621
- * Change: Remove plugin default Channel ID, Vanity custom name, Legacy username and Playlist ID; leave them empty by default and allow them to be empty parameters; throw error if required value not provided. All this to prevent questions like *Why I see your videos on my website* or *Why my website link to your channel*
622
- * Cleanup: Deprecated widget toggler for Playlist Only depending on selected Resource
623
- * Cleanup: Deprecated 16:10 styles
624
- * Optimize: Minimize admin style for widget layout
625
-
626
- = 3.0.6.2 (2015-05-15) =
627
- * Fix: Fatal error: Cannot unset string offsets in update.php on line 229 (introduced in 3.0.6.1)
628
- * Add: Helpfull links to plugin settings page
629
-
630
- = 3.0.6.1 (2015-05-14) =
631
- * Fix: Undefined index: random
632
- * Fix: Unremoved only_pl from global settings
633
- * Add: Box sizing of .youtube_channel element for crappy themes
634
-
635
- = 3.0.6 (2015-05-13/14) =
636
-
637
- * Fix: Prevent Fatal error on PHP<5.3 because required __DIR__ for updater replaced with dirname(__FILE__)
638
- * Fix: No retrieved or missing videos from some channels so switch `search` to `playlistItems` API call (kudos to @[mmirus](https://wordpress.org/support/profile/mmirus))
639
- * Add: Embed As Playlist for all resources
640
- * Add: Clearfix for crappy themes where clearfix does not exists
641
- * Add: Option to move video title below video (boolean shortcode parameter `titlebelow`)
642
- * Add: PayPal donate button to settings page
643
- * Improved: Move YouTube Data API Key to plugin settings and add notification to remove YOUTUBE_DATA_API_KEY from wp-config.php (optional)
644
- * Improved: Updated shortcode explanation in README and Help tab in plugin settings.
645
- * Improved: Better tips for 'Oops, something went wrong' message.
646
- * Change: Wording `Ups` to `Oops`
647
- * Remove: Options `Embed standard playlist` and `Show random video` from global settings as this should be off by default
648
- * Remove: Loading of fitVids JS library for test before final removing.
649
-
650
- = 3.0.5 (2015-05-11/12) =
651
-
652
- * Fix: Setting back dropdown options with `0` ID does not work on Settings page (Channel as resource to use, Cache timeout, Aspect ratio, What to show, Open link to, Link to)
653
- * Add: Option to export global settings to JSON and add to Tools tab in settings button to download global settings JSON
654
- * Change: Update plugin features
655
- * Improved: Retrieve only fields which will be used for output w/o unused items to reduce
656
- * Improved: More micro optimizations
657
-
658
- = 3.0.4 (2015-05-11) =
659
-
660
- * Add: Tip what to do if error ocurred with YouTube Data API Key printed inside YTC ERROR comment
661
- * Change: Where to ask for support links in widget
662
- * Change: Timeout for getting feed increased from 2 to 5 seconds
663
- * Change: Update FAQ sections in readme file
664
- * Remove: Check for Redux Framework in debug JSON generator
665
-
666
- = 3.0.3 (2015-05-10) =
667
-
668
- * Fix: "Oops, something went wrong." when Playlist selected as resource because wrong switch
669
- * Fix: Jumping thumbnails in responsive wall on hover in Twenty Fifteen theme because border-bottom for anchors
670
- * Fix: Another deprecated shortcode attribute backward compatibility (`use_res`)
671
- * Add: Example of dynamic responsive wall (1 large + 6 small thumbnails) (to [Description](https://wordpress.org/plugins/youtube-channel/))
672
-
673
- = 3.0.2 (2015-05-10) =
674
-
675
- * Fix: (typo - experiencing on frontend when no API Key set) PHP Fatal error: Call to undefined function __sprintf() in youtube-channel.php on line 445
676
- * Fix: shortcode deprecated params `res` and `show` not backward compatibile
677
-
678
- = 3.0.1 (2015-05-10) =
679
-
680
- * Fix: Fatal error: Using $this when not in object context in youtube-channel.php on line 89
681
- * Fix: Link to channel not visible on Twenty Fifteen theme
682
-
683
- = 3.0.0 (2015-05-07/08/09/10) =
684
-
685
- * Fix: Migraton of global and widget settings to v3.0.0
686
- * Add: New Global Settings page as replacement of Redux Framework solution
687
- * Add: Non-Dismissable Dashboard notice if YouTube Data API Key missing with link to explanation page
688
- * Change: Option key `ytc_version` to `youtube_channel_version`
689
- * Change: Shortcode parameters: `res` to `resource`, `show` to `display`; but leave old parameter names for backward compatibility
690
- * Enhance: Various plugin core micro optimizations
691
- * Enhance: Dashboard notices
692
- * Enhance: Proper options migration on plugin update
693
- * Remove: Redux Framework mentioning from core plugin
694
- * Remove: Redux Framework config.php
695
- * Remove: chromeless.swf asset
696
- * Remove: option `Fix height taken by controls` as now YouTube displays control bar only when video is hovered
697
-
698
- = 3.0.0alpha2 (2015-03-07/22/24) =
699
-
700
- * Add: Rewrite plugin to work with YouTube Data API v3
701
- * Add: Vanity link as option to Link to channel (now supports Legacy username, Channel and Vanity URL) with cleanup Vanity ID routine
702
- * Add: Liked videos as resource (now support channel, playlists, favourites and liked videos)
703
- * Add: Admin notification in widget output on front-end if no YouTube Data API Key is defined to prevent errors
704
- * Add: Dismissable Dashboard notice if PHP version is lower than 5.3 as YTC maybe will not work with older versions.
705
- * Change: Global and widget option names: `use_res` to `resource`, `cache_time` to `cache`, `maxrnd` to `fetch`, `vidqty` to `num`, `getrnd` to `random`, `to_show` to `display`, `showvidesc` to `showdesc`, `enhprivacy` to `privacy`, `videsclen` to `desclen`,
706
- * Change: Widget settings functionality, two column options, better toggle for playlist and GoTo section
707
- * Enhance: Caching routine (reduce possibility of failed feed fetch)
708
- * Remove: Chromeless and Flash player - leave only Thumbnail and HTML5
709
- * Remove: Aspect Ration 16:10 (so support only 16:9 and 4:3, same as modern YouTube)
710
- * Remove: "Fix No Item" option - not required for YouTube API 3.0
711
-
712
  == Upgrade Notice ==
713
 
714
- = 3.0.8 =
715
- Bugfixes, optimizations and improvements.
716
-
717
- = 3.0.7.3 =
718
- User experience improved with Shortcode generator for TinyMCE
719
-
720
- = 3.0.7.2 =
721
- Added report for user if any HTTP error occured
722
-
723
- = 3.0.7,1 =
724
- Quick fix for clearfix class
725
-
726
- = 3.0.7 =
727
- Cleanup and optimization release
728
 
729
  == Screenshots ==
730
 
1
  === YouTube Channel ===
2
+ Contributors: urkekg, techwebux
3
  Donate link: https://urosevic.net/wordpress/donate/?donate_for=youtube-channel
4
+ Tags: youtube, channel, playlist, widget, video
5
+ Requires at least: 4.9
6
+ Tested up to: 5.5
7
+ Stable tag: 3.0.12
8
+ Requires PHP: 5.6
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
17
 
18
  Simply insert widget to sidebar or shortcode to content, set Channel or Playlist ID, select resource to use and if you wish leave all other options on default. You will get latest video from chosen YouTube channel or playlist embedded on location of widget/shortcode, with optional link to channel at the bottom of the YTC block.
19
 
20
+ **IMPORTANT** YouTube Channel does not have Gutenberg Block, so to insert directly in page/post content use Shortcode Block or Classic Block!
21
+
22
  If you like our plugin and you find it useful, please [write review and rate it](https://wordpress.org/support/view/plugin-reviews/youtube-channel).
23
 
24
  For manual set of videos from YouTube check out [Easy YouTube Gallery](https://wordpress.org/plugins/easy-youtube-gallery/).
186
  * `cache`
187
  * `fetch`
188
  * `num`
189
+ * `skip`
190
  * `privacy`
191
  * `ratio`
192
  * `width`
193
  * `responsive`
194
  * `display`
 
195
  * `fullscreen`
196
  * `controls`
197
  * `autoplay`
204
  * `desclen`
205
  * `modestbranding`
206
  * `hideanno`
 
207
  * `goto_txt`
208
  * `popup_goto`
209
  * `link_to`
442
  If you don't wish to pay for enhancements (then you don't care would that be implemented in a week, month, year or so), then send new [Support topic](https://wordpress.org/support/plugin/youtube-channel) with *Topic title* in format **[Feature Request] ...**
443
 
444
  == Changelog ==
445
+
446
+ = 3.0.12 (20201107) =
447
+ * Add: link video title to YouTube playback page opened in new tab/window
448
+ * Cleanup: remove deprecated parameters `theme` (`themelight`), `showinfo` (`noinfo`, `hideinfo`)
449
+ * Improve: code for widget
450
+ * Add: widget parameter `skip`
451
+ * (20201014) Add: shortcode parameter `skip` to skip requested number of items
452
+
453
+ = 3.0.11.8 (20200810) =
454
+ * Tested: WordPress 5.5-RC2-48768 and PHP 7.4.1
455
+ * (20190719) Fix: referrer is wrong for protected API keys (thanks to @hmmux)
456
 
457
  = 3.0.11.7 (20180906) =
458
  * Add: Global option `sslverify` to disable SSL Verification
490
  * Fix: added all 3 parameters to `widget_title` filter (reported by @squarestar)
491
  * (20170301) Add: New shortcode options `nolightbox` and `target`, to make available opening thumbnail anchors in new tab/window (requested by @bakercreative)
492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  == Upgrade Notice ==
494
 
495
+ = 3.0.11.7 =
496
+ There is new option to disable SSL verification on host which have a problem to verify Google SSL keys
 
 
 
 
 
 
 
 
 
 
 
 
497
 
498
  == Screenshots ==
499
 
update.php CHANGED
@@ -534,3 +534,29 @@ function au_youtube_channel_update_routine_22() {
534
  }
535
 
536
  } // END function au_youtube_channel_update_routine_22()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
534
  }
535
 
536
  } // END function au_youtube_channel_update_routine_22()
537
+
538
+
539
+ /**
540
+ * Add default value for new option skip and remove deprecatged options themelight and showinfo
541
+ */
542
+ function au_youtube_channel_update_routine_23() {
543
+
544
+ // get options from DB
545
+ $defaults = get_option( 'youtube_channel_defaults' );
546
+
547
+ if ( ! isset( $defaults['skip'] ) ) {
548
+ $defaults['skip'] = 0;
549
+ }
550
+ if ( isset( $defaults['themelight'] ) ) {
551
+ unset( $defaults['themelight'] );
552
+ }
553
+ if ( isset( $defaults['noinfo'] ) ) {
554
+ unset( $defaults['noinfo'] );
555
+ }
556
+
557
+ if ( isset( $defaults ) ) {
558
+ update_option( 'youtube_channel_defaults', $defaults );
559
+ unset( $defaults );
560
+ }
561
+
562
+ } // END function au_youtube_channel_update_routine_23()
youtube-channel.php CHANGED
@@ -1,13 +1,15 @@
1
  <?php
2
- /*
3
- Plugin Name: YouTube Channel
4
- Plugin URI: https://urosevic.net/wordpress/plugins/youtube-channel/
5
- Description: Quick and easy embed latest or random videos from YouTube channel (user uploads, liked or favourited videos) or playlist. Use <a href="widgets.php">widget</a> for sidebar or shortcode for content. Works with <em>YouTube Data API v3</em>.
6
- Version: 3.0.11.8
7
- Author: Aleksandar Urošević
8
- Author URI: https://urosevic.net/
9
- Text Domain: youtube-channel
10
- */
 
 
11
 
12
  // Exit if accessed directly
13
  if ( ! defined( 'ABSPATH' ) ) {
@@ -17,8 +19,8 @@ if ( ! defined( 'ABSPATH' ) ) {
17
  if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
18
  class WPAU_YOUTUBE_CHANNEL {
19
 
20
- const DB_VER = 22;
21
- const VER = '3.0.11.8';
22
 
23
  public $plugin_name = 'YouTube Channel';
24
  public $plugin_slug = 'youtube-channel';
@@ -110,6 +112,7 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
110
  'cache' => 300, // 5 minutes // ex cache_time
111
  'fetch' => 25, // ex maxrnd
112
  'num' => 1, // ex vidqty
 
113
  'privacy' => 0,
114
 
115
  'ratio' => 3, // 3 - 16:9, 1 - 4:3 (deprecated: 2 - 16:10)
@@ -117,7 +120,6 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
117
  'responsive' => 1,
118
  'display' => 'thumbnail', // thumbnail, iframe, iframe2, playlist (deprecated: chromeless, object)
119
  'thumb_quality' => 'hqdefault', // default, mqdefault, hqdefault, sddefault, maxresdefault
120
- 'themelight' => 0,
121
  'fullscreen' => 0,
122
  'controls' => 0,
123
  'autoplay' => 0,
@@ -125,12 +127,12 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
125
  'norel' => 0,
126
  'playsinline' => 0, // play video on mobile devices inline instead in native device player
127
  'showtitle' => 'none', // above, below, inside, inside_b
 
128
  'titletag' => 'h3',
129
  'showdesc' => 0,
130
  'desclen' => 0,
131
  'modestbranding' => 0,
132
  'hideanno' => 0,
133
- 'hideinfo' => 0,
134
 
135
  'goto_txt' => 'Visit our channel',
136
  'popup_goto' => 0, // 0 same window, 1 new window JS, 2 new window target
@@ -319,12 +321,15 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
319
  '<p><strong>%1$s v3</strong> require <strong>%2$s</strong> set on plugin <a href="%6$s">%7$s</a>. You can generate your own key on <a href="%3$s" target="_blank">%4$s</a> by following <a href="%5$s" target="_blank">this tutorial</a>.</p>',
320
  'youtube-channel'
321
  ),
322
- array(
323
- 'a' => array( 'href' => array(), 'target' => array( '_blank' ) ),
324
- 'p' => array(),
325
- 'strong' => array(),
326
- 'br' => array(),
327
- )
 
 
 
328
  ),
329
  $this->plugin_name,
330
  __( 'YouTube Data API Key', 'youtube-channel' ),
@@ -460,13 +465,14 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
460
  } // END if ( empty($this->defaults['nolightbox']) )
461
 
462
  if ( ! empty( $js ) ) {
463
- $js = sprintf('
464
- <!-- YouTube Channel 3 -->
465
- <script type="text/javascript">%2$s%1$s%3$s</script>
466
- ',
467
- $js,
468
- $this->defaults['js_ev_listener'] ? "window.addEventListener('DOMContentLoaded', function() {" : '',
469
- $this->defaults['js_ev_listener'] ? "});" : ''
 
470
  );
471
 
472
  if ( WP_DEBUG ) {
@@ -489,7 +495,7 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
489
 
490
  // Extract shortcode parameters
491
  $atts = shortcode_atts(
492
- array(
493
  'vanity' => $instance['vanity'],
494
  'channel' => $instance['channel'],
495
  'username' => $instance['username'],
@@ -513,7 +519,6 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
513
  'display' => $instance['display'],
514
  'thumb_quality' => $instance['thumb_quality'],
515
  'no_thumb_title' => 0,
516
- 'themelight' => $instance['themelight'],
517
  'controls' => $instance['controls'],
518
  'autoplay' => $instance['autoplay'],
519
  'mute' => $instance['autoplay_mute'],
@@ -521,11 +526,11 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
521
  'playsinline' => $instance['playsinline'], // play video on mobile devices inline instead in native device player
522
 
523
  'showtitle' => $instance['showtitle'], // none, above, below, inside, inside_b
 
524
  'titletag' => $instance['titletag'], // h3, h4, h5, div, span, strong
525
  'showdesc' => $instance['showdesc'], // ex showvidesc
526
  'nobrand' => ! empty( $instance['modestbranding'] ) ? $instance['modestbranding'] : '0',
527
  'desclen' => $instance['desclen'], // ex videsclen
528
- 'noinfo' => $instance['hideinfo'],
529
  'noanno' => $instance['hideanno'],
530
 
531
  'goto_txt' => $instance['goto_txt'],
@@ -536,7 +541,8 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
536
 
537
  'nolightbox' => ! empty( $instance['nolightbox'] ) ? $instance['nolightbox'] : '0',
538
  'target' => '',
539
- ),
 
540
  $atts
541
  );
542
 
@@ -573,7 +579,6 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
573
  $instance['thumb_quality'] = $atts['thumb_quality']; // default, mqdefault, hqdefault, sddefault, maxresdefault
574
  $instance['no_thumb_title'] = $atts['no_thumb_title']; // hide tooltip for thumbnails
575
 
576
- $instance['themelight'] = $atts['themelight']; // use light theme, dark by default
577
  $instance['controls'] = $atts['controls']; // hide controls, false by default
578
  $instance['autoplay'] = $atts['autoplay']; // autoplay disabled by default
579
  $instance['autoplay_mute'] = $atts['mute']; // mute sound on autoplay - disabled by default
@@ -582,11 +587,11 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
582
 
583
  // Content Layout
584
  $instance['showtitle'] = $atts['showtitle']; // show video title, disabled by default
 
585
  $instance['titletag'] = $atts['titletag']; // title HTML tag wrapper, h3 by default
586
  $instance['showdesc'] = $atts['showdesc']; // show video description, disabled by default
587
  $instance['modestbranding'] = $atts['nobrand']; // hide YT logo
588
  $instance['desclen'] = (int) $atts['desclen']; // cut video description, number of characters
589
- $instance['hideinfo'] = $atts['noinfo']; // hide info by default
590
  $instance['hideanno'] = $atts['noanno']; // hide annotations, false by default
591
 
592
  // Link to Channel
@@ -600,6 +605,7 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
600
  $instance['nolightbox'] = $atts['nolightbox']; // custom usage of lightbox
601
  $instance['target'] = $atts['target']; // custom target for thumbnails w/o lightbox (empty, _blank or custom)
602
 
 
603
  // return implode( array_values( $this->output( $instance ) ) );
604
  return $this->output( $instance );
605
  } // END public function shortcode()
@@ -723,8 +729,21 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
723
 
724
  // Get max items for random video
725
  $fetch = ( empty( $instance['fetch'] ) ) ? $this->defaults['fetch'] : $instance['fetch'];
726
- if ( $fetch < 1 ) { $fetch = 10; } // default 10
727
- elseif ( $fetch > 50 ) { $fetch = 50; } // max 50
 
 
 
 
 
 
 
 
 
 
 
 
 
728
 
729
  $resource_key = "{$resource_id}_{$fetch}";
730
 
@@ -742,7 +761,8 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
742
  }
743
 
744
  // get/set transient cache
745
- if ( false === ( $json = get_transient( $cache_key ) ) || empty( $json ) ) {
 
746
 
747
  // no cached JSON, get new
748
  $json = $this->fetch_youtube_feed( $resource_id, $fetch );
@@ -773,7 +793,8 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
773
  // if current feed is messed up, try to get it from fallback cache
774
  if ( is_wp_error( $json_output ) && ! is_object( $json_output ) && empty( $json_output->items ) ) {
775
  // do we have fallback cache?!
776
- if ( true === ( $json_fallback = get_transient( $cache_key_fallback ) ) && ! empty( $json_fallback ) ) {
 
777
  $json_output = json_decode( base64_decode( $json_fallback ) );
778
  // and free memory
779
  unset( $json_fallback );
@@ -787,7 +808,7 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
787
  if ( is_wp_error( $json_output ) ) {
788
  $output .= $this->front_debug( $json_output->get_error_message() );
789
  return $output;
790
- } elseif ( isset( $json_output->items ) && 0 == sizeof( $json_output->items ) ) {
791
  $output .= $this->front_debug( sprintf( __( 'You have set to display videos from %1$s [resource list ID: %2$s], but there have no public videos in that resouce.' ), $resource_nice_name, $resource_id ) );
792
  return $output;
793
  } elseif ( empty( $json_output ) ) {
@@ -803,7 +824,9 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
803
  $json_entry = $json_output->items;
804
 
805
  $num = ( empty( $instance['num'] ) ) ? $this->defaults['num'] : $instance['num'];
806
- if ( $num > $fetch ) { $fetch = $num; }
 
 
807
  $max_items = ( $fetch > sizeof( $json_entry ) ) ? sizeof( $json_entry ) : $fetch;
808
 
809
  if ( ! empty( $instance['random'] ) ) {
@@ -812,7 +835,7 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
812
  if ( ! $num ) {
813
  $num = 1;
814
  }
815
- $items = array_slice( $json_entry, 0, $num );
816
  }
817
  }
818
 
@@ -900,7 +923,6 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
900
  unset( $random_used, $random_item, $json );
901
 
902
  } // END if ($max_items == 0)
903
-
904
  } // single playlist or ytc way
905
 
906
  // Append link to channel on bootom of the widget
@@ -1171,11 +1193,21 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1171
  // for thubmanil only if it's `below`
1172
  ( 'thumbnail' == $instance['display'] && 'above' == $instance['showtitle'] )
1173
  ) {
1174
- $output .= sprintf(
1175
- '<%1$s class="ytc_title ytc_title_above">%2$s</%1$s>',
1176
- $title_tag,
1177
- $yt_title
1178
- );
 
 
 
 
 
 
 
 
 
 
1179
  }
1180
  }
1181
 
@@ -1189,14 +1221,25 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1189
 
1190
  $output .= "<iframe title=\"YouTube Video Player\" width=\"{$instance['width']}\" height=\"{$height}\" src=\"//{$youtube_domain}/embed/{$yt_id}?wmode=opaque";
1191
 
1192
- if ( ! empty( $instance['norel'] ) ) { $output .= '&amp;rel=0'; } // disable related videos
1193
- if ( ! empty( $instance['controls'] ) ) { $output .= '&amp;controls=0'; }
1194
- if ( ! empty( $instance['hideinfo'] ) ) { $output .= '&amp;showinfo=0'; }
1195
- if ( ! empty( $instance['autoplay'] ) && 1 == $y ) { $output .= '&amp;autoplay=1'; }
1196
- if ( ! empty( $instance['hideanno'] ) ) { $output .= '&amp;iv_load_policy=3'; }
1197
- if ( ! empty( $instance['themelight'] ) ) { $output .= '&amp;theme=light'; }
1198
- if ( ! empty( $instance['modestbranding'] ) ) { $output .= '&amp;modestbranding=1'; }
1199
- if ( ! empty( $instance['playsinline'] ) ) { $output .= '&amp;playsinline=1'; }
 
 
 
 
 
 
 
 
 
 
 
1200
 
1201
  $output .= "\" style=\"border:0;\" allowfullscreen id=\"ytc_{$yt_id}\"></iframe>";
1202
 
@@ -1210,9 +1253,7 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1210
  $js_vars = '';
1211
  $js_vars .= ( ! empty( $instance['norel'] ) ) ? 'rel:0,' : '';
1212
  $js_vars .= ( ! empty( $instance['autoplay'] ) && 1 == $y ) ? 'autoplay:1,' : '';
1213
- $js_vars .= ( ! empty( $instance['hideinfo'] ) ) ? 'showinfo:0,' : '';
1214
  $js_vars .= ( ! empty( $instance['controls'] ) ) ? 'controls:0,' : '';
1215
- $js_vars .= ( ! empty( $instance['themelight'] ) ) ? "theme:'light'," : '';
1216
  $js_vars .= ( ! empty( $instance['modestbranding'] ) ) ? 'modestbranding:1,' : '';
1217
  $js_vars .= ( ! empty( $instance['playsinline'] ) ) ? 'playsinline:1,' : '';
1218
  $js_vars .= "wmmode:'opaque'";
@@ -1255,13 +1296,24 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1255
  $title = sprintf( __( 'Watch video %1$s published on %2$s', 'youtube-channel' ), $yt_title, $yt_date );
1256
  }
1257
 
1258
- $p = $target = '';
 
1259
  if ( empty( $instance['nolightbox'] ) ) {
1260
- if ( ! empty( $instance['norel'] ) ) { $p .= '&amp;rel=0'; }
1261
- if ( ! empty( $instance['modestbranding'] ) ) { $p .= '&amp;modestbranding=1'; }
1262
- if ( ! empty( $instance['controls'] ) ) { $p .= '&amp;controls=0'; }
1263
- if ( ! empty( $instance['playsinline'] ) ) { $p .= '&amp;playsinline=1'; }
1264
- if ( ! empty( $instance['privacy'] ) ) { $p .= '&amp;enhanceprivacy=1'; }
 
 
 
 
 
 
 
 
 
 
1265
  $lightbox_class = 'ytc-lightbox';
1266
  } else {
1267
  $lightbox_class = 'ytc-nolightbox';
@@ -1310,11 +1362,22 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1310
  // for thubmanil only if it's `below`
1311
  ( 'thumbnail' == $instance['display'] && 'below' == $instance['showtitle'] )
1312
  ) {
1313
- $output .= sprintf(
1314
- '<%1$s class="ytc_title ytc_title_below">%2$s</%1$s>',
1315
- $title_tag,
1316
- $yt_title
1317
- );
 
 
 
 
 
 
 
 
 
 
 
1318
  }
1319
  }
1320
 
@@ -1354,7 +1417,6 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1354
  $width = empty( $instance['width'] ) ? 306 : $instance['width'];
1355
  $height = self::height_ratio( $width, $instance['ratio'] );
1356
  $autoplay = empty( $instance['autoplay'] ) ? '' : '&autoplay=1';
1357
- $theme = empty( $instance['themelight'] ) ? '' : '&theme=light';
1358
  $modestbranding = empty( $instance['modestbranding'] ) ? '' : '&modestbranding=1';
1359
  $rel = empty( $instance['norel'] ) ? '' : '&rel=0';
1360
  $playsinline = empty( $instance['playsinline'] ) ? '' : '&playsinline=1';
@@ -1368,8 +1430,10 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1368
 
1369
  $output .= "<div class=\"ytc_video_container ytc_video_1 ytc_video_single ytc_playlist_only {$arclass}\">";
1370
  $output .= '<div class="fluid-width-video-wrapper">';
1371
- $output .= "<iframe src=\"//{$youtube_domain}/embed/videoseries?list={$resource_id}{$autoplay}{$theme}{$modestbranding}{$rel}\"";
1372
- if ( ! empty( $instance['fullscreen'] ) ) { $output .= ' allowfullscreen'; }
 
 
1373
  $output .= " width=\"{$width}\" height=\"{$height}\" frameborder=\"0\"></iframe>";
1374
  $output .= '</div><!-- .fluid-width-video-wrapper -->';
1375
  $output .= '</div><!-- .ytc_video_container -->';
@@ -1473,11 +1537,11 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
1473
  $resource_nice_name = 'Unknown resource';
1474
  }
1475
  return $resource_nice_name;
1476
- }
1477
 
1478
  function youtube_domain( $instance ) {
1479
- return empty( $instance['privacy'] ) ? 'www.youtube.com' : 'www.youtube-nocookie.com';
1480
- } // end function youtube_domain
1481
 
1482
  function arclass( $instance ) {
1483
  return ! empty( $instance['ratio'] ) && 1 == $instance['ratio'] ? 'ar4_3' : 'ar16_9';
1
  <?php
2
+ /**
3
+ * Plugin Name: YouTube Channel
4
+ * Plugin URI: https://urosevic.net/wordpress/plugins/youtube-channel/
5
+ * Description: Quick and easy embed latest or random videos from YouTube channel (user uploads, liked or favourited videos) or playlist. Use <a href="widgets.php">widget</a> for sidebar or shortcode for content. Works with <em>YouTube Data API v3</em>.
6
+ * Version: 3.0.12
7
+ * Author: Aleksandar Urošević
8
+ * Author URI: https://urosevic.net/
9
+ * License: GPLv3
10
+ * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
11
+ * Text Domain: youtube-channel
12
+ */
13
 
14
  // Exit if accessed directly
15
  if ( ! defined( 'ABSPATH' ) ) {
19
  if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
20
  class WPAU_YOUTUBE_CHANNEL {
21
 
22
+ const DB_VER = 23;
23
+ const VER = '3.0.12';
24
 
25
  public $plugin_name = 'YouTube Channel';
26
  public $plugin_slug = 'youtube-channel';
112
  'cache' => 300, // 5 minutes // ex cache_time
113
  'fetch' => 25, // ex maxrnd
114
  'num' => 1, // ex vidqty
115
+ 'skip' => 0,
116
  'privacy' => 0,
117
 
118
  'ratio' => 3, // 3 - 16:9, 1 - 4:3 (deprecated: 2 - 16:10)
120
  'responsive' => 1,
121
  'display' => 'thumbnail', // thumbnail, iframe, iframe2, playlist (deprecated: chromeless, object)
122
  'thumb_quality' => 'hqdefault', // default, mqdefault, hqdefault, sddefault, maxresdefault
 
123
  'fullscreen' => 0,
124
  'controls' => 0,
125
  'autoplay' => 0,
127
  'norel' => 0,
128
  'playsinline' => 0, // play video on mobile devices inline instead in native device player
129
  'showtitle' => 'none', // above, below, inside, inside_b
130
+ 'linktitle' => 0,
131
  'titletag' => 'h3',
132
  'showdesc' => 0,
133
  'desclen' => 0,
134
  'modestbranding' => 0,
135
  'hideanno' => 0,
 
136
 
137
  'goto_txt' => 'Visit our channel',
138
  'popup_goto' => 0, // 0 same window, 1 new window JS, 2 new window target
321
  '<p><strong>%1$s v3</strong> require <strong>%2$s</strong> set on plugin <a href="%6$s">%7$s</a>. You can generate your own key on <a href="%3$s" target="_blank">%4$s</a> by following <a href="%5$s" target="_blank">this tutorial</a>.</p>',
322
  'youtube-channel'
323
  ),
324
+ [
325
+ 'a' => [
326
+ 'href' => [],
327
+ 'target' => [ '_blank' ],
328
+ ],
329
+ 'p' => [],
330
+ 'strong' => [],
331
+ 'br' => [],
332
+ ]
333
  ),
334
  $this->plugin_name,
335
  __( 'YouTube Data API Key', 'youtube-channel' ),
465
  } // END if ( empty($this->defaults['nolightbox']) )
466
 
467
  if ( ! empty( $js ) ) {
468
+ $js = sprintf(
469
+ '
470
+ <!-- YouTube Channel 3 -->
471
+ <script type="text/javascript">%2$s%1$s%3$s</script>
472
+ ',
473
+ $js,
474
+ $this->defaults['js_ev_listener'] ? "window.addEventListener('DOMContentLoaded', function() {" : '',
475
+ $this->defaults['js_ev_listener'] ? '});' : ''
476
  );
477
 
478
  if ( WP_DEBUG ) {
495
 
496
  // Extract shortcode parameters
497
  $atts = shortcode_atts(
498
+ [
499
  'vanity' => $instance['vanity'],
500
  'channel' => $instance['channel'],
501
  'username' => $instance['username'],
519
  'display' => $instance['display'],
520
  'thumb_quality' => $instance['thumb_quality'],
521
  'no_thumb_title' => 0,
 
522
  'controls' => $instance['controls'],
523
  'autoplay' => $instance['autoplay'],
524
  'mute' => $instance['autoplay_mute'],
526
  'playsinline' => $instance['playsinline'], // play video on mobile devices inline instead in native device player
527
 
528
  'showtitle' => $instance['showtitle'], // none, above, below, inside, inside_b
529
+ 'linktitle' => ! empty( $instance['linktitle'] ) ? $instance['linktitle'] : '0',
530
  'titletag' => $instance['titletag'], // h3, h4, h5, div, span, strong
531
  'showdesc' => $instance['showdesc'], // ex showvidesc
532
  'nobrand' => ! empty( $instance['modestbranding'] ) ? $instance['modestbranding'] : '0',
533
  'desclen' => $instance['desclen'], // ex videsclen
 
534
  'noanno' => $instance['hideanno'],
535
 
536
  'goto_txt' => $instance['goto_txt'],
541
 
542
  'nolightbox' => ! empty( $instance['nolightbox'] ) ? $instance['nolightbox'] : '0',
543
  'target' => '',
544
+ 'skip' => 0, // how many items to skip
545
+ ],
546
  $atts
547
  );
548
 
579
  $instance['thumb_quality'] = $atts['thumb_quality']; // default, mqdefault, hqdefault, sddefault, maxresdefault
580
  $instance['no_thumb_title'] = $atts['no_thumb_title']; // hide tooltip for thumbnails
581
 
 
582
  $instance['controls'] = $atts['controls']; // hide controls, false by default
583
  $instance['autoplay'] = $atts['autoplay']; // autoplay disabled by default
584
  $instance['autoplay_mute'] = $atts['mute']; // mute sound on autoplay - disabled by default
587
 
588
  // Content Layout
589
  $instance['showtitle'] = $atts['showtitle']; // show video title, disabled by default
590
+ $instance['linktitle'] = $atts['linktitle']; // link title to video, disabled by default
591
  $instance['titletag'] = $atts['titletag']; // title HTML tag wrapper, h3 by default
592
  $instance['showdesc'] = $atts['showdesc']; // show video description, disabled by default
593
  $instance['modestbranding'] = $atts['nobrand']; // hide YT logo
594
  $instance['desclen'] = (int) $atts['desclen']; // cut video description, number of characters
 
595
  $instance['hideanno'] = $atts['noanno']; // hide annotations, false by default
596
 
597
  // Link to Channel
605
  $instance['nolightbox'] = $atts['nolightbox']; // custom usage of lightbox
606
  $instance['target'] = $atts['target']; // custom target for thumbnails w/o lightbox (empty, _blank or custom)
607
 
608
+ $instance['skip'] = (int) $atts['skip'];
609
  // return implode( array_values( $this->output( $instance ) ) );
610
  return $this->output( $instance );
611
  } // END public function shortcode()
729
 
730
  // Get max items for random video
731
  $fetch = ( empty( $instance['fetch'] ) ) ? $this->defaults['fetch'] : $instance['fetch'];
732
+ if ( $fetch < 1 ) {
733
+ $fetch = 10;
734
+ } elseif ( $fetch > 50 ) {
735
+ $fetch = 50;
736
+ }
737
+
738
+ // How many items to skip?
739
+ $skip = 0;
740
+ if ( ! empty( $instance['skip'] ) ) {
741
+ $skip = intval( $instance['skip'] ) > 49 ? 49 : intval( $instance['skip'] );
742
+ }
743
+ // If we have to skip more items than we have in fetch, set skip to $fetch-1
744
+ if ( $skip >= $fetch ) {
745
+ $skip = $fetch - 1;
746
+ }
747
 
748
  $resource_key = "{$resource_id}_{$fetch}";
749
 
761
  }
762
 
763
  // get/set transient cache
764
+ $json = get_transient( $cache_key );
765
+ if ( false === $json || empty( $json ) ) {
766
 
767
  // no cached JSON, get new
768
  $json = $this->fetch_youtube_feed( $resource_id, $fetch );
793
  // if current feed is messed up, try to get it from fallback cache
794
  if ( is_wp_error( $json_output ) && ! is_object( $json_output ) && empty( $json_output->items ) ) {
795
  // do we have fallback cache?!
796
+ $json_fallback = get_transient( $cache_key_fallback );
797
+ if ( true === $json_fallback && ! empty( $json_fallback ) ) {
798
  $json_output = json_decode( base64_decode( $json_fallback ) );
799
  // and free memory
800
  unset( $json_fallback );
808
  if ( is_wp_error( $json_output ) ) {
809
  $output .= $this->front_debug( $json_output->get_error_message() );
810
  return $output;
811
+ } elseif ( isset( $json_output->items ) && 0 == sizeof( $json_output->items ) ) {
812
  $output .= $this->front_debug( sprintf( __( 'You have set to display videos from %1$s [resource list ID: %2$s], but there have no public videos in that resouce.' ), $resource_nice_name, $resource_id ) );
813
  return $output;
814
  } elseif ( empty( $json_output ) ) {
824
  $json_entry = $json_output->items;
825
 
826
  $num = ( empty( $instance['num'] ) ) ? $this->defaults['num'] : $instance['num'];
827
+ if ( $num > $fetch ) {
828
+ $fetch = $num;
829
+ }
830
  $max_items = ( $fetch > sizeof( $json_entry ) ) ? sizeof( $json_entry ) : $fetch;
831
 
832
  if ( ! empty( $instance['random'] ) ) {
835
  if ( ! $num ) {
836
  $num = 1;
837
  }
838
+ $items = array_slice( $json_entry, $skip, $num );
839
  }
840
  }
841
 
923
  unset( $random_used, $random_item, $json );
924
 
925
  } // END if ($max_items == 0)
 
926
  } // single playlist or ytc way
927
 
928
  // Append link to channel on bootom of the widget
1193
  // for thubmanil only if it's `below`
1194
  ( 'thumbnail' == $instance['display'] && 'above' == $instance['showtitle'] )
1195
  ) {
1196
+ if ( ! empty( $instance['linktitle'] ) ) {
1197
+ $output .= sprintf(
1198
+ '<%1$s class="ytc_title ytc_title_above"><a href="https://%3$s/watch/?v=%4$s" target="youtube">%2$s</a></%1$s>',
1199
+ $title_tag,
1200
+ $yt_title,
1201
+ $youtube_domain,
1202
+ $yt_id
1203
+ );
1204
+ } else {
1205
+ $output .= sprintf(
1206
+ '<%1$s class="ytc_title ytc_title_above">%2$s</%1$s>',
1207
+ $title_tag,
1208
+ $yt_title
1209
+ );
1210
+ }
1211
  }
1212
  }
1213
 
1221
 
1222
  $output .= "<iframe title=\"YouTube Video Player\" width=\"{$instance['width']}\" height=\"{$height}\" src=\"//{$youtube_domain}/embed/{$yt_id}?wmode=opaque";
1223
 
1224
+ // disable related vides
1225
+ if ( ! empty( $instance['norel'] ) ) {
1226
+ $output .= '&amp;rel=0';
1227
+ }
1228
+ if ( ! empty( $instance['controls'] ) ) {
1229
+ $output .= '&amp;controls=0';
1230
+ }
1231
+ if ( ! empty( $instance['autoplay'] ) && 1 == $y ) {
1232
+ $output .= '&amp;autoplay=1';
1233
+ }
1234
+ if ( ! empty( $instance['hideanno'] ) ) {
1235
+ $output .= '&amp;iv_load_policy=3';
1236
+ }
1237
+ if ( ! empty( $instance['modestbranding'] ) ) {
1238
+ $output .= '&amp;modestbranding=1';
1239
+ }
1240
+ if ( ! empty( $instance['playsinline'] ) ) {
1241
+ $output .= '&amp;playsinline=1';
1242
+ }
1243
 
1244
  $output .= "\" style=\"border:0;\" allowfullscreen id=\"ytc_{$yt_id}\"></iframe>";
1245
 
1253
  $js_vars = '';
1254
  $js_vars .= ( ! empty( $instance['norel'] ) ) ? 'rel:0,' : '';
1255
  $js_vars .= ( ! empty( $instance['autoplay'] ) && 1 == $y ) ? 'autoplay:1,' : '';
 
1256
  $js_vars .= ( ! empty( $instance['controls'] ) ) ? 'controls:0,' : '';
 
1257
  $js_vars .= ( ! empty( $instance['modestbranding'] ) ) ? 'modestbranding:1,' : '';
1258
  $js_vars .= ( ! empty( $instance['playsinline'] ) ) ? 'playsinline:1,' : '';
1259
  $js_vars .= "wmmode:'opaque'";
1296
  $title = sprintf( __( 'Watch video %1$s published on %2$s', 'youtube-channel' ), $yt_title, $yt_date );
1297
  }
1298
 
1299
+ $p = '';
1300
+ $target = '';
1301
  if ( empty( $instance['nolightbox'] ) ) {
1302
+ if ( ! empty( $instance['norel'] ) ) {
1303
+ $p .= '&amp;rel=0';
1304
+ }
1305
+ if ( ! empty( $instance['modestbranding'] ) ) {
1306
+ $p .= '&amp;modestbranding=1';
1307
+ }
1308
+ if ( ! empty( $instance['controls'] ) ) {
1309
+ $p .= '&amp;controls=0';
1310
+ }
1311
+ if ( ! empty( $instance['playsinline'] ) ) {
1312
+ $p .= '&amp;playsinline=1';
1313
+ }
1314
+ if ( ! empty( $instance['privacy'] ) ) {
1315
+ $p .= '&amp;enhanceprivacy=1';
1316
+ }
1317
  $lightbox_class = 'ytc-lightbox';
1318
  } else {
1319
  $lightbox_class = 'ytc-nolightbox';
1362
  // for thubmanil only if it's `below`
1363
  ( 'thumbnail' == $instance['display'] && 'below' == $instance['showtitle'] )
1364
  ) {
1365
+ if ( ! empty( $instance['linktitle'] ) ) {
1366
+
1367
+ $output .= sprintf(
1368
+ '<%1$s class="ytc_title ytc_title_below"><a href="https://%3$s/watch/?v=%4$s" target="youtube">%2$s</a></%1$s>',
1369
+ $title_tag,
1370
+ $yt_title,
1371
+ $youtube_domain,
1372
+ $yt_id
1373
+ );
1374
+ } else {
1375
+ $output .= sprintf(
1376
+ '<%1$s class="ytc_title ytc_title_below">%2$s</%1$s>',
1377
+ $title_tag,
1378
+ $yt_title
1379
+ );
1380
+ }
1381
  }
1382
  }
1383
 
1417
  $width = empty( $instance['width'] ) ? 306 : $instance['width'];
1418
  $height = self::height_ratio( $width, $instance['ratio'] );
1419
  $autoplay = empty( $instance['autoplay'] ) ? '' : '&autoplay=1';
 
1420
  $modestbranding = empty( $instance['modestbranding'] ) ? '' : '&modestbranding=1';
1421
  $rel = empty( $instance['norel'] ) ? '' : '&rel=0';
1422
  $playsinline = empty( $instance['playsinline'] ) ? '' : '&playsinline=1';
1430
 
1431
  $output .= "<div class=\"ytc_video_container ytc_video_1 ytc_video_single ytc_playlist_only {$arclass}\">";
1432
  $output .= '<div class="fluid-width-video-wrapper">';
1433
+ $output .= "<iframe src=\"//{$youtube_domain}/embed/videoseries?list={$resource_id}{$autoplay}{$modestbranding}{$rel}\"";
1434
+ if ( ! empty( $instance['fullscreen'] ) ) {
1435
+ $output .= ' allowfullscreen';
1436
+ }
1437
  $output .= " width=\"{$width}\" height=\"{$height}\" frameborder=\"0\"></iframe>";
1438
  $output .= '</div><!-- .fluid-width-video-wrapper -->';
1439
  $output .= '</div><!-- .ytc_video_container -->';
1537
  $resource_nice_name = 'Unknown resource';
1538
  }
1539
  return $resource_nice_name;
1540
+ } // END function resource_nice_name( $resource_id )
1541
 
1542
  function youtube_domain( $instance ) {
1543
+ return empty( $instance['privacy'] ) ? 'www.youtube.com' : 'www.youtube-nocookie.com';
1544
+ } // END function youtube_domain
1545
 
1546
  function arclass( $instance ) {
1547
  return ! empty( $instance['ratio'] ) && 1 == $instance['ratio'] ? 'ar4_3' : 'ar16_9';