YouTube - Version 13.2

Version Description

Download this release

Release Info

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

Code changes from version 13.1.2.5 to 13.2

readme.txt CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
- Stable tag: 13.1.2.5
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, or YouTube.com live stream (with GDPR options)
@@ -17,7 +17,7 @@ YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel galler
17
  * Privacy and Consent - Improved privacy and GDPR compliance options like YouTube no cookie, YouTube API restrictions, and a customizable GDPR consent message
18
  * YouTube gallery capability (channel and playlist) – The ability to make playlist and channel embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
19
  * YouTube gallery auto continuous play - embed a playlist or channel gallery and allow it to play one video after the next without requiring viewers to click a thumbnail
20
- * YouTube Live Stream - Given a link to a YouTube channel, the plugin wizard automatically finds a livestream if one is active in that channel and generates the embed code for you. On the settings page, you can also set defaults of what to automatically display if a live stream is not active at a given moment. For example, you can have your site display a gallery of a channel's entire video library so that users can have something to watch in the meantime. We hope it's a time saver.
21
  * Improved accessibility by using title attributes for screen reader support. It should help your site pass functional accessibility evaluations (FAE).
22
  * Improved ajax theme support
23
  * Site origin information with each embed code as an extra security measure. In YouTube's/Google's own words, checking this option "protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player." We especially recommend checking it as it adds higher security than the built-in YouTube embedding method that comes with the current version of WordPress (i.e. oembed).
@@ -135,18 +135,24 @@ You can also start and end each individual video at particular times. Like the a
135
 
136
  == Screenshots ==
137
 
138
- 1. YouTube Embed Screenshot 1: Paste a YouTube link on its own line and it will become a YouTube embed on your website. Or, use the shortcode method.
139
- 2. YouTube Embed Screenshot 2: How to get to YouTube's admin settings
140
- 3. YouTube Embed Screenshot 3: Visual YouTube Wizard and Search Tool
141
- 4. YouTube Embed Screenshot 4: Wizard Insert Search Result Screenshot
142
- 5. YouTube Embed Screenshot 5: Wizard Search Results Screenshot
143
- 6. YouTube Embed Screenshot 6: Gallery layout for a playlist or channel
144
- 7. YouTube Embed Screenshot 7: YouTube playlist galleries are also easily supported. Here's the Billboard Top 25 Songs for example.
145
- 8. YouTube Embed Screenshot 8: Localization/internationalization so you can set the player's interface language
146
- 9. YouTube Embed Screenshot 9: Optional YouTube channel subscription button above gallery thumbnails
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
 
150
  = Embed Plus for YouTube WordPress Plugin 13.1.2.5 =
151
  * Improve responsive sizing aspect ratio in widgets
152
  * Fix issue: some users receive 403 error when saving
4
  Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
+ Stable tag: 13.2
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, or YouTube.com live stream (with GDPR options)
17
  * Privacy and Consent - Improved privacy and GDPR compliance options like YouTube no cookie, YouTube API restrictions, and a customizable GDPR consent message
18
  * YouTube gallery capability (channel and playlist) – The ability to make playlist and channel embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
19
  * YouTube gallery auto continuous play - embed a playlist or channel gallery and allow it to play one video after the next without requiring viewers to click a thumbnail
20
+ * YouTube Live Stream - Given a link to a YouTube channel, the plugin wizard automatically finds a livestream if one is active in that channel and displays the livestream for you.
21
  * Improved accessibility by using title attributes for screen reader support. It should help your site pass functional accessibility evaluations (FAE).
22
  * Improved ajax theme support
23
  * Site origin information with each embed code as an extra security measure. In YouTube's/Google's own words, checking this option "protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player." We especially recommend checking it as it adds higher security than the built-in YouTube embedding method that comes with the current version of WordPress (i.e. oembed).
135
 
136
  == Screenshots ==
137
 
138
+ 1. Embed Plus for YouTube WordPress Plugin Screenshot 1: Paste a YouTube link on its own line and it will become a YouTube embed on your website. Or, use the shortcode method.
139
+ 2. Embed Plus for YouTube WordPress Plugin Screenshot 2: How to get to YouTube's admin settings
140
+ 3. Embed Plus for YouTube WordPress Plugin Screenshot 3: Visual YouTube Wizard and Search Tool
141
+ 4. Embed Plus for YouTube WordPress Plugin Screenshot 4: Wizard Insert Search Result Screenshot
142
+ 5. Embed Plus for YouTube WordPress Plugin Screenshot 5: Wizard Search Results Screenshot
143
+ 6. Embed Plus for YouTube WordPress Plugin Screenshot 6: Gallery layout for a playlist or channel
144
+ 7. Embed Plus for YouTube WordPress Plugin Screenshot 7: YouTube playlist galleries are also easily supported. Here's the Billboard Top 25 Songs for example.
145
+ 8. Embed Plus for YouTube WordPress Plugin Screenshot 8: Localization/internationalization so you can set the player's interface language
146
+ 9. Embed Plus for YouTube WordPress Plugin Screenshot 9: Optional YouTube channel subscription button above gallery thumbnails
147
 
148
  == Changelog ==
149
 
150
+ = Embed Plus for YouTube WordPress Plugin 13.2 =
151
+ * Add ability to embed a live stream from a given channel
152
+ * Reduction in live stream YouTube API quota usage
153
+ * Compatibility with other plugins having tabbed sections (e.g. Yuzo)
154
+ * Show YouTube API errors to admins only
155
+
156
  = Embed Plus for YouTube WordPress Plugin 13.1.2.5 =
157
  * Improve responsive sizing aspect ratio in widgets
158
  * Fix issue: some users receive 403 error when saving
scripts/ytprefs-admin.js CHANGED
@@ -400,7 +400,7 @@
400
 
