WordPress Landing Pages - Version 2.5.4

Version Description

  • Making sure PHP sessions are only used on the backend to fix X-CACHE issue.
  • Updating shared files and database tables.
Download this release

Release Info

Developer adbox
Plugin Icon 128x128 WordPress Landing Pages
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

landing-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
- Version: 2.5.3
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
@@ -19,7 +19,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
19
  public function __construct() {
20
 
21
  /* Start a PHP Session if in wp-admin */
22
- if(session_id() == '' && !headers_sent() ) {
23
  session_start();
24
  }
25
 
@@ -37,7 +37,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
37
  */
38
  private static function load_constants() {
39
 
40
- define('LANDINGPAGES_CURRENT_VERSION', '2.5.3' );
41
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
42
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
43
  define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
+ Version: 2.5.4
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
19
  public function __construct() {
20
 
21
  /* Start a PHP Session if in wp-admin */
22
+ if(session_id() == '' && !headers_sent() && is_admin() ) {
23
  session_start();
24
  }
25
 
37
  */
38
  private static function load_constants() {
39
 
40
+ define('LANDINGPAGES_CURRENT_VERSION', '2.5.4' );
41
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
42
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
43
  define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
readme.txt CHANGED
@@ -7,7 +7,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
  Tested up to: 4.7.4
10
- Stable Tag: 2.5.3
11
 
12
 
13
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
@@ -85,6 +85,10 @@ We also offer a guide for using <a href="https://github.com/inboundnow/landing-p
85
 
86
  == Changelog ==
87
 
 
 
 
 
88
  = 2.5.3 =
89
  * Support for Avada theme
90
 
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
  Tested up to: 4.7.4
10
+ Stable Tag: 2.5.4
11
 
12
 
13
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
85
 
86
  == Changelog ==
87
 
88
+ = 2.5.4 =
89
+ * Making sure PHP sessions are only used on the backend to fix X-CACHE issue.
90
+ * Updating shared files and database tables.
91
+
92
  = 2.5.3 =
93
  * Support for Avada theme
94
 
shared/assets/js/frontend/analytics-src/analytics.forms.js CHANGED
@@ -41,7 +41,6 @@ var InboundForms = (function(_inbound) {
41
  // Init Form functions
42
  init: function() {
43
  _inbound.Forms.runFieldMappingFilters();
44
- _inbound.Forms.assignTrackClass();
45
  _inbound.Forms.formTrackInit();
46
  },
47
  /**
@@ -119,22 +118,6 @@ var InboundForms = (function(_inbound) {
119
  }
120
  }
121
  },
122
- assignTrackClass: function() {
123
- if (window.inbound_settings) {
124
- if (inbound_settings.inbound_track_include) {
125
- var selectors = inbound_settings.inbound_track_include.split(',');
126
- var msg = 'add selectors ' + inbound_settings.inbound_track_include;
127
- _inbound.deBugger('forms', msg);
128
- this.loopClassSelectors(selectors, 'add');
129
- }
130
- if (inbound_settings.inbound_track_exclude) {
131
- var selectors = inbound_settings.inbound_track_exclude.split(',');
132
- var msg = 'remove selectors ' + inbound_settings.inbound_track_exclude;
133
- _inbound.deBugger('forms', msg);
134
- this.loopClassSelectors(selectors, 'remove');
135
- }
136
- }
137
- },
138
  /* Loop through include/exclude items for tracking */
139
  loopClassSelectors: function(selectors, action) {
140
  for (var i = selectors.length - 1; i >= 0; i--) {
41
  // Init Form functions
42
  init: function() {
43
  _inbound.Forms.runFieldMappingFilters();
 
44
  _inbound.Forms.formTrackInit();
45
  },
46
  /**
118
  }
119
  }
120
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  /* Loop through include/exclude items for tracking */
122
  loopClassSelectors: function(selectors, action) {
123
  for (var i = selectors.length - 1; i >= 0; i--) {
shared/assets/js/frontend/analytics-src/analytics.page.js CHANGED
@@ -333,31 +333,43 @@ var _inboundPageTracking = (function(_inbound) {
333
  },
334
  storePageView: function() {
335
 
336
- if ( inbound_settings.page_tracking == 'off' ) {
 
337
  return;
338
  }
339
 
 
 
 
 
 
 
340
 
341
- var leadID = ( _inbound.Utils.readCookie('wp_lead_id') ) ? _inbound.Utils.readCookie('wp_lead_id') : '';
342
- var lead_uid = ( _inbound.Utils.readCookie('wp_lead_uid') ) ? _inbound.Utils.readCookie('wp_lead_uid') : '';
 
 
 
 
 
 
 
 
 
 
343
 
344
- var data = {
345
- action: 'inbound_track_lead',
346
- wp_lead_uid: lead_uid,
347
- wp_lead_id: leadID,
348
- page_id: inbound_settings.post_id,
349
- variation_id: inbound_settings.variation_id,
350
- post_type: inbound_settings.post_type,
351
- current_url: window.location.href,
352
- page_views: JSON.stringify(_inbound.PageTracking.getPageViews()),
353
- json: '0'
354
- };
355
 
356
- var firePageCallback = function(leadID) {
357
- //_inbound.Events.page_view_saved(leadID);
358
- };
359
- //_inbound.Utils.doAjax(data, firePageCallback);
360
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, firePageCallback);
361
 
362
  }
363
  /*! GA functions
333
  },
334
  storePageView: function() {
335
 
336
+ /* ignore if page tracking off and page is not a landing page */
337
+ if ( inbound_settings.page_tracking == 'off' && inbound_settings.post_type != 'landing-page' ) {
338
  return;
339
  }
340
 
341
+ /* Let's try and fire this last - also defines what constitutes a bounce - */
342
+ jQuery(document).ready(function() {
343
+ setTimeout(function(){
344
+ var leadID = ( _inbound.Utils.readCookie('wp_lead_id') ) ? _inbound.Utils.readCookie('wp_lead_id') : '';
345
+ var lead_uid = ( _inbound.Utils.readCookie('wp_lead_uid') ) ? _inbound.Utils.readCookie('wp_lead_uid') : '';
346
+ var ctas = _inbound.totalStorage('wp_cta_loaded');
347
 
348
+ var data = {
349
+ action: 'inbound_track_lead',
350
+ wp_lead_uid: lead_uid,
351
+ wp_lead_id: leadID,
352
+ page_id: inbound_settings.post_id,
353
+ variation_id: inbound_settings.variation_id,
354
+ post_type: inbound_settings.post_type,
355
+ current_url: window.location.href,
356
+ page_views: JSON.stringify(_inbound.PageTracking.getPageViews()),
357
+ ctas : JSON.stringify(ctas),
358
+ json: '0'
359
+ };
360
 
361
+ var firePageCallback = function(leadID) {
362
+ //_inbound.Events.page_view_saved(leadID);
363
+ };
364
+ //_inbound.Utils.doAjax(data, firePageCallback);
365
+
366
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, firePageCallback);
367
+
368
+ } , 400 );
369
+
370
+
371
+ });
372
 
 
 
 
 
 
373
 
374
  }
375
  /*! GA functions
shared/assets/js/frontend/analytics/inboundAnalytics.js CHANGED
@@ -1345,7 +1345,6 @@ var InboundForms = (function(_inbound) {
1345
  // Init Form functions
1346
  init: function() {
1347
  _inbound.Forms.runFieldMappingFilters();
1348
- _inbound.Forms.assignTrackClass();
1349
  _inbound.Forms.formTrackInit();
1350
  },
1351
  /**
@@ -1423,22 +1422,6 @@ var InboundForms = (function(_inbound) {
1423
  }
1424
  }
1425
  },
1426
- assignTrackClass: function() {
1427
- if (window.inbound_settings) {
1428
- if (inbound_settings.inbound_track_include) {
1429
- var selectors = inbound_settings.inbound_track_include.split(',');
1430
- var msg = 'add selectors ' + inbound_settings.inbound_track_include;
1431
- _inbound.deBugger('forms', msg);
1432
- this.loopClassSelectors(selectors, 'add');
1433
- }
1434
- if (inbound_settings.inbound_track_exclude) {
1435
- var selectors = inbound_settings.inbound_track_exclude.split(',');
1436
- var msg = 'remove selectors ' + inbound_settings.inbound_track_exclude;
1437
- _inbound.deBugger('forms', msg);
1438
- this.loopClassSelectors(selectors, 'remove');
1439
- }
1440
- }
1441
- },
1442
  /* Loop through include/exclude items for tracking */
1443
  loopClassSelectors: function(selectors, action) {
1444
  for (var i = selectors.length - 1; i >= 0; i--) {
@@ -3453,31 +3436,43 @@ var _inboundPageTracking = (function(_inbound) {
3453
  },
3454
  storePageView: function() {
3455
 
3456
- if ( inbound_settings.page_tracking == 'off' ) {
 
3457
  return;
3458
  }
3459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3460
 
3461
- var leadID = ( _inbound.Utils.readCookie('wp_lead_id') ) ? _inbound.Utils.readCookie('wp_lead_id') : '';
3462
- var lead_uid = ( _inbound.Utils.readCookie('wp_lead_uid') ) ? _inbound.Utils.readCookie('wp_lead_uid') : '';
 
 
3463
 
3464
- var data = {
3465
- action: 'inbound_track_lead',
3466
- wp_lead_uid: lead_uid,
3467
- wp_lead_id: leadID,
3468
- page_id: inbound_settings.post_id,
3469
- variation_id: inbound_settings.variation_id,
3470
- post_type: inbound_settings.post_type,
3471
- current_url: window.location.href,
3472
- page_views: JSON.stringify(_inbound.PageTracking.getPageViews()),
3473
- json: '0'
3474
- };
3475
 
3476
- var firePageCallback = function(leadID) {
3477
- //_inbound.Events.page_view_saved(leadID);
3478
- };
3479
- //_inbound.Utils.doAjax(data, firePageCallback);
3480
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, firePageCallback);
3481
 
3482
  }
3483
  /*! GA functions
1345
  // Init Form functions
1346
  init: function() {
1347
  _inbound.Forms.runFieldMappingFilters();
 
1348
  _inbound.Forms.formTrackInit();
1349
  },
1350
  /**
1422
  }
1423
  }
1424
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1425
  /* Loop through include/exclude items for tracking */
1426
  loopClassSelectors: function(selectors, action) {
1427
  for (var i = selectors.length - 1; i >= 0; i--) {
3436
  },
3437
  storePageView: function() {
3438
 
3439
+ /* ignore if page tracking off and page is not a landing page */
3440
+ if ( inbound_settings.page_tracking == 'off' && inbound_settings.post_type != 'landing-page' ) {
3441
  return;
3442
  }
3443
 
3444
+ /* Let's try and fire this last - also defines what constitutes a bounce - */
3445
+ jQuery(document).ready(function() {
3446
+ setTimeout(function(){
3447
+ var leadID = ( _inbound.Utils.readCookie('wp_lead_id') ) ? _inbound.Utils.readCookie('wp_lead_id') : '';
3448
+ var lead_uid = ( _inbound.Utils.readCookie('wp_lead_uid') ) ? _inbound.Utils.readCookie('wp_lead_uid') : '';
3449
+ var ctas = _inbound.totalStorage('wp_cta_loaded');
3450
+
3451
+ var data = {
3452
+ action: 'inbound_track_lead',
3453
+ wp_lead_uid: lead_uid,
3454
+ wp_lead_id: leadID,
3455
+ page_id: inbound_settings.post_id,
3456
+ variation_id: inbound_settings.variation_id,
3457
+ post_type: inbound_settings.post_type,
3458
+ current_url: window.location.href,
3459
+ page_views: JSON.stringify(_inbound.PageTracking.getPageViews()),
3460
+ ctas : JSON.stringify(ctas),
3461
+ json: '0'
3462
+ };
3463
 
3464
+ var firePageCallback = function(leadID) {
3465
+ //_inbound.Events.page_view_saved(leadID);
3466
+ };
3467
+ //_inbound.Utils.doAjax(data, firePageCallback);
3468
 
3469
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, firePageCallback);
3470
+
3471
+ } , 400 );
3472
+
3473
+
3474
+ });
 
 
 
 
 
3475
 
 
 
 
 
 
3476
 
3477
  }
3478
  /*! GA functions
shared/assets/js/frontend/analytics/inboundAnalytics.min.js CHANGED
@@ -1,3 +1,3 @@
1
  /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
- function inboundFormNoRedirect(){if(null==window.frames.frameElement)var e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if("undefined"!=typeof e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])');(0==n.length||"IA=="==n[0].value)&&(t.action="javascript:void(0)")}}function inboundFormNoRedirectContent(){if(null==window.frames.frameElement)var e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if("undefined"!=typeof e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),i=jQuery(e).css("background"),o=jQuery(e).css("color"),a=jQuery(e).css("height"),r=e.getElementsByClassName("inbound-form-spinner");(0==n.length||"IA=="==n[0].value)&&(jQuery(r).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+i+"; color="+o+"; font-size:calc("+a+' * .42);"></i></div>'))}}var inbound_data=inbound_data||{},_inboundOptions=_inboundOptions||{},_gaq=_gaq||[],_inbound=function(e){var t={timeout:inbound_settings.is_admin?500:1e4,formAutoTracking:!0,formAutoPopulation:!0},n={init:function(){_inbound.Utils.init(),_inbound.Utils.domReady(window,function(){_inbound.DomLoaded()})},DomLoaded:function(){_inbound.PageTracking.init(),_inbound.Forms.init(),_inbound.Utils.setUrlParams(),_inbound.LeadsAPI.init(),setTimeout(function(){_inbound.Forms.init()},2e3),_inbound.trigger("analytics_ready")},extend:function(e,t){var n,i={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i},debug:function(){},deBugger:function(e,t,n){if(console){var i,o,a,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(r=r.split("-"),a=r[1]),o="true"===_inbound.Utils.readCookie("inbound_debug")?!0:!1,i="true"===_inbound.Utils.readCookie("inbound_debug_"+e)?!0:!1,(i||s||o)&&(t&&"string"==typeof t&&(o||"all"===a?console.log('logAll "'+e+'" =>',t):i?console.log('log "'+e+'" =>',t):e===a&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},i=n.extend(t,e);return n.Settings=i||{},n}(_inboundOptions),_inboundHooks=function(e){var t=function(){function e(e,t,n,i){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("actions",e,t,n,i)),d}function t(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&u("actions",t,e),d}function n(e,t){return"string"==typeof e&&r("actions",e,t),d}function i(e,t,n){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("filters",e,t,n)),d}function o(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?u("filters",t,e):d}function a(e,t){return"string"==typeof e&&r("filters",e,t),d}function r(e,t,n,i){if(c[e][t])if(n){var o,a=c[e][t];if(i)for(o=a.length;o--;){var r=a[o];r.callback===n&&r.context===i&&a.splice(o,1)}else for(o=a.length;o--;)a[o].callback===n&&a.splice(o,1)}else c[e][t]=[]}function s(e,t,n,i,o){var a={callback:n,priority:i,context:o},r=c[e][t];r?(r.push(a),r=l(r)):r=[a],c[e][t]=r}function l(e){for(var t,n,i,o=1,a=e.length;a>o;o++){for(t=e[o],n=o;(i=e[n-1])&&i.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function u(e,t,n){var i=c[e][t];if(!i)return"filters"===e?n[0]:!1;var o=0,a=i.length;if("filters"===e)for(;a>o;o++)n[0]=i[o].callback.apply(i[o].context,n);else for(;a>o;o++)i[o].callback.apply(i[o].context,n);return"filters"===e?n[0]:!0}var d={removeFilter:a,applyFilters:o,addFilter:i,removeAction:n,doAction:t,addAction:e},c={actions:{},filters:{}};return d};return e.hooks=new t,e.add_action=function(){var t=arguments[0].split(" ");for(k in t)arguments[0]="inbound."+t[k],e.hooks.addAction.apply(this,arguments);return this},e.remove_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeAction.apply(this,arguments),this},e.do_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.doAction.apply(this,arguments),this},e.add_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.addFilter.apply(this,arguments),this},e.remove_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeFilter.apply(this,arguments),this},e.apply_filters=function(){return arguments[0]="inbound."+arguments[0],e.hooks.applyFilters.apply(this,arguments)},e}(_inbound||{}),_inboundUtils=function(e){var t,n=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,i=(Object.prototype.toString,("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/$/,"")),o={api_host:i,track_pageview:!0,track_links_timeout:300,cookie_name:"_sp",cookie_expiration:365,cookie_domain:(host=location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i))?host[0]:""};return e.Utils={init:function(){this.polyFills(),this.checkLocalStorage(),this.SetUID(),this.storeReferralData()},polyFills:function(){window.console||(window.console={});for(var e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],t=0;t<e.length;t++)window.console[e[t]]||(window.console[e[t]]=function(){});Date.prototype.toISOString||!function(){function e(e){var t=String(e);return 1===t.length&&(t="0"+t),t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}();try{new CustomEvent("?")}catch(n){this.CustomEvent=function(e,t){function n(n,o){var a=document.createEvent(e);return null!==n?i.call(a,n,(o||(o=t)).bubbles,o.cancelable,o.detail):a.initCustomEvent=i,a}function i(t,n,i,o){this["init"+e](t,n,i,o),"detail"in this||(this.detail=o)}return n}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),i=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)t=document._qsa.shift(),t.style.removeAttribute("x-qsa"),i.push(t);return document._qsa=null,i}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),!("innerText"in document.createElement("a"))&&"getSelection"in window&&HTMLElement.prototype.__defineGetter__("innerText",function(){for(var e,t=window.getSelection(),n=[],i=0;i<t.rangeCount;i++)n[i]=t.getRangeAt(i);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(var i=0;i<n.length;i++)t.addRange(n[i]);return e})},createCookie:function(e,t,n){var i="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),i="; expires="+o.toGMTString()}document.cookie=e+"="+t+i+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null},eraseCookie:function(e){this.createCookie(e,"",-1)},getAllCookies:function(){var t={};if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),i=0;i<n.length;i++){var o=n[i].split("=");o[0]=o[0].replace(/^ /,""),t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},i=window.location.search.substring(1),o=/([^&=]+)=?([^&]*)/g;e=o.exec(i);)if("-1"==e[1].indexOf("["))n[t(e[1])]=t(e[2]);else{var a=e[1].indexOf("["),r=e[1].slice(a+1,e[1].indexOf("]",a)),s=t(e[1].slice(0,a));"object"!=typeof n[s]&&(n[t(s)]={},n[t(s)].length=0),r?n[t(s)][t(r)]=t(e[2]):Array.prototype.push.call(n[t(s)],t(e[2]))}}();for(var i in n)if("action"!=i)if("object"==typeof n[i])for(var o in n[i])this.createCookie(o,n[i][o],30);else this.createCookie(i,n[i],30);if(t){var a=e.totalStorage("inbound_url_params")||{},r=this.mergeObjs(a,n);e.totalStorage("inbound_url_params",r)}var s={option1:"yo",option2:"woooo"};e.trigger("url_parameters",n,s)},getAllUrlParams:function(){var n={};if(t)var n=e.totalStorage("inbound_url_params");return n},getParameterVal:function(e,t){return(RegExp(e+"=(.+?)(&|$)").exec(t)||[,!1])[1]},checkLocalStorage:function(){if("localStorage"in window)try{ls="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof ls||"undefined"==typeof window.JSON?!1:!0}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}function n(t){return{name:t,size:e(localStorage[t])}}function i(e){return e.size=t(e.size).toFixed(2)+" MB",e}var o=Object.keys(localStorage).map(n).map(i);console.table(o)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=10>t?"0":"",i=e.getFullYear(),o=e.getHours(),a=10>o?"0":"",r=e.getMinutes(),s=10>r?"0":"",l=e.getSeconds(),u=10>l?"0":"",d=e.getMonth()+1,c=10>d?"0":"",m=i+"/"+c+d+"/"+n+t+" "+a+o+":"+s+r+":"+u+l;return m},SetSessionTimeout:function(){var e=(this.readCookie("lead_session_expire"),new Date);e.setTime(e.getTime()+18e5),this.createCookie("lead_session_expire",!0,e)},storeReferralData:function(){var t=new Date,n=document.referrer||"Direct Traffic",i=e.Utils.readCookie("inbound_referral_site"),o=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),i||this.createCookie("inbound_referral_site",n,t),o||e.totalStorage("inbound_original_referral",o)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var i=0;e>i;i++)n+=t[Math.floor(Math.random()*t.length)];return n},generateGUID:function(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,guid)},SetUID:function(e){if(!this.readCookie("wp_lead_uid")){var t=e||this.CreateUID(35);this.createCookie("wp_lead_uid",t)}},countProperties:function(e){var t=0;for(var n in e)e.hasOwnProperty(n)&&++t;return t},mergeObjs:function(e,t){var n={};for(var i in e)n[i]=e[i];for(var i in t)n[i]=t[i];return n},hasClass:function(e,t){var n;if("classList"in document.documentElement)var n=t.classList.contains(e);else var n=new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className);return n},addClass:function(e,t){"classList"in document.documentElement?t.classList.add(e):this.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(e,t){"classList"in document.documentElement?t.classList.remove(e):this.hasClass(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)*"+e+"(\\s|$)*","g"),""))},removeElement:function(e){e.parentNode.removeChild(e)},trim:function(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,"\n")},ajaxPolyFill:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var e,t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<t.length;n++)try{e=new ActiveXObject(t[n]);break}catch(i){}return e},ajaxSendData:function(e,t,n,i){var o=this.ajaxPolyFill();setTimeout(function(){o.open(n,e,!0),o.onreadystatechange=function(){4==o.readyState&&t(o.responseText)},"POST"==n&&o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(i)},100)},ajaxGet:function(e,t,n,i){var o=[];for(var a in t)o.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e+"?"+o.join("&"),n,"GET",null,i)},ajaxPost:function(e,t,n,i){var o=[];for(var a in t)o.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e,n,"POST",o.join("&"),i)},sendEvent:function(e,t,i){t=t||{},async=!0;var a=getCookie();if(a){var r;for(r in a)t[r]=a[r]}t.id||(t.id=getId());var s={e:e,t:(new Date).toISOString(),kv:t},l=o.api_host+"/track?data="+encodeURIComponent(JSON.stringify(s));if(n){var u=new XMLHttpRequest;u.open("GET",l,async),u.withCredentials=async,u.send(null)}else{var d=document.createElement("script");d.type="text/javascript",d.async=async,d.defer=async,d.src=l;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}return action(i),self},domReady:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener?"addEventListener":"attachEvent",s=o.addEventListener?"removeEventListener":"detachEvent",l=o.addEventListener?"":"on",u=function(i){("readystatechange"!=i.type||"complete"==o.readyState)&&(("load"==i.type?e:o)[s](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},d=function(){try{a.doScroll("left")}catch(e){return setTimeout(d,50),void 0}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(o.createEventObject&&a.doScroll){try{i=!e.frameElement}catch(c){}i&&d()}o[r](l+"DOMContentLoaded",u,!1),o[r](l+"readystatechange",u,!1),e[r](l+"load",u,!1)}},addListener:function(e,t,n){e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},removeListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},throttle:function(e,t){var n,i,o,a=null,r=0,s=function(){r=new Date,a=null,o=e.apply(n,i)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,i=arguments,0>=u?(clearTimeout(a),a=null,r=l,o=e.apply(n,i)):a||(a=setTimeout(s,u)),o}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),"undefined"!=typeof _gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)}},e}(_inbound||{}),InboundForms=function(e){var t=!1,n=e.Utils,o=[],a=[],r=[],s=e.Settings,l=["first name","last name","name","email","e-mail","phone","website","job title","your favorite food","company","tele","address","comment"];if(e.Forms={init:function(){e.Forms.runFieldMappingFilters(),e.Forms.assignTrackClass(),e.Forms.formTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,n){if(t&&console){var e=e||!1;e&&"string"==typeof e&&console.log(e),n&&n instanceof Function&&n()}},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=!1,n=window.document.forms[e];n.dataset.formProcessed||(n.dataset.formProcessed=!0,t=this.checkTrackStatus(n),t&&(this.attachFormSubmitEvent(n),this.initFormMapping(n)))}},checkTrackStatus:function(t){var n=t.getAttribute("class");return""!==n&&null!==n?n.toLowerCase().indexOf("wpl-track-me")>-1?!0:n.toLowerCase().indexOf("inbound-track")>-1?!0:(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1):void 0},assignTrackClass:function(){if(window.inbound_settings){if(inbound_settings.inbound_track_include){var t=inbound_settings.inbound_track_include.split(","),n="add selectors "+inbound_settings.inbound_track_include;e.deBugger("forms",n),this.loopClassSelectors(t,"add")}if(inbound_settings.inbound_track_exclude){var t=inbound_settings.inbound_track_exclude.split(","),n="remove selectors "+inbound_settings.inbound_track_exclude;e.deBugger("forms",n),this.loopClassSelectors(t,"remove")}}},loopClassSelectors:function(t,i){for(var o=t.length-1;o>=0;o--){var a=n.trim(t[o]);-1===a.indexOf("#")&&-1===a.indexOf(".")&&(a="#"+a),a=document.querySelector(a),a&&("add"===i?(e.Utils.addClass("wpl-track-me",a),e.Utils.addClass("inbound-track",a)):(e.Utils.removeClass("wpl-track-me",a),e.Utils.removeClass("inbound-track",a)))}},initFormMapping:function(t){for(var n=[],i=0;i<t.elements.length;i++)formInput=t.elements[i],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var o=n.length-1;o>=0;o--)formInput=n[o],this.mapField(formInput)},mapField:function(t){var a=t.id||!1,r=t.name||!1,s=this.getInputLabel(t);if(s){var u=this.ignoreFieldByLabel(s[0].innerText);if(u)return t.dataset.ignoreFormField=!0,!1}for(i=0;i<l.length;i++){var d=!1,c=l[i],m=n.trim(c),f=m.replace(/ /g,"_");r&&r.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching name attribute for -> "+m)):a&&a.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching ID attribute for ->"+m)):s?s[0].innerText.toLowerCase().indexOf(m)>-1&&(d=!0,e.deBugger("forms","Found matching sibling label for -> "+m)):o.push(m),d&&(this.addDataAttr(t,f),this.removeArrayItem(l,m),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},attachFormSubmitEvent:function(e){n.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},ignoreFieldByLabel:function(t){var n=!1;return t?((-1!=t.toLowerCase().indexOf("credit card")||-1!=t.toLowerCase().indexOf("card number"))&&(n=!0),(-1!=t.toLowerCase().indexOf("expiration")||-1!=t.toLowerCase().indexOf("expiry"))&&(n=!0),("month"==t.toLowerCase()||"mm"==t.toLowerCase()||"yy"==t.toLowerCase()||"yyyy"==t.toLowerCase()||"year"==t.toLowerCase())&&(n=!0),(-1!=t.toLowerCase().indexOf("cvv")||-1!=t.toLowerCase().indexOf("cvc")||-1!=t.toLowerCase().indexOf("secure code")||-1!=t.toLowerCase().indexOf("security code"))&&(n=!0),n&&e.deBugger("forms","ignore "+t),n):!1},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;("visa"==e.toLowerCase()||"mastercard"==e.toLowerCase()||"american express"==e.toLowerCase()||"amex"==e.toLowerCase()||"discover"==e.toLowerCase())&&(t=!0);var n=new RegExp("/^[0-9]+$/");if(n.test(e)){var i=e.replace(" ","");this.isInt(i)&&i.length>=16&&(t=!0)}return t},isInt:function(e){return"number"==typeof e&&isFinite(e)&&e%1===0},releaseFormSubmit:function(e){document.body.style.cursor="default",n.removeClass("wpl-track-me",e),n.removeListener(e,"submit",this.formListener);var t=e.getAttribute("class");return""!==t&&null!==t&&-1!=t.toLowerCase().indexOf("wpcf7-form")?(setTimeout(function(){document.body.style.cursor="default"},300),!0):(e.submit(),setTimeout(function(){for(var t=0;t<e.elements.length;t++)formInput=e.elements[t],type=formInput.type||!1,"submit"===type&&"submit"===formInput.name&&e.elements[t].click()},2e3),void 0)},saveFormData:function(t){for(var i=i||{},o=0;o<t.elements.length;o++)if(formInput=t.elements[o],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("forms","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),i[inputName]||(i[inputName]={}),formInput.type&&(i[inputName].type=formInput.type),i[inputName].name||(i[inputName].name=formInput.name),formInput.dataset.mapFormField&&(i[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(l=this.getInputValue(formInput),l===!1)continue;break;case"TEXTAREA":l=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var s=0;s<formInput.length;s++)formInput[s].selected&&values.push(encodeURIComponent(formInput[s].value))}else l=formInput.value}if(e.deBugger("forms","Input Value = "+l),l){i[inputName].value||(i[inputName].value=[]),i[inputName].value.push(multiple?values.join(","):encodeURIComponent(l));var l=multiple?values.join(","):encodeURIComponent(l)}}e.deBugger("forms",i);for(var u in i){var d=i[u].value,c=i[u].map;if("undefined"!=typeof d&&null!=d&&""!=d&&a.push(u+"="+i[u].value.join(",")),"undefined"!=typeof c&&null!=c&&i[u].value&&(r.push(c+"="+i[u].value.join(",")),"email"===u))var m=i[u].value.join(",")}var f=a.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=r.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g);var m=n.getParameterVal("email",g)||n.readCookie("wp_lead_email");m||(m=n.getParameterVal("wpleads_email_address",g));var p=n.getParameterVal("name",g),v=n.getParameterVal("first_name",g),h=n.getParameterVal("last_name",g);if(!h&&v){var _=decodeURI(v).split(" ");_.length>0&&(v=_[0],h=_[1])}if(p&&!h&&!v){var _=decodeURI(p).split(" ");_.length>0&&(v=_[0],h=_[1])}p=v&&h?v+" "+h:p,v||(v=""),h||(h=""),e.deBugger("forms","fName = "+v),e.deBugger("forms","lName = "+h),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)var k=!0;var C=t.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');C=C.length>0?C[0].value:0;if("undefined"!=typeof landing_path_info)var S=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)var S=cta_path_info.variation;else var S=inbound_settings.variation_id;var I=inbound_settings.post_type||"page",L=inbound_settings.post_id||0;search_data={},formData={action:"inbound_lead_store",email:m,full_name:p,first_name:v,last_name:h,raw_params:f,mapped_params:g,url_params:JSON.stringify(y),search_data:"test",page_views:JSON.stringify(b),post_type:I,page_id:L,variation:S,source:n.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:C,inbound_nonce:inbound_settings.ajax_nonce,event:t},callback=function(i){e.deBugger("forms","Lead Created with ID: "+i),i=parseInt(i,10),formData.leadID=i,i&&(n.createCookie("wp_lead_id",i),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(t)},e.trigger("form_before_submission",formData),n.ajaxPost(inbound_settings.admin_url,formData,callback)},rememberInputValues:function(t){var i=(t.name?"inbound_"+t.name:"",t.type?t.type:"text");return"submit"===i||"hidden"===i||"file"===i||"password"===i||t.dataset.ignoreFormField?!1:(n.addListener(t,"change",function(t){if(t.target.name){if("checkbox"!==i)var o=t.target.value;else for(var a=[],r=document.querySelectorAll('input[name="'+t.target.name+'"]'),s=0;s<r.length;s++){var l=r[s].checked;l&&a.push(r[s].value),o=a.join(",")}inputData={name:t.target.name,node:t.target.nodeName.toLowerCase(),type:i,value:o,mapping:t.target.dataset.mapFormField},e.trigger("form_input_change",inputData),n.createCookie("inbound_"+t.target.name,encodeURIComponent(o))}}),void 0)},fillInputValues:function(e){var t=e.name?"inbound_"+e.name:"",i=e.type?e.type:"text";if("submit"===i||"hidden"===i||"file"===i||"password"===i)return!1;if(n.readCookie(t)&&"comment"!=t)if(value=decodeURIComponent(n.readCookie(t)),"checkbox"===i||"radio"===i)for(var o=value.split(","),a=0;a<o.length;a++)e.value.indexOf(o[a])>-1&&(e.checked=!0);else"undefined"!==value&&(e.value=value)},getInputLabel:function(e){var t;return(t=this.siblingsIsLabel(e))?t:(t=this.CheckParentForLabel(e))?t:!1},getInputValue:function(e){var t=!1;switch(e.type){case"radio":case"checkbox":e.checked&&(t=e.value);break;case"text":case"hidden":default:t=e.value}return t},addDataAttr:function(e,t){for(var n=document.getElementsByName(e.name),i=n.length-1;i>=0;i--)e.dataset.mapFormField||(n[i].dataset.mapFormField=t)},removeArrayItem:function(e,t){if(e.indexOf)index=e.indexOf(t);else for(index=e.length-1;index>=0&&e[index]!==t;--index);index>=0&&e.splice(index,1)},siblingsIsLabel:function(e){for(var t=this.getSiblings(e),n=[],i=t.length-1;i>=0;i--)"label"===t[i].nodeName.toLowerCase()&&n.push(t[i]);return n.length>0&&n.length<2?n:!1},getChildren:function(e,t){for(var n=[];e;e=e.nextSibling)1==e.nodeType&&e!=t&&n.push(e);return n},getSiblings:function(e){return this.getChildren(e.parentNode.firstChild,e)},CheckParentForLabel:function(e){if("FORM"===e.nodeName)return null;do{var t=e.getElementsByTagName("label");if(t.length>0&&t.length<2)return e.getElementsByTagName("label")}while(e=e.parentNode);return null},mailCheck:function(){var e=document.querySelector(".inbound-email");e&&(n.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(t){var i=document.querySelector(".email_suggestion");i&&n.removeElement(i);var o=document.createElement("span");o.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+t.full+"</b></i>?</span>",e.parentNode.insertBefore(o,e.nextSibling);var a=document.getElementById("email_correction");n.addListener(a,"click",function(){e.value=a.innerHTML,a.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},"undefined"==typeof u)var u={domainThreshold:1,topLevelThreshold:3,defaultDomains:["yahoo.com","google.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","mail.com","outlook.com","icloud.com"],defaultTopLevelDomains:["co.jp","co.uk","com","net","org","info","edu","gov","mil","ca","de"],run:function(e){e.domains=e.domains||u.defaultDomains,e.topLevelDomains=e.topLevelDomains||u.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||u.sift3Distance;var t=function(e){return e},n=e.suggested||t,i=e.empty||t,o=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return o?n(o):i()},suggest:function(e,t,n,i){e=e.toLowerCase();var o=this.splitEmail(e),a=this.findClosestDomain(o.domain,t,i,this.domainThreshold);if(a){if(a!=o.domain)return{address:o.address,domain:a,full:o.address+"@"+a}}else{var r=this.findClosestDomain(o.topLevelDomain,n,i,this.topLevelThreshold);if(o.domain&&r&&r!=o.topLevelDomain){var s=o.domain;return a=s.substring(0,s.lastIndexOf(o.topLevelDomain))+r,{address:o.address,domain:a,full:o.address+"@"+a}}}return!1},findClosestDomain:function(e,t,n,i){i=i||this.topLevelThreshold;var o,a=99,r=null;if(!e||!t)return!1;n||(n=this.sift3Distance);for(var s=0;s<t.length;s++){if(e===t[s])return e;o=n(e,t[s]),a>o&&(a=o,r=t[s])}return i>=a&&null!==r?r:!1},sift3Distance:function(e,t){if(null===e||0===e.length)return null===t||0===t.length?0:t.length;if(null===t||0===t.length)return e.length;for(var n=0,i=0,o=0,a=0,r=5;n+i<e.length&&n+o<t.length;){if(e.charAt(n+i)==t.charAt(n+o))a++;else{i=0,o=0;for(var s=0;r>s;s++){if(n+s<e.length&&e.charAt(n+s)==t.charAt(n)){i=s;break}if(n+s<t.length&&e.charAt(n)==t.charAt(n+s)){o=s;break}}}n++}return(e.length+t.length)/2-a},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(var n=0;n<t.length;n++)if(""===t[n])return!1;var i=t.pop(),o=i.split("."),a="";if(0===o.length)return!1;if(1==o.length)a=o[0];else{for(var n=1;n<o.length;n++)a+=o[n]+".";o.length>=2&&(a=a.substring(0,a.length-1))}return{topLevelDomain:a,domain:i,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};return e}(_inbound||{}),_inboundEvents=function(e){function t(t,i,o){var i=i||{};o=o||{},o.bubbles=o.bubbles||!0,o.cancelable=o.cancelable||!0,i=e.apply_filters("filter_"+t,i);!window.ActiveXObject&&"ActiveXObject"in window;if("function"==typeof CustomEvent)var a=new CustomEvent(t,{detail:i,bubbles:o.bubbles,cancelable:o.cancelable});else{var a=document.createEvent("Event");a.initEvent(t,!0,!0)}window.dispatchEvent(a),e.do_action(t,i),n(t,i)}function n(e,t){if(window.jQuery){var t=t||{};jQuery(document).trigger(e,t)}}e.trigger=function(t,n){e.Events[t](n)};return e.Events={analytics_ready:function(){var e={opt1:!0},n={data:"xyxy"};t("analytics_ready",n,e)},url_parameters:function(e){t("url_parameters",e)},session_start:function(){console.log(""),t("session_start")},session_end:function(e){t("session_end",e),console.log("Session End")},session_active:function(){t("session_active")},session_idle:function(e){t("session_idle",e)},session_resume:function(){t("session_resume")},session_heartbeat:function(e){var n={clock:e,leadData:InboundLeadData};t("session_heartbeat",n)},page_visit:function(e){t("page_view",e)},page_first_visit:function(){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);var i=function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")};e.deBugger("pages",status,i)},tab_hidden:function(){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){var i=function(){console.log(n)};e.deBugger("forms","inputData change. Data=",i),t("form_input_change",n)},form_before_submission:function(e){t("form_before_submission",e)},form_after_submission:function(e){t("form_after_submission",e)},analyticsError:function(e,t,n){var i=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(i),console.log("Page Save Error")}},e}(_inbound||{});_inbound.add_action("form_before_submission",inboundFormNoRedirect,10),_inbound.add_action("form_after_submission",inboundFormNoRedirectContent,10);var InboundTotalStorage=function(e){var t,n,i="_inbound";if("localStorage"in window)try{n="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof n||"undefined"==typeof window.JSON?!1:!0,window.localStorage.setItem(i,"1"),window.localStorage.removeItem(i)}catch(o){t=!1}e.totalStorage=function(t,n){return e.totalStorage.impl.init(t,n)},e.totalStorage.setItem=function(t,n){return e.totalStorage.impl.setItem(t,n)},e.totalStorage.getItem=function(t){return e.totalStorage.impl.getItem(t)},e.totalStorage.getAll=function(){return e.totalStorage.impl.getAll()},e.totalStorage.deleteItem=function(t){return e.totalStorage.impl.deleteItem(t)},e.totalStorage.impl={init:function(e,t){return"undefined"!=typeof t?this.setItem(e,t):this.getItem(e)},setItem:function(i,o){if(!t)try{return e.Utils.createCookie(i,o),o}catch(a){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var r=JSON.stringify(o);return n.setItem(i,r),this.parseResult(r)},getItem:function(i){if(!t)try{return this.parseResult(e.Utils.readCookie(i))}catch(o){return null}var a=n.getItem(i);return this.parseResult(a)},deleteItem:function(i){if(!t)try{return e.Utils.eraseCookie(i,null),!0}catch(o){return!1}return n.removeItem(i),!0},getAll:function(){var i=[];if(t)for(var o in n)o.length&&i.push({key:o,value:this.parseResult(n.getItem(o))});else try{for(var a=document.cookie.split(";"),r=0;r<a.length;r++){var s=a[r].split("="),l=s[0];i.push({key:l,value:this.parseResult(e.Utils.readCookie(l))})}}catch(u){return null}return i},parseResult:function(e){var t;try{t=JSON.parse(e),"undefined"==typeof t&&(t=e),"true"==t&&(t=!0),"false"==t&&(t=!1),parseFloat(t)==t&&"object"!=typeof t&&(t=parseFloat(t))}catch(n){t=e}return t}}}(_inbound||{}),_inboundLeadsAPI=function(e){return e.LeadsAPI={init:function(){var t=e.Utils,n=(t.readCookie("wp_lead_uid"),t.readCookie("wp_lead_id")),i=t.readCookie("lead_session_expire");i||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(){var t=e.Utils.readCookie("wp_lead_id"),n=e.totalStorage("inbound_lead_data"),i=e.Utils.readCookie("lead_data_expire");
3
- data={action:"inbound_get_all_lead_data",wp_lead_id:t},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var i=new Date;i.setTime(i.getTime()+18e5);var o=e.Utils.addDays(i,3);e.Utils.createCookie("lead_data_expire",!0,o)},n?(e.LeadsAPI.setGlobalLeadData(n),e.deBugger("lead","Set Global Lead Data from Localstorage"),i||(e.Utils.ajaxPost(inbound_settings.admin_url,data,success),e.deBugger("lead","localized data old. Pull new from DB"))):e.Utils.ajaxPost(inbound_settings.admin_url,data,success)},getLeadLists:function(){var t=e.Utils.readCookie("wp_lead_id"),n={action:"wpl_check_lists",wp_lead_id:t},i=function(){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")};e.Utils.ajaxPost(inbound_settings.admin_url,n,i)}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,i=!1,o=!1,a=!1,r=parseInt(e.Utils.readCookie("lead_session"),10)||0,s=0,l=(new Date,null),u=null,d=null,c=e.Utils,m=e.Utils.GetDate(),f="page_views",g=e.totalStorage(f)||{},p=inbound_settings.post_id||window.location.pathname,v=e.Settings.timeout||1e4;return e.PageTracking={init:function(i){return"page_views"!==f?!1:(this.CheckTimeOut(),i=i||{},t=parseInt(i.reportInterval,10)||10,n=parseInt(i.idleTimeout,10)||3,c.addListener(document,"keydown",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(document,"click",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(window,"mousemove",c.throttle(e.PageTracking.pingSession,1e3)),e.PageTracking.checkVisibility(),this.startSession(),void 0)},setIdle:function(t){var t=t||"No Movement",n="Session IDLE. Activity Timeout due to "+t;e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n,i;"undefined"!=typeof document.hidden?(t="hidden",i="visibilitychange",n="visibilityState"):"undefined"!=typeof document.mozHidden?(t="mozHidden",i="mozvisibilitychange",n="mozVisibilityState"):"undefined"!=typeof document.msHidden?(t="msHidden",i="msvisibilitychange",n="msVisibilityState"):"undefined"!=typeof document.webkitHidden&&(t="webkitHidden",i="webkitvisibilitychange",n="webkitVisibilityState");var o=document[t];e.Utils.addListener(document,i,function(){o!=document[t]&&(document[t]?(e.trigger("tab_hidden"),e.PageTracking.setIdle("browser tab switch")):(e.trigger("tab_visible"),e.PageTracking.pingSession()),o=document[t])})},clock:function(){r+=1;var n=r/60,i="Total time spent on Page in this Session: "+n.toFixed(2)+" min";if(e.deBugger("pages",i),r>0&&r%t===0){var o=new Date;o.setTime(o.getTime()+18e5),c.createCookie("lead_session",r,o),e.trigger("session_heartbeat",r)}},inactiveClock:function(){s+=1;var t=(1800-s)/60,n="Time until Session Timeout: "+t.toFixed(2)+" min";e.deBugger("pages",n),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){o=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){o=!1,e.trigger("session_resume"),e.deBugger("pages","Activity resumed. Session Active"),clearTimeout(l),s=0,clearTimeout(u),l=setInterval(e.PageTracking.clock,1e3)},turnOff:function(){e.PageTracking.setIdle(),a=!0},turnOn:function(){a=!1},startSession:function(){new Date;i=!0,l=setInterval(e.PageTracking.clock,1e3);var t=c.readCookie("lead_session");if(t)e.trigger("session_active");else{e.trigger("session_start");var n=new Date;n.setTime(n.getTime()+18e5),e.Utils.createCookie("lead_session",1,n)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){a||(i||e.PageTracking.startSession(),o&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),"undefined"!=typeof t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){var t=e.Utils.checkLocalStorage();if(t){var n=localStorage.getItem(f),i=JSON.parse(n);return i}},isRevisit:function(e){var t=!1,e=e||{},n=e[p];return"undefined"!=typeof n&&null!==n&&(t=!0),t},triggerPageView:function(t){var n={title:document.title,url:document.location.href,path:document.location.pathname,count:1};t?(g[p].push(m),n.count=g[p].length,e.trigger("page_revisit",n)):(g[p]=[],g[p].push(m),e.trigger("page_first_visit",n)),e.trigger("page_visit",n),e.totalStorage(f,g),this.storePageView()},CheckTimeOut:function(){var t,n,i=this.isRevisit(g);if(i){var o=g[p].length-1,a=g[p][o],r=Math.abs(new Date(a).getTime()-new Date(m).getTime());n=r>v,n?(t="Timeout Happened. Page view fired",this.triggerPageView(i)):(time_left=.001*Math.abs(v-r),t=v/1e3+" sec timeout not done: "+time_left+" seconds left")}else this.triggerPageView(i);e.deBugger("pages",t)},storePageView:function(){if("off"!=inbound_settings.page_tracking){var t=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",n=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",i={action:"inbound_track_lead",wp_lead_uid:n,wp_lead_id:t,page_id:inbound_settings.post_id,variation_id:inbound_settings.variation_id,post_type:inbound_settings.post_type,current_url:window.location.href,page_views:JSON.stringify(e.PageTracking.getPageViews()),json:"0"},o=function(){};e.Utils.ajaxPost(inbound_settings.admin_url,i,o)}}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
1
  /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
+ function inboundFormNoRedirect(){if(null==window.frames.frameElement)var e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if("undefined"!=typeof e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])');(0==n.length||"IA=="==n[0].value)&&(t.action="javascript:void(0)")}}function inboundFormNoRedirectContent(){if(null==window.frames.frameElement)var e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if("undefined"!=typeof e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),o=jQuery(e).css("background"),i=jQuery(e).css("color"),a=jQuery(e).css("height"),r=e.getElementsByClassName("inbound-form-spinner");(0==n.length||"IA=="==n[0].value)&&(jQuery(r).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+o+"; color="+i+"; font-size:calc("+a+' * .42);"></i></div>'))}}var inbound_data=inbound_data||{},_inboundOptions=_inboundOptions||{},_gaq=_gaq||[],_inbound=function(e){var t={timeout:inbound_settings.is_admin?500:1e4,formAutoTracking:!0,formAutoPopulation:!0},n={init:function(){_inbound.Utils.init(),_inbound.Utils.domReady(window,function(){_inbound.DomLoaded()})},DomLoaded:function(){_inbound.PageTracking.init(),_inbound.Forms.init(),_inbound.Utils.setUrlParams(),_inbound.LeadsAPI.init(),setTimeout(function(){_inbound.Forms.init()},2e3),_inbound.trigger("analytics_ready")},extend:function(e,t){var n,o={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o},debug:function(){},deBugger:function(e,t,n){if(console){var o,i,a,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(r=r.split("-"),a=r[1]),i="true"===_inbound.Utils.readCookie("inbound_debug")?!0:!1,o="true"===_inbound.Utils.readCookie("inbound_debug_"+e)?!0:!1,(o||s||i)&&(t&&"string"==typeof t&&(i||"all"===a?console.log('logAll "'+e+'" =>',t):o?console.log('log "'+e+'" =>',t):e===a&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},o=n.extend(t,e);return n.Settings=o||{},n}(_inboundOptions),_inboundHooks=function(e){var t=function(){function e(e,t,n,o){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("actions",e,t,n,o)),d}function t(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&u("actions",t,e),d}function n(e,t){return"string"==typeof e&&r("actions",e,t),d}function o(e,t,n){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("filters",e,t,n)),d}function i(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?u("filters",t,e):d}function a(e,t){return"string"==typeof e&&r("filters",e,t),d}function r(e,t,n,o){if(c[e][t])if(n){var i,a=c[e][t];if(o)for(i=a.length;i--;){var r=a[i];r.callback===n&&r.context===o&&a.splice(i,1)}else for(i=a.length;i--;)a[i].callback===n&&a.splice(i,1)}else c[e][t]=[]}function s(e,t,n,o,i){var a={callback:n,priority:o,context:i},r=c[e][t];r?(r.push(a),r=l(r)):r=[a],c[e][t]=r}function l(e){for(var t,n,o,i=1,a=e.length;a>i;i++){for(t=e[i],n=i;(o=e[n-1])&&o.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function u(e,t,n){var o=c[e][t];if(!o)return"filters"===e?n[0]:!1;var i=0,a=o.length;if("filters"===e)for(;a>i;i++)n[0]=o[i].callback.apply(o[i].context,n);else for(;a>i;i++)o[i].callback.apply(o[i].context,n);return"filters"===e?n[0]:!0}var d={removeFilter:a,applyFilters:i,addFilter:o,removeAction:n,doAction:t,addAction:e},c={actions:{},filters:{}};return d};return e.hooks=new t,e.add_action=function(){var t=arguments[0].split(" ");for(k in t)arguments[0]="inbound."+t[k],e.hooks.addAction.apply(this,arguments);return this},e.remove_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeAction.apply(this,arguments),this},e.do_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.doAction.apply(this,arguments),this},e.add_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.addFilter.apply(this,arguments),this},e.remove_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeFilter.apply(this,arguments),this},e.apply_filters=function(){return arguments[0]="inbound."+arguments[0],e.hooks.applyFilters.apply(this,arguments)},e}(_inbound||{}),_inboundUtils=function(e){var t,n=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,o=(Object.prototype.toString,("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/$/,"")),i={api_host:o,track_pageview:!0,track_links_timeout:300,cookie_name:"_sp",cookie_expiration:365,cookie_domain:(host=location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i))?host[0]:""};return e.Utils={init:function(){this.polyFills(),this.checkLocalStorage(),this.SetUID(),this.storeReferralData()},polyFills:function(){window.console||(window.console={});for(var e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],t=0;t<e.length;t++)window.console[e[t]]||(window.console[e[t]]=function(){});Date.prototype.toISOString||!function(){function e(e){var t=String(e);return 1===t.length&&(t="0"+t),t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}();try{new CustomEvent("?")}catch(n){this.CustomEvent=function(e,t){function n(n,i){var a=document.createEvent(e);return null!==n?o.call(a,n,(i||(i=t)).bubbles,i.cancelable,i.detail):a.initCustomEvent=o,a}function o(t,n,o,i){this["init"+e](t,n,o,i),"detail"in this||(this.detail=i)}return n}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),o=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)t=document._qsa.shift(),t.style.removeAttribute("x-qsa"),o.push(t);return document._qsa=null,o}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),!("innerText"in document.createElement("a"))&&"getSelection"in window&&HTMLElement.prototype.__defineGetter__("innerText",function(){for(var e,t=window.getSelection(),n=[],o=0;o<t.rangeCount;o++)n[o]=t.getRangeAt(o);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(var o=0;o<n.length;o++)t.addRange(n[o]);return e})},createCookie:function(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="; expires="+i.toGMTString()}document.cookie=e+"="+t+o+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null},eraseCookie:function(e){this.createCookie(e,"",-1)},getAllCookies:function(){var t={};if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o].split("=");i[0]=i[0].replace(/^ /,""),t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},o=window.location.search.substring(1),i=/([^&=]+)=?([^&]*)/g;e=i.exec(o);)if("-1"==e[1].indexOf("["))n[t(e[1])]=t(e[2]);else{var a=e[1].indexOf("["),r=e[1].slice(a+1,e[1].indexOf("]",a)),s=t(e[1].slice(0,a));"object"!=typeof n[s]&&(n[t(s)]={},n[t(s)].length=0),r?n[t(s)][t(r)]=t(e[2]):Array.prototype.push.call(n[t(s)],t(e[2]))}}();for(var o in n)if("action"!=o)if("object"==typeof n[o])for(var i in n[o])this.createCookie(i,n[o][i],30);else this.createCookie(o,n[o],30);if(t){var a=e.totalStorage("inbound_url_params")||{},r=this.mergeObjs(a,n);e.totalStorage("inbound_url_params",r)}var s={option1:"yo",option2:"woooo"};e.trigger("url_parameters",n,s)},getAllUrlParams:function(){var n={};if(t)var n=e.totalStorage("inbound_url_params");return n},getParameterVal:function(e,t){return(RegExp(e+"=(.+?)(&|$)").exec(t)||[,!1])[1]},checkLocalStorage:function(){if("localStorage"in window)try{ls="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof ls||"undefined"==typeof window.JSON?!1:!0}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}function n(t){return{name:t,size:e(localStorage[t])}}function o(e){return e.size=t(e.size).toFixed(2)+" MB",e}var i=Object.keys(localStorage).map(n).map(o);console.table(i)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=10>t?"0":"",o=e.getFullYear(),i=e.getHours(),a=10>i?"0":"",r=e.getMinutes(),s=10>r?"0":"",l=e.getSeconds(),u=10>l?"0":"",d=e.getMonth()+1,c=10>d?"0":"",m=o+"/"+c+d+"/"+n+t+" "+a+i+":"+s+r+":"+u+l;return m},SetSessionTimeout:function(){var e=(this.readCookie("lead_session_expire"),new Date);e.setTime(e.getTime()+18e5),this.createCookie("lead_session_expire",!0,e)},storeReferralData:function(){var t=new Date,n=document.referrer||"Direct Traffic",o=e.Utils.readCookie("inbound_referral_site"),i=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),o||this.createCookie("inbound_referral_site",n,t),i||e.totalStorage("inbound_original_referral",i)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var o=0;e>o;o++)n+=t[Math.floor(Math.random()*t.length)];return n},generateGUID:function(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,guid)},SetUID:function(e){if(!this.readCookie("wp_lead_uid")){var t=e||this.CreateUID(35);this.createCookie("wp_lead_uid",t)}},countProperties:function(e){var t=0;for(var n in e)e.hasOwnProperty(n)&&++t;return t},mergeObjs:function(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n},hasClass:function(e,t){var n;if("classList"in document.documentElement)var n=t.classList.contains(e);else var n=new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className);return n},addClass:function(e,t){"classList"in document.documentElement?t.classList.add(e):this.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(e,t){"classList"in document.documentElement?t.classList.remove(e):this.hasClass(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)*"+e+"(\\s|$)*","g"),""))},removeElement:function(e){e.parentNode.removeChild(e)},trim:function(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,"\n")},ajaxPolyFill:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var e,t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<t.length;n++)try{e=new ActiveXObject(t[n]);break}catch(o){}return e},ajaxSendData:function(e,t,n,o){var i=this.ajaxPolyFill();setTimeout(function(){i.open(n,e,!0),i.onreadystatechange=function(){4==i.readyState&&t(i.responseText)},"POST"==n&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(o)},100)},ajaxGet:function(e,t,n,o){var i=[];for(var a in t)i.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e+"?"+i.join("&"),n,"GET",null,o)},ajaxPost:function(e,t,n,o){var i=[];for(var a in t)i.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e,n,"POST",i.join("&"),o)},sendEvent:function(e,t,o){t=t||{},async=!0;var a=getCookie();if(a){var r;for(r in a)t[r]=a[r]}t.id||(t.id=getId());var s={e:e,t:(new Date).toISOString(),kv:t},l=i.api_host+"/track?data="+encodeURIComponent(JSON.stringify(s));if(n){var u=new XMLHttpRequest;u.open("GET",l,async),u.withCredentials=async,u.send(null)}else{var d=document.createElement("script");d.type="text/javascript",d.async=async,d.defer=async,d.src=l;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}return action(o),self},domReady:function(e,t){var n=!1,o=!0,i=e.document,a=i.documentElement,r=i.addEventListener?"addEventListener":"attachEvent",s=i.addEventListener?"removeEventListener":"detachEvent",l=i.addEventListener?"":"on",u=function(o){("readystatechange"!=o.type||"complete"==i.readyState)&&(("load"==o.type?e:i)[s](l+o.type,u,!1),!n&&(n=!0)&&t.call(e,o.type||o))},d=function(){try{a.doScroll("left")}catch(e){return setTimeout(d,50),void 0}u("poll")};if("complete"==i.readyState)t.call(e,"lazy");else{if(i.createEventObject&&a.doScroll){try{o=!e.frameElement}catch(c){}o&&d()}i[r](l+"DOMContentLoaded",u,!1),i[r](l+"readystatechange",u,!1),e[r](l+"load",u,!1)}},addListener:function(e,t,n){e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},removeListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},throttle:function(e,t){var n,o,i,a=null,r=0,s=function(){r=new Date,a=null,i=e.apply(n,o)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,o=arguments,0>=u?(clearTimeout(a),a=null,r=l,i=e.apply(n,o)):a||(a=setTimeout(s,u)),i}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),"undefined"!=typeof _gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)}},e}(_inbound||{}),InboundForms=function(e){var t=!1,n=e.Utils,o=[],a=[],r=[],s=e.Settings,l=["first name","last name","name","email","e-mail","phone","website","job title","your favorite food","company","tele","address","comment"];if(e.Forms={init:function(){e.Forms.runFieldMappingFilters(),e.Forms.formTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,n){if(t&&console){var e=e||!1;e&&"string"==typeof e&&console.log(e),n&&n instanceof Function&&n()}},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=!1,n=window.document.forms[e];n.dataset.formProcessed||(n.dataset.formProcessed=!0,t=this.checkTrackStatus(n),t&&(this.attachFormSubmitEvent(n),this.initFormMapping(n)))}},checkTrackStatus:function(t){var n=t.getAttribute("class");return""!==n&&null!==n?n.toLowerCase().indexOf("wpl-track-me")>-1?!0:n.toLowerCase().indexOf("inbound-track")>-1?!0:(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1):void 0},loopClassSelectors:function(t,o){for(var i=t.length-1;i>=0;i--){var a=n.trim(t[i]);-1===a.indexOf("#")&&-1===a.indexOf(".")&&(a="#"+a),a=document.querySelector(a),a&&("add"===o?(e.Utils.addClass("wpl-track-me",a),e.Utils.addClass("inbound-track",a)):(e.Utils.removeClass("wpl-track-me",a),e.Utils.removeClass("inbound-track",a)))}},initFormMapping:function(t){for(var n=[],o=0;o<t.elements.length;o++)formInput=t.elements[o],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var i=n.length-1;i>=0;i--)formInput=n[i],this.mapField(formInput)},mapField:function(t){var a=t.id||!1,r=t.name||!1,s=this.getInputLabel(t);if(s){var u=this.ignoreFieldByLabel(s[0].innerText);if(u)return t.dataset.ignoreFormField=!0,!1}for(i=0;i<l.length;i++){var d=!1,c=l[i],m=n.trim(c),f=m.replace(/ /g,"_");r&&r.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching name attribute for -> "+m)):a&&a.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching ID attribute for ->"+m)):s?s[0].innerText.toLowerCase().indexOf(m)>-1&&(d=!0,e.deBugger("forms","Found matching sibling label for -> "+m)):o.push(m),d&&(this.addDataAttr(t,f),this.removeArrayItem(l,m),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},attachFormSubmitEvent:function(e){n.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},ignoreFieldByLabel:function(t){var n=!1;return t?((-1!=t.toLowerCase().indexOf("credit card")||-1!=t.toLowerCase().indexOf("card number"))&&(n=!0),(-1!=t.toLowerCase().indexOf("expiration")||-1!=t.toLowerCase().indexOf("expiry"))&&(n=!0),("month"==t.toLowerCase()||"mm"==t.toLowerCase()||"yy"==t.toLowerCase()||"yyyy"==t.toLowerCase()||"year"==t.toLowerCase())&&(n=!0),(-1!=t.toLowerCase().indexOf("cvv")||-1!=t.toLowerCase().indexOf("cvc")||-1!=t.toLowerCase().indexOf("secure code")||-1!=t.toLowerCase().indexOf("security code"))&&(n=!0),n&&e.deBugger("forms","ignore "+t),n):!1},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;("visa"==e.toLowerCase()||"mastercard"==e.toLowerCase()||"american express"==e.toLowerCase()||"amex"==e.toLowerCase()||"discover"==e.toLowerCase())&&(t=!0);var n=new RegExp("/^[0-9]+$/");if(n.test(e)){var o=e.replace(" ","");this.isInt(o)&&o.length>=16&&(t=!0)}return t},isInt:function(e){return"number"==typeof e&&isFinite(e)&&e%1===0},releaseFormSubmit:function(e){document.body.style.cursor="default",n.removeClass("wpl-track-me",e),n.removeListener(e,"submit",this.formListener);var t=e.getAttribute("class");return""!==t&&null!==t&&-1!=t.toLowerCase().indexOf("wpcf7-form")?(setTimeout(function(){document.body.style.cursor="default"},300),!0):(e.submit(),setTimeout(function(){for(var t=0;t<e.elements.length;t++)formInput=e.elements[t],type=formInput.type||!1,"submit"===type&&"submit"===formInput.name&&e.elements[t].click()},2e3),void 0)},saveFormData:function(t){for(var o=o||{},i=0;i<t.elements.length;i++)if(formInput=t.elements[i],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("forms","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),o[inputName]||(o[inputName]={}),formInput.type&&(o[inputName].type=formInput.type),o[inputName].name||(o[inputName].name=formInput.name),formInput.dataset.mapFormField&&(o[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(l=this.getInputValue(formInput),l===!1)continue;break;case"TEXTAREA":l=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var s=0;s<formInput.length;s++)formInput[s].selected&&values.push(encodeURIComponent(formInput[s].value))}else l=formInput.value}if(e.deBugger("forms","Input Value = "+l),l){o[inputName].value||(o[inputName].value=[]),o[inputName].value.push(multiple?values.join(","):encodeURIComponent(l));var l=multiple?values.join(","):encodeURIComponent(l)}}e.deBugger("forms",o);for(var u in o){var d=o[u].value,c=o[u].map;if("undefined"!=typeof d&&null!=d&&""!=d&&a.push(u+"="+o[u].value.join(",")),"undefined"!=typeof c&&null!=c&&o[u].value&&(r.push(c+"="+o[u].value.join(",")),"email"===u))var m=o[u].value.join(",")}var f=a.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=r.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g);var m=n.getParameterVal("email",g)||n.readCookie("wp_lead_email");m||(m=n.getParameterVal("wpleads_email_address",g));var p=n.getParameterVal("name",g),v=n.getParameterVal("first_name",g),h=n.getParameterVal("last_name",g);if(!h&&v){var _=decodeURI(v).split(" ");_.length>0&&(v=_[0],h=_[1])}if(p&&!h&&!v){var _=decodeURI(p).split(" ");_.length>0&&(v=_[0],h=_[1])}p=v&&h?v+" "+h:p,v||(v=""),h||(h=""),e.deBugger("forms","fName = "+v),e.deBugger("forms","lName = "+h),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)var k=!0;var S=t.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');S=S.length>0?S[0].value:0;if("undefined"!=typeof landing_path_info)var C=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)var C=cta_path_info.variation;else var C=inbound_settings.variation_id;var I=inbound_settings.post_type||"page",L=inbound_settings.post_id||0;search_data={},formData={action:"inbound_lead_store",email:m,full_name:p,first_name:v,last_name:h,raw_params:f,mapped_params:g,url_params:JSON.stringify(y),search_data:"test",page_views:JSON.stringify(b),post_type:I,page_id:L,variation:C,source:n.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:S,inbound_nonce:inbound_settings.ajax_nonce,event:t},callback=function(o){e.deBugger("forms","Lead Created with ID: "+o),o=parseInt(o,10),formData.leadID=o,o&&(n.createCookie("wp_lead_id",o),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(t)},e.trigger("form_before_submission",formData),n.ajaxPost(inbound_settings.admin_url,formData,callback)},rememberInputValues:function(t){var o=(t.name?"inbound_"+t.name:"",t.type?t.type:"text");return"submit"===o||"hidden"===o||"file"===o||"password"===o||t.dataset.ignoreFormField?!1:(n.addListener(t,"change",function(t){if(t.target.name){if("checkbox"!==o)var i=t.target.value;else for(var a=[],r=document.querySelectorAll('input[name="'+t.target.name+'"]'),s=0;s<r.length;s++){var l=r[s].checked;l&&a.push(r[s].value),i=a.join(",")}inputData={name:t.target.name,node:t.target.nodeName.toLowerCase(),type:o,value:i,mapping:t.target.dataset.mapFormField},e.trigger("form_input_change",inputData),n.createCookie("inbound_"+t.target.name,encodeURIComponent(i))}}),void 0)},fillInputValues:function(e){var t=e.name?"inbound_"+e.name:"",o=e.type?e.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o)return!1;if(n.readCookie(t)&&"comment"!=t)if(value=decodeURIComponent(n.readCookie(t)),"checkbox"===o||"radio"===o)for(var i=value.split(","),a=0;a<i.length;a++)e.value.indexOf(i[a])>-1&&(e.checked=!0);else"undefined"!==value&&(e.value=value)},getInputLabel:function(e){var t;return(t=this.siblingsIsLabel(e))?t:(t=this.CheckParentForLabel(e))?t:!1},getInputValue:function(e){var t=!1;switch(e.type){case"radio":case"checkbox":e.checked&&(t=e.value);break;case"text":case"hidden":default:t=e.value}return t},addDataAttr:function(e,t){for(var n=document.getElementsByName(e.name),o=n.length-1;o>=0;o--)e.dataset.mapFormField||(n[o].dataset.mapFormField=t)},removeArrayItem:function(e,t){if(e.indexOf)index=e.indexOf(t);else for(index=e.length-1;index>=0&&e[index]!==t;--index);index>=0&&e.splice(index,1)},siblingsIsLabel:function(e){for(var t=this.getSiblings(e),n=[],o=t.length-1;o>=0;o--)"label"===t[o].nodeName.toLowerCase()&&n.push(t[o]);return n.length>0&&n.length<2?n:!1},getChildren:function(e,t){for(var n=[];e;e=e.nextSibling)1==e.nodeType&&e!=t&&n.push(e);return n},getSiblings:function(e){return this.getChildren(e.parentNode.firstChild,e)},CheckParentForLabel:function(e){if("FORM"===e.nodeName)return null;do{var t=e.getElementsByTagName("label");if(t.length>0&&t.length<2)return e.getElementsByTagName("label")}while(e=e.parentNode);return null},mailCheck:function(){var e=document.querySelector(".inbound-email");e&&(n.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(t){var o=document.querySelector(".email_suggestion");o&&n.removeElement(o);var i=document.createElement("span");i.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+t.full+"</b></i>?</span>",e.parentNode.insertBefore(i,e.nextSibling);var a=document.getElementById("email_correction");n.addListener(a,"click",function(){e.value=a.innerHTML,a.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},"undefined"==typeof u)var u={domainThreshold:1,topLevelThreshold:3,defaultDomains:["yahoo.com","google.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","mail.com","outlook.com","icloud.com"],defaultTopLevelDomains:["co.jp","co.uk","com","net","org","info","edu","gov","mil","ca","de"],run:function(e){e.domains=e.domains||u.defaultDomains,e.topLevelDomains=e.topLevelDomains||u.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||u.sift3Distance;var t=function(e){return e},n=e.suggested||t,o=e.empty||t,i=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return i?n(i):o()},suggest:function(e,t,n,o){e=e.toLowerCase();var i=this.splitEmail(e),a=this.findClosestDomain(i.domain,t,o,this.domainThreshold);if(a){if(a!=i.domain)return{address:i.address,domain:a,full:i.address+"@"+a}}else{var r=this.findClosestDomain(i.topLevelDomain,n,o,this.topLevelThreshold);if(i.domain&&r&&r!=i.topLevelDomain){var s=i.domain;return a=s.substring(0,s.lastIndexOf(i.topLevelDomain))+r,{address:i.address,domain:a,full:i.address+"@"+a}}}return!1},findClosestDomain:function(e,t,n,o){o=o||this.topLevelThreshold;var i,a=99,r=null;if(!e||!t)return!1;n||(n=this.sift3Distance);for(var s=0;s<t.length;s++){if(e===t[s])return e;i=n(e,t[s]),a>i&&(a=i,r=t[s])}return o>=a&&null!==r?r:!1},sift3Distance:function(e,t){if(null===e||0===e.length)return null===t||0===t.length?0:t.length;if(null===t||0===t.length)return e.length;for(var n=0,o=0,i=0,a=0,r=5;n+o<e.length&&n+i<t.length;){if(e.charAt(n+o)==t.charAt(n+i))a++;else{o=0,i=0;for(var s=0;r>s;s++){if(n+s<e.length&&e.charAt(n+s)==t.charAt(n)){o=s;break}if(n+s<t.length&&e.charAt(n)==t.charAt(n+s)){i=s;break}}}n++}return(e.length+t.length)/2-a},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(var n=0;n<t.length;n++)if(""===t[n])return!1;var o=t.pop(),i=o.split("."),a="";if(0===i.length)return!1;if(1==i.length)a=i[0];else{for(var n=1;n<i.length;n++)a+=i[n]+".";i.length>=2&&(a=a.substring(0,a.length-1))}return{topLevelDomain:a,domain:o,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};return e}(_inbound||{}),_inboundEvents=function(e){function t(t,o,i){var o=o||{};i=i||{},i.bubbles=i.bubbles||!0,i.cancelable=i.cancelable||!0,o=e.apply_filters("filter_"+t,o);!window.ActiveXObject&&"ActiveXObject"in window;if("function"==typeof CustomEvent)var a=new CustomEvent(t,{detail:o,bubbles:i.bubbles,cancelable:i.cancelable});else{var a=document.createEvent("Event");a.initEvent(t,!0,!0)}window.dispatchEvent(a),e.do_action(t,o),n(t,o)}function n(e,t){if(window.jQuery){var t=t||{};jQuery(document).trigger(e,t)}}e.trigger=function(t,n){e.Events[t](n)};return e.Events={analytics_ready:function(){var e={opt1:!0},n={data:"xyxy"};t("analytics_ready",n,e)},url_parameters:function(e){t("url_parameters",e)},session_start:function(){console.log(""),t("session_start")},session_end:function(e){t("session_end",e),console.log("Session End")},session_active:function(){t("session_active")},session_idle:function(e){t("session_idle",e)},session_resume:function(){t("session_resume")},session_heartbeat:function(e){var n={clock:e,leadData:InboundLeadData};t("session_heartbeat",n)},page_visit:function(e){t("page_view",e)},page_first_visit:function(){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);var o=function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")};e.deBugger("pages",status,o)},tab_hidden:function(){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){var o=function(){console.log(n)};e.deBugger("forms","inputData change. Data=",o),t("form_input_change",n)},form_before_submission:function(e){t("form_before_submission",e)},form_after_submission:function(e){t("form_after_submission",e)},analyticsError:function(e,t,n){var o=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(o),console.log("Page Save Error")}},e}(_inbound||{});_inbound.add_action("form_before_submission",inboundFormNoRedirect,10),_inbound.add_action("form_after_submission",inboundFormNoRedirectContent,10);var InboundTotalStorage=function(e){var t,n,o="_inbound";if("localStorage"in window)try{n="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof n||"undefined"==typeof window.JSON?!1:!0,window.localStorage.setItem(o,"1"),window.localStorage.removeItem(o)}catch(i){t=!1}e.totalStorage=function(t,n){return e.totalStorage.impl.init(t,n)},e.totalStorage.setItem=function(t,n){return e.totalStorage.impl.setItem(t,n)},e.totalStorage.getItem=function(t){return e.totalStorage.impl.getItem(t)},e.totalStorage.getAll=function(){return e.totalStorage.impl.getAll()},e.totalStorage.deleteItem=function(t){return e.totalStorage.impl.deleteItem(t)},e.totalStorage.impl={init:function(e,t){return"undefined"!=typeof t?this.setItem(e,t):this.getItem(e)},setItem:function(o,i){if(!t)try{return e.Utils.createCookie(o,i),i}catch(a){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var r=JSON.stringify(i);return n.setItem(o,r),this.parseResult(r)},getItem:function(o){if(!t)try{return this.parseResult(e.Utils.readCookie(o))}catch(i){return null}var a=n.getItem(o);return this.parseResult(a)},deleteItem:function(o){if(!t)try{return e.Utils.eraseCookie(o,null),!0}catch(i){return!1}return n.removeItem(o),!0},getAll:function(){var o=[];if(t)for(var i in n)i.length&&o.push({key:i,value:this.parseResult(n.getItem(i))});else try{for(var a=document.cookie.split(";"),r=0;r<a.length;r++){var s=a[r].split("="),l=s[0];o.push({key:l,value:this.parseResult(e.Utils.readCookie(l))})}}catch(u){return null}return o},parseResult:function(e){var t;try{t=JSON.parse(e),"undefined"==typeof t&&(t=e),"true"==t&&(t=!0),"false"==t&&(t=!1),parseFloat(t)==t&&"object"!=typeof t&&(t=parseFloat(t))}catch(n){t=e}return t}}}(_inbound||{}),_inboundLeadsAPI=function(e){return e.LeadsAPI={init:function(){var t=e.Utils,n=(t.readCookie("wp_lead_uid"),t.readCookie("wp_lead_id")),o=t.readCookie("lead_session_expire");o||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(){var t=e.Utils.readCookie("wp_lead_id"),n=e.totalStorage("inbound_lead_data"),o=e.Utils.readCookie("lead_data_expire");data={action:"inbound_get_all_lead_data",wp_lead_id:t},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var o=new Date;o.setTime(o.getTime()+18e5);var i=e.Utils.addDays(o,3);e.Utils.createCookie("lead_data_expire",!0,i)},n?(e.LeadsAPI.setGlobalLeadData(n),e.deBugger("lead","Set Global Lead Data from Localstorage"),o||(e.Utils.ajaxPost(inbound_settings.admin_url,data,success),e.deBugger("lead","localized data old. Pull new from DB"))):e.Utils.ajaxPost(inbound_settings.admin_url,data,success)
3
+ },getLeadLists:function(){var t=e.Utils.readCookie("wp_lead_id"),n={action:"wpl_check_lists",wp_lead_id:t},o=function(){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")};e.Utils.ajaxPost(inbound_settings.admin_url,n,o)}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,o=!1,i=!1,a=!1,r=parseInt(e.Utils.readCookie("lead_session"),10)||0,s=0,l=(new Date,null),u=null,d=null,c=e.Utils,m=e.Utils.GetDate(),f="page_views",g=e.totalStorage(f)||{},p=inbound_settings.post_id||window.location.pathname,v=e.Settings.timeout||1e4;return e.PageTracking={init:function(o){return"page_views"!==f?!1:(this.CheckTimeOut(),o=o||{},t=parseInt(o.reportInterval,10)||10,n=parseInt(o.idleTimeout,10)||3,c.addListener(document,"keydown",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(document,"click",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(window,"mousemove",c.throttle(e.PageTracking.pingSession,1e3)),e.PageTracking.checkVisibility(),this.startSession(),void 0)},setIdle:function(t){var t=t||"No Movement",n="Session IDLE. Activity Timeout due to "+t;e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n,o;"undefined"!=typeof document.hidden?(t="hidden",o="visibilitychange",n="visibilityState"):"undefined"!=typeof document.mozHidden?(t="mozHidden",o="mozvisibilitychange",n="mozVisibilityState"):"undefined"!=typeof document.msHidden?(t="msHidden",o="msvisibilitychange",n="msVisibilityState"):"undefined"!=typeof document.webkitHidden&&(t="webkitHidden",o="webkitvisibilitychange",n="webkitVisibilityState");var i=document[t];e.Utils.addListener(document,o,function(){i!=document[t]&&(document[t]?(e.trigger("tab_hidden"),e.PageTracking.setIdle("browser tab switch")):(e.trigger("tab_visible"),e.PageTracking.pingSession()),i=document[t])})},clock:function(){r+=1;var n=r/60,o="Total time spent on Page in this Session: "+n.toFixed(2)+" min";if(e.deBugger("pages",o),r>0&&r%t===0){var i=new Date;i.setTime(i.getTime()+18e5),c.createCookie("lead_session",r,i),e.trigger("session_heartbeat",r)}},inactiveClock:function(){s+=1;var t=(1800-s)/60,n="Time until Session Timeout: "+t.toFixed(2)+" min";e.deBugger("pages",n),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){i=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){i=!1,e.trigger("session_resume"),e.deBugger("pages","Activity resumed. Session Active"),clearTimeout(l),s=0,clearTimeout(u),l=setInterval(e.PageTracking.clock,1e3)},turnOff:function(){e.PageTracking.setIdle(),a=!0},turnOn:function(){a=!1},startSession:function(){new Date;o=!0,l=setInterval(e.PageTracking.clock,1e3);var t=c.readCookie("lead_session");if(t)e.trigger("session_active");else{e.trigger("session_start");var n=new Date;n.setTime(n.getTime()+18e5),e.Utils.createCookie("lead_session",1,n)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){a||(o||e.PageTracking.startSession(),i&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),"undefined"!=typeof t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){var t=e.Utils.checkLocalStorage();if(t){var n=localStorage.getItem(f),o=JSON.parse(n);return o}},isRevisit:function(e){var t=!1,e=e||{},n=e[p];return"undefined"!=typeof n&&null!==n&&(t=!0),t},triggerPageView:function(t){var n={title:document.title,url:document.location.href,path:document.location.pathname,count:1};t?(g[p].push(m),n.count=g[p].length,e.trigger("page_revisit",n)):(g[p]=[],g[p].push(m),e.trigger("page_first_visit",n)),e.trigger("page_visit",n),e.totalStorage(f,g),this.storePageView()},CheckTimeOut:function(){var t,n,o=this.isRevisit(g);if(o){var i=g[p].length-1,a=g[p][i],r=Math.abs(new Date(a).getTime()-new Date(m).getTime());n=r>v,n?(t="Timeout Happened. Page view fired",this.triggerPageView(o)):(time_left=.001*Math.abs(v-r),t=v/1e3+" sec timeout not done: "+time_left+" seconds left")}else this.triggerPageView(o);e.deBugger("pages",t)},storePageView:function(){("off"!=inbound_settings.page_tracking||"landing-page"==inbound_settings.post_type)&&jQuery(document).ready(function(){setTimeout(function(){var t=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",n=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",o=e.totalStorage("wp_cta_loaded"),i={action:"inbound_track_lead",wp_lead_uid:n,wp_lead_id:t,page_id:inbound_settings.post_id,variation_id:inbound_settings.variation_id,post_type:inbound_settings.post_type,current_url:window.location.href,page_views:JSON.stringify(e.PageTracking.getPageViews()),ctas:JSON.stringify(o),json:"0"},a=function(){};e.Utils.ajaxPost(inbound_settings.admin_url,i,a)},400)})}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
shared/classes/class.ajax.php CHANGED
@@ -84,6 +84,13 @@ if (!class_exists('Inbound_Ajax')) {
84
  Inbound_Events::store_page_view($lead_data);
85
  }
86
 
 
 
 
 
 
 
 
87
  /* update content data */
88
  do_action('lp_record_impression', $lead_data['page_id'], $_POST['post_type'], $_POST['variation_id']);
89
 
84
  Inbound_Events::store_page_view($lead_data);
85
  }
86
 
87
+ /* record CTA impressions */
88
+ $cta_impressions = ( isset($_POST['ctas']) ) ? json_decode(stripslashes($_POST['ctas']),true) : array();
89
+
90
+ foreach ( $cta_impressions as $cta_id => $vid ) {
91
+ do_action('wp_cta_record_impression', (int) $cta_id, (int) $vid );
92
+ }
93
+
94
  /* update content data */
95
  do_action('lp_record_impression', $lead_data['page_id'], $_POST['post_type'], $_POST['variation_id']);
96
 
shared/classes/class.database-routines.php CHANGED
@@ -39,6 +39,14 @@ if ( !class_exists('Inbound_Upgrade_Routines') ) {
39
  'callback' => array( __CLASS__ , 'alter_events_table_1')
40
  );
41
 
 
 
 
 
 
 
 
 
42
  /* alter automation queue table */
43
  self::$routines['automation-queue-table-1'] = array(
44
  'id' => 'automation-queue-table-1',
@@ -46,6 +54,15 @@ if ( !class_exists('Inbound_Upgrade_Routines') ) {
46
  'introduced' => '1.0.3',
47
  'callback' => array( __CLASS__ , 'alter_automation_queue_table_1')
48
  );
 
 
 
 
 
 
 
 
 
49
  }
50
 
51
  /**
@@ -134,10 +151,45 @@ if ( !class_exists('Inbound_Upgrade_Routines') ) {
134
 
135
  $wpdb->get_results( "ALTER TABLE {$table_name} ADD `funnel` text NOT NULL" );
136
  $wpdb->get_results( "ALTER TABLE {$table_name} ADD `source` text NOT NULL" );
137
- $wpdb->get_results( "ALTER TABLE {$table_name} ADD `list_id` varchar(255) NOT NULL" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
  /**
143
  * @migration-type: alter inbound_automation_queue table
@@ -150,7 +202,7 @@ if ( !class_exists('Inbound_Upgrade_Routines') ) {
150
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
151
  $table_name = $wpdb->prefix . "inbound_automation_queue";
152
 
153
- $wpdb->get_results( "ALTER TABLE {$table_name} ADD `lead_id` varchar(255) NOT NULL" );
154
 
155
  }
156
  }
@@ -159,7 +211,18 @@ if ( !class_exists('Inbound_Upgrade_Routines') ) {
159
  add_action('inbound_shared_activate' , array( 'Inbound_Upgrade_Routines' , 'load') );
160
 
161
 
 
 
 
162
  if (isset($_REQUEST['force_upgrade_routines']) && $_REQUEST['force_upgrade_routines'] ) {
 
 
 
 
 
 
 
 
163
  Inbound_Upgrade_Routines::load();
164
  }
165
  }
39
  'callback' => array( __CLASS__ , 'alter_events_table_1')
40
  );
41
 
42
+ /* alter events table */
43
+ self::$routines['events-table-2'] = array(
44
+ 'id' => 'events-table-2',
45
+ 'scope' => 'shared',
46
+ 'introduced' => '1.0.5',
47
+ 'callback' => array( __CLASS__ , 'alter_events_table_1_0_5')
48
+ );
49
+
50
  /* alter automation queue table */
51
  self::$routines['automation-queue-table-1'] = array(
52
  'id' => 'automation-queue-table-1',
54
  'introduced' => '1.0.3',
55
  'callback' => array( __CLASS__ , 'alter_automation_queue_table_1')
56
  );
57
+
58
+
59
+ /* alter events table */
60
+ self::$routines['events-pageviews-107'] = array(
61
+ 'id' => 'events-pageviews-107',
62
+ 'scope' => 'shared',
63
+ 'introduced' => '1.0.7',
64
+ 'callback' => array( __CLASS__ , 'alter_events_pageviews_107')
65
+ );
66
  }
67
 
68
  /**
151
 
152
  $wpdb->get_results( "ALTER TABLE {$table_name} ADD `funnel` text NOT NULL" );
153
  $wpdb->get_results( "ALTER TABLE {$table_name} ADD `source` text NOT NULL" );
154
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `list_id` mediumint(20) NOT NULL" );
155
+
156
+ }
157
+
158
+ /**
159
+ * @migration-type: alter inbound_events table
160
+ * @mirgration: adds columns list_id funnel, and source to events table
161
+ */
162
+ public static function alter_events_table_1_0_5() {
163
+
164
+ global $wpdb;
165
+
166
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
167
+ $table_name = $wpdb->prefix . "inbound_events";
168
+
169
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `rule_id` mediumint(20) NOT NULL" );
170
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `job_id` mediumint(20) NOT NULL" );
171
 
172
  }
173
 
174
+ /**
175
+ * @migration-type: alter inbound_events,inbound_pageviews table
176
+ * @mirgration: convert page_id to VARCHAR to accept complex ids related to taxonomy archives
177
+ */
178
+ public static function alter_events_pageviews_107() {
179
+
180
+ global $wpdb;
181
+
182
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
183
+
184
+ /* events table */
185
+ $table_name = $wpdb->prefix . "inbound_events";
186
+ $wpdb->get_results( "ALTER TABLE {$table_name} MODIFY COLUMN `page_id` VARCHAR(20)" );
187
+
188
+ /* pageviews table */
189
+ $table_name = $wpdb->prefix . "inbound_page_views";
190
+ $wpdb->get_results( "ALTER TABLE {$table_name} MODIFY COLUMN `page_id` VARCHAR(20)" );
191
+ }
192
+
193
 
194
  /**
195
  * @migration-type: alter inbound_automation_queue table
202
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
203
  $table_name = $wpdb->prefix . "inbound_automation_queue";
204
 
205
+ $wpdb->get_results( "ALTER TABLE {$table_name} ADD `lead_id` mediumint(20) NOT NULL" );
206
 
207
  }
208
  }
211
  add_action('inbound_shared_activate' , array( 'Inbound_Upgrade_Routines' , 'load') );
212
 
213
 
214
+ /**
215
+ * Listen for Database Repair Call
216
+ */
217
  if (isset($_REQUEST['force_upgrade_routines']) && $_REQUEST['force_upgrade_routines'] ) {
218
+ Inbound_Events::create_page_views_table();
219
+ Inbound_Events::create_events_table();
220
+ if (class_exists('Inbound_Automation_Activation')) {
221
+ Inbound_Automation_Activation::create_automation_queue_table();
222
+ }
223
+ if (class_exists('Inbound_Mailer_Activation')) {
224
+ Inbound_Mailer_Activation::create_email_queue_table();
225
+ }
226
  Inbound_Upgrade_Routines::load();
227
  }
228
  }
shared/classes/class.events.php CHANGED
@@ -66,6 +66,8 @@ class Inbound_Events {
66
  `form_id` mediumint(20) NOT NULL,
67
  `cta_id` mediumint(20) NOT NULL,
68
  `email_id` mediumint(20) NOT NULL,
 
 
69
  `list_id` mediumint(20) NOT NULL,
70
  `lead_id` mediumint(20) NOT NULL,
71
  `lead_uid` varchar(255) NOT NULL,
@@ -102,7 +104,7 @@ class Inbound_Events {
102
 
103
  $sql = "CREATE TABLE IF NOT EXISTS $table_name (
104
  `id` mediumint(9) NOT NULL AUTO_INCREMENT,
105
- `page_id` mediumint(20) NOT NULL,
106
  `variation_id` mediumint(9) NOT NULL,
107
  `lead_id` mediumint(20) NOT NULL,
108
  `lead_uid` varchar(255) NOT NULL,
@@ -269,6 +271,8 @@ class Inbound_Events {
269
  'form_id' => '',
270
  'cta_id' => '',
271
  'email_id' => '',
 
 
272
  'list_id' => '',
273
  'lead_id' => ( isset($_COOKIE['wp_lead_id']) ? $_COOKIE['wp_lead_id'] : '' ),
274
  'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : '' ),
66
  `form_id` mediumint(20) NOT NULL,
67
  `cta_id` mediumint(20) NOT NULL,
68
  `email_id` mediumint(20) NOT NULL,
69
+ `rule_id` mediumint(20) NOT NULL,
70
+ `job_id` mediumint(20) NOT NULL,
71
  `list_id` mediumint(20) NOT NULL,
72
  `lead_id` mediumint(20) NOT NULL,
73
  `lead_uid` varchar(255) NOT NULL,
104
 
105
  $sql = "CREATE TABLE IF NOT EXISTS $table_name (
106
  `id` mediumint(9) NOT NULL AUTO_INCREMENT,
107
+ `page_id` varchar(20) NOT NULL,
108
  `variation_id` mediumint(9) NOT NULL,
109
  `lead_id` mediumint(20) NOT NULL,
110
  `lead_uid` varchar(255) NOT NULL,
271
  'form_id' => '',
272
  'cta_id' => '',
273
  'email_id' => '',
274
+ 'rule_id' => '',
275
+ 'job_id' => '',
276
  'list_id' => '',
277
  'lead_id' => ( isset($_COOKIE['wp_lead_id']) ? $_COOKIE['wp_lead_id'] : '' ),
278
  'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : '' ),
shared/classes/class.form.php CHANGED
@@ -284,6 +284,34 @@ if (!class_exists('Inbound_Forms')) {
284
  }
285
  $form .= ' </select>';
286
  $form .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
 
288
  } else if ($type === 'date') {
289
 
284
  }
285
  $form .= ' </select>';
286
  $form .= '</div>';
287
+ $form .= '<script>
288
+ function inbf_daysInMonth(month,year) {
289
+ return new Date(year, month, 0).getDate();
290
+ }
291
+
292
+ jQuery("#formletMonth, #formletYears").on("change",function() {
293
+
294
+ /* get current selected day */
295
+ var selected_date = jQuery( "#formletDays" ).find(":selected").val();
296
+
297
+ /* remove day options */
298
+ jQuery("#formletDays").find("option").remove();
299
+
300
+ /* get more supportive variables */
301
+ var month = jQuery("#formletMonth").find(":selected").val();
302
+ var year = jQuery("#formletYears").find(":selected").val();
303
+ var days_in_month = inbf_daysInMonth(month,year);
304
+
305
+ /* build new option set */
306
+ for (var i = 1; i <= days_in_month; i++) {
307
+ jQuery("#formletDays").append(jQuery("<option></option>").attr("value", i).text(i));
308
+ }
309
+
310
+ /* set date to original selection */
311
+ jQuery("#formletDays option[value="+selected_date+"]").prop("selected", true)
312
+ });
313
+
314
+ </script>';
315
 
316
  } else if ($type === 'date') {
317
 
shared/classes/class.lead-storage.php CHANGED
@@ -75,6 +75,7 @@ if (!class_exists('LeadStorage')) {
75
  $lead['url_params'] = self::check_val('url_params', $args);
76
  $lead['variation'] = self::check_val('variation', $args);
77
  $lead['source'] = self::check_val('source', $args);
 
78
  $lead['ip_address'] = self::lookup_ip_address();
79
 
80
 
@@ -117,15 +118,23 @@ if (!class_exists('LeadStorage')) {
117
 
118
  $leadExists = self::lookup_lead_by_email($lead['email']);
119
 
120
- /* Update Lead if Exists else Create New Lead */
121
- if ( $leadExists ) {
122
  $lead['id'] = $leadExists;
123
- /* action hook on existing leads only */
124
  do_action('wpleads_existing_lead_update', $lead);
125
- } else {
126
- /* Create new lead if one doesnt exist */
 
127
  $lead['id'] = self::store_new_lead($lead);
128
- update_post_meta( $lead['id'] , 'wp_lead_status' , 'new');
 
 
 
 
 
 
 
 
129
  }
130
 
131
  /* do everything else for lead storage */
75
  $lead['url_params'] = self::check_val('url_params', $args);
76
  $lead['variation'] = self::check_val('variation', $args);
77
  $lead['source'] = self::check_val('source', $args);
78
+ $lead['wp_lead_status'] = self::check_val('wp_lead_status', $args);
79
  $lead['ip_address'] = self::lookup_ip_address();
80
 
81
 
118
 
119
  $leadExists = self::lookup_lead_by_email($lead['email']);
120
 
121
+ /* If lead already exists run update action hook */
122
+ if ($leadExists) {
123
  $lead['id'] = $leadExists;
 
124
  do_action('wpleads_existing_lead_update', $lead);
125
+ }
126
+ /* else create new lead */
127
+ else {
128
  $lead['id'] = self::store_new_lead($lead);
129
+ }
130
+
131
+ /* if status is included in lead array then set status */
132
+ if (isset($lead['wp_lead_status']) && !empty($lead['wp_lead_status'])) {
133
+ update_post_meta($lead['id'], 'wp_lead_status', $lead['wp_lead_status']);
134
+ }
135
+ /* else if new lead then set status to new */
136
+ else if (!$leadExists) {
137
+ update_post_meta($lead['id'], 'wp_lead_status', 'new');
138
  }
139
 
140
  /* do everything else for lead storage */
shared/classes/class.load-assets.php CHANGED
@@ -104,8 +104,8 @@ if (!class_exists('Inbound_Asset_Loader')) {
104
 
105
  /* Global Specific localize functions */
106
  static function localize_lead_data() {
107
- global $post;
108
- $post_id = null;
109
  $id_check = false;
110
  $page_tracking = 'on';
111
  $search_tracking = 'on';
@@ -118,28 +118,31 @@ if (!class_exists('Inbound_Asset_Loader')) {
118
  $lead_uid = (isset($_COOKIE['wp_lead_uid'])) ? $_COOKIE['wp_lead_uid'] : false;
119
  $custom_map_values = array();
120
  $custom_map_values = apply_filters( 'inboundnow_custom_map_values_filter' , $custom_map_values);
121
- /* Get correct post ID */
122
 
123
- global $wp_query;
124
- $current_page_id = $wp_query->get_queried_object_id();
125
- $post_id = $current_page_id;
126
- $id_check = ($post_id != null) ? true : false;
127
 
128
- if (!is_archive() && !$id_check){
129
- $post_id = (isset($post)) ? $post->ID : false;
130
- $id_check = ($post_id != null) ? true : false;
 
 
131
  }
132
- if (!$id_check) {
133
- $post_id = wpl_url_to_postid($current_page);
134
- $id_check = ($post_id != null) ? true : false;
 
135
  }
136
- if(!$id_check){
137
- $post_id = wp_leads_get_page_final_id();
138
- $id_check = ($post_id != null) ? true : false;
 
 
139
  }
140
 
141
  /* If page tracking on */
142
- $lead_page_view_tracking = self::get_lead_setting( 'wpl-main-page-view-tracking', 1);
 
143
  $lead_search_tracking = self::get_lead_setting( 'wpl-main-search-tracking', 1);
144
  $lead_comment_tracking = self::get_lead_setting( 'wpl-main-comment-tracking', 1);
145
  if (!$lead_search_tracking) {
@@ -159,8 +162,6 @@ if (!class_exists('Inbound_Asset_Loader')) {
159
  $lead_data_array['lead_uid'] = ($lead_uid) ? $lead_uid : null;
160
  $time = current_time( 'timestamp', 0 ); /* Current wordpress time from settings */
161
  $wordpress_date_time = date("Y/m/d G:i:s", $time);
162
- $inbound_track_include = self::get_lead_setting( 'wpl-main-tracking-ids' , '');
163
- $inbound_track_exclude = self::get_lead_setting( 'wpl-main-exclude-tracking-ids' , '');
164
 
165
  /* get variation id */
166
  if (class_exists('Landing_Pages_Variations')) {
@@ -172,7 +173,8 @@ if (!class_exists('Inbound_Asset_Loader')) {
172
  $variation = (isset($variation)) ? $variation : 0;
173
 
174
  $inbound_localized_data = array(
175
- 'post_id' => $post_id,
 
176
  'variation_id' => $variation,
177
  'ip_address' => $ip_address,
178
  'wp_lead_data' => $lead_data_array,
@@ -183,8 +185,6 @@ if (!class_exists('Inbound_Asset_Loader')) {
183
  'search_tracking' => $search_tracking,
184
  'comment_tracking' => $comment_tracking,
185
  'custom_mapping' => $custom_map_values,
186
- 'inbound_track_exclude' => $inbound_track_exclude,
187
- 'inbound_track_include' => $inbound_track_include,
188
  'is_admin' => current_user_can( 'manage_options' ),
189
  'ajax_nonce' => wp_create_nonce(SECURE_AUTH_KEY)
190
  );
104
 
105
  /* Global Specific localize functions */
106
  static function localize_lead_data() {
107
+ global $post , $inbound_settings, $wp_query;
108
+
109
  $id_check = false;
110
  $page_tracking = 'on';
111
  $search_tracking = 'on';
118
  $lead_uid = (isset($_COOKIE['wp_lead_uid'])) ? $_COOKIE['wp_lead_uid'] : false;
119
  $custom_map_values = array();
120
  $custom_map_values = apply_filters( 'inboundnow_custom_map_values_filter' , $custom_map_values);
 
121
 
122
+ /* Get correct post ID */
123
+ //print_r($wp_query);exit;
 
 
124
 
125
+ /* if blog archive homepage */
126
+ if ( $wp_query->is_home && $wp_query->post_count > 1 ) {
127
+ $post_id = 'blog_home';
128
+ $page = get_page_by_path( 'blog' );
129
+ $post_id = (isset($page->ID)) ? $page->ID : $post_id;
130
  }
131
+ /* if page homepage */
132
+ else if ( $wp_query->post_count == 1 ) {
133
+ $current_page_id = $wp_query->get_queried_object_id();
134
+ $post_id = $current_page_id;
135
  }
136
+ /* if archive */
137
+ else if ( is_archive() ) {
138
+ $post_id = wp_leads_get_page_final_id($current_page);
139
+ } else if (strpos($_SERVER['REQUEST_URI'], "preview") !== false) {
140
+ $post_id = 'preview.php';
141
  }
142
 
143
  /* If page tracking on */
144
+ $inbound_settings['inbound-analytics-rules'] = ( isset( $inbound_settings['inbound-analytics-rules']) ) ? $inbound_settings['inbound-analytics-rules'] : array();
145
+ $lead_page_view_tracking = ( isset( $inbound_settings['inbound-analytics-rules']['page-tracking']) && $inbound_settings['inbound-analytics-rules']['page-tracking'] == 'off' ) ? false : true;
146
  $lead_search_tracking = self::get_lead_setting( 'wpl-main-search-tracking', 1);
147
  $lead_comment_tracking = self::get_lead_setting( 'wpl-main-comment-tracking', 1);
148
  if (!$lead_search_tracking) {
162
  $lead_data_array['lead_uid'] = ($lead_uid) ? $lead_uid : null;
163
  $time = current_time( 'timestamp', 0 ); /* Current wordpress time from settings */
164
  $wordpress_date_time = date("Y/m/d G:i:s", $time);
 
 
165
 
166
  /* get variation id */
167
  if (class_exists('Landing_Pages_Variations')) {
173
  $variation = (isset($variation)) ? $variation : 0;
174
 
175
  $inbound_localized_data = array(
176
+ 'post_id' => (isset($post_id)) ? $post_id : 0,
177
+ 'post_type' => (isset($post->post_type)) ? $post->post_type : 'na' ,
178
  'variation_id' => $variation,
179
  'ip_address' => $ip_address,
180
  'wp_lead_data' => $lead_data_array,
185
  'search_tracking' => $search_tracking,
186
  'comment_tracking' => $comment_tracking,
187
  'custom_mapping' => $custom_map_values,
 
 
188
  'is_admin' => current_user_can( 'manage_options' ),
189
  'ajax_nonce' => wp_create_nonce(SECURE_AUTH_KEY)
190
  );
shared/classes/class.load-shared.php CHANGED
@@ -37,7 +37,7 @@ if (!class_exists('Inbound_Load_Shared')) {
37
  */
38
  public static function load_constants() {
39
  define('INBOUNDNOW_SHARED', 'loaded' );
40
- define('INBOUNDNOW_SHARED_DBRV', '1.0.4' );
41
  define('INBOUNDNOW_SHARED_PATH', self::get_shared_path() );
42
  define('INBOUNDNOW_SHARED_URLPATH', self::get_shared_urlpath() );
43
  define('INBOUNDNOW_SHARED_FILE', self::get_shared_file() );
@@ -182,13 +182,14 @@ if (!class_exists('Inbound_Load_Shared')) {
182
  return;
183
  }
184
 
185
- /* Delete activation trigger */
186
- delete_option( 'Inbound_Activate' );
187
-
188
  /* Run activation action hook for shared components */
189
  do_action( 'inbound_shared_activate' );
190
 
191
 
 
 
 
 
192
  }
193
  }
194
  }
37
  */
38
  public static function load_constants() {
39
  define('INBOUNDNOW_SHARED', 'loaded' );
40
+ define('INBOUNDNOW_SHARED_DBRV', '1.0.7' );
41
  define('INBOUNDNOW_SHARED_PATH', self::get_shared_path() );
42
  define('INBOUNDNOW_SHARED_URLPATH', self::get_shared_urlpath() );
43
  define('INBOUNDNOW_SHARED_FILE', self::get_shared_file() );
182
  return;
183
  }
184
 
 
 
 
185
  /* Run activation action hook for shared components */
186
  do_action( 'inbound_shared_activate' );
187
 
188
 
189
+ /* Delete activation trigger */
190
+ delete_option( 'Inbound_Activate' );
191
+
192
+
193
  }
194
  }
195
  }
shared/classes/class.marketing-button.php CHANGED
@@ -46,143 +46,146 @@ class Inbound_Marketing_Button {
46
  global $pagenow, $typenow;
47
  // Only run in post/page creation and edit screens
48
  if (in_array($pagenow, array('post.php','page.php','post-new.php','post-edit.php'))) { ?>
49
- <style type="text/css">
50
- #inbound-shortcodes-popup {
51
- min-height: 650px;
52
- }
53
- #marketing-popup-controls {
54
- position: fixed;
55
- bottom: 20px;
56
- width: 100%;
57
- }
58
- .marketing-back-button {
59
- position: absolute;
60
- top: 15px;
61
- left: 20px;
62
- cursor: pointer;
63
- }
64
- #inbound-shortcodes-form-head {
65
- text-align: center;
66
- }
67
- #inbound-shortcodes-preview {
68
- height: 607px;
69
- }
70
- .inbound-short-list {
71
- padding: 40px;
72
- }
73
- .inbound-short-list li {
74
- position: relative;
75
- padding-left: 30px;
76
- margin-bottom: 29px;
77
- display: block;
78
- font-size: 19px;
79
- vertical-align: top;
80
- }
81
- .inbound-short-list span.new-sc-icons {
82
- top:-1px;
83
- }
84
-
85
- .shortcode-popup-block {
86
- max-height: 660px;
87
- overflow: auto;
88
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
89
- background: #fff;
90
- padding: 0px;
91
- text-align: left;
92
- max-width: 85%;
93
- margin: 20px auto;
94
- position: relative;
95
- }
96
-
97
- .mfp-bg {
98
- top: 0;
99
- left: 0;
100
- width: 100%;
101
- height: 100%;
102
- z-index: 90000;
103
- overflow: hidden;
104
- position: fixed;
105
- background: #0b0b0b;
106
- opacity: 0.8;
107
- }
108
-
109
-
110
- .mfp-wrap {
111
- top: 0;
112
- left: 0;
113
- width: 100%;
114
- height: 100%;
115
- z-index: 100001;
116
- position: fixed;
117
- outline: none !important;
118
- -webkit-backface-visibility: hidden;
119
- }
120
-
121
- .mfp-container {
122
- position: relative;
123
- display: inline-block;
124
- vertical-align: middle;
125
- margin: 0 auto;
126
- text-align: left;
127
- z-index: 100002;
128
- }
129
-
130
-
131
- #popup-controls {
132
- z-index: 999999;
133
- width: 100%;
134
- margin: auto;
135
-
136
- position: fixed;
137
- }
138
- </style>
139
  <div id="inbound-marketing-popup" class="shortcode-popup-block mfp-hide">
140
  <ul class="inbound-short-list" style="display: block;">
141
  <li class="launch-marketing-shortcode" data-launch-sc="quick-forms">
142
  <span class="new-sc-icons mceIcon mce_editor-icon-quick-forms"></span>
143
- Insert Existing Form
144
  </li>
145
  <li class="launch-marketing-shortcode" data-launch-sc="button">
146
  <span class="new-sc-icons mceIcon mce_editor-icon-button"></span>
147
- Build a Button
148
  </li>
149
  <li class="launch-marketing-shortcode" data-launch-sc="call-to-action">
150
- <span class="new-sc-icons mceIcon mce_editor-icon-call-to-action"></span>Call to action Shortcodes
 
151
  </li>
152
  <li class="launch-marketing-shortcode" data-launch-sc="social-share">
153
- <span class="new-sc-icons mceIcon mce_editor-icon-social-share"></span>Social Share
 
154
  </li>
155
  <li class="launch-marketing-shortcode" data-launch-sc="lists">
156
  <span class="new-sc-icons mceIcon mce_editor-icon-lists"></span>
157
- Insert Icon List
158
  </li>
159
  <li class="launch-marketing-shortcode" data-launch-sc="columns">
160
  <span class="new-sc-icons mceIcon mce_editor-icon-columns"></span>
161
- Insert Columns
162
  </li>
163
- </ul>
164
- <div id="iframe-target"></div>
165
 
166
  </div>
167
  <script type="text/javascript">
168
- jQuery(document).ready(function($) {
169
- /* See marketing-button.js */
170
 
171
 
172
- jQuery("body").on('click', '.marketing-back-button', function () {
173
- // toggle display
174
- jQuery("#iframe-target").html('');
175
- $('.select2-drop').remove();
176
- $('.inbound-short-list').show();
177
 
178
- });
179
 
180
 
181
- });
182
 
183
  </script>
184
- <?php
185
  }
186
  }
187
  }
188
- $Inbound_Marketing_Button = new Inbound_Marketing_Button();
 
46
  global $pagenow, $typenow;
47
  // Only run in post/page creation and edit screens
48
  if (in_array($pagenow, array('post.php','page.php','post-new.php','post-edit.php'))) { ?>
49
+ <style type="text/css">
50
+ #inbound-shortcodes-popup {
51
+ min-height: 650px;
52
+ }
53
+ #marketing-popup-controls {
54
+ position: fixed;
55
+ bottom: 20px;
56
+ width: 100%;
57
+ }
58
+ .marketing-back-button {
59
+ position: absolute;
60
+ top: 15px;
61
+ left: 20px;
62
+ cursor: pointer;
63
+ }
64
+ #inbound-shortcodes-form-head {
65
+ text-align: center;
66
+ }
67
+ #inbound-shortcodes-preview {
68
+ height: 607px;
69
+ }
70
+ .inbound-short-list {
71
+ padding: 40px;
72
+ }
73
+ .inbound-short-list li {
74
+ position: relative;
75
+ padding-left: 30px;
76
+ margin-bottom: 29px;
77
+ display: block;
78
+ font-size: 19px;
79
+ vertical-align: top;
80
+ }
81
+ .inbound-short-list span.new-sc-icons {
82
+ top:-1px;
83
+ }
84
+
85
+ .shortcode-popup-block {
86
+ max-height: 660px;
87
+ overflow: auto;
88
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
89
+ background: #fff;
90
+ padding: 0px;
91
+ text-align: left;
92
+ max-width: 85%;
93
+ margin: 20px auto;
94
+ position: relative;
95
+ }
96
+
97
+ .mfp-bg {
98
+ top: 0;
99
+ left: 0;
100
+ width: 100%;
101
+ height: 100%;
102
+ z-index: 90000;
103
+ overflow: hidden;
104
+ position: fixed;
105
+ background: #0b0b0b;
106
+ opacity: 0.8;
107
+ }
108
+
109
+
110
+ .mfp-wrap {
111
+ top: 0;
112
+ left: 0;
113
+ width: 100%;
114
+ height: 100%;
115
+ z-index: 100001;
116
+ position: fixed;
117
+ outline: none !important;
118
+ -webkit-backface-visibility: hidden;
119
+ }
120
+
121
+ .mfp-container {
122
+ position: relative;
123
+ display: inline-block;
124
+ vertical-align: middle;
125
+ margin: 0 auto;
126
+ text-align: left;
127
+ z-index: 100002;
128
+ }
129
+
130
+
131
+ #popup-controls {
132
+ z-index: 999999;
133
+ width: 100%;
134
+ margin: auto;
135
+
136
+ position: fixed;
137
+ }
138
+ </style>
139
  <div id="inbound-marketing-popup" class="shortcode-popup-block mfp-hide">
140
  <ul class="inbound-short-list" style="display: block;">
141
  <li class="launch-marketing-shortcode" data-launch-sc="quick-forms">
142
  <span class="new-sc-icons mceIcon mce_editor-icon-quick-forms"></span>
143
+ <?php _e('Insert Existing Form' , 'inbound-pro' ); ?>
144
  </li>
145
  <li class="launch-marketing-shortcode" data-launch-sc="button">
146
  <span class="new-sc-icons mceIcon mce_editor-icon-button"></span>
147
+ <?php _e('Build a Button' , 'inbound-pro' ); ?>
148
  </li>
149
  <li class="launch-marketing-shortcode" data-launch-sc="call-to-action">
150
+ <span class="new-sc-icons mceIcon mce_editor-icon-call-to-action"></span>
151
+ <?php _e('Call to Action Shortcodes' , 'inbound-pro' ); ?>
152
  </li>
153
  <li class="launch-marketing-shortcode" data-launch-sc="social-share">
154
+ <span class="new-sc-icons mceIcon mce_editor-icon-social-share"></span>
155
+ <?php _e('Social Share' , 'inbound-pro' ); ?>
156
  </li>
157
  <li class="launch-marketing-shortcode" data-launch-sc="lists">
158
  <span class="new-sc-icons mceIcon mce_editor-icon-lists"></span>
159
+ <?php _e('Insert Icon List' , 'inbound-pro' ); ?>
160
  </li>
161
  <li class="launch-marketing-shortcode" data-launch-sc="columns">
162
  <span class="new-sc-icons mceIcon mce_editor-icon-columns"></span>
163
+ <?php _e('Insert Columns' , 'inbound-pro' ); ?>
164
  </li>
165
+ </ul>
166
+ <div id="iframe-target"></div>
167
 
168
  </div>
169
  <script type="text/javascript">
170
+ jQuery(document).ready(function($) {
171
+ /* See marketing-button.js */
172
 
173
 
174
+ jQuery("body").on('click', '.marketing-back-button', function () {
175
+ // toggle display
176
+ jQuery("#iframe-target").html('');
177
+ jQuery('.select2-drop').remove();
178
+ jQuery('.inbound-short-list').show();
179
 
180
+ });
181
 
182
 
183
+ });
184
 
185
  </script>
186
+ <?php
187
  }
188
  }
189
  }
190
+
191
+ new Inbound_Marketing_Button();
shared/classes/class.post-type.wp-lead.php CHANGED
@@ -661,15 +661,17 @@ if ( !class_exists('Inbound_Leads') ) {
661
  * @param $lead_id
662
  */
663
  public static function get_user_by_lead_id( $lead_id ) {
664
-
 
 
665
  }
666
 
667
  /**
668
  * Get User Object from lead email
669
  * @param $lead_id
670
  */
671
- public static function get_user_by_lead_email( $lead_id ) {
672
-
673
  }
674
 
675
  /**
661
  * @param $lead_id
662
  */
663
  public static function get_user_by_lead_id( $lead_id ) {
664
+ $email_address = get_post_meta($lead_id ,'wpleads_email_address' , true );
665
+ $user = self::get_user_by_lead_email( $email_address );
666
+ return $user;
667
  }
668
 
669
  /**
670
  * Get User Object from lead email
671
  * @param $lead_id
672
  */
673
+ public static function get_user_by_lead_email( $email_address ) {
674
+ return get_user_by('email' , $email_address );
675
  }
676
 
677
  /**
shared/shortcodes/js/shortcodes.js CHANGED
@@ -483,29 +483,14 @@ var InboundShortcodes = {
483
 
484
  if (shortcode_name === 'insert_call_to_action') {
485
 
486
-
487
- jQuery("#insert_inbound_cta").select2({
488
- placeholder: "Select one or more calls to action to rotate through",
489
- });
490
-
491
  jQuery("body").on('change', '#insert_inbound_cta, #inbound_shortcode_align', function () {
492
- var cta_ids = jQuery("#insert_inbound_cta").select2("data");
493
- var cta_val = jQuery("#insert_inbound_cta").select2("val");
494
-
495
- var cta_id_array = [];
496
-
497
- jQuery.each(cta_ids, function (key, valueObj) {
498
- var the_id = valueObj['id'];
499
- cta_id_array.push(the_id);
500
- });
501
 
502
- console.log(cta_id_array);
503
- var final_ids = cta_id_array.join();
504
  var align = jQuery('#inbound_shortcode_align').val();
505
  setTimeout(function () {
506
- jQuery("#_inbound_shortcodes_newoutput").html('[cta id="' + final_ids + '" align="' + align + '"]');
507
  /* new stuff */
508
- jQuery("#insert_new_shortcode_here").val('[cta id="' + final_ids + '" align="' + align + '"]');
509
  }, 1000);
510
  });
511
  }
483
 
484
  if (shortcode_name === 'insert_call_to_action') {
485
 
 
 
 
 
 
486
  jQuery("body").on('change', '#insert_inbound_cta, #inbound_shortcode_align', function () {
487
+ var cta_id = jQuery("#insert_inbound_cta").find('option:selected').val();
 
 
 
 
 
 
 
 
488
 
 
 
489
  var align = jQuery('#inbound_shortcode_align').val();
490
  setTimeout(function () {
491
+ jQuery("#_inbound_shortcodes_newoutput").html('[cta id="' + cta_id + '" align="' + align + '"]');
492
  /* new stuff */
493
+ jQuery("#insert_new_shortcode_here").val('[cta id="' + cta_id + '" align="' + align + '"]');
494
  }, 1000);
495
  });
496
  }
shared/shortcodes/popup.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  include( 'shortcodes-fields.php' );
3
  $popup = trim( sanitize_text_field($_GET['popup']) );
4
 
1
  <?php
2
+
3
  include( 'shortcodes-fields.php' );
4
  $popup = trim( sanitize_text_field($_GET['popup']) );
5
 
shared/shortcodes/preview.php CHANGED
@@ -48,19 +48,18 @@ $shortcode = str_replace('{{child}}', '', $shortcode);
48
  wp_enqueue_script( 'jquery' );
49
 
50
  wp_enqueue_script( 'inbound-analytics' , INBOUNDNOW_SHARED_URLPATH .'assets/js/frontend/analytics/inboundAnalytics.js');
51
- $inbound_localized_data = array('post_id' => 'test',
52
- 'ip_address' => 'test',
53
- 'wp_lead_data' => 'test',
54
- 'admin_url' => 'test',
55
- 'track_time' => 'test',
56
- 'post_type' => 'test',
57
- 'page_tracking' => 'test',
58
- 'search_tracking' => 'test',
59
- 'comment_tracking' => 'test',
60
- 'custom_mapping' => 'test',
61
- 'inbound_track_exclude' => 'test',
62
- 'inbound_track_include' => 'test'
63
- );
64
  wp_localize_script( 'inbound-analytics' , 'inbound_settings', $inbound_localized_data);
65
  wp_head();
66
  ?>
48
  wp_enqueue_script( 'jquery' );
49
 
50
  wp_enqueue_script( 'inbound-analytics' , INBOUNDNOW_SHARED_URLPATH .'assets/js/frontend/analytics/inboundAnalytics.js');
51
+ $inbound_localized_data = array(
52
+ 'post_id' => 'test',
53
+ 'ip_address' => 'test',
54
+ 'wp_lead_data' => 'test',
55
+ 'admin_url' => 'test',
56
+ 'track_time' => 'test',
57
+ 'post_type' => 'test',
58
+ 'page_tracking' => 'test',
59
+ 'search_tracking' => 'test',
60
+ 'comment_tracking' => 'test',
61
+ 'custom_mapping' => 'test'
62
+ );
 
63
  wp_localize_script( 'inbound-analytics' , 'inbound_settings', $inbound_localized_data);
64
  wp_head();
65
  ?>
shared/shortcodes/shortcodes/call-to-action.php CHANGED
@@ -27,5 +27,5 @@
27
 
28
  ),
