Pop-Ups no longer loading
-
Hi Hustle team,
My pop-ups won’t show anymore. Everything used to be fine. I’ve enabled debugging but there are no errors. However, browser console errors show the following:
front.min.js?ver=1.1:1 Uncaught ReferenceError: inc_opt is not defined
On expanding the error, I get the following:
inc_opt.is_admin||(e.moduleLogView=Backbone.Model.extend({url:inc_opt.ajaxurl+"?action=hustle_module_viewed",defaults:{page_id:inc_opt.page_id},parse:function(t){t.success?console.log("Log success!"):console.log("Log failed!")}}),t(document).on("hustle:module:displayed",function(t,i){if("object"===_typeof(i)){var n=i.module_type,s=Hustle.consts.Module_Show_Count+n+"-"+i.moduleId,r=Hustle.cookie.get(s);Hustle.cookie.set(s,r+1,30);var o="undefined"!==i.$el.data("sub-type")?i.$el.data("sub-type"):null;if(void 0!==e.moduleLogView&&i.isTrackingEnabled){var a=new e.moduleLogView;a.set("module_sub_type",o),a.set("module_type",n),a.set("module_id",i.moduleId),a.save()}}}),e.updateSshareNetworks=function(i){var n=void 0===i?e.networksToRetrieve:i;void 0!==n&&n.length&&t.ajax({type:"POST",url:inc_opt.ajaxurl,dataType:"json",data:{action:"hustle_update_network_shares",postId:inc_opt.page_id,networks:n}}).done(function(e){if(e.success){var i=e.data;t.each(i.networks,function(e,n){var s=t('.hustle-share-icon[data-counter="native"][data-network="'.concat(e,'"] .hustle-counter'));s.length&&s.each(function(){var e=parseInt(t(this).text(),10);if(!e||e<parseInt(n,10)){var s="";s=1e3>n?n:1e6>n?(n/1e3).toFixed(1)+i.shorten.thousand:(n/1e6).toFixed(1)+i.shorten.million,t(this).text(s)}})})}})})}(jQuery),function(t){t(document).on("submit","form.hustle-layout-form",function(e){e.preventDefault();var i=t(e.target),n=i.find(".hustle-button-submit"),s=i.closest(".hustle-ui"),r=s.find(".g-recaptcha-response").val(),o=s.data("id"),a=s.find("#hustle-modal-gdpr-"+o+":checked").val(),l=i.find(".hustle-error-message"),u=l.find("p"),c=l.data("default-error"),h=l.data("required-error"),d=i.serialize(),f=_.find(Modules,function(t,e){return o===parseInt(t.module_id)});if(!i.data("sending")){if(i.trigger("hustle:module:submit",d),HUI.optinValidate(s),i.find(".hustle-field-error").length)return u.text(h),void HUI.optinError(l);inc_opt.is_admin||(HUI.optinSubmit(n),i.data("sending",!0),t.ajax({type:"POST",url:inc_opt.ajaxurl,dataType:"json",data:{action:"hustle_module_form_submit",data:{form:d,module_id:o,recaptcha:r,gdpr:a,uri:encodeURI(window.location.href)}},success:function(t){if(t&&t.success){var e;if(i.trigger("hustle:module:submit:success",d),void 0!==f.settings.hide_after_subscription)"popup"===f.module_type?e=Optin.POPUP_COOKIE_PREFIX+o:"slidein"===f.module_type?e=Optin.SLIDE_IN_COOKIE_PREFIX+o:"embedded"===f.module_type&&(e=Optin.EMBEDDED_COOKIE_PREFIX+o),"no_show_on_post"===f.settings.hide_after_subscription?Optin.cookie.set(e+"_success_"+inc_opt.page_id,o):"no_show_all"===f.settings.hide_after_subscription&&Optin.cookie.set(e+"_success",o);if("redirect"===t.data.behavior.after_submit&&t.data.behavior.url.length>0)window.location.assign(t.data.behavior.url);else{var n=s.find(".hustle-success"),a=n.find(".hustle-success-content");t.data.message&&a.length&&a.html(t.data.message),HUI.optinSuccess(n,n.data("close-delay"))}}else{if(i.trigger("hustle:module:submit:failed",d),r){var h=s.find(".hustle-modal-recaptcha").attr("recaptcha-id");grecaptcha.reset(h)}t.data.message?u.text(t.data.message):u.text(c),HUI.optinError(l)}},error:function(){i.trigger("hustle:module:submit:failed",d),u.text(c),HUI.optinError(l)},complete:function(){i.data("sending",!1),i.find(".hustle-button-onload").removeClass("hustle-button-onload")}}))}}),t(document).on("change","form.hustle-modal-optin_form",function(e){var i=t(e.target);i.hasClass("hustle-modal-optin_error")&&(i.removeClass("hustle-modal-optin_error"),i.next("label").find(".hustle-i_warning").hide())}),t(document).on("submit","form.hustle-unsubscribe-form",function(e){e.preventDefault();var i=t(e.target),n=i.find(".hustle-email-section"),s=i.serialize(),r=i.find("button"),o=i.find(".wpoi-submit-failure");return r.attr("disabled",!0),r.addClass("sui-button-onload"),i.on("keypress",function(){return o.hide()}),t.ajax({type:"POST",url:inc_opt.ajaxurl,dataType:"json",data:{action:"hustle_unsubscribe_form_submission",data:s},success:function(t){t.success&&!0===t.success?(n.hide(),t.data.wrapper&&t.data.html&&i.find(t.data.wrapper).html(t.data.html)):t.data.html&&(o.text(t.data.html),o.show())},error:function(){o.text(o.data("default-error")),o.show()},complete:function(){r.attr("disabled",!1),r.removeClass("sui-button-onload")}}),!1})}(jQuery),function(t,e,i){"use strict";inc_opt.is_upfront||(inc_opt.is_admin||(Optin.ModuleLogConversion=Backbone.Model.extend({url:inc_opt.ajaxurl+"?action=hustle_module_converted",defaults:{page_id:inc_opt.page_id},parse:function(t){t.success?console.log("Log success!"):console.log("Log failed!")}})),Optin.Module=Backbone.View.extend({moduleId:"",module_type:"",settings:{},data:{},appear_after:"time",parent:"body",cookie_key:"",never_see_cookie_key:"",isShown:!1,events:{"click .hustle-button-cta":"ctaClicked"},close:_.noop,initialize:function(t){this.data=t,this.moduleId=t.module_id,this.settings=t.settings,this.module_type=t.module_type,this.isTrackingEnabled="enabled"===this.$el.data("tracking"),this.setOnInit(t),this.shouldDisplay()&&this.render()},setOnInit:function(){this.expiration_days=this.get_expiration_days(),this.appear_after=this.settings.triggers.trigger,this.expiration=parseInt(this.settings.expiration,10),this.triggers={on_time_delay:this.settings.triggers.on_time_delay,on_time_unit:this.settings.triggers.on_time_unit,on_scroll:this.settings.triggers.on_scroll,on_scroll_page_percent:parseInt(this.settings.triggers.on_scroll_page_percent),on_scroll_css_selector:this.settings.triggers.on_scroll_css_selector,enable_on_click_element:this.settings.triggers.enable_on_click_element,on_click_element:this.settings.triggers.on_click_element,enable_on_click_shortcode:this.settings.triggers.enable_on_click_shortcode,on_exit_intent_per_session:this.settings.triggers.on_exit_intent_per_session,on_exit_intent_delayed:this.settings.triggers.on_exit_intent_delayed,on_exit_intent_delayed_time:this.settings.triggers.on_exit_intent_delayed_time,on_exit_intent_delayed_unit:this.settings.triggers.on_exit_intent_delayed_unit,on_adblock:this.settings.triggers.on_adblock},"popup"===this.module_type?this.cookie_key=Optin.POPUP_COOKIE_PREFIX+this.moduleId:"slidein"===this.module_type?this.cookie_key=Optin.SLIDE_IN_COOKIE_PREFIX+this.moduleId:"embedded"===this.module_type&&(this.cookie_key=Optin.EMBEDDED_COOKIE_PREFIX+this.moduleId),this.never_see_cookie_key=Optin.NEVER_SEE_PREFIX+this.data.module_type+"-"+this.moduleId},shouldDisplay:function(){if(!this.$el.length)return!1;var t,e=Optin.cookie.get(this.never_see_cookie_key);return(e=parseInt(e)===parseInt(this.moduleId))?t=!1:(t="no_show_on_post"===this.settings.after_close?!(0<parseInt(inc_opt.page_id,10))||!_.isTrue(Optin.cookie.get(this.cookie_key+"_"+inc_opt.page_id)):"no_show_all"!==this.settings.after_close||!_.isTrue(Optin.cookie.get(this.cookie_key)))?("no_show_on_post"===this.data.settings.hide_after_subscription?t=!(0<parseInt(inc_opt.page_id,10))||!_.isTrue(Optin.cookie.get(this.cookie_key+"_success_"+inc_opt.page_id)):"no_show_all"===this.data.settings.hide_after_subscription&&(t=!_.isTrue(Optin.cookie.get(this.cookie_key+"_success"))),t):t},get_expiration_days:function(){switch(this.settings.expiration_unit){case"months":return 30*this.expiration;case"weeks":return 7*this.expiration;case"hours":return this.expiration/24;case"minutes":return this.expiration/1440;case"seconds":return this.expiration/86400;default:return this.expiration}},render:function(){"function"==typeof this[this.appear_after+"Trigger"]&&(this[this.appear_after+"Trigger"](),this.$el.off("hustle:module:closed").on("hustle:module:closed",t.proxy(this,"onModuleClosed","click_close_icon")),this.$el.off("hustle:module:hidden").on("hustle:module:hidden",t.proxy(this,"onModuleClosed","auto_hide")),this.$el.off("hustle:module:click_outside").on("hustle:module:click_outside",t.proxy(this,"onModuleClosed","click_outside")),this.$el.off("hustle:module:clicked_never_see").on("hustle:module:clicked_never_see",t.proxy(this,"onModuleClosed","click_never_see"))),HUI.inputFilled()},maybeRenderRecaptcha:function(){var t=this.$el.find(".hustle-recaptcha");if(t.length){var e=this,i=this.$el.data("render-id"),n="hustle-modal-recaptcha-"+this.moduleId+"-"+i,s=t.data("size"),r=t.data("theme"),o=t.data("sitekey");this.$el.find(".hustle-modal-body button").prop("disabled",!0),grecaptcha.ready(function(){var t={sitekey:o,theme:r,size:s};"invisible"===s?(t.badge="inline",t.callback=function(t){e.$el.trigger("submit.frontSubmit")}):t.callback=function(){e.$el.find(".hustle-layout-body button").removeProp("disabled")};var i=grecaptcha.render(n,t);e.$el.find(".hustle-recaptcha").attr("recaptcha-id",i)})}},display:function(){this.isShown||(this.beforeShowModule(),this.showModule(),t(document).trigger("hustle:module:displayed",this),this.isShown=!0)},beforeShowModule:function(){this.handleCompatibility(),"function"==typeof Optin.render_hustle_sshare_module_embeds&&Optin.render_hustle_sshare_module_embeds(!1),this.maybeRenderRecaptcha(),this.$el.find(".hustle-select2").length&&HUI.select2(),this.$el.find(".hustle-time").length&&HUI.timepicker(".hustle-time"),this.$el.find(".hustle-date").length&&HUI.datepicker(".hustle-date"),HUI.inputFilled()},timeTrigger:function(){var e=1e3*parseInt(this.triggers.on_time_delay,10);"minutes"===this.triggers.on_time_unit?e*=60:"hours"===this.triggers.on_time_unit&&(e*=3600),_.delay(t.proxy(this,"display"),e)},clickTrigger:function(){var e=this,i="";_.isTrue(this.triggers.enable_on_click_element)&&""!==(i=t.trim(this.triggers.on_click_element))&&(t(i).length&&t(document).on("click",i,function(t){t.preventDefault(),e.display()}));_.isTrue(this.triggers.enable_on_click_shortcode)&&t(document).on("click",".hustle_module_shortcode_trigger",function(i){i.preventDefault(),t(this).data("id")==e.moduleId&&t(this).data("type")==e.type&&e.display()})},scrollTrigger:function(){var n=this,s=!1;if("scrolled"===this.triggers.on_scroll&&t(i).scroll(_.debounce(function(){s||100*i.pageYOffset/t(e).height()>=parseFloat(n.triggers.on_scroll_page_percent)&&(n.display(),s=!0)},50)),"selector"===this.triggers.on_scroll){var r=t(this.triggers.on_scroll_css_selector);r.length&&t(i).scroll(_.debounce(function(){s||i.pageYOffset>=r.position().top&&(n.display(),s=!0)},50))}},exit_intentTrigger:function(){var i=this,n=0;_.isTrue(this.triggers.on_exit_intent_delayed)&&(n=1e3*parseInt(this.triggers.on_exit_intent_delayed_time,10),"minutes"===this.triggers.on_exit_intent_delayed_time?n*=60:"hours"===this.triggers.on_exit_intent_delayed_time&&(n*=3600)),_.isTrue(this.triggers.on_exit_intent_per_session)?t(e).on("mouseleave",_.debounce(function(e){t("input").is(":focus")||(i.set_exit_timer(),t(this).off(e))},300)):t(e).on("mouseleave",_.debounce(function(e){t("input").is(":focus")||i.set_exit_timer()},300)),t("html").on("mousemove",_.debounce(function(t){i.reset_exit_timer()},300)),this.exit_timer=null,this.reset_exit_timer=function(){i.exit_timer&&clearTimeout(i.exit_timer)},this.set_exit_timer=function(){i.exit_timer=setTimeout(function(){i.exit_timer=null,i.display()},n)}},adblockTrigger:function(){!t("#hustle_optin_adBlock_detector").length&&_.isTrue(this.triggers.on_adblock)&&this.display()},convertToMicroseconds:function(t,e){return"seconds"===e?1e3*parseInt(t,10):"minutes"===e?60*parseInt(t,10)*1e3:60*parseInt(t,10)*60*1e3},onModuleClosed:function(e){this.clearRunningCompatInterval(),this.$el.find("iframe").each(function(){t(this).attr("src",t(this).attr("src"))}),Array.isArray(this.settings.after_close_trigger)&&-1!==this.settings.after_close_trigger.indexOf(e)?"no_show_on_post"===this.settings.after_close?0<parseInt(inc_opt.page_id,10)&&Optin.cookie.set(this.cookie_key+"_"+inc_opt.page_id,this.moduleId,this.expiration_days):"no_show_all"===this.settings.after_close&&Optin.cookie.set(this.cookie_key,this.moduleId,this.expiration_days):"click_never_see"===e&&Hustle.cookie.set(this.never_see_cookie_key,this.moduleId),this.isShown=!1},redirectOnExternalFormSubmit:function(e,i){var n=t(e.target);n.attr("action")&&setTimeout(function(){return window.location.replace(n.attr("action"))},i)},handleCompatibility:function(){var e=this,i=this.data.settings.on_submit,n=this.convertToMicroseconds(this.data.settings.on_submit_delay,this.data.settings.on_submit_delay_unit);-1!==t.inArray(i,["close","default"])&&"embedded"!==this.data.module_type?(this.$el.find("form.wpcf7-form").length&&this.$el.on("wpcf7mailsent",function(){return e.close(n)}),this.$(".forminator-custom-form").length&&this.$el.on("forminator:form:submit:success",function(){return e.close(n)}),this.$(".gform_wrapper").length&&t(document).on("gform_confirmation_loaded",function(){return e.close(n)}),this.$(".nf-form-cont").length&&t(document).on("nfFormSubmitResponse",function(){return e.close(n)})):"redirect"===i&&(this.$el.find("form.wpcf7-form").length&&this.$el.on("wpcf7mailsent",function(t){return e.redirectOnExternalFormSubmit(t,n)}),this.$(".forminator-custom-form").length&&this.$el.on("forminator:form:submit:success",function(t){return e.redirectOnExternalFormSubmit(t,n)}),this.$(".gform_wrapper").length&&t(document).on("gform_confirmation_loaded",function(t){return e.redirectOnExternalFormSubmit(t,n)}),this.$(".nf-form-cont").length&&t(document).on("nfFormSubmitResponse",function(t){return e.redirectOnExternalFormSubmit(t,n)}));var s=this.$el.find("form#subscribes_form"),r=1e3;s.length&&(e.waitEnewsletterResult=setInterval(function(){r+=(_readOnlyError("enewsletterWaited"),1e3);var t=e.$el.find("#message");_.isEmpty(t.text().trim())&&216e6!==r||e.close()},1e3))},clearRunningCompatInterval:function(){void 0!==this.waitEnewsletterResult&&clearInterval(this.waitEnewsletterResult)},ctaClicked:function(){if(void 0!==Optin.ModuleLogConversion&&this.isTrackingEnabled){var t=new Optin.ModuleLogConversion,e="undefined"!==this.$el.data("sub-type")?this.$el.data("sub-type"):"";t.set("module_sub_type",e),t.set("module_id",this.moduleId),t.save()}}}))}(jQuery,document,window),function(t){"use strict";(Optin=Optin||{}).Embedded=Optin.Module.extend({type:"embedded",render:function(){var e=this.el;t(window).on("resize",function(){HUI.inlineResize(e)}),this.display()},showModule:function(){HUI.inlineResize(this.el),HUI.inlineLoad(this.el)}})}(jQuery),function(t){"use strict";inc_opt.is_upfront||((Optin=window.Optin||{}).PopUp=Optin.Module.extend({type:"popup",showModule:function(){"0"===this.settings.allow_scroll_page&&t("html").addClass("hustle-no-scroll");var e="false"!==String(this.$el.data("close-delay"))&&this.$el.data("close-delay");HUI.popupLoad(this.el,e)},close:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;HUI.popupClose(this.$el,t)}}))}(jQuery),function(t){"use strict";inc_opt.is_upfront||((Optin=window.Optin||{}).SlideIn=Optin.Module.extend({type:"slidein",showModule:function(){var e=this,i="false"!==String(this.$el.data("close-delay"))&&this.$el.data("close-delay");HUI.slideinBoxShadow(this.$el),t(window).on("resize",function(){HUI.slideinBoxShadow(e.$el)}),HUI.slideinLoad(this.$el,i)},close:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;HUI.slideinClose(this.$el,t)}}))}(jQuery),function(t){"use strict";var e=window.Optin||{};e.SShare=e.Module.extend({type:"social_sharing",beforeShowModule:_.noop,events:{"click .hustle-share-icon":"iconClicked"},render:function(){this.collectNativeCounters(),this.display()},showModule:function(){var e=this.$el.data(),i=this;"floating"===e.subType?(setTimeout(function(){HUI.floatResize(i.$el.find(".hustle-social"))},200),HUI.floatLoad(this.el),t(window).on("resize",function(){return HUI.floatLoad(i.el)})):HUI.inlineLoad(this.el)},setOnInit:function(e){this.is_compat=void 0!==e.is_compat,void 0!==e.parent&&(this.parent=e.parent);var i=this;t(window).on("resize",function(){HUI.floatResize(i.$el.find(".hustle-social"))})},shouldDisplay:function(){return!0},iconClicked:function(e){var i=t(e.currentTarget),n=i.data("counter"),s=i.data("link");this.isTrackingEnabled&&this.logConversion(),"native"===s&&(e.preventDefault(),this.openNativeSharingUrl(i)),"native"===n?this.updateSocialCounter(i,"native"):"click"===n&&this.updateSocialCounter(i,"click")},logConversion:function(){if(void 0!==e.ModuleLogConversion&&this.isTrackingEnabled){var t=new e.ModuleLogConversion,i="undefined"!==this.$el.data("sub-type")?this.$el.data("sub-type"):"";t.set("module_sub_type",i),t.set("module_id",this.moduleId),t.save()}},openNativeSharingUrl:function(t){var e=t.data("network");e&&void 0!==inc_opt.native_share_enpoints[e]&&window.open(inc_opt.native_share_enpoints[e],"MsgWindow","menubar=no,toolbar=no,resizable=yes,scrollbars=yes")},updateSocialCounter:function(e,i){var n=e.data("network"),s=".hustle_module_id_"+this.$el.data("id");"click"===i?(this.storeUpdatedClickCounter(n),_.delay(function(){t(s+' a[data-network="'+n+'"]').not('a[data-counter="native"]').each(function(){var e=t(this).find(".hustle-counter");if(e.length){var i=parseInt(e.text())+1;e.text(i)}})},5e3)):_.delay(function(){t(s+' a[data-network="'+n+'"]').not('a[data-counter="click"]').each(function(){var e=t(this).find(".hustle-counter");if(e.length){e.html('<i class="hustle-icon-loader hustle-loading-icon" aria-hidden="true"></i>')}})},5e3)},storeUpdatedClickCounter:function(e){t.post({url:inc_opt.ajaxurl,dataType:"json",data:{action:"hustle_sshare_click_counted",moduleId:this.moduleId,network:e}})},collectNativeCounters:function(){var i=this.$el.find('.hustle-share-icon[data-counter="native"]');i.length&&(e.networksToRetrieve=e.networksToRetrieve||[],i.each(function(){var i=t(this).data("network");-1===e.networksToRetrieve.indexOf(i)&&e.networksToRetrieve.push(i)}))}})}(jQuery),function(t,e,i){"use strict";inc_opt.is_upfront||(t(window).on("resize",_.debounce(function(t){Hustle.Events.trigger("hustle_resize")},300)),_.each(Modules,function(e,i){if(e.el=".hustle_module_id_"+e.module_id,"popup"===e.module_type)new Optin.PopUp(e);else if("slidein"===e.module_type)new Optin.SlideIn(e);else if("embedded"===e.module_type){t(e.el).each(function(){e.el=this,new Optin.Embedded(e)})}else if("social_sharing"===e.module_type){t(e.el).each(function(){e.el=this,new Optin.SShare(e)})}}),Optin.updateSshareNetworks())}(jQuery,document,window);
Please, note, with all plugins disabled ( with the exception of Hustle ) and the theme is switched to the default Twenty Nineteen Theme, the above errors still occur.
The site is running PHP 7.3 and uses SiteGround Cloud hosting.
Kind regards,
Simon
- The topic ‘Pop-Ups no longer loading’ is closed to new replies.