401
  $(window).on('hashchange', function ()
402
  {
403
- if (window.location.hash.length > 0)
404
  {
405
  $section = $('section' + window.location.hash);
406
  if ($section.length > 0)
400
 
401
  $(window).on('hashchange', function ()
402
  {
403
+ if (window.location.hash.length > 0 && false) // stop; due to vi deprecation
404
  {
405
  $section = $('section' + window.location.hash);
406
  if ($section.length > 0)
scripts/ytprefs-admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- (function(a,b){a._EPYTA_.widen_ytprefs_wiz=a._EPYTA_.widen_ytprefs_wiz||function(){setTimeout(function(){var c=Math.min(950,b(a).width()-100);var d=-1*c/2;b("#TB_window").addClass("epyt-thickbox").animate({marginLeft:d,width:c},150,"swing",function(){b("#TB_window").get(0).style.setProperty("width",c,"important")});b("#TB_overlay").addClass("epyt-thickbox");b("#TB_window iframe").animate({width:c},150)},750)};a._EPYTA_.ytvi_cancel=a._EPYTA_.ytvi_cancel||function(){b(".ytvi-step").hide("fade",{},500,function(){b(".ytvi-step-1").show("fade",{},500)})};a._EPYTA_.moneyFormat=a._EPYTA_.moneyFormat||function(c){return"$"+parseFloat(c).toFixed(2)};a._EPYTA_.escId=function(c){return"#"+c.replace(/(:|\.|\[|\]|,|=|@)/g,"\\$1")};a._EPYTA_.demoBackgroundColor=function(c,d){setTimeout(function(){b(".vi-story-demo--info").css("background-color",b(a._EPYTA_.escId("vi_js_settings[backgroundColor]")).val())},0)};a._EPYTA_.demoTextColor=function(c,d){setTimeout(function(){b(".vi-story-demo--info *").css("color",b(a._EPYTA_.escId("vi_js_settings[textColor]")).val())},0)};a._EPYTA_.demoFontFamily=function(){b(".vi-story-demo--title").css("font-family",b(a._EPYTA_.escId("vi_js_settings[font]")).val())};a._EPYTA_.demoFontSize=function(){b(".vi-story-demo--title").css("font-size",b(a._EPYTA_.escId("vi_js_settings[fontSize]")).val()+"px")};a._EPYTA_.onboardNext=function(c){b(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){a.scrollTo(0,0);c.next().addClass("active-step")},600)};a._EPYTA_.onboardPrev=function(c){b(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){a.scrollTo(0,0);c.prev().addClass("active-step")},600)};a._EPYTA_.selectText=function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}};a._EPYTA_.adstxtLookup=function(){a._EPYTA_.adstxtLoading(true);b.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt?c="+Date.now(),dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:true}).always(function(c,h,f){if(h==="success"){var d=f;var e=c;switch(d.status){case 200:case 301:case 302:case 304:case 307:a._EPYTA_.adstxtVerify(e);break;default:a._EPYTA_.adstxtVerify("");break}}else{var d=c;var g=f;if(d.status==404){b.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt",dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:true}).always(function(i,m,l){if(m==="success"){var j=l;var k=i;switch(j.status){case 200:case 301:case 302:case 304:case 307:a._EPYTA_.adstxtVerify(k);break;default:a._EPYTA_.adstxtVerify("");break}}else{a._EPYTA_.adstxtVerify("")}})}else{a._EPYTA_.adstxtVerify("")}}})};a._EPYTA_.adstxtVerify=function(c){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_adstxt_status_soft_ajax",current_adstxt:c},success:function(d){if(d.code==2){b(".nav-tab-adstxt").addClass("nav-tab-valid")}else{if(d.code<=0){b(".nav-tab-adstxt").addClass("nav-tab-invalid")}}b(".adstxt-verify-message").html(d.message)},error:function(f,d,e){b(".nav-tab-adstxt").addClass("nav-tab-invalid");b(".adstxt-verify-message").html("Could not validate ads.txt: "+e)},complete:function(){a._EPYTA_.adstxtLoading(false)}})};a._EPYTA_.adstxtLoading=function(c){if(c){b(".nav-tab-adstxt").addClass("nav-tab-loading")}else{b(".nav-tab-adstxt").removeClass("nav-tab-loading")}};a._EPYTA_.gbPreviewSetup=function(){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API GB");a._EPADashboard_.pageReady();jQuery("body").fitVidsEP()};a._EPYTA_.iabAdd=function(e,d,c){var f=b('<div class="iab-cat-tag-button" data-tag="'+e+'">'+c+" : "+d+" &times;</div>");b(".iab-cat-tags-display").append(f);b(".iab-cat-tags-display .iab-cat-tag-button").sort(function(h,g){return b(h).text()>b(g).text()?1:-1}).appendTo(".iab-cat-tags-display")};b.fn.ytprefsFormJSON=function(){var d={};var c=this.serializeArray();b.each(c,function(){if(d[this.name]){if(!d[this.name].push){d[this.name]=[d[this.name]]}d[this.name].push(this.value||"")}else{d[this.name]=this.value||""}});return d};b(document).ready(function(){if(a.location.toString().indexOf("https://")===0){a._EPYTA_.wpajaxurl=a._EPYTA_.wpajaxurl.replace("http://","https://")}var g=a.addEventListener?"addEventListener":"attachEvent";var e=a[g];var d=g==="attachEvent"?"onmessage":"message";e(d,function(k){var i="";try{if(k.data.indexOf("youtubeembedplus")===0&&k.data.indexOf("clientId=")<0){i=k.data.split("|")[1];if(i.indexOf("[")!==0){i="<p>"+i+"</p>"}if(a.tinyMCE!==null&&a.tinyMCE.activeEditor!==null&&!a.tinyMCE.activeEditor.isHidden()){if(a._EPYTA_.mceBookmark){try{a.tinyMCE.activeEditor.selection.moveToBookmark(a._EPYTA_.mceBookmark)}catch(j){}}if(typeof a.tinyMCE.execInstanceCommand!=="undefined"){a.tinyMCE.execInstanceCommand(a.tinyMCE.activeEditor.id,"mceInsertContent",false,i)}else{send_to_editor(i)}setTimeout(function(){a._EPYTA_.mceBookmark=null},500)}else{i=i.replace("<p>","\n").replace("</p>","\n");if(typeof QTags.insertContent==="function"){QTags.insertContent(i)}else{send_to_editor(i)}}tb_remove()}}catch(j){}},false);b("body").on("click.tbyt","#ytprefs_wiz_button, .ytprefs_wiz_button_widget_text, .ytprefs-onboarding-launch",function(){a._EPYTA_.widen_ytprefs_wiz()});b("body").on("click.tbyt","#ytprefs_wiz_button_vi, .ytprefs_wiz_button_vi_widget_text",function(){send_to_editor("<p>[embed-vi-ad]</p>")});b(a).resize(a._EPYTA_.widen_ytprefs_wiz);b(document).on("wp-before-tinymce-init.ytprefs-media_button",function(i,j){$media_buttons=b(j.selector).closest(".wp-editor-wrap").find(".wp-media-buttons");if(!$media_buttons.find(".ytprefs_media_link").length){$media_buttons.append('<a href="'+encodeURI(a._EPYTA_.wizhref)+'" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>');if(a._EPYTA_.manage_options&&a._EPYTA_.vi_logged_in){$media_buttons.append('<a class="button ytprefs_vi_embed_shortcode" id="ytprefs_wiz_button_vi" title="Embed vi video ad"><span></span> Video Ad</a>')}}});if(b(".wrap-vi-settings").length){a._EPYTA_.adstxtLookup()}b('.wrap section a[href^="#jump"]').on("click",function(j){j.preventDefault();var i=b(this).attr("href");b('.nav-tab-wrapper a[href="'+i+'"]').click()});b(".ytprefs-ajax-form").on("keypress",function(i){if(i.which==13){i.preventDefault();b(this).find(".ytprefs-ajax-form--submit:not([disabled])").click()}});b(a).on("hashchange",function(){if(a.location.hash.length>0){$section=b("section"+a.location.hash);if($section.length>0){$section.find("h2").addClass("ytvi-hash-scroll");setTimeout(function(){$section.find("h2").removeClass("ytvi-hash-scroll")},2000)}$jumper=b(".jumper"+a.location.hash);if($jumper.length>0){b(".jumper"+a.location.hash+" + h3.sect").addClass("ytvi-hash-scroll");setTimeout(function(){b(".jumper"+a.location.hash+" + h3.sect").removeClass("ytvi-hash-scroll")},2000)}}});b(".vi-cover-prompt-no").on("click",function(){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_hide_feature_ajax"},success:function(i){if(!i||i.type==="error"){alertify.alert(i.message)}else{if(a!=a.top){a.location.reload()}else{a.top.location.href=i.url}}},error:function(k,i,j){alertify.alert('Sorry, there was a network error. Please try again, or turn off this feature using the "Hide Monetize Feature" checkbox on the "Defaults" tab of the YouTube settings. If the issue persists, please contact ext@embedplus.com')},complete:function(){}})});b(".vi-cover-prompt-yes").on("click",function(){b(".vi-cover-prompt, .vi-cover-clear").fadeOut(500);var i=new Date();i.setTime(i.getTime()+(365*24*60*60*1000));document.cookie="vi_cover_prompt_yes=1;expires="+i.toUTCString()+";path="+a._EPYTA_.admin_url});b(".vi-cover-prompt-maybe").on("click",function(){var i=new Date();i.setTime(i.getTime()+(365*24*60*60*1000));document.cookie="vi_cover_prompt_yes=1;expires="+i.toUTCString()+";path="+a._EPYTA_.admin_url;if(a!=a.top){a.location.reload()}else{a.top.location.href=a._EPYTA_.admin_url_ytprefs}});if(b(".vi-demo-screen").length>1){var f=setInterval(function(){b(".vi-demo-screen-2").toggleClass("demo-hide");b(".vi-demo-mobile-caption").toggleClass("demo-hide")},20000)}b(".ytvi-step-1--submit-register").on("click",function(i){var j=b.trim(b(".ytvi-register-email").val());if(!j.length){alertify.alert("Please enter your email address.")}else{b(".ytvi-step-1--submit-register").prop("disabled",true);b(".ytvi-step-1").hide("fade",{},500,function(){b(".ytvi-step-2-loading").show("fade",{},500,function(){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_cache_endpoints_ajax",email:j,domain:a.location.href},success:function(k){if(k.type=="success"){b(".ytvi-step-2 .ytvi-registration iframe").attr("src",k.signupURLParams);setTimeout(function(){b(".ytvi-step-2-loading").hide("fade",{},500,function(){b(".ytvi-step-2").show("fade",{},500)})},3000);var m=new Date(),l=new Date();l.setTime(l.getTime()+(365*24*60*60*1000));document.cookie="vi_signup_attempt="+m.toUTCString()+";expires="+l.toUTCString()+";path="+a._EPYTA_.admin_url}else{if(k.type==="error"){alertify.alert(k.message);a._EPYTA_.ytvi_cancel()}}},error:function(m,k,l){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");a._EPYTA_.ytvi_cancel()},complete:function(){b(".ytvi-step-1--submit-register").prop("disabled",false)}})})})}});b(".ytvi-registration--cancel").on("click",function(){a._EPYTA_.ytvi_cancel()});b(".ytvi-step-1--confirm").on("change",function(){if(b(this).is(":checked")){b(".ytvi-step-1--submit-register").prop("disabled",false)}else{b(".ytvi-step-1--submit-register").prop("disabled",true)}});b(".ytvi-step-1--submit-login").on("click",function(k){var l=b.trim(b(".ytvi-login-email").val());var i=b.trim(b(".ytvi-password").val());var j="";j+=l.length?"":"Please enter your email address. ";j+=i.length?"":"Please enter your vi dashboard password.";if(j.length){alertify.alert(j)}else{b(".ytvi-step-1--submit-login").prop("disabled",true);b(".ytvi-step-1").hide("fade",{},500,function(){b(".ytvi-login-loading").show("fade",{},500,function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_login_ajax",email:l,password:i},success:function(m){if(m.type==="error"){alertify.alert(m.message);a._EPYTA_.ytvi_cancel()}else{b(".ytvi-login-loading").hide("fade",{},500,function(){document.cookie="vi_signup_attempt=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";b(".ytvi-login-success-message").html(m.message);b(".ytvi-login-success").show("fade",{},500,function(){})})}},error:function(o,m,n){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");a._EPYTA_.ytvi_cancel()},complete:function(){b(".ytvi-step-1--submit-login").prop("disabled",false)}})})})}});b("a.vi-logged-in-goto").each(function(){if(b(this).attr("href").indexOf(a.location.pathname+a.location.search)>0||a.location.search.indexOf("youtube-my-preferences")>0){b(this).removeAttr("target")}});if(b(".wrap-vi-settings").length){b(".vi-how-works").on("click",function(){var i=b(this).data("jump");b('.nav-tab-wrapper > a[href="'+i+'"]').click()});b(document).on("click",".wrap-vi-settings .nav-tab-wrapper a",function(){$a=b(this);b(".wrap-vi-settings .nav-tab-wrapper a").removeClass("nav-tab-active");$a.addClass("nav-tab-active");b(".wrap-vi-settings section").hide();b(".wrap-vi-settings section").filter($a.attr("href")).fadeIn(200);return false});var c=b(".iab-cat-tags").val();if(c.length>0){var h=c.split(",");h.forEach(function(k){var j=b('.iab-cat-child option[value="'+k+'"]').text();var i=b('.iab-cat-parent option[value="'+(k.split("-")[0])+'"]').text();a._EPYTA_.iabAdd(k,j,i)})}b(".iab-cat-parent").on("change",function(){var i=b(this).val();b(".iab-cat-child").val(i);if(i==""){b(".iab-cat-child-box").addClass("hidden");b(".iab-cat-child-box select").prop("disabled",true)}else{b(".iab-cat-child-box").removeClass("hidden");b(".iab-cat-child-box select").prop("disabled",false);b(".iab-cat-child option").addClass("hidden");b('.iab-cat-child option[value^="'+i+'-"], .iab-cat-child option[value="'+i+'"], .iab-cat-child option[value=""]').removeClass("hidden");b(".iab-cat-child-box select").val("")}});b(".iab-cat-child").on("change",function(){var l=b(".iab-cat-tags").val()?b(".iab-cat-tags").val().split(","):[];if(l.length<4){var k=b(this).val();var j=b(this).find("option:selected").text();var i=b(".iab-cat-parent").find("option:selected").text();if(k&&l.indexOf(k)==-1){l.push(k);b(".iab-cat-tags").val(l.join(","));a._EPYTA_.iabAdd(k,j,i)}}else{alertify.alert("You can choose up to 4 categories maximum. In order to add a new one, you must remove one of the existing ones.")}});b(".iab-cat-tags-display").on("click",".iab-cat-tag-button",function(){var i=b(this);var j=i.data("tag");var k=b(".iab-cat-tags").val()?b(".iab-cat-tags").val().split(","):[];k=k.filter(function(l){return l!=j});b(".iab-cat-tags").val(k.join(","));i.remove()});a._EPYTA_.demoBackgroundColor();a._EPYTA_.demoTextColor();a._EPYTA_.demoFontFamily();a._EPYTA_.demoFontSize();b(a._EPYTA_.escId("vi_js_settings[backgroundColor]")).wpColorPicker({change:a._EPYTA_.demoBackgroundColor});b(a._EPYTA_.escId("vi_js_settings[textColor]")).wpColorPicker({change:a._EPYTA_.demoTextColor});b(a._EPYTA_.escId("vi_js_settings[font]")).on("change",a._EPYTA_.demoFontFamily);b(a._EPYTA_.escId("vi_js_settings[fontSize]")).on("change",a._EPYTA_.demoFontSize);b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_reports_ajax"},success:function(l){if(l.type==="error"||!l.data.mtdReport.length||typeof(l.data.mtdReport[0].date)==="undefined"){b(".vi-report-error").removeClass("hide");b(".vi-report").addClass("hide")}else{var n=l.data.mtdReport.map(function(p,o){return{x:moment(p.date,"YYYY-MM-DD").format(),y:p.revenue}});b(".vi-total-earnings-num").text(a._EPYTA_.moneyFormat(l.data.netRevenue));var k=moment(n.length?n[0].x:new Date()).format("MMMM YYYY");var j=document.getElementById("vi-report-canvas").getContext("2d");var m={type:"line",data:{datasets:[{label:k+" Earnings (USD)",backgroundColor:"#1193aa",borderColor:"#1193aa",fill:false,data:n}]},options:{responsive:true,maintainAspectRatio:false,plugins:{deferred:{delay:1000},},title:{display:false},legend:{labels:{fontSize:15,fontColor:"#000000"}},tooltips:{position:"nearest",mode:"index",intersect:false,callbacks:{label:function(o,p){return a._EPYTA_.moneyFormat(o.yLabel)},title:function(o,p){return moment(o[0].xLabel).format("LL")}}},scales:{xAxes:[{type:"time",time:{unit:"day",unitStepSize:1,displayFormats:{day:"MMM DD"}},display:true,scaleLabel:{display:true,labelString:"Date",fontSize:15,fontColor:"#000000"},ticks:{major:{fontStyle:"bold",fontColor:"#000000"}}}],yAxes:[{display:true,scaleLabel:{display:true,labelString:"Revenue",fontSize:15,fontColor:"#000000"},ticks:{callback:function(q,p,o){return a._EPYTA_.moneyFormat(q)}}}]}}};Chart.defaults.global.defaultFontFamily="'Segoe UI', Roboto, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif";var i=new Chart(j,m)}},error:function(k,i,j){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}});b(".ytvi-btn-logout").on("click",function(){var j="";var i=b(".iab-cat-tags").val();if(i.length>0&&i.split(",").length>1){j=" (Note: If you selected more than one video category, you must stay logged in to this settings page for your categories to automatically add variety to your ads)"}alertify.confirm().set({title:"Logout of Monetize settings",message:"Logging out won't delete your settings. However, it will require you or any other admins to re-login to change vi ad settings in the future"+j+".<br><br>To actually disable monetization, make sure the '<strong>vi ads are: On/Off</strong>' button is set to '<strong>Off</strong>.'",onok:function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_logout_ajax"},success:function(k){if(k.type==="error"){alertify.alert(k.message)}else{location.href=k.url}},error:function(m,k,l){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()})}b(".ytvi-btn-toggle").on("click",function(){var i=b(this);alertify.confirm().set({title:(i.hasClass("ytvi-btn-active")?"Turn off":"Turn on")+" your vi ads",message:i.hasClass("ytvi-btn-active")?"Are you sure you would like to deactivate your video ads? Please note that your ads will no longer appear on the front end and your revenue will be paused. If you would like them to reappear later, simply click on this button again.":"Click OK to confirm turning on your vi ads. They will appear on your site according to your <strong>Placement</strong> settings.",onok:function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_toggle_ajax"},success:function(j){if(j.type==="error"){alertify.alert(j.message)}else{i.find("strong").text(j.button_text);i.toggleClass("ytvi-btn-active ytvi-btn-inactive");if(i.hasClass("ytvi-btn-active")){b(".ytvi-msg-congrats").show(200)}else{b(".ytvi-msg-congrats").hide()}}},error:function(l,j,k){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()});b(".ytvi-intro-video-modal").on("click",function(k){k.preventDefault();var i=Math.min(document.body.clientWidth*0.8,800);var j=9/16*i;alertify.YoutubeDialog("BcrNPnWUkVI").set({frameless:true,resizeable:true}).resizeTo(i,j)});b("#vi_show_gdpr_authorization").on("change",function(){if(b(this).is(":checked")){b(".opt_vi_show_privacy_button").show(300)}else{b(".opt_vi_show_privacy_button").hide(300)}});if(b(".wrap-ytprefs-onboarding").length){b(".ytprefs-ob-nav-close").on("click",function(){a.parent.tb_remove();a.top.location.reload()});b(".ytprefs-ob-nav-prev").on("click",function(){a._EPYTA_.onboardPrev(b(this).closest(".ytprefs-ob-step"))});b(".ytprefs-ob-filter li").hover(function(){var i="."+b(this).find('input[type="checkbox"]').data("obfilter")+"-icon";b(i).addClass("yob-icon-visible")},function(){var i="."+b(this).find('input[type="checkbox"]').data("obfilter")+"-icon";b(i).removeClass("yob-icon-visible")});b('.ytprefs-ob-filter input[type="checkbox"]').on("change",function(){var i=b(this);var j=i.data("obfilter");var k=b('.ytprefs-ob-filter input[type="checkbox"]:checked');if(k.length&&!(k.length===1&&k.is('[data-obfilter="yob-monetize"]'))){b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",false)}else{b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",true)}if(j=="yob-monetize"){b(".ytprefs-ob-step3 .ytprefs-ob-nav-ultimate, .ytprefs-ob-step3 .ytprefs-ob-nav-penultimate").toggleClass("ytprefs-ob-nav-hide")}else{if(i.is(":checked")){b(".ytprefs-ob-step2 ."+j).addClass(j+"-visible")}else{b(".ytprefs-ob-step2 ."+j).removeClass(j+"-visible")}}});b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").on("click",function(){a._EPYTA_.onboardNext(b(this).closest(".ytprefs-ob-step"))});b("#form-onboarding").on("submit",function(k){k.preventDefault();(a.tinyMCE||a.tinymce).triggerSave();var i=b(this);i.find(".ytprefs-ob-nav-next").prop("disabled",true);var j=i.ytprefsFormJSON();j.security=a._EPYTA_.security;b.ajax({type:"post",dataType:"json",timeout:30000,url:a._EPYTA_?a._EPYTA_.wpajaxurl:ajaxurl,data:j,success:function(l){if(l.type=="success"){a._EPYTA_.onboardNext(i.closest(".ytprefs-ob-step"))}else{}},error:function(n,l,m){},complete:function(){i.find(".ytprefs-ob-nav-next").prop("disabled",false)}})});b(".ytprefs-ob-step3 .ytprefs-ob-nav-skip").on("click",function(){a._EPYTA_.onboardNext(b(this).closest(".ytprefs-ob-step"))});b("#form-onboarding-apikey").on("submit",function(k){k.preventDefault();var i=b(this);i.find(".ytprefs-ob-nav-next").prop("disabled",true);var j=i.ytprefsFormJSON();j.security=a._EPYTA_.security;b.ajax({type:"post",dataType:"json",timeout:30000,url:a._EPYTA_?a._EPYTA_.wpajaxurl:ajaxurl,data:j,success:function(l){if(l.type=="success"){if(i.find(".ytprefs-ob-nav-ultimate").hasClass("ytprefs-ob-nav-hide")){a._EPYTA_.onboardNext(i.closest(".ytprefs-ob-step"))}else{a.parent.tb_remove();a.top.location.reload()}}else{}},error:function(n,l,m){},complete:function(){i.find(".ytprefs-ob-nav-next").prop("disabled",false)}})})}});b(a).on("load",function(){if(_EPYTA_.onboarded!="1"){b(".ytprefs-onboarding-launch").click()}})})(window,jQuery);
1
 
2
+ (function(a,b){a._EPYTA_.widen_ytprefs_wiz=a._EPYTA_.widen_ytprefs_wiz||function(){setTimeout(function(){var c=Math.min(950,b(a).width()-100);var d=-1*c/2;b("#TB_window").addClass("epyt-thickbox").animate({marginLeft:d,width:c},150,"swing",function(){b("#TB_window").get(0).style.setProperty("width",c,"important")});b("#TB_overlay").addClass("epyt-thickbox");b("#TB_window iframe").animate({width:c},150)},750)};a._EPYTA_.ytvi_cancel=a._EPYTA_.ytvi_cancel||function(){b(".ytvi-step").hide("fade",{},500,function(){b(".ytvi-step-1").show("fade",{},500)})};a._EPYTA_.moneyFormat=a._EPYTA_.moneyFormat||function(c){return"$"+parseFloat(c).toFixed(2)};a._EPYTA_.escId=function(c){return"#"+c.replace(/(:|\.|\[|\]|,|=|@)/g,"\\$1")};a._EPYTA_.demoBackgroundColor=function(c,d){setTimeout(function(){b(".vi-story-demo--info").css("background-color",b(a._EPYTA_.escId("vi_js_settings[backgroundColor]")).val())},0)};a._EPYTA_.demoTextColor=function(c,d){setTimeout(function(){b(".vi-story-demo--info *").css("color",b(a._EPYTA_.escId("vi_js_settings[textColor]")).val())},0)};a._EPYTA_.demoFontFamily=function(){b(".vi-story-demo--title").css("font-family",b(a._EPYTA_.escId("vi_js_settings[font]")).val())};a._EPYTA_.demoFontSize=function(){b(".vi-story-demo--title").css("font-size",b(a._EPYTA_.escId("vi_js_settings[fontSize]")).val()+"px")};a._EPYTA_.onboardNext=function(c){b(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){a.scrollTo(0,0);c.next().addClass("active-step")},600)};a._EPYTA_.onboardPrev=function(c){b(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){a.scrollTo(0,0);c.prev().addClass("active-step")},600)};a._EPYTA_.selectText=function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}};a._EPYTA_.adstxtLookup=function(){a._EPYTA_.adstxtLoading(true);b.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt?c="+Date.now(),dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:true}).always(function(c,h,f){if(h==="success"){var d=f;var e=c;switch(d.status){case 200:case 301:case 302:case 304:case 307:a._EPYTA_.adstxtVerify(e);break;default:a._EPYTA_.adstxtVerify("");break}}else{var d=c;var g=f;if(d.status==404){b.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt",dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:true}).always(function(i,m,l){if(m==="success"){var j=l;var k=i;switch(j.status){case 200:case 301:case 302:case 304:case 307:a._EPYTA_.adstxtVerify(k);break;default:a._EPYTA_.adstxtVerify("");break}}else{a._EPYTA_.adstxtVerify("")}})}else{a._EPYTA_.adstxtVerify("")}}})};a._EPYTA_.adstxtVerify=function(c){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_adstxt_status_soft_ajax",current_adstxt:c},success:function(d){if(d.code==2){b(".nav-tab-adstxt").addClass("nav-tab-valid")}else{if(d.code<=0){b(".nav-tab-adstxt").addClass("nav-tab-invalid")}}b(".adstxt-verify-message").html(d.message)},error:function(f,d,e){b(".nav-tab-adstxt").addClass("nav-tab-invalid");b(".adstxt-verify-message").html("Could not validate ads.txt: "+e)},complete:function(){a._EPYTA_.adstxtLoading(false)}})};a._EPYTA_.adstxtLoading=function(c){if(c){b(".nav-tab-adstxt").addClass("nav-tab-loading")}else{b(".nav-tab-adstxt").removeClass("nav-tab-loading")}};a._EPYTA_.gbPreviewSetup=function(){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API GB");a._EPADashboard_.pageReady();jQuery("body").fitVidsEP()};a._EPYTA_.iabAdd=function(e,d,c){var f=b('<div class="iab-cat-tag-button" data-tag="'+e+'">'+c+" : "+d+" &times;</div>");b(".iab-cat-tags-display").append(f);b(".iab-cat-tags-display .iab-cat-tag-button").sort(function(h,g){return b(h).text()>b(g).text()?1:-1}).appendTo(".iab-cat-tags-display")};b.fn.ytprefsFormJSON=function(){var d={};var c=this.serializeArray();b.each(c,function(){if(d[this.name]){if(!d[this.name].push){d[this.name]=[d[this.name]]}d[this.name].push(this.value||"")}else{d[this.name]=this.value||""}});return d};b(document).ready(function(){if(a.location.toString().indexOf("https://")===0){a._EPYTA_.wpajaxurl=a._EPYTA_.wpajaxurl.replace("http://","https://")}var g=a.addEventListener?"addEventListener":"attachEvent";var e=a[g];var d=g==="attachEvent"?"onmessage":"message";e(d,function(k){var i="";try{if(k.data.indexOf("youtubeembedplus")===0&&k.data.indexOf("clientId=")<0){i=k.data.split("|")[1];if(i.indexOf("[")!==0){i="<p>"+i+"</p>"}if(a.tinyMCE!==null&&a.tinyMCE.activeEditor!==null&&!a.tinyMCE.activeEditor.isHidden()){if(a._EPYTA_.mceBookmark){try{a.tinyMCE.activeEditor.selection.moveToBookmark(a._EPYTA_.mceBookmark)}catch(j){}}if(typeof a.tinyMCE.execInstanceCommand!=="undefined"){a.tinyMCE.execInstanceCommand(a.tinyMCE.activeEditor.id,"mceInsertContent",false,i)}else{send_to_editor(i)}setTimeout(function(){a._EPYTA_.mceBookmark=null},500)}else{i=i.replace("<p>","\n").replace("</p>","\n");if(typeof QTags.insertContent==="function"){QTags.insertContent(i)}else{send_to_editor(i)}}tb_remove()}}catch(j){}},false);b("body").on("click.tbyt","#ytprefs_wiz_button, .ytprefs_wiz_button_widget_text, .ytprefs-onboarding-launch",function(){a._EPYTA_.widen_ytprefs_wiz()});b("body").on("click.tbyt","#ytprefs_wiz_button_vi, .ytprefs_wiz_button_vi_widget_text",function(){send_to_editor("<p>[embed-vi-ad]</p>")});b(a).resize(a._EPYTA_.widen_ytprefs_wiz);b(document).on("wp-before-tinymce-init.ytprefs-media_button",function(i,j){$media_buttons=b(j.selector).closest(".wp-editor-wrap").find(".wp-media-buttons");if(!$media_buttons.find(".ytprefs_media_link").length){$media_buttons.append('<a href="'+encodeURI(a._EPYTA_.wizhref)+'" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>');if(a._EPYTA_.manage_options&&a._EPYTA_.vi_logged_in){$media_buttons.append('<a class="button ytprefs_vi_embed_shortcode" id="ytprefs_wiz_button_vi" title="Embed vi video ad"><span></span> Video Ad</a>')}}});if(b(".wrap-vi-settings").length){a._EPYTA_.adstxtLookup()}b('.wrap section a[href^="#jump"]').on("click",function(j){j.preventDefault();var i=b(this).attr("href");b('.nav-tab-wrapper a[href="'+i+'"]').click()});b(".ytprefs-ajax-form").on("keypress",function(i){if(i.which==13){i.preventDefault();b(this).find(".ytprefs-ajax-form--submit:not([disabled])").click()}});b(a).on("hashchange",function(){if(a.location.hash.length>0&&false){$section=b("section"+a.location.hash);if($section.length>0){$section.find("h2").addClass("ytvi-hash-scroll");setTimeout(function(){$section.find("h2").removeClass("ytvi-hash-scroll")},2000)}$jumper=b(".jumper"+a.location.hash);if($jumper.length>0){b(".jumper"+a.location.hash+" + h3.sect").addClass("ytvi-hash-scroll");setTimeout(function(){b(".jumper"+a.location.hash+" + h3.sect").removeClass("ytvi-hash-scroll")},2000)}}});b(".vi-cover-prompt-no").on("click",function(){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_hide_feature_ajax"},success:function(i){if(!i||i.type==="error"){alertify.alert(i.message)}else{if(a!=a.top){a.location.reload()}else{a.top.location.href=i.url}}},error:function(k,i,j){alertify.alert('Sorry, there was a network error. Please try again, or turn off this feature using the "Hide Monetize Feature" checkbox on the "Defaults" tab of the YouTube settings. If the issue persists, please contact ext@embedplus.com')},complete:function(){}})});b(".vi-cover-prompt-yes").on("click",function(){b(".vi-cover-prompt, .vi-cover-clear").fadeOut(500);var i=new Date();i.setTime(i.getTime()+(365*24*60*60*1000));document.cookie="vi_cover_prompt_yes=1;expires="+i.toUTCString()+";path="+a._EPYTA_.admin_url});b(".vi-cover-prompt-maybe").on("click",function(){var i=new Date();i.setTime(i.getTime()+(365*24*60*60*1000));document.cookie="vi_cover_prompt_yes=1;expires="+i.toUTCString()+";path="+a._EPYTA_.admin_url;if(a!=a.top){a.location.reload()}else{a.top.location.href=a._EPYTA_.admin_url_ytprefs}});if(b(".vi-demo-screen").length>1){var f=setInterval(function(){b(".vi-demo-screen-2").toggleClass("demo-hide");b(".vi-demo-mobile-caption").toggleClass("demo-hide")},20000)}b(".ytvi-step-1--submit-register").on("click",function(i){var j=b.trim(b(".ytvi-register-email").val());if(!j.length){alertify.alert("Please enter your email address.")}else{b(".ytvi-step-1--submit-register").prop("disabled",true);b(".ytvi-step-1").hide("fade",{},500,function(){b(".ytvi-step-2-loading").show("fade",{},500,function(){b.ajax({type:"post",dataType:"json",timeout:120000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_cache_endpoints_ajax",email:j,domain:a.location.href},success:function(k){if(k.type=="success"){b(".ytvi-step-2 .ytvi-registration iframe").attr("src",k.signupURLParams);setTimeout(function(){b(".ytvi-step-2-loading").hide("fade",{},500,function(){b(".ytvi-step-2").show("fade",{},500)})},3000);var m=new Date(),l=new Date();l.setTime(l.getTime()+(365*24*60*60*1000));document.cookie="vi_signup_attempt="+m.toUTCString()+";expires="+l.toUTCString()+";path="+a._EPYTA_.admin_url}else{if(k.type==="error"){alertify.alert(k.message);a._EPYTA_.ytvi_cancel()}}},error:function(m,k,l){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");a._EPYTA_.ytvi_cancel()},complete:function(){b(".ytvi-step-1--submit-register").prop("disabled",false)}})})})}});b(".ytvi-registration--cancel").on("click",function(){a._EPYTA_.ytvi_cancel()});b(".ytvi-step-1--confirm").on("change",function(){if(b(this).is(":checked")){b(".ytvi-step-1--submit-register").prop("disabled",false)}else{b(".ytvi-step-1--submit-register").prop("disabled",true)}});b(".ytvi-step-1--submit-login").on("click",function(k){var l=b.trim(b(".ytvi-login-email").val());var i=b.trim(b(".ytvi-password").val());var j="";j+=l.length?"":"Please enter your email address. ";j+=i.length?"":"Please enter your vi dashboard password.";if(j.length){alertify.alert(j)}else{b(".ytvi-step-1--submit-login").prop("disabled",true);b(".ytvi-step-1").hide("fade",{},500,function(){b(".ytvi-login-loading").show("fade",{},500,function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_login_ajax",email:l,password:i},success:function(m){if(m.type==="error"){alertify.alert(m.message);a._EPYTA_.ytvi_cancel()}else{b(".ytvi-login-loading").hide("fade",{},500,function(){document.cookie="vi_signup_attempt=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";b(".ytvi-login-success-message").html(m.message);b(".ytvi-login-success").show("fade",{},500,function(){})})}},error:function(o,m,n){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com");a._EPYTA_.ytvi_cancel()},complete:function(){b(".ytvi-step-1--submit-login").prop("disabled",false)}})})})}});b("a.vi-logged-in-goto").each(function(){if(b(this).attr("href").indexOf(a.location.pathname+a.location.search)>0||a.location.search.indexOf("youtube-my-preferences")>0){b(this).removeAttr("target")}});if(b(".wrap-vi-settings").length){b(".vi-how-works").on("click",function(){var i=b(this).data("jump");b('.nav-tab-wrapper > a[href="'+i+'"]').click()});b(document).on("click",".wrap-vi-settings .nav-tab-wrapper a",function(){$a=b(this);b(".wrap-vi-settings .nav-tab-wrapper a").removeClass("nav-tab-active");$a.addClass("nav-tab-active");b(".wrap-vi-settings section").hide();b(".wrap-vi-settings section").filter($a.attr("href")).fadeIn(200);return false});var c=b(".iab-cat-tags").val();if(c.length>0){var h=c.split(",");h.forEach(function(k){var j=b('.iab-cat-child option[value="'+k+'"]').text();var i=b('.iab-cat-parent option[value="'+(k.split("-")[0])+'"]').text();a._EPYTA_.iabAdd(k,j,i)})}b(".iab-cat-parent").on("change",function(){var i=b(this).val();b(".iab-cat-child").val(i);if(i==""){b(".iab-cat-child-box").addClass("hidden");b(".iab-cat-child-box select").prop("disabled",true)}else{b(".iab-cat-child-box").removeClass("hidden");b(".iab-cat-child-box select").prop("disabled",false);b(".iab-cat-child option").addClass("hidden");b('.iab-cat-child option[value^="'+i+'-"], .iab-cat-child option[value="'+i+'"], .iab-cat-child option[value=""]').removeClass("hidden");b(".iab-cat-child-box select").val("")}});b(".iab-cat-child").on("change",function(){var l=b(".iab-cat-tags").val()?b(".iab-cat-tags").val().split(","):[];if(l.length<4){var k=b(this).val();var j=b(this).find("option:selected").text();var i=b(".iab-cat-parent").find("option:selected").text();if(k&&l.indexOf(k)==-1){l.push(k);b(".iab-cat-tags").val(l.join(","));a._EPYTA_.iabAdd(k,j,i)}}else{alertify.alert("You can choose up to 4 categories maximum. In order to add a new one, you must remove one of the existing ones.")}});b(".iab-cat-tags-display").on("click",".iab-cat-tag-button",function(){var i=b(this);var j=i.data("tag");var k=b(".iab-cat-tags").val()?b(".iab-cat-tags").val().split(","):[];k=k.filter(function(l){return l!=j});b(".iab-cat-tags").val(k.join(","));i.remove()});a._EPYTA_.demoBackgroundColor();a._EPYTA_.demoTextColor();a._EPYTA_.demoFontFamily();a._EPYTA_.demoFontSize();b(a._EPYTA_.escId("vi_js_settings[backgroundColor]")).wpColorPicker({change:a._EPYTA_.demoBackgroundColor});b(a._EPYTA_.escId("vi_js_settings[textColor]")).wpColorPicker({change:a._EPYTA_.demoTextColor});b(a._EPYTA_.escId("vi_js_settings[font]")).on("change",a._EPYTA_.demoFontFamily);b(a._EPYTA_.escId("vi_js_settings[fontSize]")).on("change",a._EPYTA_.demoFontSize);b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_reports_ajax"},success:function(l){if(l.type==="error"||!l.data.mtdReport.length||typeof(l.data.mtdReport[0].date)==="undefined"){b(".vi-report-error").removeClass("hide");b(".vi-report").addClass("hide")}else{var n=l.data.mtdReport.map(function(p,o){return{x:moment(p.date,"YYYY-MM-DD").format(),y:p.revenue}});b(".vi-total-earnings-num").text(a._EPYTA_.moneyFormat(l.data.netRevenue));var k=moment(n.length?n[0].x:new Date()).format("MMMM YYYY");var j=document.getElementById("vi-report-canvas").getContext("2d");var m={type:"line",data:{datasets:[{label:k+" Earnings (USD)",backgroundColor:"#1193aa",borderColor:"#1193aa",fill:false,data:n}]},options:{responsive:true,maintainAspectRatio:false,plugins:{deferred:{delay:1000},},title:{display:false},legend:{labels:{fontSize:15,fontColor:"#000000"}},tooltips:{position:"nearest",mode:"index",intersect:false,callbacks:{label:function(o,p){return a._EPYTA_.moneyFormat(o.yLabel)},title:function(o,p){return moment(o[0].xLabel).format("LL")}}},scales:{xAxes:[{type:"time",time:{unit:"day",unitStepSize:1,displayFormats:{day:"MMM DD"}},display:true,scaleLabel:{display:true,labelString:"Date",fontSize:15,fontColor:"#000000"},ticks:{major:{fontStyle:"bold",fontColor:"#000000"}}}],yAxes:[{display:true,scaleLabel:{display:true,labelString:"Revenue",fontSize:15,fontColor:"#000000"},ticks:{callback:function(q,p,o){return a._EPYTA_.moneyFormat(q)}}}]}}};Chart.defaults.global.defaultFontFamily="'Segoe UI', Roboto, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif";var i=new Chart(j,m)}},error:function(k,i,j){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}});b(".ytvi-btn-logout").on("click",function(){var j="";var i=b(".iab-cat-tags").val();if(i.length>0&&i.split(",").length>1){j=" (Note: If you selected more than one video category, you must stay logged in to this settings page for your categories to automatically add variety to your ads)"}alertify.confirm().set({title:"Logout of Monetize settings",message:"Logging out won't delete your settings. However, it will require you or any other admins to re-login to change vi ad settings in the future"+j+".<br><br>To actually disable monetization, make sure the '<strong>vi ads are: On/Off</strong>' button is set to '<strong>Off</strong>.'",onok:function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_logout_ajax"},success:function(k){if(k.type==="error"){alertify.alert(k.message)}else{location.href=k.url}},error:function(m,k,l){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()})}b(".ytvi-btn-toggle").on("click",function(){var i=b(this);alertify.confirm().set({title:(i.hasClass("ytvi-btn-active")?"Turn off":"Turn on")+" your vi ads",message:i.hasClass("ytvi-btn-active")?"Are you sure you would like to deactivate your video ads? Please note that your ads will no longer appear on the front end and your revenue will be paused. If you would like them to reappear later, simply click on this button again.":"Click OK to confirm turning on your vi ads. They will appear on your site according to your <strong>Placement</strong> settings.",onok:function(){b.ajax({type:"post",dataType:"json",timeout:12000000,url:a._EPYTA_.wpajaxurl,data:{security:a._EPYTA_.security,action:"my_embedplus_vi_toggle_ajax"},success:function(j){if(j.type==="error"){alertify.alert(j.message)}else{i.find("strong").text(j.button_text);i.toggleClass("ytvi-btn-active ytvi-btn-inactive");if(i.hasClass("ytvi-btn-active")){b(".ytvi-msg-congrats").show(200)}else{b(".ytvi-msg-congrats").hide()}}},error:function(l,j,k){alertify.alert("Sorry, there was a network error. Please try again. If the issue persists, please contact ext@embedplus.com")},complete:function(){}})}}).show()});b(".ytvi-intro-video-modal").on("click",function(k){k.preventDefault();var i=Math.min(document.body.clientWidth*0.8,800);var j=9/16*i;alertify.YoutubeDialog("BcrNPnWUkVI").set({frameless:true,resizeable:true}).resizeTo(i,j)});b("#vi_show_gdpr_authorization").on("change",function(){if(b(this).is(":checked")){b(".opt_vi_show_privacy_button").show(300)}else{b(".opt_vi_show_privacy_button").hide(300)}});if(b(".wrap-ytprefs-onboarding").length){b(".ytprefs-ob-nav-close").on("click",function(){a.parent.tb_remove();a.top.location.reload()});b(".ytprefs-ob-nav-prev").on("click",function(){a._EPYTA_.onboardPrev(b(this).closest(".ytprefs-ob-step"))});b(".ytprefs-ob-filter li").hover(function(){var i="."+b(this).find('input[type="checkbox"]').data("obfilter")+"-icon";b(i).addClass("yob-icon-visible")},function(){var i="."+b(this).find('input[type="checkbox"]').data("obfilter")+"-icon";b(i).removeClass("yob-icon-visible")});b('.ytprefs-ob-filter input[type="checkbox"]').on("change",function(){var i=b(this);var j=i.data("obfilter");var k=b('.ytprefs-ob-filter input[type="checkbox"]:checked');if(k.length&&!(k.length===1&&k.is('[data-obfilter="yob-monetize"]'))){b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",false)}else{b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").prop("disabled",true)}if(j=="yob-monetize"){b(".ytprefs-ob-step3 .ytprefs-ob-nav-ultimate, .ytprefs-ob-step3 .ytprefs-ob-nav-penultimate").toggleClass("ytprefs-ob-nav-hide")}else{if(i.is(":checked")){b(".ytprefs-ob-step2 ."+j).addClass(j+"-visible")}else{b(".ytprefs-ob-step2 ."+j).removeClass(j+"-visible")}}});b(".ytprefs-ob-step1 .ytprefs-ob-nav-next").on("click",function(){a._EPYTA_.onboardNext(b(this).closest(".ytprefs-ob-step"))});b("#form-onboarding").on("submit",function(k){k.preventDefault();(a.tinyMCE||a.tinymce).triggerSave();var i=b(this);i.find(".ytprefs-ob-nav-next").prop("disabled",true);var j=i.ytprefsFormJSON();j.security=a._EPYTA_.security;b.ajax({type:"post",dataType:"json",timeout:30000,url:a._EPYTA_?a._EPYTA_.wpajaxurl:ajaxurl,data:j,success:function(l){if(l.type=="success"){a._EPYTA_.onboardNext(i.closest(".ytprefs-ob-step"))}else{}},error:function(n,l,m){},complete:function(){i.find(".ytprefs-ob-nav-next").prop("disabled",false)}})});b(".ytprefs-ob-step3 .ytprefs-ob-nav-skip").on("click",function(){a._EPYTA_.onboardNext(b(this).closest(".ytprefs-ob-step"))});b("#form-onboarding-apikey").on("submit",function(k){k.preventDefault();var i=b(this);i.find(".ytprefs-ob-nav-next").prop("disabled",true);var j=i.ytprefsFormJSON();j.security=a._EPYTA_.security;b.ajax({type:"post",dataType:"json",timeout:30000,url:a._EPYTA_?a._EPYTA_.wpajaxurl:ajaxurl,data:j,success:function(l){if(l.type=="success"){if(i.find(".ytprefs-ob-nav-ultimate").hasClass("ytprefs-ob-nav-hide")){a._EPYTA_.onboardNext(i.closest(".ytprefs-ob-step"))}else{a.parent.tb_remove();a.top.location.reload()}}else{}},error:function(n,l,m){},complete:function(){i.find(".ytprefs-ob-nav-next").prop("disabled",false)}})})}});b(a).on("load",function(){if(_EPYTA_.onboarded!="1"){b(".ytprefs-onboarding-launch").click()}})})(window,jQuery);
scripts/ytprefs-wizard.js CHANGED
@@ -100,6 +100,7 @@ window._EPYTWIZ_ = window._EPYTWIZ_ || {};
100
  });
101
 
102
  $('.playlist-tabs').tabs();
 
103
 
104
  if (window._EPYTWIZ_.acc_expand)
105
  {
100
  });
101
 
102
  $('.playlist-tabs').tabs();
103
+ $('.livestream-tabs').tabs();
104
 
105
  if (window._EPYTWIZ_.acc_expand)
106
  {
scripts/ytprefs-wizard.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- window._EPYTWIZ_=window._EPYTWIZ_||{};(function(a){a.fn.followTo=function(e,b){var c=this,d=a(window);d.scroll(function(f){if(d.scrollTop()>e){c.css({position:"absolute",top:e})}else{c.css({position:"fixed",top:b})}})};window._EPYTWIZ_.getUrlParameter=function(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var d=new RegExp("[\\?&]"+b+"=([^&#]*)");var c=d.exec(window.location.search);return c===null?"":decodeURIComponent(c[1].replace(/\+/g," "))};window._EPYTWIZ_.selectText=window._EPYTWIZ_.selectText||function(d){if(document.selection){var b=document.body.createTextRange();b.moveToElementText(d);b.select()}else{if(window.getSelection){var c=window.getSelection();var b=document.createRange();b.selectNode(d);c.removeAllRanges();c.addRange(b)}}};window._EPYTWIZ_.loadmovieplain=window._EPYTWIZ_.loadmovieplain||function(b){var c='<iframe width="600" height="368" src="//www.youtube.com/embed/~ytid?autoplay=1" frameborder="0" allowfullscreen ></iframe>';c=c.replace(/~ytid/g,b);a("#watch"+b).html(c);a("#closeme"+b).css("display","inline");a("#moviecontainer"+b).css("display","block");if(document.getElementById("scrollwatch"+b)){setTimeout(function(){a("html, body").animate({scrollTop:a("#scrollwatch"+b).offset().top-50},250,function(){})},800)}};window._EPYTWIZ_.closeme=window._EPYTWIZ_.closeme||function(b){a("#moviecontainer"+b).css("display","none");a("#watch"+b).html("")};a(document).ready(function(){a(".wiz-accordion").accordion({header:"> h3",collapsible:true,active:false,icons:{header:"ui-icon-circle-arrow-e",activeHeader:"ui-icon-circle-arrow-s"},heightStyle:"content",autoHeight:false}).find("h3.header-go").click(function(){window.open(a(this).find("a").attr("href"),"_blank");return false});a(".playlist-tabs").tabs();if(window._EPYTWIZ_.acc_expand){a(".wiz-accordion #"+window._EPYTWIZ_.acc_expand).click()}a("form.wizform").each(function(){$thisForm=a(this);$thisForm.find(".txturlpastecustom").on("paste",function(){$thisTxtUrl=a(this);setTimeout(function(){var d=a.trim($thisTxtUrl.val());var c=/<.*/i;if(c.test(d)){var e=new RegExp("(?:https?://)?(?:www\\.)?(?:youtu\\.be/|youtube\\.com(?:/embed/|/v/|/watch\\?v=))([\\w-]{10,12})","ig");var f=e.exec(d);if(f){var g=f[1];$thisTxtUrl.val("https://www.youtube.com/watch?v="+g)}else{$thisTxtUrl.val("https://www.youtube.com/watch?v=")}$thisForm.find(".badpaste").show()}else{$thisForm.find(".badpaste").hide()}},100)})});var b=a("#epyt_wiz_wrap");b.on("click",".copycode",function(){window._EPYTWIZ_.selectText(this)});b.on("click",".inserttopost",function(){var d=window.location.toString().split("/")[0]+"//"+window.location.toString().split("/")[2];var e=a(this).attr("rel");var c=window._EPYTWIZ_.getUrlParameter("clientId");parent.postMessage("youtubeembedplus|"+e+(c?"|clientId="+c:""),d)});b.on("click",".resultdiv .load-movie",function(){window._EPYTWIZ_.loadmovieplain(a(this).closest(".resultdiv").data("vid"));return false});b.on("click",".moviecontainer a.closeme",function(){window._EPYTWIZ_.closeme(a(this).data("vid"))})})})(jQuery);
1
 
2
+ window._EPYTWIZ_=window._EPYTWIZ_||{};(function(a){a.fn.followTo=function(e,b){var c=this,d=a(window);d.scroll(function(f){if(d.scrollTop()>e){c.css({position:"absolute",top:e})}else{c.css({position:"fixed",top:b})}})};window._EPYTWIZ_.getUrlParameter=function(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var d=new RegExp("[\\?&]"+b+"=([^&#]*)");var c=d.exec(window.location.search);return c===null?"":decodeURIComponent(c[1].replace(/\+/g," "))};window._EPYTWIZ_.selectText=window._EPYTWIZ_.selectText||function(d){if(document.selection){var b=document.body.createTextRange();b.moveToElementText(d);b.select()}else{if(window.getSelection){var c=window.getSelection();var b=document.createRange();b.selectNode(d);c.removeAllRanges();c.addRange(b)}}};window._EPYTWIZ_.loadmovieplain=window._EPYTWIZ_.loadmovieplain||function(b){var c='<iframe width="600" height="368" src="//www.youtube.com/embed/~ytid?autoplay=1" frameborder="0" allowfullscreen ></iframe>';c=c.replace(/~ytid/g,b);a("#watch"+b).html(c);a("#closeme"+b).css("display","inline");a("#moviecontainer"+b).css("display","block");if(document.getElementById("scrollwatch"+b)){setTimeout(function(){a("html, body").animate({scrollTop:a("#scrollwatch"+b).offset().top-50},250,function(){})},800)}};window._EPYTWIZ_.closeme=window._EPYTWIZ_.closeme||function(b){a("#moviecontainer"+b).css("display","none");a("#watch"+b).html("")};a(document).ready(function(){a(".wiz-accordion").accordion({header:"> h3",collapsible:true,active:false,icons:{header:"ui-icon-circle-arrow-e",activeHeader:"ui-icon-circle-arrow-s"},heightStyle:"content",autoHeight:false}).find("h3.header-go").click(function(){window.open(a(this).find("a").attr("href"),"_blank");return false});a(".playlist-tabs").tabs();a(".livestream-tabs").tabs();if(window._EPYTWIZ_.acc_expand){a(".wiz-accordion #"+window._EPYTWIZ_.acc_expand).click()}a("form.wizform").each(function(){$thisForm=a(this);$thisForm.find(".txturlpastecustom").on("paste",function(){$thisTxtUrl=a(this);setTimeout(function(){var d=a.trim($thisTxtUrl.val());var c=/<.*/i;if(c.test(d)){var e=new RegExp("(?:https?://)?(?:www\\.)?(?:youtu\\.be/|youtube\\.com(?:/embed/|/v/|/watch\\?v=))([\\w-]{10,12})","ig");var f=e.exec(d);if(f){var g=f[1];$thisTxtUrl.val("https://www.youtube.com/watch?v="+g)}else{$thisTxtUrl.val("https://www.youtube.com/watch?v=")}$thisForm.find(".badpaste").show()}else{$thisForm.find(".badpaste").hide()}},100)})});var b=a("#epyt_wiz_wrap");b.on("click",".copycode",function(){window._EPYTWIZ_.selectText(this)});b.on("click",".inserttopost",function(){var d=window.location.toString().split("/")[0]+"//"+window.location.toString().split("/")[2];var e=a(this).attr("rel");var c=window._EPYTWIZ_.getUrlParameter("clientId");parent.postMessage("youtubeembedplus|"+e+(c?"|clientId="+c:""),d)});b.on("click",".resultdiv .load-movie",function(){window._EPYTWIZ_.loadmovieplain(a(this).closest(".resultdiv").data("vid"));return false});b.on("click",".moviecontainer a.closeme",function(){window._EPYTWIZ_.closeme(a(this).data("vid"))})})})(jQuery);
styles/ytprefs-onboarding.css CHANGED
@@ -258,4 +258,20 @@ iframe#gdpr_consent_message_ifr {
258
 
259
  .ytprefs-ob-success:after {
260
  content: url('../images/adstxt-valid.png');
261
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
  .ytprefs-ob-success:after {
260
  content: url('../images/adstxt-valid.png');
261
+ }
262
+
263
+ input[type="checkbox"] + label .check-note {
264
+ display: none;
265
+ }
266
+
267
+ input[type="checkbox"]:checked + label .check-note {
268
+ display: inline;
269
+ }
270
+
271
+ #not_live_on ~ #wp-not_live_content-wrap {
272
+ opacity: .3;
273
+ }
274
+
275
+ #not_live_on:checked ~ #wp-not_live_content-wrap {
276
+ opacity: 1;
277
+ }
styles/ytprefs-onboarding.min.css CHANGED
@@ -1,2 +1,2 @@
1
 
2
- #wphead{display:none}#wpbody{margin-left:0}#adminmenuback{display:none}#adminmenu,adminmenuwrap{display:none}#wpcontent,.auto-fold #wpcontent{margin-left:0}#wpadminbar{display:none}html.wp-toolbar{padding:0}#footer,#wpfooter,.auto-fold #wpfooter{display:none}#screen-meta-links{display:none}#wpfooter{clear:both}.clearboth{clear:both}.pad20{padding:20px}.center{text-align:center}.bold{font-weight:bold}.orange{color:#f85d00}.smallnote{font-size:small;font-style:italic}.indent-option{margin-left:25px}.ui-widget,.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:inherit}.ui-accordion .ui-accordion-header{margin-top:15px;font-weight:bold}.ui-accordion .ui-accordion-content.header-go-content{display:none!important;height:0!important}.ui-widget-content a{color:#0073aa}input.ui-widget[type=text]{margin:0;padding:.4em 1em;width:450px}.txt-button-align input.ui-widget[type=text],.txt-button-align button{vertical-align:top}#epyt_wiz_wrap .ui-button{font-weight:bold}.ui-button .ui-icon{transform:scale(1.35,1.35)}.copycode{background-color:#eef;border:2px solid #c7d6e4;display:inline-block;font-size:.9em;overflow-x:hidden;vertical-align:middle;white-space:nowrap;width:400px;padding-left:15px;padding-right:15px}.pointer{cursor:pointer}.relative{position:relative}.wrap-ytprefs-onboarding h1{line-height:40px}.wrap-ytprefs-onboarding h2{line-height:2em}.wrap-ytprefs-onboarding .box-vi-not-interested{display:none}.ytprefs-ob-step{position:absolute;visibility:hidden;opacity:0;transition:opacity 300ms,visibility 300ms;width:100%;height:0;top:-200000px}.ytprefs-ob-step.active-step{visibility:visible;opacity:1;height:auto;top:0}.ytprefs-ob-title{font-size:2em;line-height:2em;text-align:center}.ytprefs-ob-subtitle{font-size:1.4em;line-height:2em}.ytprefs-ob-content{max-width:800px;margin:0 auto}.ytprefs-ob-nav{text-align:center;margin-top:20px;padding-top:20px;border-top:2px solid #ddd;clear:both;margin-bottom:50px}.ytprefs-ob-nav .ytprefs-ob-nav-hide{display:none}.ytprefs-ob-nav button.button-secondary,.ytprefs-ob-nav button.button-primary{display:inline-block;margin:0 10px}.ytprefs-ob-nav button.ytprefs-ob-nav-prev,.ytprefs-ob-nav button.ytprefs-ob-nav-close{margin-right:25px}.ytprefs-ob-step1 ul.ytprefs-ob-filter li{margin-bottom:15px}.ytprefs-ob-step1 .ytprefs-hover-icons{width:160px;float:right;margin-left:30px;min-height:200px;position:relative}.ytprefs-ob-step1 .ytprefs-hover-icons img{position:absolute;top:0;left:0;opacity:0;display:block;width:100%;height:auto;transition:opacity 200ms}.ytprefs-ob-step1 .ytprefs-hover-icons img.yob-icon-visible{opacity:1}.ytprefs-ob-step2 .ytprefs-ob-setting{display:none;margin:10px 0 25px 0}.ytprefs-ob-step2 .ytprefs-ob-setting.yob-single-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-gallery-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-standalone-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-privacy-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-live-visible{display:block}.ytprefs-ob-step2 form #responsive ~ #boxresponsive_all{height:0;visibility:none;opacity:0;transition:opacity 300ms,visibility 300ms}.ytprefs-ob-step2 form #responsive:checked ~ #boxresponsive_all{height:auto;visibility:visible;opacity:1}.gdpr-options-left{width:65%;float:left}.gdpr-options-right{width:33%;float:right;margin-top:20px}.gdpr-options-right .img-gdpr-message{width:100%;height:auto}iframe#gdpr_consent_message_ifr{min-height:250px!important}.ytprefs-ob-step4 .ytprefs-ob-content{max-width:100%}.wiztab-screenshots{float:right;max-width:50%;height:auto;clear:right;margin-left:30px;margin-bottom:15px;display:block;border:5px solid #ddd}.ytprefs-ob-success{color:#00a000;font-weight:bold}.ytprefs-ob-success:after{content:url('../images/adstxt-valid.png')}
1
 
2
+ #wphead{display:none}#wpbody{margin-left:0}#adminmenuback{display:none}#adminmenu,adminmenuwrap{display:none}#wpcontent,.auto-fold #wpcontent{margin-left:0}#wpadminbar{display:none}html.wp-toolbar{padding:0}#footer,#wpfooter,.auto-fold #wpfooter{display:none}#screen-meta-links{display:none}#wpfooter{clear:both}.clearboth{clear:both}.pad20{padding:20px}.center{text-align:center}.bold{font-weight:bold}.orange{color:#f85d00}.smallnote{font-size:small;font-style:italic}.indent-option{margin-left:25px}.ui-widget,.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:inherit}.ui-accordion .ui-accordion-header{margin-top:15px;font-weight:bold}.ui-accordion .ui-accordion-content.header-go-content{display:none!important;height:0!important}.ui-widget-content a{color:#0073aa}input.ui-widget[type=text]{margin:0;padding:.4em 1em;width:450px}.txt-button-align input.ui-widget[type=text],.txt-button-align button{vertical-align:top}#epyt_wiz_wrap .ui-button{font-weight:bold}.ui-button .ui-icon{transform:scale(1.35,1.35)}.copycode{background-color:#eef;border:2px solid #c7d6e4;display:inline-block;font-size:.9em;overflow-x:hidden;vertical-align:middle;white-space:nowrap;width:400px;padding-left:15px;padding-right:15px}.pointer{cursor:pointer}.relative{position:relative}.wrap-ytprefs-onboarding h1{line-height:40px}.wrap-ytprefs-onboarding h2{line-height:2em}.wrap-ytprefs-onboarding .box-vi-not-interested{display:none}.ytprefs-ob-step{position:absolute;visibility:hidden;opacity:0;transition:opacity 300ms,visibility 300ms;width:100%;height:0;top:-200000px}.ytprefs-ob-step.active-step{visibility:visible;opacity:1;height:auto;top:0}.ytprefs-ob-title{font-size:2em;line-height:2em;text-align:center}.ytprefs-ob-subtitle{font-size:1.4em;line-height:2em}.ytprefs-ob-content{max-width:800px;margin:0 auto}.ytprefs-ob-nav{text-align:center;margin-top:20px;padding-top:20px;border-top:2px solid #ddd;clear:both;margin-bottom:50px}.ytprefs-ob-nav .ytprefs-ob-nav-hide{display:none}.ytprefs-ob-nav button.button-secondary,.ytprefs-ob-nav button.button-primary{display:inline-block;margin:0 10px}.ytprefs-ob-nav button.ytprefs-ob-nav-prev,.ytprefs-ob-nav button.ytprefs-ob-nav-close{margin-right:25px}.ytprefs-ob-step1 ul.ytprefs-ob-filter li{margin-bottom:15px}.ytprefs-ob-step1 .ytprefs-hover-icons{width:160px;float:right;margin-left:30px;min-height:200px;position:relative}.ytprefs-ob-step1 .ytprefs-hover-icons img{position:absolute;top:0;left:0;opacity:0;display:block;width:100%;height:auto;transition:opacity 200ms}.ytprefs-ob-step1 .ytprefs-hover-icons img.yob-icon-visible{opacity:1}.ytprefs-ob-step2 .ytprefs-ob-setting{display:none;margin:10px 0 25px 0}.ytprefs-ob-step2 .ytprefs-ob-setting.yob-single-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-gallery-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-standalone-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-privacy-visible,.ytprefs-ob-step2 .ytprefs-ob-setting.yob-live-visible{display:block}.ytprefs-ob-step2 form #responsive ~ #boxresponsive_all{height:0;visibility:none;opacity:0;transition:opacity 300ms,visibility 300ms}.ytprefs-ob-step2 form #responsive:checked ~ #boxresponsive_all{height:auto;visibility:visible;opacity:1}.gdpr-options-left{width:65%;float:left}.gdpr-options-right{width:33%;float:right;margin-top:20px}.gdpr-options-right .img-gdpr-message{width:100%;height:auto}iframe#gdpr_consent_message_ifr{min-height:250px!important}.ytprefs-ob-step4 .ytprefs-ob-content{max-width:100%}.wiztab-screenshots{float:right;max-width:50%;height:auto;clear:right;margin-left:30px;margin-bottom:15px;display:block;border:5px solid #ddd}.ytprefs-ob-success{color:#00a000;font-weight:bold}.ytprefs-ob-success:after{content:url('../images/adstxt-valid.png')}input[type="checkbox"]+label .check-note{display:none}input[type="checkbox"]:checked+label .check-note{display:inline}#not_live_on ~ #wp-not_live_content-wrap{opacity:.3}#not_live_on:checked ~ #wp-not_live_content-wrap{opacity:1}
styles/ytprefs-wizard.css CHANGED
@@ -27,6 +27,10 @@ html.wp-toolbar {padding: 0px;}
27
  font-family: inherit;
28
  }
29
 
 
 
 
 
30
 
31
  .ui-accordion .ui-accordion-header {
32
  margin-top: 15px;
27
  font-family: inherit;
28
  }
29
 
30
+ .ui-widget .ui-widget li {
31
+ font-size: 13px;
32
+ }
33
+
34
 
35
  .ui-accordion .ui-accordion-header {
36
  margin-top: 15px;
styles/ytprefs-wizard.min.css CHANGED
@@ -1,2 +1,2 @@
1
 
2
- #wphead{display:none}#wpbody{margin-left:0}#adminmenuback{display:none}#adminmenu,adminmenuwrap{display:none}#wpcontent,.auto-fold #wpcontent{margin-left:0}#wpadminbar{display:none}html.wp-toolbar{padding:0}#footer,#wpfooter,.auto-fold #wpfooter{display:none}#screen-meta-links{display:none}#wpfooter{clear:both}.clearboth{clear:both}.pad20{padding:20px}.center{text-align:center}.bold{font-weight:bold}.orange{color:#f85d00}.smallnote{font-size:small;font-style:italic}.ui-widget,.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:inherit}.ui-accordion .ui-accordion-header{margin-top:15px;font-weight:bold}.ui-accordion .ui-accordion-content.header-go-content{display:none!important;height:0!important}.ui-widget-content a{color:#0073aa}input.ui-widget[type=text]{margin:0;padding:.4em 1em;width:450px;line-height:2}.txt-button-align input.ui-widget[type=text],.txt-button-align button{vertical-align:top}#epyt_wiz_wrap .ui-button{font-weight:bold;line-height:2}#epyt_wiz_wrap .ui-icon{display:inline-block}.ui-button .ui-icon{transform:scale(1.35,1.35);display:inline-block}.copycode{background-color:#eef;border:2px solid #c7d6e4;display:inline-block;font-size:.9em;overflow-x:hidden;vertical-align:middle;white-space:nowrap;width:400px;padding-left:15px;padding-right:15px}.pointer{cursor:pointer}.relative{position:relative}.epyt-search-results a.pointer.thumb.load-movie{float:left;width:160px;height:90px;background-position:center;background-size:cover;display:block;margin:0 25px 10px 0}.epyt-search-results .resultdiv{margin-bottom:40px}.epyt-search-results .resultinfo{text-align:left}.epyt-search-results .resulttitle{font-weight:bold}.epyt-search-results .moviecontainer{margin-bottom:40px;margin-top:-30px;clear:both}.epyt-search-results .closeme{right:110px;top:-10px;position:absolute;font-weight:bold;font-size:50px;cursor:pointer}.epyt-search-results .resulttitle .ui-icon{transform:scale(1.35,1.35)}.epyt-pagination{clear:both;text-align:center;padding:10px 8px 10px 8px;display:none}.epyt-pagination>div,.epyt-pagenumbers>div{display:inline-block;padding:0 2px 0 2px;vertical-align:middle}.epyt-pagination .epyt-pagebutton{cursor:pointer;display:inline-block;padding:0 10px 0 10px}.epyt-pagebutton>div{display:inline}.epyt-pagination .epyt-loader{display:none}.epyt-gallery-list.epyt-loading .epyt-pagination .epyt-loader{display:inline-block}.epyt-pagebutton.hide,.epyt-pagenumbers.hide{display:none!important;opacity:0!important;visibility:hidden!important}.ui-tabs .ui-tabs-anchor{font-weight:bold}.playlist-tabs{margin-bottom:20px}.icon-playlist{float:left;height:auto;margin:15px 30px 0 0;max-width:150px}a.ythealth{clear:both;float:right;margin-top:15px;position:relative}a.ythealth .tip{position:absolute;width:450px;right:0;top:-100px;display:none;background-color:#fff;padding:20px;border:2px solid #ddd;border-radius:5px}a.ythealth:hover .tip{display:block}.h3_vi_monetize-content{background-color:#f0f0f0}
1
 
2
+ #wphead{display:none}#wpbody{margin-left:0}#adminmenuback{display:none}#adminmenu,adminmenuwrap{display:none}#wpcontent,.auto-fold #wpcontent{margin-left:0}#wpadminbar{display:none}html.wp-toolbar{padding:0}#footer,#wpfooter,.auto-fold #wpfooter{display:none}#screen-meta-links{display:none}#wpfooter{clear:both}.clearboth{clear:both}.pad20{padding:20px}.center{text-align:center}.bold{font-weight:bold}.orange{color:#f85d00}.smallnote{font-size:small;font-style:italic}.ui-widget,.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:inherit}.ui-widget .ui-widget li{font-size:13px}.ui-accordion .ui-accordion-header{margin-top:15px;font-weight:bold}.ui-accordion .ui-accordion-content.header-go-content{display:none!important;height:0!important}.ui-widget-content a{color:#0073aa}input.ui-widget[type=text]{margin:0;padding:.4em 1em;width:450px;line-height:2}.txt-button-align input.ui-widget[type=text],.txt-button-align button{vertical-align:top}#epyt_wiz_wrap .ui-button{font-weight:bold;line-height:2}#epyt_wiz_wrap .ui-icon{display:inline-block}.ui-button .ui-icon{transform:scale(1.35,1.35);display:inline-block}.copycode{background-color:#eef;border:2px solid #c7d6e4;display:inline-block;font-size:.9em;overflow-x:hidden;vertical-align:middle;white-space:nowrap;width:400px;padding-left:15px;padding-right:15px}.pointer{cursor:pointer}.relative{position:relative}.epyt-search-results a.pointer.thumb.load-movie{float:left;width:160px;height:90px;background-position:center;background-size:cover;display:block;margin:0 25px 10px 0}.epyt-search-results .resultdiv{margin-bottom:40px}.epyt-search-results .resultinfo{text-align:left}.epyt-search-results .resulttitle{font-weight:bold}.epyt-search-results .moviecontainer{margin-bottom:40px;margin-top:-30px;clear:both}.epyt-search-results .closeme{right:110px;top:-10px;position:absolute;font-weight:bold;font-size:50px;cursor:pointer}.epyt-search-results .resulttitle .ui-icon{transform:scale(1.35,1.35)}.epyt-pagination{clear:both;text-align:center;padding:10px 8px 10px 8px;display:none}.epyt-pagination>div,.epyt-pagenumbers>div{display:inline-block;padding:0 2px 0 2px;vertical-align:middle}.epyt-pagination .epyt-pagebutton{cursor:pointer;display:inline-block;padding:0 10px 0 10px}.epyt-pagebutton>div{display:inline}.epyt-pagination .epyt-loader{display:none}.epyt-gallery-list.epyt-loading .epyt-pagination .epyt-loader{display:inline-block}.epyt-pagebutton.hide,.epyt-pagenumbers.hide{display:none!important;opacity:0!important;visibility:hidden!important}.ui-tabs .ui-tabs-anchor{font-weight:bold}.playlist-tabs{margin-bottom:20px}.icon-playlist{float:left;height:auto;margin:15px 30px 0 0;max-width:150px}a.ythealth{clear:both;float:right;margin-top:15px;position:relative}a.ythealth .tip{position:absolute;width:450px;right:0;top:-100px;display:none;background-color:#fff;padding:20px;border:2px solid #ddd;border-radius:5px}a.ythealth:hover .tip{display:block}.h3_vi_monetize-content{background-color:#f0f0f0}
youtube.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
- Version: 13.1.2.5
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  */
10
 
11
  /*
12
  Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
13
- Copyright (C) 2019 EmbedPlus.com
14
 
15
  This program is free software: you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ class YouTubePrefs
34
 
35
  public static $folder_name = 'youtube-embed-plus';
36
  public static $curltimeout = 30;
37
- public static $version = '13.1.2.5';
38
  public static $opt_version = 'version';
39
  public static $optembedwidth = null;
40
  public static $optembedheight = null;
@@ -106,9 +106,11 @@ class YouTubePrefs
106
  public static $opt_gallery_customprev = 'gallery_customprev';
107
  public static $opt_gallery_customnext = 'gallery_customnext';
108
  public static $opt_not_live_content = 'not_live_content';
 
109
  public static $opt_admin_off_scripts = 'admin_off_scripts';
110
  public static $opt_ajax_save = 'ajax_save';
111
  public static $opt_onboarded = 'onboarded';
 
112
  public static $opt_alloptions = 'youtubeprefs_alloptions';
113
  public static $alloptions = null;
114
  public static $yt_options = array();
@@ -176,10 +178,10 @@ class YouTubePrefs
176
  ///////////////////////////////////////////////////////////////////////////////////////////////////
177
  ///////////////////////////////////////////////////////////////////////////////////////////////////
178
 
179
- public static $oldytregex = '@^\s*https?://(?:www\.)?(?:(?:youtube.com/(?:(?:watch)|(?:embed)|(?:playlist))/{0,1}\?)|(?:youtu.be/))([^\s"]+)\s*$@im';
180
- public static $ytregex = '@^[\r\t ]*https?://(?:www\.)?(?:(?:youtube.com/(?:(?:watch)|(?:embed)|(?:playlist))/{0,1}\?)|(?:youtu.be/))([^\s"]+)[\r\t ]*$@im';
181
- public static $justurlregex = '@https?://(?:www\.)?(?:(?:youtube.com/(?:(?:watch)|(?:embed)|(?:playlist))/{0,1}\?)|(?:youtu.be/))([^\[\s"]+)@i';
182
-
183
  ///////////////////////////////////////////////////////////////////////////////////////////////////
184
  ///////////////////////////////////////////////////////////////////////////////////////////////////
185
  ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -229,7 +231,8 @@ class YouTubePrefs
229
  'index',
230
  'list',
231
  'start',
232
- 'end'
 
233
  );
234
 
235
  add_action('media_buttons', array(get_class(), 'media_button_wizard'), 11);
@@ -667,6 +670,9 @@ class YouTubePrefs
667
  $step1_channel_error_invalid = 'Sorry, that does not seem to be a link to an existing video. ' . $step1_api_error_msg;
668
  $step1_live_errors = '';
669
  $step1_live_error_invalid = 'Sorry, that does not seem to be a valid link to an existing live video. ' . $step1_api_error_msg;
 
 
 
670
  $if_live_preview = false;
671
 
672
  $theytid = null;
@@ -970,6 +976,86 @@ class YouTubePrefs
970
  $acc_expand = 'h3_channel';
971
  }
972
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
973
  else if ($submit_type === 'step1_live')
974
  {
975
  $search = sanitize_text_field(trim($_POST['txtUrlLive']));
@@ -1079,12 +1165,12 @@ class YouTubePrefs
1079
  <div>
1080
  <h4 class="center">Single video directions</h4>
1081
  <p>
1082
- Search YouTube videos by title below (example: <em>TED talks</em>). Or, if you already have the URL for the video, you can paste it below (example: <em>https://www.youtube.com/watch?v=YVvn8dpSAt0</em> )
1083
  </p>
1084
  <form name="wizform_video" method="post" action="" class="wizform" id="wizform_video">
1085
  <?php wp_nonce_field('_epyt_wiz', '_epyt_nonce', true); ?>
1086
  <div class="center txt-button-align">
1087
- <input name="txtUrl" maxlength="200" id="txtUrl" class="txturlpastecustom ui-widget ui-widget-content ui-corner-all" placeholder="Search by title or paste URL here" type="text"> <button name="wizform_submit" class="ui-button ui-widget ui-corner-all" type="submit" value="step1_video">Submit</button>
1088
  </div>
1089
  <p class="badpaste orange bold" style="display: none;">
1090
  Please do not paste full embedcode above, only simple links to the YouTube video.
@@ -1093,6 +1179,7 @@ class YouTubePrefs
1093
  </p>
1094
  </form>
1095
  <?php echo $step1_video_errors ? '<p class="orange bold">' . $step1_video_errors . '</p>' : ''; ?>
 
1096
  </div>
1097
  <h3 id="h3_playlist"> <a href="#">Embed a playlist. </a></h3>
1098
  <div>
@@ -1183,30 +1270,57 @@ class YouTubePrefs
1183
  If you're trying to embed a livestream from your own channel, you can check make sure it is <strong>Eligible</strong> and <strong>Enabled</strong> by <a href="https://www.youtube.com/features" target="_blank">visiting here.</a>
1184
  You are verified if you see the word "Enabled" at the bottom of the box that is labeled "Embed live streams." Note that verification can only be done directly through YouTube/Google with the link above, and this plugin cannot automatically do that.
1185
  </p>
1186
- <p>
1187
- Once you have the link for a live stream, follow the steps below.
1188
- </p>
1189
- <ol>
1190
- <li>
1191
- Paste in the direct URL of the live stream below and click Submit. Example: https://www.youtube.com/watch?v=<strong>hHW1oY26kxQ</strong>
1192
- </li>
1193
- <li>
1194
- On the next screen, customize or insert your video.
1195
- </li>
1196
- </ol>
1197
- <form name="wizform_live" method="post" action="" class="wizform" id="wizform_live">
1198
- <?php wp_nonce_field('_epyt_wiz', '_epyt_nonce', true); ?>
1199
- <div class="center txt-button-align">
1200
- <input name="txtUrlLive" maxlength="200" id="txtUrlLive" class="ui-widget ui-widget-content ui-corner-all" placeholder="Paste YouTube link here" type="text"> <button name="wizform_submit" class="ui-button ui-widget ui-corner-all" type="submit" value="step1_live">Submit</button>
 
 
 
 
 
 
 
 
 
 
1201
  </div>
1202
- </form>
1203
- <?php echo $step1_live_errors ? '<p class="orange bold">' . $step1_live_errors . '</p>' : ''; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1204
  <?php
1205
  }
1206
  ?>
1207
  </div>
1208
  <?php
1209
- if (current_user_can('manage_options') && !self::vi_logged_in() && !(bool) (self::$alloptions[self::$opt_vi_hide_monetize_tab]))
1210
  {
1211
  ?>
1212
  <h3 id="h3_vi_monetize"> <a href="#"> Earn money embedding videos. </a></h3>
@@ -1326,9 +1440,13 @@ class YouTubePrefs
1326
 
1327
  public static function clean_api_error_html($raw_message, $add_boilerplate)
1328
  {
1329
- $clean_html = '<div>Sorry, there was a YouTube API error: <em>' . self::clean_api_error($raw_message) . '</em>' .
1330
- ( $add_boilerplate ? self::$boilerplate_api_error_message : '' ) .
1331
- '</div>';
 
 
 
 
1332
  return $clean_html;
1333
  }
1334
 
@@ -1750,9 +1868,11 @@ class YouTubePrefs
1750
  $_gallery_customnext = 'Next';
1751
  $_gallery_pagesize = 15;
1752
  $_not_live_content = '';
 
1753
  $_debugmode = 0;
1754
  $_admin_off_scripts = 0;
1755
  $_ajax_save = 1;
 
1756
  $_onboarded = 0;
1757
  $_old_script_method = 0;
1758
 
@@ -1838,8 +1958,10 @@ class YouTubePrefs
1838
  $_gallery_customnext = self::tryget($arroptions, self::$opt_gallery_customnext, $_gallery_customnext);
1839
  $_gallery_customprev = self::tryget($arroptions, self::$opt_gallery_customprev, $_gallery_customprev);
1840
  $_not_live_content = self::tryget($arroptions, self::$opt_not_live_content, $_not_live_content);
 
1841
  $_admin_off_scripts = self::tryget($arroptions, self::$opt_admin_off_scripts, $_admin_off_scripts);
1842
  $_ajax_save = self::tryget($arroptions, self::$opt_ajax_save, $_ajax_save);
 
1843
  $_onboarded = 0; // self::tryget($arroptions, self::$opt_onboarded, $_onboarded);
1844
 
1845
  $_vi_active = self::tryget($arroptions, self::$opt_vi_active, $_vi_active);
@@ -1924,9 +2046,11 @@ class YouTubePrefs
1924
  self::$opt_gallery_customprev => $_gallery_customprev,
1925
  self::$opt_gallery_pagesize => $_gallery_pagesize,
1926
  self::$opt_not_live_content => $_not_live_content,
 
1927
  self::$opt_debugmode => $_debugmode,
1928
  self::$opt_admin_off_scripts => $_admin_off_scripts,
1929
  self::$opt_ajax_save => $_ajax_save,
 
1930
  self::$opt_onboarded => $_onboarded,
1931
  self::$opt_old_script_method => $_old_script_method,
1932
  self::$opt_vi_active => $_vi_active,
@@ -1967,7 +2091,10 @@ class YouTubePrefs
1967
  public static function do_ytprefs()
1968
  {
1969
  //add_filter('autoptimize_filter_js_exclude', array(get_class(), 'ao_override_jsexclude'), 10, 1);
1970
- if (!is_admin() || (self::$alloptions[self::$opt_frontend_only] != 1))
 
 
 
1971
  {
1972
  add_filter('the_content', array(get_class(), 'apply_prefs_content'), 1);
1973
  add_filter('widget_text', array(get_class(), 'apply_prefs_widget'), 1);
@@ -2339,30 +2466,34 @@ class YouTubePrefs
2339
  {
2340
  if (isset($linkparams['channel']))
2341
  {
2342
- try
 
2343
  {
2344
- $ytapilink_live = 'https://www.googleapis.com/youtube/v3/search?order=date&maxResults=1&type=video&eventType=live&safeSearch=none&videoEmbeddable=true&channelId=' . $linkparams['channel'] . '&part=snippet&key=' . self::$alloptions[self::$opt_apikey];
2345
- $apidata_live = wp_remote_get($ytapilink_live, array('timeout' => self::$curltimeout));
2346
- if (!is_wp_error($apidata_live))
2347
  {
2348
- $raw = wp_remote_retrieve_body($apidata_live);
2349
- if (!empty($raw))
 
2350
  {
2351
- $json = json_decode($raw, true);
2352
- if (!isset($json['error']) && is_array($json) && count($json['items']))
2353
- {
2354
- $linkparams['v'] = $json['items'][0]['id']['videoId'];
2355
- }
2356
- else if (isset($json['error']))
2357
  {
2358
- return $live_error_msg; // . ' <em>(Error code ' . $json['error']->code . ': ' . $json['error']->message . ')</em>';
 
 
 
 
 
 
 
 
2359
  }
2360
  }
2361
  }
2362
- }
2363
- catch (Exception $ex)
2364
- {
2365
- return $live_error_msg;
2366
  }
2367
  }
2368
  else if (isset($linkparams['v']))
@@ -2370,28 +2501,31 @@ class YouTubePrefs
2370
  ////////////////////// process single video live stream
2371
  try
2372
  {
2373
- // if not_live_content isn't being used, just process as a normal single video. otherwise: if not currently live (nor upcoming?), unset $linkparams['v']
2374
- $not_live_content = trim(htmlspecialchars_decode(wp_strip_all_tags(self::$alloptions[self::$opt_not_live_content], true)));
2375
- if (!empty($not_live_content))
2376
  {
2377
- $ytapilink_live = 'https://www.googleapis.com/youtube/v3/videos?id=' . $linkparams['v'] . '&part=snippet&key=' . self::$alloptions[self::$opt_apikey];
2378
- $apidata_live = wp_remote_get($ytapilink_live, array('timeout' => self::$curltimeout));
2379
- if (!is_wp_error($apidata_live))
2380
  {
2381
- $raw = wp_remote_retrieve_body($apidata_live);
2382
- if (!empty($raw))
 
2383
  {
2384
- $json = json_decode($raw, true);
2385
- if (!isset($json['error']) && is_array($json) && count($json['items']))
2386
  {
2387
- if (isset($json['items'][0]['snippet']['liveBroadcastContent']) && $json['items'][0]['snippet']['liveBroadcastContent'] != 'live')
 
2388
  {
2389
- unset($linkparams['v']);
 
 
 
 
 
 
 
2390
  }
2391
- }
2392
- else if (isset($json['error']))
2393
- {
2394
- return $live_error_msg; // . ' <em>(Error code ' . $json['error']->code . ': ' . $json['error']->message . ')</em>';
2395
  }
2396
  }
2397
  }
@@ -2408,11 +2542,16 @@ class YouTubePrefs
2408
  return $live_error_msg;
2409
  }
2410
 
2411
- if (!isset($linkparams['v']))
2412
  {
2413
  return apply_filters('ytprefs_filter_the_content_light', wp_kses_post(self::$alloptions[self::$opt_not_live_content]));
2414
  }
2415
  }
 
 
 
 
 
2416
 
2417
  $youtubebaseurl = 'youtube';
2418
  $voloutput = '';
@@ -2474,7 +2613,7 @@ class YouTubePrefs
2474
  $acctitle = $odata->title;
2475
  }
2476
  }
2477
- else
2478
  {
2479
  $odata = self::get_oembed('https://youtube.com/watch?v=' . $linkparams['v'], 1920, 1280);
2480
  if (is_object($odata) && isset($odata->title))
@@ -2488,6 +2627,10 @@ class YouTubePrefs
2488
  {
2489
  $acctitle = ' title="' . esc_attr($acctitle) . '" ';
2490
  }
 
 
 
 
2491
  }
2492
  catch (Exception $e)
2493
  {
@@ -2565,6 +2708,11 @@ class YouTubePrefs
2565
  $finalparams['rel'] = 0;
2566
  }
2567
 
 
 
 
 
 
2568
  $code1 = '<iframe ' . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight . '" ' .
2569
  ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
2570
  ' src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
@@ -2810,7 +2958,10 @@ class YouTubePrefs
2810
 
2811
  public static function custom_admin_pointers_check()
2812
  {
2813
- //return false; // ooopointer shut all off;
 
 
 
2814
  $admin_pointers = self::custom_admin_pointers();
2815
  foreach ($admin_pointers as $pointer => $array)
2816
  {
@@ -2924,10 +3075,10 @@ class YouTubePrefs
2924
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
2925
 
2926
  $new_pointer_content .= '<p>'; // ooopointer
2927
- $new_pointer_content .= "This update supports better responsive sizing in widgets and fixes a &quot;save settings&quot; issue for Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
2928
  if (self::vi_logged_in())
2929
  {
2930
- $new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version. Please contact ext@embedplus.com for questions.";
2931
  }
2932
  if (!empty(self::$alloptions[self::$opt_pro]) && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
2933
  {
@@ -3021,7 +3172,7 @@ class YouTubePrefs
3021
  .wrap {font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",Arial,sans-serif; color: #000000;}
3022
  .wrap-ytprefs {max-width: 1064px;}
3023
  h1 span {vertical-align: middle;}
3024
- #ytform p { line-height: 20px; margin: 18px 0; }
3025
  .ytindent {padding: 0px 0px 0px 20px; font-size: 13px; margin-bottom: 100px;}
3026
  .ytindent ul, .ytindent p {font-size: 13px;}
3027
  .shadow {-webkit-box-shadow: 0px 0px 20px 0px #000000; box-shadow: 0px 0px 20px 0px #000000;}
@@ -3188,6 +3339,23 @@ class YouTubePrefs
3188
  .epyt-deprecated {
3189
  color: #aaaaaa;
3190
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3191
  </style>
3192
  <div class="wrap wrap-ytprefs">
3193
  <h1><span class="dashicons-before dashicons-video-alt3"></span> <?php echo __('YouTube Settings') ?></h1>
@@ -3349,23 +3517,34 @@ class YouTubePrefs
3349
  Check this to hide the installation setup wizard when this page loads.
3350
  </label>
3351
  </p>
 
 
 
 
 
 
 
3352
  <p class="<?php echo self::vi_logged_in() || !empty($all[self::$opt_vi_active]) || !self::vi_ever_logged_in() ? 'hidden' : '' ?>">
3353
  <input name="<?php echo self::$opt_vi_hide_monetize_tab; ?>" id="<?php echo self::$opt_vi_hide_monetize_tab; ?>" <?php checked($all[self::$opt_vi_hide_monetize_tab], 1); ?> type="checkbox" class="checkbox">
3354
  <label for="<?php echo self::$opt_vi_hide_monetize_tab; ?>"><b class="chktitle">Hide "Monetize" Feature:</b> (deprecated) Hide the tab(s) for the deprecated video intelligence feature.</label>
3355
  </p>
3356
- <p id="not_live_content_scroll">
3357
- <label for="<?php echo self::$opt_not_live_content; ?>">
 
3358
  <b class="chktitle">Default "Not Live" Content:</b>
3359
  When your channel is not streaming live, the YouTube live player will simply display a countdown.
3360
  Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your channel begins to live stream.
3361
  The plugin will automatically switch to your channel's live stream once it's active.
3362
- Below, enter what you would like to appear until then. <strong><span class="orange">NOTE:</span> Do not put another live stream embed below.</strong>
3363
- If you just want to show the standard countdown player that YouTube provides, just leave the below empty and save.
 
3364
  </label>
 
 
3365
  <?php
3366
  wp_editor(wp_kses_post($all[self::$opt_not_live_content]), self::$opt_not_live_content, array('textarea_rows' => 7));
3367
  ?>
3368
- </p>
3369
 
3370
 
3371
  </div>
@@ -4320,6 +4499,8 @@ class YouTubePrefs
4320
  $new_options[self::$opt_autoplay] = self::postchecked(self::$opt_autoplay) ? 1 : 0;
4321
  $new_options[self::$opt_debugmode] = self::postchecked(self::$opt_debugmode) ? 1 : 0;
4322
  $new_options[self::$opt_admin_off_scripts] = self::postchecked(self::$opt_admin_off_scripts) ? 1 : 0;
 
 
4323
  $new_options[self::$opt_old_script_method] = self::postchecked(self::$opt_old_script_method) ? 1 : 0;
4324
  $new_options[self::$opt_cc_load_policy] = self::postchecked(self::$opt_cc_load_policy) ? 1 : 0;
4325
  $new_options[self::$opt_iv_load_policy] = self::postchecked(self::$opt_iv_load_policy) ? 1 : 3;
@@ -4349,6 +4530,7 @@ class YouTubePrefs
4349
  $new_options[self::$opt_defaultvol] = self::postchecked(self::$opt_defaultvol) ? 1 : 0;
4350
  $new_options[self::$opt_dohl] = self::postchecked(self::$opt_dohl) ? 1 : 0;
4351
  $new_options[self::$opt_onboarded] = self::postchecked(self::$opt_onboarded) ? 1 : 0;
 
4352
  $new_options[self::$opt_gallery_hideprivate] = self::postchecked(self::$opt_gallery_hideprivate) ? 1 : 0;
4353
  $new_options[self::$opt_gallery_showtitle] = self::postchecked(self::$opt_gallery_showtitle) ? 1 : 0;
4354
  $new_options[self::$opt_gallery_showpaging] = self::postchecked(self::$opt_gallery_showpaging) ? 1 : 0;
@@ -4624,6 +4806,7 @@ class YouTubePrefs
4624
  $input[self::$opt_gallery_pagesize] = intval($input[self::$opt_gallery_pagesize]);
4625
  $input[self::$opt_gallery_columns] = intval($input[self::$opt_gallery_columns]);
4626
  $input[self::$opt_not_live_content] = wp_kses_post(stripslashes($input[self::$opt_not_live_content]));
 
4627
 
4628
  if (!in_array($input[self::$opt_ytapi_load], array('always', 'light', 'never')))
4629
  {
@@ -4657,6 +4840,7 @@ class YouTubePrefs
4657
  self::$opt_gallery_pagesize => 15,
4658
  self::$opt_gallery_columns => 3,
4659
  self::$opt_not_live_content => '',
 
4660
  self::$opt_ytapi_load => 'light',
4661
  self::$opt_gdpr_consent => 0,
4662
  self::$opt_gdpr_consent_message => self::$dft_gdpr_consent_message,
@@ -4874,24 +5058,18 @@ class YouTubePrefs
4874
  Enter how many thumbnails can fit per row. You can later use the embedding wizard to customize this for specific galleries.
4875
  </div>
4876
  <div class="ytprefs-ob-setting yob-live">
4877
- <p>
4878
- <label for="<?php echo self::$opt_not_live_content; ?>">
4879
- <b class="chktitle">Default "Not Live" Content:</b>
4880
- When your channel is not streaming live, the YouTube live player will simply display a countdown.
4881
- Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your channel begins to live stream.
4882
- The plugin will automatically switch to your channel's live stream once it's active.
4883
- Below, enter what you would like to appear until then. <strong><span class="orange">NOTE:</span> Do not put another live stream embed below.</strong>
4884
- <?php
4885
- if (self::vi_logged_in())
4886
- {
4887
- ?>
4888
- One new option is to embed a quality video advertisement so that you can gain revenue during times when your live stream is not active. Simply click the "$ Video Ad" button below to enter the proper shortcode and the plugin with manage the rest.
4889
- <?php
4890
- }
4891
- ?>
4892
- If you just want to show the standard countdown player that YouTube provides, just leave the below empty.
4893
- </label>
4894
- </p>
4895
  <?php
4896
  wp_editor(wp_kses_post($all[self::$opt_not_live_content]), self::$opt_not_live_content, array('textarea_rows' => 7));
4897
  ?>
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
+ Version: 13.2
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  */
10
 
11
  /*
12
  Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
13
+ Copyright (C) 2020 EmbedPlus.com
14
 
15
  This program is free software: you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License as published by
34
 
35
  public static $folder_name = 'youtube-embed-plus';
36
  public static $curltimeout = 30;
37
+ public static $version = '13.2';
38
  public static $opt_version = 'version';
39
  public static $optembedwidth = null;
40
  public static $optembedheight = null;
106
  public static $opt_gallery_customprev = 'gallery_customprev';
107
  public static $opt_gallery_customnext = 'gallery_customnext';
108
  public static $opt_not_live_content = 'not_live_content';
109
+ public static $opt_not_live_on = 'not_live_on';
110
  public static $opt_admin_off_scripts = 'admin_off_scripts';
111
  public static $opt_ajax_save = 'ajax_save';
112
  public static $opt_onboarded = 'onboarded';
113
+ public static $opt_show_pointer = 'show_pointer';
114
  public static $opt_alloptions = 'youtubeprefs_alloptions';
115
  public static $alloptions = null;
116
  public static $yt_options = array();
178
  ///////////////////////////////////////////////////////////////////////////////////////////////////
179
  ///////////////////////////////////////////////////////////////////////////////////////////////////
180
 
181
+ public static $oldytregex = '@^\s*https?://(?:www\.)?(?:(?:youtube.com/(?:(?:watch)|(?:embed)|(?:playlist))(?:/live_stream){0,1}/{0,1}\?)|(?:youtu.be/))([^\s"]+)\s*$@im';
182
+ public static $ytregex = '@^[\r\t ]*https?://(?:www\.)?(?:(?:youtube.com/(?:(?:watch)|(?:embed)|(?:playlist))(?:/live_stream){0,1}/{0,1}\?)|(?:youtu.be/))([^\s"]+)[\r\t ]*$@im';
183
+ public static $justurlregex = '@https?://(?:www\.)?(?:(?:youtube.com/(?:(?:watch)|(?:embed)|(?:playlist))(?:/live_stream){0,1}/{0,1}\?)|(?:youtu.be/))([^\[\s"]+)@i';
184
+
185
  ///////////////////////////////////////////////////////////////////////////////////////////////////
186
  ///////////////////////////////////////////////////////////////////////////////////////////////////
187
  ///////////////////////////////////////////////////////////////////////////////////////////////////
231
  'index',
232
  'list',
233
  'start',
234
+ 'end',
235
+ 'channel'
236
  );
237
 
238
  add_action('media_buttons', array(get_class(), 'media_button_wizard'), 11);
670
  $step1_channel_error_invalid = 'Sorry, that does not seem to be a link to an existing video. ' . $step1_api_error_msg;
671
  $step1_live_errors = '';
672
  $step1_live_error_invalid = 'Sorry, that does not seem to be a valid link to an existing live video. ' . $step1_api_error_msg;
673
+ $step1_livechannel_errors = '';
674
+ $step1_livechannel_error_invalid = 'Sorry, that does not seem to be a link to an existing channel.';
675
+
676
  $if_live_preview = false;
677
 
678
  $theytid = null;
976
  $acc_expand = 'h3_channel';
977
  }
978
  }
979
+ else if ($submit_type === 'step1_livechannel')
980
+ {
981
+ $search = sanitize_text_field(trim($_POST['txtUrlLiveChannel']));
982
+ try
983
+ {
984
+ if (empty($search))
985
+ {
986
+ throw new Exception();
987
+ }
988
+ if (preg_match('@/channel/(.+)@', $search))
989
+ {
990
+ try
991
+ {
992
+ $thechannelid = null;
993
+ // channel id
994
+ $chanmatch = array();
995
+ preg_match('@/channel/(.+)@', $search, $chanmatch);
996
+ if (!empty($chanmatch))
997
+ {
998
+ $thechannelid = $chanmatch[1];
999
+ //$thechannel = self::get_channel_snippet($chanmatch[1]);
1000
+ }
1001
+ if (!empty($thechannelid))
1002
+ {
1003
+ $rel = 'https://www.youtube.com/embed/live_stream?channel=' . (esc_attr($thechannelid));
1004
+
1005
+ $final_title = esc_url('https://www.youtube.com/channel/' . $thechannelid);
1006
+ $final_title_prefix = 'Live stream from channel';
1007
+ $doing_live = true;
1008
+ ?>
1009
+
1010
+ <div id="step2_livechannel" class="center">
1011
+ <h2>
1012
+ <?php
1013
+ echo 'Live stream from channel: ' . esc_url('https://www.youtube.com/channel/' . $thechannelid);
1014
+ ?>
1015
+ </h2>
1016
+ <p class="center">
1017
+ <a class="ui-button ui-widget ui-corner-all inserttopost" rel="[embedyt] https://www.youtube.com/embed/live_stream?channel=<?php echo esc_attr($thechannelid) ?>[/embedyt]"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span> Insert Into Editor</a>
1018
+ &nbsp;
1019
+ <a class="ui-button ui-widget ui-corner-all" href="<?php echo $get_pro_link; ?>" target="_blank"><span class="ui-icon ui-icon-gear"></span> Customize (PRO)</a>
1020
+ </p>
1021
+ &nbsp; Or Copy Code:
1022
+ <span class="copycode">[embedyt] https://www.youtube.com/embed/live_stream?channel=<?php echo esc_attr($thechannelid) ?>[/embedyt]</span>
1023
+ <div class="clearboth" style="height: 10px;">
1024
+ </div>
1025
+ <div class="center relative">
1026
+ <iframe src="https://www.youtube.com/embed/live_stream?channel=<?php echo esc_attr($thechannelid) ?>" allowfullscreen="" width="854" height="480" frameborder="0"></iframe>
1027
+ </div>
1028
+ </div>
1029
+ <?php
1030
+ }
1031
+ else
1032
+ {
1033
+ $form_valid = false;
1034
+ $step1_livechannel_errors = $step1_livechannel_error_invalid;
1035
+ $acc_expand = 'h3_live';
1036
+ }
1037
+ }
1038
+ catch (Exception $ex)
1039
+ {
1040
+ $form_valid = false;
1041
+ $step1_livechannel_errors = $step1_livechannel_error_invalid;
1042
+ $acc_expand = 'h3_live';
1043
+ }
1044
+ }
1045
+ else
1046
+ {
1047
+ $form_valid = false;
1048
+ $step1_livechannel_errors = $step1_livechannel_error_invalid;
1049
+ $acc_expand = 'h3_live';
1050
+ }
1051
+ }
1052
+ catch (Exception $ex)
1053
+ {
1054
+ $form_valid = false;
1055
+ $step1_livechannel_errors = $step1_livechannel_error_invalid;
1056
+ $acc_expand = 'h3_live';
1057
+ }
1058
+ }
1059
  else if ($submit_type === 'step1_live')
1060
  {
1061
  $search = sanitize_text_field(trim($_POST['txtUrlLive']));
1165
  <div>
1166
  <h4 class="center">Single video directions</h4>
1167
  <p>
1168
+ Paste the url of a single video below (example: <em>https://www.youtube.com/watch?v=YVvn8dpSAt0</em> )
1169
  </p>
1170
  <form name="wizform_video" method="post" action="" class="wizform" id="wizform_video">
1171
  <?php wp_nonce_field('_epyt_wiz', '_epyt_nonce', true); ?>
1172
  <div class="center txt-button-align">
1173
+ <input name="txtUrl" maxlength="200" id="txtUrl" class="txturlpastecustom ui-widget ui-widget-content ui-corner-all" placeholder="Paste URL here" type="text"> <button name="wizform_submit" class="ui-button ui-widget ui-corner-all" type="submit" value="step1_video">Submit</button>
1174
  </div>
1175
  <p class="badpaste orange bold" style="display: none;">
1176
  Please do not paste full embedcode above, only simple links to the YouTube video.
1179
  </p>
1180
  </form>
1181
  <?php echo $step1_video_errors ? '<p class="orange bold">' . $step1_video_errors . '</p>' : ''; ?>
1182
+ <p><em>Note: You can also search YouTube videos by title in the text box above (example: <em>TED talks</em>). However, searching will use a significant amount of your YouTube API quota.</em></p>
1183
  </div>
1184
  <h3 id="h3_playlist"> <a href="#">Embed a playlist. </a></h3>
1185
  <div>
1270
  If you're trying to embed a livestream from your own channel, you can check make sure it is <strong>Eligible</strong> and <strong>Enabled</strong> by <a href="https://www.youtube.com/features" target="_blank">visiting here.</a>
1271
  You are verified if you see the word "Enabled" at the bottom of the box that is labeled "Embed live streams." Note that verification can only be done directly through YouTube/Google with the link above, and this plugin cannot automatically do that.
1272
  </p>
1273
+
1274
+ <div class="livestream-tabs">
1275
+ <ul>
1276
+ <li><a href="#livestream-tabs-2">Channel-based livestream (recommended)<sup class="orange">new</sup></a></li>
1277
+ <li><a href="#livestream-tabs-1">Direct link to livestream</a></li>
1278
+ </ul>
1279
+ <div id="livestream-tabs-1">
1280
+ <p>
1281
+ This will embed a specific live stream video.
1282
+ </p>
1283
+ <ol>
1284
+ <li>
1285
+ Paste in the direct URL of the live stream below and click Submit. Example: https://www.youtube.com/watch?v=<strong>hHW1oY26kxQ</strong>
1286
+ </li>
1287
+ <li>
1288
+ On the next screen, customize or insert your video.
1289
+ </li>
1290
+ </ol>
1291
+ <form name="wizform_live" method="post" action="" class="wizform" id="wizform_live">
1292
+ <?php wp_nonce_field('_epyt_wiz', '_epyt_nonce', true); ?>
1293
+ <div class="center txt-button-align">
1294
+ <input name="txtUrlLive" maxlength="200" id="txtUrlLive" class="ui-widget ui-widget-content ui-corner-all" placeholder="Paste YouTube link here" type="text"> <button name="wizform_submit" class="ui-button ui-widget ui-corner-all" type="submit" value="step1_live">Submit</button>
1295
+ </div>
1296
+ </form>
1297
+ <?php echo $step1_live_errors ? '<p class="orange bold">' . $step1_live_errors . '</p>' : ''; ?>
1298
  </div>
1299
+ <div id="livestream-tabs-2">
1300
+ <p>
1301
+ This will embed a video that will automatically display the next upcoming live stream from a channel.
1302
+ </p>
1303
+ <p>
1304
+ Enter the link to the channel page below (note the word "channel" should be in the link).<br>Example: https://www.youtube.com/<strong>channel</strong>/UCL0iAkpqV5YaIVG7xkDtS4Q
1305
+ </p>
1306
+ <form name="wizform_livechannel" method="post" action="" class="wizform" id="wizform_livechannel">
1307
+ <?php wp_nonce_field('_epyt_wiz', '_epyt_nonce', true); ?>
1308
+ <div class="center txt-button-align">
1309
+ <input name="txtUrlLiveChannel" maxlength="200" id="txtUrlLiveChannel" class="ui-widget ui-widget-content ui-corner-all" placeholder="Paste channel link here" type="text"> <button name="wizform_submit" class="ui-button ui-widget ui-corner-all" type="submit" value="step1_livechannel">Get Channel</button>
1310
+ </div>
1311
+ </form>
1312
+ <?php echo $step1_livechannel_errors ? '<p class="orange bold">' . $step1_livechannel_errors . '</p>' : ''; ?>
1313
+ <p class="smallnote">
1314
+ <strong class="orange">Note</strong>: For now, the "Not Live" custom content feature is not available for channel-based embeds. YouTube's standard countdown will appear in the video until the scheduled stream goes live.
1315
+ </p>
1316
+ </div>
1317
+ </div>
1318
  <?php
1319
  }
1320
  ?>
1321
  </div>
1322
  <?php
1323
+ if (false && current_user_can('manage_options') && !self::vi_logged_in() && !(bool) (self::$alloptions[self::$opt_vi_hide_monetize_tab]))
1324
  {
1325
  ?>
1326
  <h3 id="h3_vi_monetize"> <a href="#"> Earn money embedding videos. </a></h3>
1440
 
1441
  public static function clean_api_error_html($raw_message, $add_boilerplate)
1442
  {
1443
+ $clean_html = '<div>Sorry, there was a YouTube error.</div>';
1444
+ if (current_user_can('manage_options'))
1445
+ {
1446
+ $clean_html = '<div>Sorry, there was a YouTube API error: <em>' . self::clean_api_error($raw_message) . '</em>' .
1447
+ ( $add_boilerplate ? self::$boilerplate_api_error_message : '' ) .
1448
+ '</div>';
1449
+ }
1450
  return $clean_html;
1451
  }
1452
 
1868
  $_gallery_customnext = 'Next';
1869
  $_gallery_pagesize = 15;
1870
  $_not_live_content = '';
1871
+ $_not_live_on = 1;
1872
  $_debugmode = 0;
1873
  $_admin_off_scripts = 0;
1874
  $_ajax_save = 1;
1875
+ $_show_pointer = 1;
1876
  $_onboarded = 0;
1877
  $_old_script_method = 0;
1878
 
1958
  $_gallery_customnext = self::tryget($arroptions, self::$opt_gallery_customnext, $_gallery_customnext);
1959
  $_gallery_customprev = self::tryget($arroptions, self::$opt_gallery_customprev, $_gallery_customprev);
1960
  $_not_live_content = self::tryget($arroptions, self::$opt_not_live_content, $_not_live_content);
1961
+ $_not_live_on = self::tryget($arroptions, self::$opt_not_live_on, empty(trim($_not_live_content)) ? 0 : 1);
1962
  $_admin_off_scripts = self::tryget($arroptions, self::$opt_admin_off_scripts, $_admin_off_scripts);
1963
  $_ajax_save = self::tryget($arroptions, self::$opt_ajax_save, $_ajax_save);
1964
+ $_show_pointer = self::tryget($arroptions, self::$opt_show_pointer, $_show_pointer);
1965
  $_onboarded = 0; // self::tryget($arroptions, self::$opt_onboarded, $_onboarded);
1966
 
1967
  $_vi_active = self::tryget($arroptions, self::$opt_vi_active, $_vi_active);
2046
  self::$opt_gallery_customprev => $_gallery_customprev,
2047
  self::$opt_gallery_pagesize => $_gallery_pagesize,
2048
  self::$opt_not_live_content => $_not_live_content,
2049
+ self::$opt_not_live_on => $_not_live_on,
2050
  self::$opt_debugmode => $_debugmode,
2051
  self::$opt_admin_off_scripts => $_admin_off_scripts,
2052
  self::$opt_ajax_save => $_ajax_save,
2053
+ self::$opt_show_pointer => $_show_pointer,
2054
  self::$opt_onboarded => $_onboarded,
2055
  self::$opt_old_script_method => $_old_script_method,
2056
  self::$opt_vi_active => $_vi_active,
2091
  public static function do_ytprefs()
2092
  {
2093
  //add_filter('autoptimize_filter_js_exclude', array(get_class(), 'ao_override_jsexclude'), 10, 1);
2094
+ if (
2095
+ !is_admin() || (self::$alloptions[self::$opt_frontend_only] != 1)
2096
+ //|| (function_exists('wp_doing_ajax') && wp_doing_ajax())
2097
+ )
2098
  {
2099
  add_filter('the_content', array(get_class(), 'apply_prefs_content'), 1);
2100
  add_filter('widget_text', array(get_class(), 'apply_prefs_widget'), 1);
2466
  {
2467
  if (isset($linkparams['channel']))
2468
  {
2469
+ $linkparams['live_stream'] = 1;
2470
+ if (false) // takes up too much quota;
2471
  {
2472
+ try
 
 
2473
  {
2474
+ $ytapilink_live = 'https://www.googleapis.com/youtube/v3/search?order=date&maxResults=1&type=video&eventType=live&safeSearch=none&videoEmbeddable=true&channelId=' . $linkparams['channel'] . '&part=snippet&key=' . self::$alloptions[self::$opt_apikey];
2475
+ $apidata_live = wp_remote_get($ytapilink_live, array('timeout' => self::$curltimeout));
2476
+ if (!is_wp_error($apidata_live))
2477
  {
2478
+ $raw = wp_remote_retrieve_body($apidata_live);
2479
+ if (!empty($raw))
 
 
 
 
2480
  {
2481
+ $json = json_decode($raw, true);
2482
+ if (!isset($json['error']) && is_array($json) && count($json['items']))
2483
+ {
2484
+ $linkparams['v'] = $json['items'][0]['id']['videoId'];
2485
+ }
2486
+ else if (isset($json['error']))
2487
+ {
2488
+ return $live_error_msg; // . ' <em>(Error code ' . $json['error']->code . ': ' . $json['error']->message . ')</em>';
2489
+ }
2490
  }
2491
  }
2492
  }
2493
+ catch (Exception $ex)
2494
+ {
2495
+ return $live_error_msg;
2496
+ }
2497
  }
2498
  }
2499
  else if (isset($linkparams['v']))
2501
  ////////////////////// process single video live stream
2502
  try
2503
  {
2504
+ if (self::$alloptions[self::$opt_not_live_on])
 
 
2505
  {
2506
+ // if not_live_content isn't being used, just process as a normal single video. otherwise: if not currently live (nor upcoming?), unset $linkparams['v']
2507
+ $not_live_content = trim(htmlspecialchars_decode(wp_strip_all_tags(self::$alloptions[self::$opt_not_live_content], true)));
2508
+ if (!empty($not_live_content))
2509
  {
2510
+ $ytapilink_live = 'https://www.googleapis.com/youtube/v3/videos?id=' . $linkparams['v'] . '&part=snippet&key=' . self::$alloptions[self::$opt_apikey];
2511
+ $apidata_live = wp_remote_get($ytapilink_live, array('timeout' => self::$curltimeout));
2512
+ if (!is_wp_error($apidata_live))
2513
  {
2514
+ $raw = wp_remote_retrieve_body($apidata_live);
2515
+ if (!empty($raw))
2516
  {
2517
+ $json = json_decode($raw, true);
2518
+ if (!isset($json['error']) && is_array($json) && count($json['items']))
2519
  {
2520
+ if (isset($json['items'][0]['snippet']['liveBroadcastContent']) && $json['items'][0]['snippet']['liveBroadcastContent'] != 'live')
2521
+ {
2522
+ unset($linkparams['v']);
2523
+ }
2524
+ }
2525
+ else if (isset($json['error']))
2526
+ {
2527
+ return $live_error_msg; // . ' <em>(Error code ' . $json['error']->code . ': ' . $json['error']->message . ')</em>';
2528
  }
 
 
 
 
2529
  }
2530
  }
2531
  }
2542
  return $live_error_msg;
2543
  }
2544
 
2545
+ if (!isset($linkparams['v']) && !isset($linkparams['live_stream']))
2546
  {
2547
  return apply_filters('ytprefs_filter_the_content_light', wp_kses_post(self::$alloptions[self::$opt_not_live_content]));
2548
  }
2549
  }
2550
+
2551
+ if (stripos($linkparamstemp[0], 'live_stream') !== false)
2552
+ {
2553
+ $linkparams['live_stream'] = 1;
2554
+ }
2555
 
2556
  $youtubebaseurl = 'youtube';
2557
  $voloutput = '';
2613
  $acctitle = $odata->title;
2614
  }
2615
  }
2616
+ else if (isset($linkparams['v']))
2617
  {
2618
  $odata = self::get_oembed('https://youtube.com/watch?v=' . $linkparams['v'], 1920, 1280);
2619
  if (is_object($odata) && isset($odata->title))
2627
  {
2628
  $acctitle = ' title="' . esc_attr($acctitle) . '" ';
2629
  }
2630
+ else
2631
+ {
2632
+ $acctitle = ' title="YouTube player" ';
2633
+ }
2634
  }
2635
  catch (Exception $e)
2636
  {
2708
  $finalparams['rel'] = 0;
2709
  }
2710
 
2711
+ if (!empty($finalparams['live_stream']))
2712
+ {
2713
+ $videoidoutput = 'live_stream';
2714
+ }
2715
+
2716
  $code1 = '<iframe ' . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight . '" ' .
2717
  ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
2718
  ' src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
2958
 
2959
  public static function custom_admin_pointers_check()
2960
  {
2961
+ if (!self::$alloptions[self::$opt_show_pointer])
2962
+ {
2963
+ return false;
2964
+ }
2965
  $admin_pointers = self::custom_admin_pointers();
2966
  foreach ($admin_pointers as $pointer => $array)
2967
  {
3075
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
3076
 
3077
  $new_pointer_content .= '<p>'; // ooopointer
3078
+ $new_pointer_content .= "This update brings back the automatic &quot;live stream by channel&quot; feature, and includes a few bug fixes for both Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
3079
  if (self::vi_logged_in())
3080
  {
3081
+ $new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version, so we recommend taking the vi ads down from your site. Please contact ext@embedplus.com for questions.";
3082
  }
3083
  if (!empty(self::$alloptions[self::$opt_pro]) && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
3084
  {
3172
  .wrap {font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",Arial,sans-serif; color: #000000;}
3173
  .wrap-ytprefs {max-width: 1064px;}
3174
  h1 span {vertical-align: middle;}
3175
+ #ytform p, #ytform .p { line-height: 20px; margin: 18px 0; }
3176
  .ytindent {padding: 0px 0px 0px 20px; font-size: 13px; margin-bottom: 100px;}
3177
  .ytindent ul, .ytindent p {font-size: 13px;}
3178
  .shadow {-webkit-box-shadow: 0px 0px 20px 0px #000000; box-shadow: 0px 0px 20px 0px #000000;}
3339
  .epyt-deprecated {
3340
  color: #aaaaaa;
3341
  }
3342
+
3343
+ input[type="checkbox"] + label .check-note {
3344
+ display: none;
3345
+ }
3346
+
3347
+ input[type="checkbox"]:checked + label .check-note {
3348
+ display: inline;
3349
+ }
3350
+
3351
+ #not_live_on ~ #wp-not_live_content-wrap {
3352
+ opacity: .3;
3353
+ }
3354
+
3355
+ #not_live_on:checked ~ #wp-not_live_content-wrap {
3356
+ opacity: 1;
3357
+ }
3358
+
3359
  </style>
3360
  <div class="wrap wrap-ytprefs">
3361
  <h1><span class="dashicons-before dashicons-video-alt3"></span> <?php echo __('YouTube Settings') ?></h1>
3517
  Check this to hide the installation setup wizard when this page loads.
3518
  </label>
3519
  </p>
3520
+ <p>
3521
+ <input name="<?php echo self::$opt_show_pointer; ?>" id="<?php echo self::$opt_show_pointer; ?>" <?php checked($all[self::$opt_show_pointer], 1); ?> type="checkbox" class="checkbox">
3522
+ <label for="<?php echo self::$opt_show_pointer; ?>">
3523
+ <b class="chktitle">Show New Feature Notice:</b>
3524
+ Show admin notice of new plugin features after updates.
3525
+ </label>
3526
+ </p>
3527
  <p class="<?php echo self::vi_logged_in() || !empty($all[self::$opt_vi_active]) || !self::vi_ever_logged_in() ? 'hidden' : '' ?>">
3528
  <input name="<?php echo self::$opt_vi_hide_monetize_tab; ?>" id="<?php echo self::$opt_vi_hide_monetize_tab; ?>" <?php checked($all[self::$opt_vi_hide_monetize_tab], 1); ?> type="checkbox" class="checkbox">
3529
  <label for="<?php echo self::$opt_vi_hide_monetize_tab; ?>"><b class="chktitle">Hide "Monetize" Feature:</b> (deprecated) Hide the tab(s) for the deprecated video intelligence feature.</label>
3530
  </p>
3531
+ <div id="not_live_content_scroll" class="p">
3532
+ <input name="<?php echo self::$opt_not_live_on; ?>" id="<?php echo self::$opt_not_live_on; ?>" <?php checked($all[self::$opt_not_live_on], 1); ?> type="checkbox" class="checkbox">
3533
+ <label for="<?php echo self::$opt_not_live_on; ?>">
3534
  <b class="chktitle">Default "Not Live" Content:</b>
3535
  When your channel is not streaming live, the YouTube live player will simply display a countdown.
3536
  Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your channel begins to live stream.
3537
  The plugin will automatically switch to your channel's live stream once it's active.
3538
+ Below, enter what you would like to appear until then.
3539
+ If you just want to show the standard countdown player that YouTube provides, uncheck this option.
3540
+ <strong class="check-note"><span class="orange">NOTE:</span> This feature uses a significant amount of your YouTube API quota. We suggest unchecking it if your site has high traffic. If you chose to use this feature, do not put another live stream embed below.</strong>
3541
  </label>
3542
+ <br>
3543
+ <br>
3544
  <?php
3545
  wp_editor(wp_kses_post($all[self::$opt_not_live_content]), self::$opt_not_live_content, array('textarea_rows' => 7));
3546
  ?>
3547
+ </div>
3548
 
3549
 
3550
  </div>
4499
  $new_options[self::$opt_autoplay] = self::postchecked(self::$opt_autoplay) ? 1 : 0;
4500
  $new_options[self::$opt_debugmode] = self::postchecked(self::$opt_debugmode) ? 1 : 0;
4501
  $new_options[self::$opt_admin_off_scripts] = self::postchecked(self::$opt_admin_off_scripts) ? 1 : 0;
4502
+ $new_options[self::$opt_ajax_save] = self::postchecked(self::$opt_ajax_save) ? 1 : 0;
4503
+ $new_options[self::$opt_show_pointer] = self::postchecked(self::$opt_show_pointer) ? 1 : 0;
4504
  $new_options[self::$opt_old_script_method] = self::postchecked(self::$opt_old_script_method) ? 1 : 0;
4505
  $new_options[self::$opt_cc_load_policy] = self::postchecked(self::$opt_cc_load_policy) ? 1 : 0;
4506
  $new_options[self::$opt_iv_load_policy] = self::postchecked(self::$opt_iv_load_policy) ? 1 : 3;
4530
  $new_options[self::$opt_defaultvol] = self::postchecked(self::$opt_defaultvol) ? 1 : 0;
4531
  $new_options[self::$opt_dohl] = self::postchecked(self::$opt_dohl) ? 1 : 0;
4532
  $new_options[self::$opt_onboarded] = self::postchecked(self::$opt_onboarded) ? 1 : 0;
4533
+ $new_options[self::$opt_not_live_on] = self::postchecked(self::$opt_not_live_on) ? 1 : 0;
4534
  $new_options[self::$opt_gallery_hideprivate] = self::postchecked(self::$opt_gallery_hideprivate) ? 1 : 0;
4535
  $new_options[self::$opt_gallery_showtitle] = self::postchecked(self::$opt_gallery_showtitle) ? 1 : 0;
4536
  $new_options[self::$opt_gallery_showpaging] = self::postchecked(self::$opt_gallery_showpaging) ? 1 : 0;
4806
  $input[self::$opt_gallery_pagesize] = intval($input[self::$opt_gallery_pagesize]);
4807
  $input[self::$opt_gallery_columns] = intval($input[self::$opt_gallery_columns]);
4808
  $input[self::$opt_not_live_content] = wp_kses_post(stripslashes($input[self::$opt_not_live_content]));
4809
+ $input[self::$opt_not_live_on] = intval($input[self::$opt_not_live_on]);
4810
 
4811
  if (!in_array($input[self::$opt_ytapi_load], array('always', 'light', 'never')))
4812
  {
4840
  self::$opt_gallery_pagesize => 15,
4841
  self::$opt_gallery_columns => 3,
4842
  self::$opt_not_live_content => '',
4843
+ self::$opt_not_live_on => 0,
4844
  self::$opt_ytapi_load => 'light',
4845
  self::$opt_gdpr_consent => 0,
4846
  self::$opt_gdpr_consent_message => self::$dft_gdpr_consent_message,
5058
  Enter how many thumbnails can fit per row. You can later use the embedding wizard to customize this for specific galleries.
5059
  </div>
5060
  <div class="ytprefs-ob-setting yob-live">
5061
+ <input name="<?php echo self::$opt_not_live_on; ?>" id="<?php echo self::$opt_not_live_on; ?>" <?php checked($all[self::$opt_not_live_on], 1); ?> type="checkbox" class="checkbox">
5062
+ <label for="<?php echo self::$opt_not_live_on; ?>">
5063
+ <b class="chktitle">Default "Not Live" Content:</b>
5064
+ When your channel is not streaming live, the YouTube live player will simply display a countdown.
5065
+ Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your channel begins to live stream.
5066
+ The plugin will automatically switch to your channel's live stream once it's active.
5067
+ Below, enter what you would like to appear until then.
5068
+ If you just want to show the standard countdown player that YouTube provides, uncheck this option.
5069
+ <strong class="check-note"><span class="orange">NOTE:</span> This feature uses a significant amount of your YouTube API quota. We suggest unchecking it if your site has high traffic. If you chose to use this feature, do not put another live stream embed below.</strong>
5070
+ </label>
5071
+ <br>
5072
+ <br>
 
 
 
 
 
 
5073
  <?php
5074
  wp_editor(wp_kses_post($all[self::$opt_not_live_content]), self::$opt_not_live_content, array('textarea_rows' => 7));
5075
  ?>