29
  'shortcode' => '[cta id="{{insert_default}}" align="{{align}}"]',
30
- 'popup_title' => 'Insert Call to Action'
31
  );
27
 
28
  ),
29
  'shortcode' => '[cta id="{{insert_default}}" align="{{align}}"]',
30
+ 'popup_title' => __('Insert Call to Action' , 'inbound-pro' )
31
  );
shared/shortcodes/shortcodes/forms.php CHANGED
@@ -326,7 +326,7 @@ $shortcodes_config['forms'] = array(
326
  'std' => '',
327
  'class' => '',
328
  ),
329
- 'exclude_tracking' => array(
330
  'name' => __('Exclude Tracking? <span class="small-optional-text">(optional)</span>', 'inbound-pro' ),
331
  'checkbox_text' => __('Check to exclude this form field from being tracked. Note this will not store in your Database', 'inbound-pro' ),
332
  'desc' => '',
@@ -407,6 +407,7 @@ if (!function_exists('inbound_forms_cpt')) {
407
  'query_var' => true,
408
  'show_in_menu' => true,
409
  'capability_type' => array('inbound-form','inbound-forms'),
 
410
  'hierarchical' => false,
411
  'menu_position' => 34,
412
  'supports' => array('title','custom-fields', 'editor')
@@ -445,9 +446,10 @@ if (!function_exists('inbound_forms_cpt')) {
445
  $role->add_cap( 'read_private_inbound-forms' );
446
  $role->add_cap( 'edit_inbound-form' );
447
  $role->add_cap( 'edit_inbound-forms' );
448
- $role->add_cap( 'edit_others_inbound-form' );
449
  $role->add_cap( 'edit_published_inbound-forms' );
450
  $role->add_cap( 'publish_inbound-form' );
 
451
  $role->add_cap( 'delete_inbound-forms' );
452
  $role->add_cap( 'delete_others_inbound-forms' );
453
  $role->add_cap( 'delete_private_inbound-forms' );
@@ -711,38 +713,38 @@ if (!function_exists('inbound_form_get_data')) {
711
  $shortcode = get_post_meta( $post_ID, 'inbound_shortcode', TRUE );
712
  $inbound_form_values = get_post_meta( $post_ID, 'inbound_form_values', TRUE );
713
 
714
-
715
- /**get stored email response info. Mainly used when selecting a form starting template**/
716
- $send_email = get_post_meta( $post_ID, 'inbound_email_send_notification', true);//yes/no select send response email
717
- $send_email = '&inbound_email_send_notification=' . $send_email;//format the data into a string which fill_form_fields() over in shortcodes.js will use to fill in the field
718
-
719
- $email_template_id = get_post_meta( $post_ID, 'inbound_email_send_notification_template', true );// email template id, or 'custom' email flag
720
-
721
- /*if a custom email response is to be used, custom will be true*/
722
- if($email_template_id == 'custom'){
723
- $content = get_post($post_ID); //the email is contained in the post content
724
- $content = $content->post_content;
725
- $custom_email_response = '&content=' . $content;
726
-
727
- $custom_email_subject = get_post_meta( $post_ID, 'inbound_confirmation_subject', true ); //the subject is in the meta
728
- $custom_email_subject = '&inbound_confirmation_subject=' . $custom_email_subject;
729
- }else{
730
- $custom_email_response = '';
731
- $custom_email_subject = '';
732
- }
733
-
734
- $email_template_id = '&inbound_email_send_notification_template=' . $email_template_id;
735
-
736
- /*concatenate into a big string and add it to $inbound_form_values*/
737
- $inbound_form_values .= ($send_email . $email_template_id . $custom_email_response . $custom_email_subject);
738
-
739
-
740
  /* update_post_meta( $post_ID, 'inbound_form_created_on', $page_id );
741
  update_post_meta( $post_ID, 'inbound_shortcode', $shortcode );
742
  update_post_meta( $post_ID, 'inbound_form_values', $form_values );
743
  update_post_meta( $post_ID, 'inbound_form_field_count', $field_count );
744
  */
745
-
746
  $output = array('inbound_shortcode'=> $shortcode,
747
  'field_count'=>$field_count,
748
  'form_settings_data' => $form_settings_data,
326
  'std' => '',
327
  'class' => '',
328
  ),
329
+ 'exclude_tracking' => array(
330
  'name' => __('Exclude Tracking? <span class="small-optional-text">(optional)</span>', 'inbound-pro' ),
331
  'checkbox_text' => __('Check to exclude this form field from being tracked. Note this will not store in your Database', 'inbound-pro' ),
332
  'desc' => '',
407
  'query_var' => true,
408
  'show_in_menu' => true,
409
  'capability_type' => array('inbound-form','inbound-forms'),
410
+ 'map_meta_cap' => true,
411
  'hierarchical' => false,
412
  'menu_position' => 34,
413
  'supports' => array('title','custom-fields', 'editor')
446
  $role->add_cap( 'read_private_inbound-forms' );
447
  $role->add_cap( 'edit_inbound-form' );
448
  $role->add_cap( 'edit_inbound-forms' );
449
+ $role->add_cap( 'edit_others_inbound-forms' );
450
  $role->add_cap( 'edit_published_inbound-forms' );
451
  $role->add_cap( 'publish_inbound-form' );
452
+ $role->add_cap( 'delete_inbound-form' );
453
  $role->add_cap( 'delete_inbound-forms' );
454
  $role->add_cap( 'delete_others_inbound-forms' );
455
  $role->add_cap( 'delete_private_inbound-forms' );
713
  $shortcode = get_post_meta( $post_ID, 'inbound_shortcode', TRUE );
714
  $inbound_form_values = get_post_meta( $post_ID, 'inbound_form_values', TRUE );
715
 
716
+
717
+ /**get stored email response info. Mainly used when selecting a form starting template**/
718
+ $send_email = get_post_meta( $post_ID, 'inbound_email_send_notification', true);//yes/no select send response email
719
+ $send_email = '&inbound_email_send_notification=' . $send_email;//format the data into a string which fill_form_fields() over in shortcodes.js will use to fill in the field
720
+
721
+ $email_template_id = get_post_meta( $post_ID, 'inbound_email_send_notification_template', true );// email template id, or 'custom' email flag
722
+
723
+ /*if a custom email response is to be used, custom will be true*/
724
+ if($email_template_id == 'custom'){
725
+ $content = get_post($post_ID); //the email is contained in the post content
726
+ $content = $content->post_content;
727
+ $custom_email_response = '&content=' . $content;
728
+
729
+ $custom_email_subject = get_post_meta( $post_ID, 'inbound_confirmation_subject', true ); //the subject is in the meta
730
+ $custom_email_subject = '&inbound_confirmation_subject=' . $custom_email_subject;
731
+ }else{
732
+ $custom_email_response = '';
733
+ $custom_email_subject = '';
734
+ }
735
+
736
+ $email_template_id = '&inbound_email_send_notification_template=' . $email_template_id;
737
+
738
+ /*concatenate into a big string and add it to $inbound_form_values*/
739
+ $inbound_form_values .= ($send_email . $email_template_id . $custom_email_response . $custom_email_subject);
740
+
741
+
742
  /* update_post_meta( $post_ID, 'inbound_form_created_on', $page_id );
743
  update_post_meta( $post_ID, 'inbound_shortcode', $shortcode );
744
  update_post_meta( $post_ID, 'inbound_form_values', $form_values );
745
  update_post_meta( $post_ID, 'inbound_form_field_count', $field_count );
746
  */
747
+
748
  $output = array('inbound_shortcode'=> $shortcode,
749
  'field_count'=>$field_count,
750
  'form_settings_data' => $form_settings_data,