WordPress Landing Pages - Version 1.3.9

Version Description

  • Bug fixes for form creation issues
  • Bug fixes for safari page tracking not firing
  • Added quick menu to WP admin bar for quicker marketing!
Download this release

Release Info

Developer DavidWells
Plugin Icon 128x128 WordPress Landing Pages
Version 1.3.9
Comparing to
See all releases

Code changes from version 1.3.8 to 1.3.9

css/admin-global-settings.css CHANGED
@@ -45,7 +45,7 @@
45
  width: 26%; }
46
 
47
  .lp-sidebar-settings {
48
- background: #f2f2f2 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
49
  border: 1px solid #EBEBEA;
50
  -webkit-box-shadow: inset 1px 1px 1px #f9f9f9;
51
  -moz-box-shadow: inset 1px 1px 1px #f9f9f9;
@@ -55,7 +55,7 @@ margin-bottom: 20px;
55
  margin-right: 20px;
56
  }
57
  .lp-sidebar-settings .review-button {
58
- background: #94BA65 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
59
  border: 1px solid rgba(0,0,0,0.15);
60
  -webkit-border-radius: 2px;
61
  -moz-border-radius: 2px;
45
  width: 26%; }
46
 
47
  .lp-sidebar-settings {
48
+ background: #f2f2f2 ;
49
  border: 1px solid #EBEBEA;
50
  -webkit-box-shadow: inset 1px 1px 1px #f9f9f9;
51
  -moz-box-shadow: inset 1px 1px 1px #f9f9f9;
55
  margin-right: 20px;
56
  }
57
  .lp-sidebar-settings .review-button {
58
+ background: #94BA65 ;
59
  border: 1px solid rgba(0,0,0,0.15);
60
  -webkit-border-radius: 2px;
61
  -moz-border-radius: 2px;
css/admin-style.css CHANGED
@@ -340,7 +340,7 @@ div#lp-store-iframe-container > iframe {
340
 
341
  #wp-leads-splash-header
342
  {
343
- background: #f2f2f2 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
344
  border-bottom: 1px solid #EBEBEA;
345
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
346
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
@@ -374,7 +374,7 @@ div#lp-store-iframe-container > iframe {
374
 
375
  .wplp-green-button
376
  {
377
- background: #94BA65 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
378
  border: 1px solid rgba(0,0,0,0.15);
379
  -webkit-border-radius: 2px;
380
  -moz-border-radius: 2px;
340
 
341
  #wp-leads-splash-header
342
  {
343
+ background: #f2f2f2;
344
  border-bottom: 1px solid #EBEBEA;
345
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
346
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
374
 
375
  .wplp-green-button
376
  {
377
+ background: #94BA65;
378
  border: 1px solid rgba(0,0,0,0.15);
379
  -webkit-border-radius: 2px;
380
  -moz-border-radius: 2px;
landing-pages.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: The first true all-in-one Landing Page solution for WordPress, including ongoing conversion metrics, a/b split testing, unlimited design options and so much more!
6
- Version: 1.3.8
7
  Author: David Wells, Hudson Atwell
8
  Author URI: http://www.inboundnow.com/
9
  Text Domain: landing-pages
10
  Domain Path: shared/languages/landing-pages/
11
  */
12
 
13
- define('LANDINGPAGES_CURRENT_VERSION', '1.3.8' );
14
  define('LANDINGPAGES_URLPATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' );
15
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
16
  define('LANDINGPAGES_PLUGIN_SLUG', plugin_basename( dirname(__FILE__) ) );
@@ -19,7 +19,9 @@ define('LANDINGPAGES_STORE_URL', 'http://www.inboundnow.com/landing-pages/' );
19
  $uploads = wp_upload_dir();
20
  define('LANDINGPAGES_UPLOADS_PATH', $uploads['basedir'].'/landing-pages/templates/' );
21
  define('LANDINGPAGES_UPLOADS_URLPATH', $uploads['baseurl'].'/landing-pages/templates/' );
22
- define('LANDINGPAGES_TEXT_DOMAIN', 'landing-pages' );
 
 
23
  define('INBOUNDNOW_LABEL', 'inboundnow-legacy' );
24
 
25
 
@@ -31,6 +33,7 @@ if (is_admin())
31
  switch (is_admin()) :
32
  case true :
33
  /* loads admin files */
 
34
  include_once('modules/module.language-support.php');
35
  include_once('modules/module.javascript-admin.php');
36
  include_once('modules/module.activate.php');
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: The first true all-in-one Landing Page solution for WordPress, including ongoing conversion metrics, a/b split testing, unlimited design options and so much more!
6
+ Version: 1.3.9
7
  Author: David Wells, Hudson Atwell
8
  Author URI: http://www.inboundnow.com/
9
  Text Domain: landing-pages
10
  Domain Path: shared/languages/landing-pages/
11
  */
12
 
13
+ define('LANDINGPAGES_CURRENT_VERSION', '1.3.9' );
14
  define('LANDINGPAGES_URLPATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' );
15
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
16
  define('LANDINGPAGES_PLUGIN_SLUG', plugin_basename( dirname(__FILE__) ) );
19
  $uploads = wp_upload_dir();
20
  define('LANDINGPAGES_UPLOADS_PATH', $uploads['basedir'].'/landing-pages/templates/' );
21
  define('LANDINGPAGES_UPLOADS_URLPATH', $uploads['baseurl'].'/landing-pages/templates/' );
22
+ if ( !defined( 'LANDINGPAGES_TEXT_DOMAIN' ) ) {
23
+ define('LANDINGPAGES_TEXT_DOMAIN', 'landing-pages' );
24
+ }
25
  define('INBOUNDNOW_LABEL', 'inboundnow-legacy' );
26
 
27
 
33
  switch (is_admin()) :
34
  case true :
35
  /* loads admin files */
36
+ // include_once('modules/module.cron.php'); not ready yet
37
  include_once('modules/module.language-support.php');
38
  include_once('modules/module.javascript-admin.php');
39
  include_once('modules/module.activate.php');
modules/module.cron.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_filter( 'cron_schedules', 'filter_cron_schedules' );
4
+ function filter_cron_schedules( $schedules ) {
5
+ $schedules['three_minutes'] = array(
6
+ 'interval' => 180, // 1 week in seconds
7
+ 'display' => __( 'Every 3 minutes' ),
8
+ );
9
+
10
+ return $schedules;
11
+ }
12
+ if (!wp_next_scheduled('sfs_cron_cache')) {
13
+ wp_schedule_event(time(), 'hourly', 'sfs_cron_cache'); // hourly, daily, twicedaily, three_minutes
14
+ }
15
+ if (isset($_GET['cron-check'])) {
16
+ $get_count = get_option( 'cron-tester');
17
+ echo 'cron counter: ' . $get_count;
18
+ }
19
+
20
+ // cache feed counts
21
+ add_action('sfs_cron_cache', 'sfs_cache_data');
22
+ function sfs_cache_data() {
23
+ $get_count = get_option( 'cron-tester');
24
+ $new_count = $get_count + 1;
25
+ update_option( 'cron-tester', $new_count );
26
+ /*
27
+ $page_conversion_data = get_post_meta( 1523, 'inbound_conversion_data', TRUE );
28
+ $page_conversion_data = json_decode($page_conversion_data,true);
29
+ $version = '0';
30
+ if (is_array($page_conversion_data)){
31
+ $convert_count = count($page_conversion_data) + 1;
32
+ $page_conversion_data[$convert_count]['lead_id'] = 99;
33
+ $page_conversion_data[$convert_count]['variation'] = $version;
34
+ $page_conversion_data[$convert_count]['datetime'] = '2013-12-16 12:29:46 UTC';
35
+ } else {
36
+ $convert_count = 1;
37
+ $page_conversion_data[$convert_count]['lead_id'] = 99;
38
+ $page_conversion_data[$convert_count]['variation'] = $version;
39
+ $page_conversion_data[$convert_count]['datetime'] = '2013-12-16 12:29:46 UTC';
40
+ }
41
+ $page_conversion_data = json_encode($page_conversion_data);
42
+ update_post_meta(1523, 'inbound_conversion_data', $page_conversion_data);
43
+ */
44
+
45
+ }
modules/module.javascript-frontend.php CHANGED
@@ -27,9 +27,27 @@ function lp_fontend_enqueue_scripts($hook)
27
  // Load funnel tracking. Force Leads to load its version if active
28
  if ($post_type!=='wp-call-to-action')
29
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  wp_register_script('funnel-tracking',LANDINGPAGES_URLPATH . 'js/funnel-tracking.js', array( 'jquery', 'jquery-cookie'));
31
  wp_enqueue_script('funnel-tracking');
32
- wp_localize_script( 'funnel-tracking' , 'wplft', array( 'post_id' => $post_id , 'ip_address' => $ip_address ));
 
 
 
33
  }
34
 
35
  if (isset($post)&&$post->post_type=='landing-page')
27
  // Load funnel tracking. Force Leads to load its version if active
28
  if ($post_type!=='wp-call-to-action')
29
  {
30
+ /* Global Lead Data */
31
+ $lead_cpt_id = (isset($_COOKIE['wp_lead_id'])) ? $_COOKIE['wp_lead_id'] : false;
32
+ $lead_email = (isset($_COOKIE['wp_lead_email'])) ? $_COOKIE['wp_lead_email'] : false;
33
+ $lead_unique_key = (isset($_COOKIE['wp_lead_uid'])) ? $_COOKIE['wp_lead_uid'] : false;
34
+ $lead_data_array = array();
35
+ if ($lead_cpt_id) {
36
+ $lead_data_array['lead_id'] = $lead_cpt_id;
37
+ $type = 'wplid';}
38
+ if ($lead_email) {
39
+ $lead_data_array['lead_email'] = $lead_email;
40
+ $type = 'wplemail';}
41
+ if ($lead_unique_key) {
42
+ $lead_data_array['lead_uid'] = $lead_unique_key;
43
+ $type = 'wpluid';
44
+ }
45
  wp_register_script('funnel-tracking',LANDINGPAGES_URLPATH . 'js/funnel-tracking.js', array( 'jquery', 'jquery-cookie'));
46
  wp_enqueue_script('funnel-tracking');
47
+ $time = current_time( 'timestamp', 0 ); // Current wordpress time from settings
48
+ $wordpress_date_time = date("Y-m-d G:i:s T", $time);
49
+ wp_localize_script( 'funnel-tracking' , 'wplft', array( 'post_id' => $post_id, 'ip_address' => $ip_address, 'wp_lead_data' => $lead_data_array, 'admin_url' => admin_url( 'admin-ajax.php' ), 'track_time' => $wordpress_date_time));
50
+ /* End Global Lead Data */
51
  }
52
 
53
  if (isset($post)&&$post->post_type=='landing-page')
modules/module.metaboxes-ab-testing.php CHANGED
@@ -3,12 +3,12 @@
3
  add_action('add_meta_boxes', 'lp_ab_display_stats_metabox');
4
  function lp_ab_display_stats_metabox() {
5
 
6
- add_meta_box(
7
- 'lp_ab_display_stats_metabox',
8
  __( 'A/B Testing', 'bab' ),
9
  'lp_ab_stats_metabox',
10
- 'landing-page' ,
11
- 'side',
12
  'high' );
13
  }
14
 
@@ -20,9 +20,9 @@ function lp_ab_stats_metabox() {
20
  ?>
21
  <div>
22
  <style type="text/css">
23
-
24
  </style>
25
- <div class="inside" style='margin-left:-8px;'>
26
  <div id="bab-stat-box">
27
  <?php if (isset($_GET['new_meta_key'])) { ?>
28
  <script type="text/javascript">
@@ -56,10 +56,10 @@ function lp_ab_stats_metabox() {
56
  {
57
  if (!is_numeric($vid)&&$key==0)
58
  $vid = 0;
59
-
60
  $variation_status = lp_ab_get_lp_active_status($post,$vid);
61
  $variation_status_class = ($variation_status ==1) ? "variation-on" : 'variation-off';
62
-
63
  $permalink = get_permalink($post->ID);
64
  if (strstr($permalink,'?lp-variation-id'))
65
  {
@@ -67,25 +67,25 @@ function lp_ab_stats_metabox() {
67
  $permalink = $permalink[0];
68
  }
69
  $permalink = $permalink."?lp-variation-id=".$vid;
70
-
71
  $impressions = get_post_meta($post->ID,'lp-ab-variation-impressions-'.$vid, true);
72
  $conversions = get_post_meta($post->ID,'lp-ab-variation-conversions-'.$vid, true);
73
-
74
-
75
- (is_numeric($impressions)) ? $impressions = $impressions : $impressions = 0;
76
- (is_numeric($conversions)) ? $conversions = $conversions : $conversions = 0;
77
-
78
  if ($impressions>0)
79
  {
80
  $conversion_rate = $conversions / $impressions;
81
- (($conversions===0)) ? $sign = "" : $sign = "%";
82
- $conversion_rate = round($conversion_rate,2) * 100 . $sign;
83
  }
84
  else
85
  {
86
  $conversion_rate = 0;
87
  }
88
-
89
  if ($key==0)
90
  {
91
  $title = get_post_meta($post->ID,'lp-main-headline', true);
@@ -94,14 +94,14 @@ function lp_ab_stats_metabox() {
94
  {
95
  $title = get_post_meta($post->ID,'lp-main-headline-'.$vid, true);
96
  }
97
-
98
  //determine letter from key
99
  ?>
100
 
101
  <div id="lp-variation-<?php echo lp_ab_key_to_letter($key); ?>" class="bab-variation-row <?php echo $variation_status_class;?>" >
102
  <div class='bab-varation-header'>
103
  <span class='bab-variation-name'>Variation <span class='bab-stat-letter'><?php echo lp_ab_key_to_letter($vid); ?></span>
104
- <?php
105
  if($variation_status!=1)
106
  {
107
  ?>
@@ -109,12 +109,12 @@ function lp_ab_stats_metabox() {
109
  <?php
110
  }
111
  ?>
112
- </span>
113
-
114
-
115
  <span class="lp-delete-var-stats" data-letter='<?php echo lp_ab_key_to_letter($vid); ?>' data-vid='<?php echo $vid; ?>' rel='<?php echo $post->ID;?>' title="Delete this variations stats">Clear Stats</span>
116
  </div>
117
- <div class="bab-stat-row">
118
  <div class='bab-stat-stats' colspan='2'>
119
  <div class='bab-stat-container-impressions bab-number-box'>
120
  <span class='bab-stat-span-impressions'><?php echo $impressions; ?></span>
@@ -134,29 +134,29 @@ function lp_ab_stats_metabox() {
134
  <span class='bab-stat-menu-edit'><a title="Edit this variation" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>'>Edit</a></span> <span class='bab-stat-seperator'>|</span>
135
  <span class='bab-stat-menu-preview'><a title="Preview this variation" class='thickbox' href='<?php echo $permalink; ?>&iframe_window=on&post_id=<?php echo $post->ID;?>&TB_iframe=true&width=1503&height=467' target='_blank'>Preview</a></span> <span class='bab-stat-seperator'>|</span>
136
  <span class='bab-stat-menu-clone'><a title="Clone this variation" href='?post=<?php echo $post->ID; ?>&action=edit&new-variation=1&clone=<?php echo $vid; ?>&new_meta_key=<?php echo $howmany; ?>'>Clone</a></span> <span class='bab-stat-seperator'>|</span>
137
- <span class='bab-stat-control-delete'><a title="Delete this variation" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=delete-variation'>Delete</a></span>
138
  </div>
139
  </div>
140
  </div>
141
- <div class="bab-stat-row">
142
-
143
  <div class='bab-stat-menu-container'>
144
-
145
- <?php do_action('lp_ab_testing_stats_menu_post'); ?>
146
-
147
  </div>
148
  </div>
149
  </div>
150
  <?php
151
-
152
  }
153
  ?>
154
  </div>
155
-
156
- </div>
157
  </div>
158
  <?php
159
- }
160
 
161
  //print out tabs
162
  add_action('edit_form_after_title','lp_ab_testing_add_tabs', 5);
@@ -165,24 +165,24 @@ function lp_ab_testing_add_tabs()
165
  global $post;
166
  $post_type_is = get_post_type($post->ID);
167
  $permalink = get_permalink($post->ID);
168
-
169
  // Only show lp tabs on landing pages post types (for now)
170
- if ($post_type_is === "landing-page")
171
  {
172
  $current_variation_id = lp_ab_testing_get_current_variation_id();
173
  if (isset($_GET['new_meta_key']))
174
  $current_variation_id = $_GET['new_meta_key'];
175
-
176
  echo "<input type='hidden' id='open_variation' value='{$current_variation_id}'>";
177
-
178
  $variations = get_post_meta($post->ID,'lp-ab-variations', true);
179
  $array_variations = explode(',',$variations);
180
  $variations = array_filter($array_variations,'is_numeric');
181
  sort($array_variations,SORT_NUMERIC);
182
-
183
  $lid = end($array_variations);
184
  $new_variation_id = $lid+1;
185
-
186
  if ($current_variation_id>0||isset($_GET['new-variation']))
187
  {
188
  $first_class = 'inactive';
@@ -191,21 +191,21 @@ function lp_ab_testing_add_tabs()
191
  {
192
  $first_class = 'active';
193
  }
194
-
195
  echo '<h2 class="nav-tab-wrapper a_b_tabs">';
196
- echo '<a href="?post='.$post->ID.'&lp-variation-id=0&action=edit" class="lp-ab-tab nav-tab nav-tab-special-'.$first_class.'" id="tabs-0">A</a>';
197
 
198
  $var_id_marker = 1;
199
 
200
-
201
  foreach ($array_variations as $i => $vid)
202
  {
203
-
204
  if ($vid!=0)
205
  {
206
  $letter = lp_ab_key_to_letter($vid);
207
-
208
- //alert (variation.new_variation);
209
  if ($current_variation_id==$vid&&!isset($_GET['new-variation']))
210
  {
211
  $cur_class = 'active';
@@ -215,10 +215,10 @@ function lp_ab_testing_add_tabs()
215
  $cur_class = 'inactive';
216
  }
217
  echo '<a href="?post='.$post->ID.'&lp-variation-id='.$vid.'&action=edit" class="lp-nav-tab nav-tab nav-tab-special-'.$cur_class.'" id="tabs-add-variation">'.$letter.'</a>';
218
-
219
- }
220
- }
221
-
222
  if (!isset($_GET['new-variation']))
223
  {
224
  echo '<a href="?post='.$post->ID.'&lp-variation-id='.$new_variation_id.'&action=edit&new-variation=1" class="lp-nav-tab nav-tab nav-tab-special-inactive nav-tab-add-new-variation" id="tabs-add-variation">Add New Variation</a>';
@@ -234,6 +234,6 @@ function lp_ab_testing_add_tabs()
234
  $post_link = preg_replace('/\?.*/', '', $post_link);
235
  echo "<a rel='".$post_link."' id='launch-visual-editer' class='button-primary new-save-lp-frontend' href='$post_link$edit_link&template-customize=on'>Launch Visual Editor</a>";
236
  echo '</h2>';
237
- }
238
-
239
  }
3
  add_action('add_meta_boxes', 'lp_ab_display_stats_metabox');
4
  function lp_ab_display_stats_metabox() {
5
 
6
+ add_meta_box(
7
+ 'lp_ab_display_stats_metabox',
8
  __( 'A/B Testing', 'bab' ),
9
  'lp_ab_stats_metabox',
10
+ 'landing-page' ,
11
+ 'side',
12
  'high' );
13
  }
14
 
20
  ?>
21
  <div>
22
  <style type="text/css">
23
+
24
  </style>
25
+ <div class="inside" style='margin-left:-8px;'>
26
  <div id="bab-stat-box">
27
  <?php if (isset($_GET['new_meta_key'])) { ?>
28
  <script type="text/javascript">
56
  {
57
  if (!is_numeric($vid)&&$key==0)
58
  $vid = 0;
59
+
60
  $variation_status = lp_ab_get_lp_active_status($post,$vid);
61
  $variation_status_class = ($variation_status ==1) ? "variation-on" : 'variation-off';
62
+
63
  $permalink = get_permalink($post->ID);
64
  if (strstr($permalink,'?lp-variation-id'))
65
  {
67
  $permalink = $permalink[0];
68
  }
69
  $permalink = $permalink."?lp-variation-id=".$vid;
70
+
71
  $impressions = get_post_meta($post->ID,'lp-ab-variation-impressions-'.$vid, true);
72
  $conversions = get_post_meta($post->ID,'lp-ab-variation-conversions-'.$vid, true);
73
+
74
+
75
+ (is_numeric($impressions)) ? $impressions = $impressions : $impressions = 0;
76
+ (is_numeric($conversions)) ? $conversions = $conversions : $conversions = 0;
77
+
78
  if ($impressions>0)
79
  {
80
  $conversion_rate = $conversions / $impressions;
81
+ (($conversions===0)) ? $sign = "" : $sign = "%";
82
+ $conversion_rate = round($conversion_rate,2) * 100 . $sign;
83
  }
84
  else
85
  {
86
  $conversion_rate = 0;
87
  }
88
+
89
  if ($key==0)
90
  {
91
  $title = get_post_meta($post->ID,'lp-main-headline', true);
94
  {
95
  $title = get_post_meta($post->ID,'lp-main-headline-'.$vid, true);
96
  }
97
+
98
  //determine letter from key
99
  ?>
100
 
101
  <div id="lp-variation-<?php echo lp_ab_key_to_letter($key); ?>" class="bab-variation-row <?php echo $variation_status_class;?>" >
102
  <div class='bab-varation-header'>
103
  <span class='bab-variation-name'>Variation <span class='bab-stat-letter'><?php echo lp_ab_key_to_letter($vid); ?></span>
104
+ <?php
105
  if($variation_status!=1)
106
  {
107
  ?>
109
  <?php
110
  }
111
  ?>
112
+ </span>
113
+
114
+
115
  <span class="lp-delete-var-stats" data-letter='<?php echo lp_ab_key_to_letter($vid); ?>' data-vid='<?php echo $vid; ?>' rel='<?php echo $post->ID;?>' title="Delete this variations stats">Clear Stats</span>
116
  </div>
117
+ <div class="bab-stat-row">
118
  <div class='bab-stat-stats' colspan='2'>
119
  <div class='bab-stat-container-impressions bab-number-box'>
120
  <span class='bab-stat-span-impressions'><?php echo $impressions; ?></span>
134
  <span class='bab-stat-menu-edit'><a title="Edit this variation" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>'>Edit</a></span> <span class='bab-stat-seperator'>|</span>
135
  <span class='bab-stat-menu-preview'><a title="Preview this variation" class='thickbox' href='<?php echo $permalink; ?>&iframe_window=on&post_id=<?php echo $post->ID;?>&TB_iframe=true&width=1503&height=467' target='_blank'>Preview</a></span> <span class='bab-stat-seperator'>|</span>
136
  <span class='bab-stat-menu-clone'><a title="Clone this variation" href='?post=<?php echo $post->ID; ?>&action=edit&new-variation=1&clone=<?php echo $vid; ?>&new_meta_key=<?php echo $howmany; ?>'>Clone</a></span> <span class='bab-stat-seperator'>|</span>
137
+ <span class='bab-stat-control-delete'><a title="Delete this variation" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=delete-variation'>Delete</a></span>
138
  </div>
139
  </div>
140
  </div>
141
+ <div class="bab-stat-row">
142
+
143
  <div class='bab-stat-menu-container'>
144
+
145
+ <?php do_action('lp_ab_testing_stats_menu_post'); ?>
146
+
147
  </div>
148
  </div>
149
  </div>
150
  <?php
151
+
152
  }
153
  ?>
154
  </div>
155
+
156
+ </div>
157
  </div>
158
  <?php
159
+ }
160
 
161
  //print out tabs
162
  add_action('edit_form_after_title','lp_ab_testing_add_tabs', 5);
165
  global $post;
166
  $post_type_is = get_post_type($post->ID);
167
  $permalink = get_permalink($post->ID);
168
+
169
  // Only show lp tabs on landing pages post types (for now)
170
+ if ($post_type_is === "landing-page")
171
  {
172
  $current_variation_id = lp_ab_testing_get_current_variation_id();
173
  if (isset($_GET['new_meta_key']))
174
  $current_variation_id = $_GET['new_meta_key'];
175
+
176
  echo "<input type='hidden' id='open_variation' value='{$current_variation_id}'>";
177
+
178
  $variations = get_post_meta($post->ID,'lp-ab-variations', true);
179
  $array_variations = explode(',',$variations);
180
  $variations = array_filter($array_variations,'is_numeric');
181
  sort($array_variations,SORT_NUMERIC);
182
+
183
  $lid = end($array_variations);
184
  $new_variation_id = $lid+1;
185
+
186
  if ($current_variation_id>0||isset($_GET['new-variation']))
187
  {
188
  $first_class = 'inactive';
191
  {
192
  $first_class = 'active';
193
  }
194
+
195
  echo '<h2 class="nav-tab-wrapper a_b_tabs">';
196
+ echo '<a href="?post='.$post->ID.'&lp-variation-id=0&action=edit" class="lp-ab-tab nav-tab nav-tab-special-'.$first_class.'" id="tabs-0">A</a>';
197
 
198
  $var_id_marker = 1;
199
 
200
+
201
  foreach ($array_variations as $i => $vid)
202
  {
203
+
204
  if ($vid!=0)
205
  {
206
  $letter = lp_ab_key_to_letter($vid);
207
+
208
+ //alert (variation.new_variation);
209
  if ($current_variation_id==$vid&&!isset($_GET['new-variation']))
210
  {
211
  $cur_class = 'active';
215
  $cur_class = 'inactive';
216
  }
217
  echo '<a href="?post='.$post->ID.'&lp-variation-id='.$vid.'&action=edit" class="lp-nav-tab nav-tab nav-tab-special-'.$cur_class.'" id="tabs-add-variation">'.$letter.'</a>';
218
+
219
+ }
220
+ }
221
+
222
  if (!isset($_GET['new-variation']))
223
  {
224
  echo '<a href="?post='.$post->ID.'&lp-variation-id='.$new_variation_id.'&action=edit&new-variation=1" class="lp-nav-tab nav-tab nav-tab-special-inactive nav-tab-add-new-variation" id="tabs-add-variation">Add New Variation</a>';
234
  $post_link = preg_replace('/\?.*/', '', $post_link);
235
  echo "<a rel='".$post_link."' id='launch-visual-editer' class='button-primary new-save-lp-frontend' href='$post_link$edit_link&template-customize=on'>Launch Visual Editor</a>";
236
  echo '</h2>';
237
+ }
238
+
239
  }
modules/module.metaboxes.php CHANGED
@@ -157,6 +157,10 @@ function lp_landing_page_header_area()
157
  $variation_notes = apply_filters('lp_edit_variation_notes', $variation_notes, 1);
158
  $variation_id = apply_filters( 'lp_display_notes_input_id' , 'lp-variation-notes' );
159
 
 
 
 
 
160
  echo "<div id='lp-notes-area'>";
161
  echo "<span id='add-lp-notes'>". __('Notes' , LANDINGPAGES_TEXT_DOMAIN) .":</span><input placeholder='". __('Add Notes to your variation. Example: This version is testing a green submit button ' , LANDINGPAGES_TEXT_DOMAIN) ."' type='text' class='lp-notes' name='{$variation_id}' id='{$variation_id}' value='{$variation_notes}' size='30'>";
162
  echo '</div><div id="main-title-area"><input type="text" name="lp-main-headline" placeholder="'. __('Primary Headline Goes here. This will be visible on the page' , LANDINGPAGES_TEXT_DOMAIN) .'" id="lp-main-headline" value="'.$main_title.'" title="'. __('This headline will appear in the landing page template.' , LANDINGPAGES_TEXT_DOMAIN) .'"></div><div id="lp-current-view">'.$lp_variation.'</div><div id="switch-lp">0</div>';
@@ -350,7 +354,7 @@ function lp_display_meta_box_select_template_container() {
350
  <p>
351
  <div id="template-title"><?php echo $data['info']['label']; ?></div>
352
  <a href='#' label='<?php echo $data['info']['label']; ?>' id='<?php echo $this_extension; ?>' class='lp_select_template'><?php _e( 'Select' , LANDINGPAGES_TEXT_DOMAIN); ?> </a> |
353
- <a class='thickbox <?php echo $cat_slug;?>' href='<?php echo $data['info']['demo'];?>' id='lp_preview_this_template'><?php _e( 'Preview' , LANDINGPAGES_TEXT_DOMAIN); ?></a>
354
  </p>
355
  </div>
356
  </div>
@@ -496,6 +500,24 @@ function lp_conversion_log_metabox() {
496
 
497
  $final_data[] = $this_data;
498
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  }
500
  //print_r($final_data);
501
  $this->table_data = $final_data;
157
  $variation_notes = apply_filters('lp_edit_variation_notes', $variation_notes, 1);
158
  $variation_id = apply_filters( 'lp_display_notes_input_id' , 'lp-variation-notes' );
159
 
160
+ $page_conversion_data = get_post_meta( $post->ID, 'inbound_conversion_data', TRUE );
161
+ $page_conversion_data = json_decode($page_conversion_data,true);
162
+ //print_r($page_conversion_data);
163
+ //echo "TEST";
164
  echo "<div id='lp-notes-area'>";
165
  echo "<span id='add-lp-notes'>". __('Notes' , LANDINGPAGES_TEXT_DOMAIN) .":</span><input placeholder='". __('Add Notes to your variation. Example: This version is testing a green submit button ' , LANDINGPAGES_TEXT_DOMAIN) ."' type='text' class='lp-notes' name='{$variation_id}' id='{$variation_id}' value='{$variation_notes}' size='30'>";
166
  echo '</div><div id="main-title-area"><input type="text" name="lp-main-headline" placeholder="'. __('Primary Headline Goes here. This will be visible on the page' , LANDINGPAGES_TEXT_DOMAIN) .'" id="lp-main-headline" value="'.$main_title.'" title="'. __('This headline will appear in the landing page template.' , LANDINGPAGES_TEXT_DOMAIN) .'"></div><div id="lp-current-view">'.$lp_variation.'</div><div id="switch-lp">0</div>';
354
  <p>
355
  <div id="template-title"><?php echo $data['info']['label']; ?></div>
356
  <a href='#' label='<?php echo $data['info']['label']; ?>' id='<?php echo $this_extension; ?>' class='lp_select_template'><?php _e( 'Select' , LANDINGPAGES_TEXT_DOMAIN); ?> </a> |
357
+ <a class='thickbox <?php echo $cat_slug;?>' href='<?php echo $demo_link;?>' id='lp_preview_this_template'><?php _e( 'Preview' , LANDINGPAGES_TEXT_DOMAIN); ?></a>
358
  </p>
359
  </div>
360
  </div>
500
 
501
  $final_data[] = $this_data;
502
  }
503
+ /* Port Old Conversion Logs to new inbound_conversion_data. Not Finished
504
+ $page_conversion_data = get_post_meta( $post->ID, 'inbound_conversion_data', TRUE );
505
+ $page_conversion_data = json_decode($page_conversion_data,true);
506
+ $version = '0';
507
+ if (is_array($page_conversion_data)){
508
+ $convert_count = count($page_conversion_data) + 1;
509
+ $page_conversion_data[$convert_count]['lead_id'] = $row['ID'];
510
+ $page_conversion_data[$convert_count]['variation'] = $version;
511
+ $page_conversion_data[$convert_count]['datetime'] = $datetime;
512
+ } else {
513
+ $convert_count = 1;
514
+ $page_conversion_data[$convert_count]['lead_id'] = $row['ID'];
515
+ $page_conversion_data[$convert_count]['variation'] = $version;
516
+ $page_conversion_data[$convert_count]['datetime'] = $datetime;
517
+ }
518
+ $page_conversion_data = json_encode($page_conversion_data);
519
+ update_post_meta($post->ID, 'inbound_conversion_data', $page_conversion_data);
520
+ */
521
  }
522
  //print_r($final_data);
523
  $this->table_data = $final_data;
readme.txt CHANGED
@@ -5,9 +5,9 @@ Donate link: mailto:marketplace@inboundnow.com
5
  License: GPLv2 or later
6
  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.7
9
- Tested up to: 3.8
10
- Stable Tag: 1.3.8
11
 
12
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
13
 
@@ -69,6 +69,11 @@ The plugin is also fully extendable and has a number of <a href='http://docs.inb
69
 
70
  == Changelog ==
71
 
 
 
 
 
 
72
  = 1.3.8 =
73
  * Updated styles to 3.8 wordpress
74
  * Streamlined form creation
5
  License: GPLv2 or later
6
  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.6
9
+ Tested up to: 3.7.1
10
+ Stable Tag: 1.3.9
11
 
12
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
13
 
69
 
70
  == Changelog ==
71
 
72
+ = 1.3.9 =
73
+ * Bug fixes for form creation issues
74
+ * Bug fixes for safari page tracking not firing
75
+ * Added quick menu to WP admin bar for quicker marketing!
76
+
77
  = 1.3.8 =
78
  * Updated styles to 3.8 wordpress
79
  * Streamlined form creation
shared/classes/menu.class.php ADDED
@@ -0,0 +1,728 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Inbound Now Menu Class */
3
+ if ( ! defined( 'LANDINGPAGES_TEXT_DOMAIN' ) ) {
4
+ define('LANDINGPAGES_TEXT_DOMAIN', 'landing-pages' );
5
+ }
6
+ if (!class_exists('InboundMenu')) {
7
+ class InboundMenu {
8
+ static $add_menu;
9
+
10
+ /* Contruct
11
+ * --------------------------------------------------------- */
12
+ static function init() {
13
+ self::$add_menu = true;
14
+
15
+ add_action('admin_bar_menu', array( __CLASS__, 'loads' ), 98);
16
+ add_action( 'wp_head', array(__CLASS__, 'menu_admin_head'));
17
+ add_action( 'admin_head', array(__CLASS__, 'menu_admin_head'));
18
+ }
19
+
20
+ /* Loads
21
+ * --------------------------------------------------------- */
22
+ static function loads($hook) {
23
+ if ( ! self::$add_menu )
24
+ return;
25
+ global $wp_admin_bar, $locale, $edd_options, $eddtb_edd_name, $eddtb_edd_name_tooltip;
26
+
27
+ /** Get the proper 'Download' post type ID/tag */
28
+ if ( post_type_exists( 'landing-page' ) ) {
29
+ $eddtb_download_cpt = 'landing-page';
30
+ } elseif ( post_type_exists( 'landing-page' ) ) {
31
+ $eddtb_download_cpt = 'landing-page';
32
+ } else {
33
+ $eddtb_download_cpt = '';
34
+ }
35
+
36
+ // CHECK FOR ACTIVE PLUGINS
37
+ $leads_status = FALSE; $landing_page_status = FALSE; $cta_status = FALSE;
38
+ if (function_exists( 'is_plugin_active' ) && is_plugin_active('leads/wordpress-leads.php')) {
39
+ $leads_status = TRUE;
40
+ $leads_version_number = defined( 'LEADS_CURRENT_VERSION' ) ? 'v' . LEADS_CURRENT_VERSION : '';
41
+ }
42
+ if (function_exists( 'is_plugin_active' ) && is_plugin_active('landing-pages/landing-pages.php')) {
43
+ $landing_page_status = TRUE;
44
+ $landing_page_version_number = defined( 'LANDINGPAGES_CURRENT_VERSION' ) ? 'v' . LANDINGPAGES_CURRENT_VERSION : '';
45
+
46
+ }
47
+ if (function_exists( 'is_plugin_active' ) && is_plugin_active('cta/wordpress-cta.php')) {
48
+ $cta_status = TRUE;
49
+ $cta_number = defined( 'WP_CTA_CURRENT_VERSION' ) ? 'v' . WP_CTA_CURRENT_VERSION : '';
50
+ }
51
+
52
+ if ( $leads_status == FALSE && $landing_page_status == FALSE && $cta_status == FALSE ) {
53
+
54
+ return; // end plugin is
55
+
56
+ }
57
+ /** EDD version number for later use */
58
+ $edd_version_number = defined( 'EDD_VERSION' ) ? 'v' . EDD_VERSION : '';
59
+
60
+ /** Resources links EDD settings check*/
61
+ $eddtb_resources_check = 'default';
62
+
63
+ if ( ( ! isset( $edd_options['eddtb_remove_resources'] ) && ! isset( $edd_options['eddtb_remove_translation_resources'] ) )
64
+ || ( isset( $edd_options['eddtb_remove_resources'] ) && ! isset( $edd_options['eddtb_remove_translation_resources'] ) )
65
+ || ( ! isset( $edd_options['eddtb_remove_resources'] ) && isset( $edd_options['eddtb_remove_translation_resources'] ) )
66
+
67
+ ) {
68
+
69
+ $eddtb_resources_check = 'eddtb_resources_yes';
70
+
71
+ } // end-if resources settings check
72
+
73
+
74
+ /**
75
+ * Allows for filtering the general user role/capability to display main & sub-level items
76
+ *
77
+ * Default capability: 'edit_posts' (we need this for the "Downloads" post type set by EDD itself!)
78
+ *
79
+ * @since 1.0.0
80
+ */
81
+ $eddtb_cap_default = class_exists( 'EDD_Roles' ) ? 'edit_products' : 'edit_posts';
82
+ $eddtb_filter_capability = apply_filters( 'eddtb_filter_capability_all', $eddtb_cap_default );
83
+
84
+ // Exit if admin bar not there
85
+ if ( ! is_user_logged_in() || ! is_admin_bar_showing() ) {
86
+ return;
87
+ }
88
+
89
+ /** Set unique prefix */
90
+ $prefix = 'inbound-';
91
+ /** Create parent menu item references */
92
+ $inbounddocs = $prefix . 'inbounddocs'; // sub level: edd docs
93
+ $inbounddocsquick = $prefix . 'inbounddocsquick'; // third level: docs quick links
94
+ $inbounddocssections = $prefix . 'inbounddocssections'; // third level: docs sections
95
+ $inboundreports = $prefix . 'inboundreports'; // sub level: edd reports
96
+ $inboundgroup = $prefix . 'inboundgroup'; // sub level: edd group (resources)
97
+ $inboundbar = $prefix . 'admin-bar'; // root level
98
+ $inboundsupport = $prefix . 'inboundsupport'; // sub level: edd support
99
+ $inboundsupportsections = $prefix . 'inboundsupportsections'; // third level: support sections
100
+ $inboundsupportaccount = $prefix . 'inboundsupportaccount'; // third level: support user account
101
+ $inboundsites = $prefix . 'inboundsites'; // sub level: edd sites
102
+ $inboundsitesaccount = $prefix . 'inboundsitesaccount';
103
+ $inboundsitesextensions = $prefix . 'inboundsitesextensions'; // third level: edd extensions
104
+ $landingpages_menu = $prefix . 'landingpages';
105
+ $cta_menu = $prefix . 'cta';
106
+ $leads_menu = $prefix . 'leads';
107
+ $form_menu = $prefix . 'inboundforms';
108
+ $settings_menu = $prefix . 'inboundsettings';
109
+ $templates_menu = $prefix . 'inboundtemplates';
110
+ $landingpagesettings = $prefix . 'landingpagesettings';
111
+ $ctasettings = $prefix . 'ctasettings';
112
+ $landing_pages_templates = $prefix . 'landingpagetemplates';
113
+ $cta_templates = $prefix . 'ctatemplates';
114
+
115
+ /** Make the "EDD" name filterable within menu items */
116
+ $eddtb_edd_name = apply_filters( 'eddtb_filter_edd_name', __( 'EDD', 'edd-toolbar' ) );
117
+
118
+ /** Make the "Easy Digital Downloads" name's tooltip filterable within menu items */
119
+ $eddtb_edd_name_tooltip = apply_filters( 'eddtb_filter_edd_name_tooltip', _x( 'Easy Digital Downloads', 'Translators: For the tooltip', 'edd-toolbar' ) );
120
+
121
+
122
+ /** "Sub Forum" string */
123
+ $eddtb_sub_forum = __( 'Sub Forum', 'edd-toolbar' ) . ': ';
124
+
125
+ /** For the Documentation search */
126
+ $eddtb_search_docs = __( 'Search Docs', 'edd-toolbar' );
127
+ $eddtb_go_button = '<input type="submit" value="' . __( 'GO', 'edd-toolbar' ) . '" class="eddtb-search-go" /></form>';
128
+
129
+ /** Show these items only if Inbound Now plugin is actually installed */
130
+ if ( $leads_status == TRUE || $landing_page_status == TRUE || $cta_status == TRUE ) {
131
+
132
+ /** Set EDD active variable for later user */
133
+ $edd_active = 'edd_is_active';
134
+
135
+ /** EDD main downloads section */
136
+ if ( current_user_can( 'edit_posts' ) && $landing_page_status) {
137
+
138
+ $menu_items['landingpages'] = array(
139
+ 'parent' => $inboundbar,
140
+ 'title' => __( 'Landing Pages', LANDINGPAGES_TEXT_DOMAIN ),
141
+ 'href' => admin_url( 'edit.php?post_type=landing-page' ),
142
+ 'meta' => array( 'target' => '', 'title' => __( 'View All Landing Pages', 'edd-toolbar' ) )
143
+ );
144
+ $menu_items['landingpages-view'] = array(
145
+ 'parent' => $landingpages_menu,
146
+ 'title' => __( 'View Landing Pages List', LANDINGPAGES_TEXT_DOMAIN ),
147
+ 'href' => admin_url( 'edit.php?post_type=landing-page' ),
148
+ 'meta' => array( 'target' => '', 'title' => __( 'View All Landing Pages', 'edd-toolbar' ) )
149
+ );
150
+ $menu_items['landingpages-add'] = array(
151
+ 'parent' => $landingpages_menu,
152
+ 'title' => __( 'Add New Landing Page', LANDINGPAGES_TEXT_DOMAIN ),
153
+ 'href' => admin_url( 'post-new.php?post_type=landing-page' ),
154
+ 'meta' => array( 'target' => '', 'title' => __( 'Add new Landing Page', 'edd-toolbar' ) )
155
+ );
156
+
157
+ $menu_items['landingpages-categories'] = array(
158
+ 'parent' => $landingpages_menu,
159
+ 'title' => __( 'Categories', LANDINGPAGES_TEXT_DOMAIN ),
160
+ 'href' => admin_url( 'edit-tags.php?taxonomy=landing_page_category&post_type=landing-page' ),
161
+ 'meta' => array( 'target' => '', 'title' => __( 'Landing Page Categories', 'edd-toolbar' ) )
162
+ );
163
+ if ( current_user_can( 'manage_options' )) {
164
+ $menu_items['landingpages-settings'] = array(
165
+ 'parent' => $landingpages_menu,
166
+ 'title' => __( 'Settings', LANDINGPAGES_TEXT_DOMAIN ),
167
+ 'href' => admin_url( 'edit.php?post_type=landing-page&page=lp_global_settings' ),
168
+ 'meta' => array( 'target' => '', 'title' => __( 'Manage Landing Page Settings', 'edd-toolbar' ) )
169
+ );
170
+ }
171
+ //
172
+ }
173
+
174
+ /** EDD main downloads section */
175
+ if ( current_user_can( 'edit_posts' ) && $cta_status) {
176
+
177
+ $menu_items['cta'] = array(
178
+ 'parent' => $inboundbar,
179
+ 'title' => __( 'Call to Actions', LANDINGPAGES_TEXT_DOMAIN ),
180
+ 'href' => admin_url( 'edit.php?post_type=wp-call-to-action' ),
181
+ 'meta' => array( 'target' => '', 'title' => __( 'View All Landing Pages', 'edd-toolbar' ) )
182
+ );
183
+ $menu_items['cta-view'] = array(
184
+ 'parent' => $cta_menu,
185
+ 'title' => __( 'View Calls to Action List', LANDINGPAGES_TEXT_DOMAIN ),
186
+ 'href' => admin_url( 'post-new.php?post_type=wp-call-to-action' ),
187
+ 'meta' => array( 'target' => '', 'title' => __( 'View All Landing Pages', 'edd-toolbar' ) )
188
+ );
189
+ $menu_items['cta-add'] = array(
190
+ 'parent' => $cta_menu,
191
+ 'title' => __( 'Add New Call to Action', LANDINGPAGES_TEXT_DOMAIN ),
192
+ 'href' => admin_url( 'post-new.php?post_type=wp-call-to-action' ),
193
+ 'meta' => array( 'target' => '', 'title' => __( 'Add new call to action', 'edd-toolbar' ) )
194
+ );
195
+
196
+ $menu_items['cta-categories'] = array(
197
+ 'parent' => $cta_menu,
198
+ 'title' => __( 'Categories', LANDINGPAGES_TEXT_DOMAIN ),
199
+ 'href' => admin_url( 'edit-tags.php?taxonomy=wp_call_to_action_category&post_type=wp-call-to-action' ),
200
+ 'meta' => array( 'target' => '', 'title' => __( 'Landing Page Categories', 'edd-toolbar' ) )
201
+ );
202
+ if ( current_user_can( 'manage_options' )) {
203
+ $menu_items['cta-settings'] = array(
204
+ 'parent' => $cta_menu,
205
+ 'title' => __( 'Settings', LANDINGPAGES_TEXT_DOMAIN ),
206
+ 'href' => admin_url( 'edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings' ),
207
+ 'meta' => array( 'target' => '', 'title' => __( 'Manage Call to Action Settings', 'edd-toolbar' ) )
208
+ );
209
+ }
210
+
211
+ }
212
+
213
+ /** admin settings sections */
214
+ if ( current_user_can( 'manage_options' )) {
215
+ // Leads Menu
216
+ if ($leads_status) {
217
+ $menu_items['leads'] = array(
218
+ 'parent' => $inboundbar,
219
+ 'title' => __( 'Leads', 'edd-toolbar' ),
220
+ 'href' => admin_url( 'edit.php?post_type=inbound-forms' ),
221
+ 'meta' => array( 'target' => '', 'title' => _x( 'Manage Forms', 'edd-toolbar' ) )
222
+ );
223
+ $menu_items['leads-view'] = array(
224
+ 'parent' => $leads_menu,
225
+ 'title' => __( 'View All Leads', LANDINGPAGES_TEXT_DOMAIN ),
226
+ 'href' => admin_url( 'edit.php?post_type=wp-lead' ),
227
+ 'meta' => array( 'target' => '', 'title' => __( 'View All Forms', 'edd-toolbar' ) )
228
+ );
229
+ $menu_items['leads-add'] = array(
230
+ 'parent' => $leads_menu,
231
+ 'title' => __( 'Manually Create New Lead', LANDINGPAGES_TEXT_DOMAIN ),
232
+ 'href' => admin_url( 'post-new.php?post_type=wp-lead' ),
233
+ 'meta' => array( 'target' => '', 'title' => __( 'Add new lead', 'edd-toolbar' ) )
234
+ );
235
+ }
236
+
237
+
238
+ $menu_items['inboundforms'] = array(
239
+ 'parent' => $inboundbar,
240
+ 'title' => __( 'Manage Forms', 'edd-toolbar' ),
241
+ 'href' => admin_url( 'edit.php?post_type=inbound-forms' ),
242
+ 'meta' => array( 'target' => '', 'title' => _x( 'Manage Forms', 'edd-toolbar' ) )
243
+ );
244
+ $menu_items['inboundforms-view'] = array(
245
+ 'parent' => $form_menu,
246
+ 'title' => __( 'View All Forms', LANDINGPAGES_TEXT_DOMAIN ),
247
+ 'href' => admin_url( 'edit.php?post_type=inbound-forms' ),
248
+ 'meta' => array( 'target' => '', 'title' => __( 'View All Forms', 'edd-toolbar' ) )
249
+ );
250
+ $menu_items['inboundforms-add'] = array(
251
+ 'parent' => $form_menu,
252
+ 'title' => __( 'Create New Form', LANDINGPAGES_TEXT_DOMAIN ),
253
+ 'href' => admin_url( 'post-new.php?post_type=inbound-forms' ),
254
+ 'meta' => array( 'target' => '', 'title' => __( 'Add new call to action', 'edd-toolbar' ) )
255
+ );
256
+ /** Template Setup */
257
+ if ($landing_page_status || $cta_status) {
258
+
259
+ $menu_items['inboundtemplates'] = array(
260
+ 'parent' => $inboundbar,
261
+ 'title' => __( 'Manage Templates', 'edd-toolbar' ),
262
+ 'href' => "",
263
+ 'meta' => array( 'target' => '', 'title' => _x( 'Manage Templates', 'edd-toolbar' ) )
264
+ );
265
+ $menu_items['getmoretemplates'] = array(
266
+ 'parent' => $templates_menu,
267
+ 'title' => __( 'Download More Templates', 'edd-toolbar' ),
268
+ 'href' => "http://www.inboundnow.com/market",
269
+ 'meta' => array( 'target' => '', 'title' => __( 'Download More Templates', 'edd-toolbar' ) )
270
+ );
271
+ if ($landing_page_status){
272
+ $menu_items['landingpagetemplates'] = array(
273
+ 'parent' => $templates_menu,
274
+ 'title' => __( 'Landing Page Templates', 'edd-toolbar' ),
275
+ 'href' => admin_url( 'edit.php?post_type=landing-page&page=lp_manage_templates' ),
276
+ 'meta' => array( 'target' => '', 'title' => __( 'Landing Page Settings', 'edd-toolbar' ) )
277
+ );
278
+
279
+ $menu_items['landingpagetemplates-main'] = array(
280
+ 'parent' => $landing_pages_templates,
281
+ 'title' => __( 'Add New Landing Page Templates', 'edd-toolbar' ),
282
+ 'href' => admin_url( 'edit.php?post_type=landing-page&page=lp_manage_templates' ),
283
+ 'meta' => array( 'target' => '', 'title' => __( 'Global Settings', 'edd-toolbar' ) )
284
+ );
285
+ }
286
+ if ($cta_status){
287
+ $menu_items['ctatemplates'] = array(
288
+ 'parent' => $templates_menu,
289
+ 'title' => __( 'Call to Action Templates', 'edd-toolbar' ),
290
+ 'href' => admin_url( 'edit.php?post_type=wp-call-to-action&page=wp_cta_manage_templates' ),
291
+ 'meta' => array( 'target' => '', 'title' => __( 'Global Settings', 'edd-toolbar' ) )
292
+ );
293
+
294
+ $menu_items['ctatemplates-main'] = array(
295
+ 'parent' => $cta_templates,
296
+ 'title' => __( 'Add New CTA Templates', 'edd-toolbar' ),
297
+ 'href' => admin_url( 'edit.php?post_type=wp-call-to-action&page=wp_cta_manage_templates' ),
298
+ 'meta' => array( 'target' => '', 'title' => __( 'Global Settings', 'edd-toolbar' ) )
299
+ );
300
+ }
301
+
302
+ }
303
+ /** Settings Items */
304
+ $menu_items['inboundsettings'] = array(
305
+ 'parent' => $inboundbar,
306
+ 'title' => __( 'Global Settings', 'edd-toolbar' ),
307
+ 'href' => "",
308
+ 'meta' => array( 'target' => '', 'title' => _x( 'Manage Settings', 'edd-toolbar' ) )
309
+ );
310
+ if ($landing_page_status){
311
+ $menu_items['landingpagesettings'] = array(
312
+ 'parent' => $settings_menu,
313
+ 'title' => __( 'Landing Page Settings', 'edd-toolbar' ),
314
+ 'href' => admin_url( 'edit.php?post_type=landing-page&page=lp_global_settings' ),
315
+ 'meta' => array( 'target' => '', 'title' => __( 'Landing Page Settings', 'edd-toolbar' ) )
316
+ );
317
+ /*
318
+ $menu_items['landingpagesettings-main'] = array(
319
+ 'parent' => $landingpagesettings,
320
+ 'title' => __( 'Main', 'edd-toolbar' ),
321
+ 'href' => admin_url( 'edit.php?post_type=landing-page&page=lp_global_settings' ),
322
+ 'meta' => array( 'target' => '', 'title' => __( 'Global Settings', 'edd-toolbar' ) )
323
+ ); */
324
+ }
325
+ if ($cta_status){
326
+ $menu_items['ctasettings'] = array(
327
+ 'parent' => $settings_menu,
328
+ 'title' => __( 'Call to Action Settings', 'edd-toolbar' ),
329
+ 'href' => admin_url( 'edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings' ),
330
+ 'meta' => array( 'target' => '', 'title' => __( 'Call to Action Settings', 'edd-toolbar' ) )
331
+ );
332
+ /*
333
+ $menu_items['ctasettings-main'] = array(
334
+ 'parent' => $ctasettings,
335
+ 'title' => __( 'Main', 'edd-toolbar' ),
336
+ 'href' => admin_url( 'edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings' ),
337
+ 'meta' => array( 'target' => '', 'title' => __( 'Global Settings', 'edd-toolbar' ) )
338
+ ); */
339
+ }
340
+ if ($leads_status){
341
+ $menu_items['leadssettings'] = array(
342
+ 'parent' => $settings_menu,
343
+ 'title' => __( 'Lead Settings', 'edd-toolbar' ),
344
+ 'href' => admin_url( 'edit.php?post_type=wp-lead&page=wpleads_global_settings' ),
345
+ 'meta' => array( 'target' => '', 'title' => __( 'Lead Settings', 'edd-toolbar' ) )
346
+ );
347
+ }
348
+
349
+ $menu_items['inboundreports'] = array(
350
+ 'parent' => $inboundbar,
351
+ 'title' => __( 'Analytics (coming soon)', 'edd-toolbar' ),
352
+ 'href' => '#',
353
+ 'meta' => array( 'target' => '', 'title' => __( 'Analytics (coming soon)', 'edd-toolbar' ) )
354
+ );
355
+
356
+ if (function_exists( 'is_plugin_active' ) && is_plugin_active('wordpress-seo/wp-seo.php')) {
357
+ $menu_items['inboundseo'] = array(
358
+ 'parent' => $inboundbar,
359
+ 'title' => __( 'SEO by Yoast', 'edd-toolbar' ),
360
+ 'href' => admin_url( 'admin.php?page=wpseo_dashboard' ),
361
+ 'meta' => array( 'target' => '', 'title' => __( 'Manage SEO Settings', 'edd-toolbar' ) )
362
+ );
363
+ }
364
+
365
+ $inboundsecondary_menu_items['inboundsupport'] = array(
366
+ 'parent' => $inboundgroup,
367
+ 'title' => __( 'Support Forum', 'edd-toolbar' ),
368
+ 'href' => 'https://www.inboundnow.com/support/',
369
+ 'meta' => array( 'target' => '_blank' , 'title' => __( 'Support Forum', 'edd-toolbar' ) )
370
+ );
371
+
372
+ /** Documentation menu items */
373
+ $inboundsecondary_menu_items['inbounddocs'] = array(
374
+ 'parent' => $inboundgroup,
375
+ 'title' => __( 'Documentation', 'edd-toolbar' ),
376
+ 'href' => 'http://docs.inboundnow.com/',
377
+ 'meta' => array( 'title' => __( 'Documentation', 'edd-toolbar' ) )
378
+ );
379
+
380
+ /** Docs search form */
381
+ $inboundsecondary_menu_items['inbounddocs-searchform'] = array(
382
+ 'parent' => $inboundgroup,
383
+ 'title' => '<form method="get" action="http://www.inboundnow.com/support/search/?action=bbp-search-request" class=" " target="_blank">
384
+ <input type="text" placeholder="' . $eddtb_search_docs . '" onblur="this.value=(this.value==\'\') ? \'' . $eddtb_search_docs . '\' : this.value;" onfocus="this.value=(this.value==\'' . $eddtb_search_docs . '\') ? \'\' : this.value;" value="' . $eddtb_search_docs . '" name="bbp_search" value="' . esc_attr( 'Search Docs', 'edd-toolbar' ) . '" class="text eddtb-search-input" />
385
+ <input type="hidden" name="post_type[]" value="docs" />
386
+ <input type="hidden" name="post_type[]" value="page" />' . $eddtb_go_button,
387
+ 'href' => false,
388
+ 'meta' => array( 'target' => '', 'title' => _x( 'Search Docs', 'Translators: For the tooltip', 'edd-toolbar' ) )
389
+ );
390
+
391
+ /** Easy Digital Downloads HQ menu items */
392
+ $inboundsecondary_menu_items['inboundsites'] = array(
393
+ 'parent' => $inboundgroup,
394
+ 'title' => __( 'Inbound Now Plugin HQ', 'edd-toolbar' ),
395
+ 'href' => 'https://www.inboundnow.com/',
396
+ 'meta' => array( 'title' => $eddtb_edd_name_tooltip . ' ' . __( 'Plugin HQ', 'edd-toolbar' ) )
397
+ );
398
+
399
+ /** HQ: GitHub */
400
+ $inboundsecondary_menu_items['inboundsites-dev'] = array(
401
+ 'parent' => $inboundsites,
402
+ 'title' => __( 'GitHub Repository Developer Center', 'edd-toolbar' ),
403
+ 'href' => 'https://github.com/inboundnow',
404
+ 'meta' => array( 'title' => __( 'GitHub Repository Developer Center', 'edd-toolbar' ) )
405
+ );
406
+
407
+ /** HQ: Blog */
408
+ $inboundsecondary_menu_items['inboundsites-blog'] = array(
409
+ 'parent' => $inboundsites,
410
+ 'title' => __( 'Official Blog', 'edd-toolbar' ),
411
+ 'href' => 'https://www.inboundnow.com/blog/',
412
+ 'meta' => array( 'title' => __( 'Official Blog', 'edd-toolbar' ) )
413
+ );
414
+
415
+ /** HQ: Site Account */
416
+ $inboundsecondary_menu_items['inboundsitesaccount'] = array(
417
+ 'parent' => $inboundsites,
418
+ 'title' => __( 'My Account', 'edd-toolbar' ),
419
+ 'href' => 'https://www.inboundnow.com/marketplace/account/',
420
+ 'meta' => array( 'title' => __( 'My Account', 'edd-toolbar' ) )
421
+ );
422
+
423
+ $inboundsecondary_menu_items['inboundsitesaccount-history'] = array(
424
+ 'parent' => $inboundsitesaccount,
425
+ 'title' => __( 'Purchase History', 'edd-toolbar' ),
426
+ 'href' => 'https://www.inboundnow.com/marketplace/account/purchase-history/',
427
+ 'meta' => array( 'title' => __( 'Purchase History', 'edd-toolbar' ) )
428
+ );
429
+ /*
430
+ $menu_items['edd-systeminfo'] = array(
431
+ 'parent' => $inboundgroup,
432
+ 'title' => __( 'System Info (Debug)', 'edd-toolbar' ),
433
+ 'href' => admin_url( 'edit.php?post_type=landing-page&page=edd-system-info' ),
434
+ 'meta' => array( 'target' => '', 'title' => __( 'System Info (Debug)', 'edd-toolbar' ) )
435
+ );
436
+ */
437
+
438
+
439
+ } // end-if global settings/options cap checks (including backward compatibility)
440
+
441
+ } else {
442
+
443
+ /** If Easy Digital Downloads is not active, to avoid PHP notices */
444
+ if ( 'eddtb_resources_yes' == $eddtb_resources_check && $inboundsecondary_menu_items ) {
445
+ $menu_items = $inboundsecondary_menu_items;
446
+ }
447
+
448
+ /** If Easy Digital Downloads is not active and no icon filter is active, then display no icon */
449
+ if ( ! has_filter( 'eddtb_filter_main_icon' ) ) {
450
+ add_filter( 'eddtb_filter_main_item_icon_display', '__eddtb_no_icon_display' );
451
+ }
452
+
453
+ }
454
+
455
+
456
+
457
+ /** Allow menu items to be filtered, but pass in parent menu item IDs */
458
+ $menu_items = (array) apply_filters( 'ddw_eddtb_menu_items', $menu_items, ( 'eddtb_resources_yes' == $eddtb_resources_check ) ? $inboundsecondary_menu_items : '',
459
+ $prefix,
460
+ $inboundbar,
461
+ $inboundsupport,
462
+ $inboundsupportsections,
463
+ $inboundsupportaccount,
464
+ $inbounddocs,
465
+ $inbounddocsquick,
466
+ $inbounddocssections,
467
+ $inboundsites,
468
+ $inboundsitesaccount,
469
+ $inboundsitesextensions,
470
+ $inboundreports,
471
+ $inboundgroup,
472
+ // NEW PREFIXES
473
+ $landingpages_menu,
474
+ $cta_menu,
475
+ $form_menu,
476
+ $settings_menu,
477
+ $templates_menu,
478
+ $landingpagesettings,
479
+ $ctasettings,
480
+ $landing_pages_templates,
481
+ $cta_templates
482
+ ); // end of array
483
+
484
+
485
+ /** Filter the main item icon's class/display */
486
+ $eddtb_main_item_icon_display = apply_filters( 'eddtb_filter_main_item_icon_display', 'icon-edd' );
487
+
488
+ $wp_admin_bar->add_menu( array(
489
+ 'id' => $inboundbar,
490
+ 'title' => __( ' Marketing', 'edd-toolbar' ),
491
+ 'href' => "",
492
+ 'meta' => array( 'class' => $eddtb_main_item_icon_display, 'title' => 'Inbound Marketing Admin' )
493
+ ) );
494
+
495
+
496
+ /** Loop through the menu items */
497
+ foreach ( $menu_items as $id => $menu_item ) {
498
+
499
+ /** Add in the item ID */
500
+ $menu_item['id'] = $prefix . $id;
501
+
502
+ /** Add meta target to each item where it's not already set, so links open in new window/tab */
503
+ if ( ! isset( $menu_item['meta']['target'] ) )
504
+ $menu_item['meta']['target'] = '_blank';
505
+
506
+ /** Add class to links that open up in a new window/tab */
507
+ if ( '_blank' === $menu_item['meta']['target'] ) {
508
+ if ( ! isset( $menu_item['meta']['class'] ) )
509
+ $menu_item['meta']['class'] = '';
510
+ $menu_item['meta']['class'] .= $prefix . 'eddtb-new-tab';
511
+ }
512
+
513
+ /** Add menu items */
514
+ $wp_admin_bar->add_menu( $menu_item );
515
+
516
+ } // end foreach menu items
517
+
518
+
519
+ /**
520
+ * Action Hook 'eddtb_custom_main_items'
521
+ * allows for hooking other main items in
522
+ *
523
+ * @since 1.2.0
524
+ */
525
+ do_action( 'eddtb_custom_main_items' );
526
+
527
+
528
+ /** add special blue links
529
+ $wp_admin_bar->add_group( array(
530
+ 'parent' => $eddsettings,
531
+ 'id' => $eddspecials
532
+ ) );
533
+ */
534
+
535
+ /** Adds search box and sub */
536
+ $wp_admin_bar->add_group( array(
537
+ 'parent' => $inboundbar,
538
+ 'id' => $inboundgroup,
539
+ 'meta' => array( 'class' => 'ab-sub-secondary' )
540
+ ) );
541
+
542
+
543
+ // Load grey secondary items
544
+ foreach ( $inboundsecondary_menu_items as $id => $inboundgroup_menu_item ) {
545
+
546
+ /** EDD Group: Add in the item ID */
547
+ $inboundgroup_menu_item['id'] = $prefix . $id;
548
+
549
+ /** EDD Group: Add meta target to each item where it's not already set, so links open in new window/tab */
550
+ if ( ! isset( $inboundgroup_menu_item['meta']['target'] ) )
551
+ $inboundgroup_menu_item['meta']['target'] = '_blank';
552
+
553
+ /** EDD Group: Add class to links that open up in a new window/tab */
554
+ if ( '_blank' === $inboundgroup_menu_item['meta']['target'] ) {
555
+
556
+ if ( ! isset( $inboundgroup_menu_item['meta']['class'] ) ) {
557
+ $inboundgroup_menu_item['meta']['class'] = '';
558
+ }
559
+
560
+ $inboundgroup_menu_item['meta']['class'] .= $prefix . 'eddtb-new-tab';
561
+
562
+ }
563
+
564
+ /** EDD Group: Add menu items */
565
+ $wp_admin_bar->add_menu( $inboundgroup_menu_item );
566
+
567
+ } // end foreach EDD Group
568
+
569
+
570
+ /**
571
+ * Action Hook 'eddtb_custom_group_items'
572
+ * allows for hooking other EDD Group items in
573
+ *
574
+ * @since 1.2.0
575
+ */
576
+ // do_action( 'eddtb_custom_group_items' );
577
+
578
+ }
579
+
580
+ static function menu_admin_head() {
581
+ /** No styles if admin bar is disabled or user is not logged in or items are disabled via constant */
582
+ if ( ! is_admin_bar_showing() || ! is_user_logged_in() ) {
583
+ return;
584
+ }
585
+ if ( defined( 'WPL_URL' )) {
586
+ $final_path = WPL_URL . "/";
587
+ } else if (defined( 'LANDINGPAGES_URLPATH' )){
588
+ $final_path = LANDINGPAGES_URLPATH;
589
+ } else if (defined( 'WP_CTA_URLPATH' )){
590
+ $final_path = WP_CTA_URLPATH;
591
+ } else {
592
+ $final_path = preg_replace("/\/shared\/inbound-shortcodes\//", "/", INBOUND_FORMS);
593
+ }
594
+ ?>
595
+ <script type="text/javascript">
596
+ /* <![CDATA[ */
597
+ // Load inline scripts var freshthemes_theme_dir = "<?php // echo INBOUND_FORMS; ?>", test = "<?php // _e('Insert Shortcode', INBOUND_LABEL); ?>";
598
+ /* ]]> */
599
+ </script>
600
+ <style type="text/css">
601
+ #wpadminbar.nojs .ab-top-menu > li.menupop.icon-edd:hover > .ab-item,
602
+ #wpadminbar .ab-top-menu > li.menupop.icon-edd.hover > .ab-item,
603
+ #wpadminbar.nojs .ab-top-menu > li.menupop.icon-edd > .ab-item,
604
+ #wpadminbar .ab-top-menu > li.menupop.icon-edd > .ab-item {
605
+
606
+ background-image: url(<?php echo $final_path . 'shared/inbound-shortcodes/shortcodes-blue.png';?>);
607
+
608
+ background-repeat: no-repeat;
609
+ background-position: 0.15em 50%;
610
+ padding-left: 22px;
611
+ }
612
+ #wp-admin-bar-ddw-edd-languages-de > .ab-item:before,
613
+ #wp-admin-bar-ddw-edd-translations-forum > .ab-item:before {
614
+ color: #ff9900;
615
+ content: '• ';
616
+ }
617
+ #wpadminbar .eddtb-search-input {
618
+ width: 140px;
619
+ }
620
+ #wp-admin-bar-ddw-edd-inboundsupportsections .ab-item,
621
+ #wp-admin-bar-ddw-edd-inbounddocsquick .ab-item,
622
+ #wp-admin-bar-ddw-edd-inbounddocssections .ab-item,
623
+ #wpadminbar .eddtb-search-input,
624
+ #wpadminbar .eddtb-search-go {
625
+ color: #21759b !important;
626
+ text-shadow: none;
627
+ }
628
+ #wpadminbar .eddtb-search-input,
629
+ #wpadminbar .eddtb-search-go {
630
+ background-color: #fff;
631
+ height: 18px;
632
+ line-height: 18px;
633
+ padding: 1px 4px;
634
+ }
635
+ #wpadminbar .eddtb-search-go {
636
+ -webkit-border-radius: 11px;
637
+ -moz-border-radius: 11px;
638
+ border-radius: 11px;
639
+ font-size: 0.67em;
640
+ margin: 0 0 0 2px;
641
+ }
642
+ @font-face {
643
+ font-family: 'FontAwesome';
644
+ src: url('<?php echo $final_path . "shared/fonts/fontawesome/fontawesome-webfont.eot";?>');
645
+ src: url('<?php echo $final_path . "shared/fonts/fontawesome/fontawesome-webfont.eot";?>') format('embedded-opentype'),
646
+ url('<?php echo $final_path . "shared/fonts/fontawesome/fontawesome-webfont.woff?v=3.0.2"?>') format('woff'),
647
+ url('<?php echo $final_path . "shared/fonts/fontawesome/fontawesome-webfont.ttf?v=3.0.2"?>') format('truetype');
648
+ font-weight: normal;
649
+ font-style: normal;
650
+ }
651
+ #wp-admin-bar-inbound-cta a:first-child, #wp-admin-bar-inbound-inboundtemplates .ab-item.ab-empty-item, #wp-admin-bar-inbound-inboundsettings .ab-item.ab-empty-item, #wp-admin-bar-inbound-inboundreports a:first-child {
652
+ padding-left: 30px;
653
+ }
654
+ #wp-admin-bar-inbound-inboundtemplates .ab-item.ab-empty-item:hover, #wp-admin-bar-inbound-inboundsettings .ab-item.ab-empty-item:hover {
655
+ color: #2ea2cc;
656
+ }
657
+ #wp-admin-bar-inbound-leads a:first-child, #wp-admin-bar-inbound-inboundseo a:first-child {
658
+ padding-left: 31px;
659
+ }
660
+ #wp-admin-bar-inbound-landingpages a:first-child, #wp-admin-bar-inbound-inboundforms a:first-child{
661
+ padding-left: 31px;
662
+ }
663
+ #wp-admin-bar-inbound-cta .ab-submenu a, #wp-admin-bar-inbound-leads .ab-submenu a, #wp-admin-bar-inbound-landingpages .ab-submenu a , #wp-admin-bar-inbound-inboundforms .ab-submenu a, #wp-admin-bar-inbound-inboundtemplates .ab-submenu a, #wp-admin-bar-inbound-inboundreports .ab-submenu a, #wp-admin-bar-inbound-inboundseo .ab-submenu a{
664
+ padding-left: 10px;
665
+ }
666
+ #wp-admin-bar-inbound-cta:before, #wp-admin-bar-inbound-leads:before, #wp-admin-bar-inbound-landingpages:before, #wp-admin-bar-inbound-inboundforms:before, #wp-admin-bar-inbound-inboundtemplates:before, #wp-admin-bar-inbound-inboundsettings:before, #wp-admin-bar-inbound-inboundreports:before, #wp-admin-bar-inbound-inboundseo:before {
667
+ font-family: "FontAwesome" !important;
668
+ content: "\f05b" !important;
669
+ font: 100 19px/1 "FontAwesome" !important;
670
+ padding-top: 4px;
671
+ width: 30px;
672
+ display: inline-block;
673
+ height: 30px;
674
+ position: absolute;
675
+ left: 6px;
676
+ }
677
+ #wp-admin-bar-inbound-leads:before {
678
+ content: "\f0c0" !important;
679
+ font: 100 17px/1 "FontAwesome" !important;
680
+ }
681
+ #wp-admin-bar-inbound-landingpages:before {
682
+ content: "\f15c" !important;
683
+ left: 7px;
684
+ font-size: 21px !important;
685
+ }
686
+ #wp-admin-bar-inbound-inboundforms:before {
687
+ font: 400 18px/1 dashicons!important;
688
+ content: "\f163" !important;
689
+ }
690
+ #wp-admin-bar-inbound-inboundtemplates:before {
691
+ content: "\f0c5" !important;
692
+ font-size: 18px !important;
693
+ }
694
+ #wp-admin-bar-inbound-inboundsettings:before {
695
+ content: "\f013" !important;
696
+ left: 7px !important;
697
+ }
698
+ #wp-admin-bar-inbound-inboundreports:before {
699
+ content: "\f012" !important;
700
+ font-size: 17px !important;
701
+ }
702
+ #wp-admin-bar-inbound-inboundseo:before {
703
+ content: "\f002" !important;
704
+ font-size: 17px !important;
705
+ }
706
+ #wp-admin-bar-inbound-cta a {
707
+ vertical-align: top;
708
+ }
709
+ #adminmenu .menu-icon-wp-call-to-action div.wp-menu-image:before {
710
+ font-family: "FontAwesome" !important;
711
+ content: "\f05b";
712
+ font: 400 24px/1 "FontAwesome" !important;
713
+ padding-top: 6px;
714
+
715
+ }
716
+ </style>
717
+ <?php }
718
+
719
+
720
+
721
+ }
722
+ }
723
+ /* Initialize InboundNow Menu
724
+ * --------------------------------------------------------- */
725
+
726
+ InboundMenu::init();
727
+
728
+ ?>
shared/inbound-shortcodes/css/frontend-render.css CHANGED
@@ -329,7 +329,7 @@ ul.social-links li a:hover{
329
  /* Call Out
330
  * ----------------------------------------------------- */
331
  .callout{
332
- background: #f2f2f2 url('images/gradient.png') repeat-x top left;
333
  border: 1px solid #EBEBEA;
334
  -webkit-box-shadow: inset 1px 1px 1px #f9f9f9;
335
  -moz-box-shadow: inset 1px 1px 1px #f9f9f9;
@@ -426,7 +426,7 @@ ul.tabs-nav li:last-child{
426
  margin-bottom: 20px
427
  }
428
  .accordion .pane-title{
429
- background: #f2f2f2 url('images/gradient.png') repeat-x top left;
430
  border: 1px solid #EBEBEA;
431
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
432
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
@@ -483,7 +483,7 @@ ul.tabs-nav li:last-child{
483
  margin: 0 0 20px;
484
  }
485
  .fancy-quote .quote-text{
486
- background: #f2f2f2 url('images/gradient.png') repeat-x top left;
487
  border: 1px solid #EBEBEA;
488
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
489
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
@@ -546,7 +546,7 @@ ul.tabs-nav li:last-child{
546
  margin-left: -1px;
547
  }
548
  .pricing .plan-header{
549
- background: #f2f2f2 url('images/gradient.png') repeat-x top left;
550
  border-bottom: 1px solid #EBEBEA;
551
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
552
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
@@ -709,7 +709,7 @@ ul.tabs-nav li:last-child{
709
  /* Content Box
710
  * ----------------------------------------------------- */
711
  .content-box{
712
- background: #f2f2f2 url('images/gradient.png') repeat-x top left;
713
  border: 1px solid #EBEBEA;
714
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
715
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
329
  /* Call Out
330
  * ----------------------------------------------------- */
331
  .callout{
332
+ background: #f2f2f2;
333
  border: 1px solid #EBEBEA;
334
  -webkit-box-shadow: inset 1px 1px 1px #f9f9f9;
335
  -moz-box-shadow: inset 1px 1px 1px #f9f9f9;
426
  margin-bottom: 20px
427
  }
428
  .accordion .pane-title{
429
+ background: #f2f2f2;
430
  border: 1px solid #EBEBEA;
431
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
432
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
483
  margin: 0 0 20px;
484
  }
485
  .fancy-quote .quote-text{
486
+ background: #f2f2f2;
487
  border: 1px solid #EBEBEA;
488
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
489
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
546
  margin-left: -1px;
547
  }
548
  .pricing .plan-header{
549
+ background: #f2f2f2;
550
  border-bottom: 1px solid #EBEBEA;
551
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
552
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
709
  /* Content Box
710
  * ----------------------------------------------------- */
711
  .content-box{
712
+ background: #f2f2f2;
713
  border: 1px solid #EBEBEA;
714
  -webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
715
  -moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
shared/inbound-shortcodes/js/shortcodes.js CHANGED
@@ -209,7 +209,7 @@
209
  var shortcode = shortcode.replace(/#/g, '');
210
  }
211
  // updates the src value
212
- iframe.attr( 'src', iframeSrc + '?post='+inbound_shortcodes.form_id+'&sc=' + InboundShortcodes.htmlEncode(shortcode) + "&path=" + inbound_load.image_dir );
213
 
214
  //console.log('updated iframe');
215
  // update the height
@@ -452,7 +452,7 @@
452
  InboundShortcodes.update_fields();
453
  });
454
  jQuery("body").on('click', '.switch-to-form-insert', function () {
455
- tb_show( inbound_load.pop_title, inbound_load.image_dir + 'popup.php?popup=quick-forms&width=' + 900 + "&path=" + inbound_load.image_dir);
456
  });
457
  }
458
  if (shortcode_name === 'insert_button_shortcode' || shortcode_name === 'insert_styled_list_shortcode'){
209
  var shortcode = shortcode.replace(/#/g, '');
210
  }
211
  // updates the src value
212
+ iframe.attr( 'src', iframeSrc + '?post='+inbound_shortcodes.form_id+'&sc=' + InboundShortcodes.htmlEncode(shortcode));
213
 
214
  //console.log('updated iframe');
215
  // update the height
452
  InboundShortcodes.update_fields();
453
  });
454
  jQuery("body").on('click', '.switch-to-form-insert', function () {
455
+ tb_show( inbound_load.pop_title, inbound_load.image_dir + 'popup.php?popup=quick-forms&width=' + 900);
456
  });
457
  }
458
  if (shortcode_name === 'insert_button_shortcode' || shortcode_name === 'insert_styled_list_shortcode'){
shared/inbound-shortcodes/preview.php CHANGED
@@ -16,19 +16,15 @@ $test = "http://local.dev/wp-content/plugins/inbound-forms/preview.php?sc=[inbou
16
 
17
  $shortcode = html_entity_decode( trim( $_GET['sc'] ) );
18
  // SET CORRECT FILE PATHS FOR SCRIPTS
19
- $file_path = html_entity_decode( trim( $_GET['path'] ) );
20
- if ((preg_match("/landing-pages/i", $file_path))) {
 
21
  $final_path = LANDINGPAGES_URLPATH;
22
- }
23
- else if (preg_match("/leads/i", $file_path)) {
24
- $final_path = WPL_URL . "/";
25
- }
26
- else if (preg_match("/cta/i", $file_path)) {
27
  $final_path = WP_CTA_URLPATH;
28
  } else {
29
- $final_path = "";
30
  }
31
-
32
  /* HTML MATCHES */
33
  // $test = 'html="&lt;span%20class="test"&gt;tes&lt;/span&gt;"';
34
  // preg_match_all('%\[inbound_form_test\s*(?:(layout)\s*=\s*(.*?))?\](.*?)\[/inbound_form_test\]%', $shortcode, $matches);
@@ -135,6 +131,7 @@ display: none;
135
  </style>
136
  </head>
137
  <body>
 
138
  <div id="close-preview-window"><a href="javascript:window.close()" class="close_window">close window</a></div>
139
  <span class="disclaimer"><strong>Note:</strong> Previews aren't always exactly what they will look like on your page. Sometimes other styles can interfere</span>
140
  <?php echo $horiz;
16
 
17
  $shortcode = html_entity_decode( trim( $_GET['sc'] ) );
18
  // SET CORRECT FILE PATHS FOR SCRIPTS
19
+ if ( defined( 'WPL_URL' )) {
20
+ $final_path = WPL_URL . "/";
21
+ } else if (defined( 'LANDINGPAGES_URLPATH' )){
22
  $final_path = LANDINGPAGES_URLPATH;
23
+ } else if (defined( 'WP_CTA_URLPATH' )){
 
 
 
 
24
  $final_path = WP_CTA_URLPATH;
25
  } else {
26
+ $final_path = preg_replace("/\/shared\/inbound-shortcodes\//", "/", INBOUND_FORMS);
27
  }
 
28
  /* HTML MATCHES */
29
  // $test = 'html="&lt;span%20class="test"&gt;tes&lt;/span&gt;"';
30
  // preg_match_all('%\[inbound_form_test\s*(?:(layout)\s*=\s*(.*?))?\](.*?)\[/inbound_form_test\]%', $shortcode, $matches);
131
  </style>
132
  </head>
133
  <body>
134
+
135
  <div id="close-preview-window"><a href="javascript:window.close()" class="close_window">close window</a></div>
136
  <span class="disclaimer"><strong>Note:</strong> Previews aren't always exactly what they will look like on your page. Sometimes other styles can interfere</span>
137
  <?php echo $horiz;
shared/tracking/page-tracking.js CHANGED
@@ -1,4 +1,4 @@
1
- // Console.log fix
2
  (function() {
3
  if (!window.console) {
4
  window.console = {};
@@ -16,24 +16,113 @@
16
  }
17
  }
18
  })();
19
- function wpl_numKeys(obj)
20
- {
21
- var count = 0;
22
- for(var key in obj)
23
- {
24
- if (obj.hasOwnProperty(key)) {
25
-
26
- for(var key_b in obj[key])
27
- {
28
- //alert ('1');
29
- count++;
30
- }
31
 
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- }
35
- return count;
36
- }
37
  /* Count number of session visits */
38
  function countProperties(obj) {
39
  var count = 0;
@@ -45,23 +134,8 @@ function countProperties(obj) {
45
 
46
  return count;
47
  }
48
- /* build tracking uid */
49
- function generate_wp_leads_uid(length) {
50
 
51
- var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
52
-
53
- if (! length) {
54
- length = Math.floor(Math.random() * chars.length);
55
- }
56
-
57
- var str = '';
58
- for (var i = 0; i < length; i++) {
59
- str += chars[Math.floor(Math.random() * chars.length)];
60
- }
61
- return str;
62
- }
63
-
64
- /* build tracking uid */
65
  function generate_session_id(length) {
66
  var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
67
 
@@ -76,139 +150,124 @@ function generate_session_id(length) {
76
  return str;
77
  }
78
 
79
-
80
  /* Function for adding minutes to current time */
81
  function add_page_timeout(date, minutes) {
82
  return new Date(date.getTime() + minutes*60000);
83
  }
84
 
85
- /*
86
- * Date Format 1.2.3
87
- * (c) 2007-2009 Steven Levithan <stevenlevithan.com>
88
- * MIT license
89
- *
90
- * Includes enhancements by Scott Trenda <scott.trenda.net>
91
- * and Kris Kowal <cixar.com/~kris.kowal/>
92
- *
93
- * Accepts a date, a mask, or a date and a mask.
94
- * Returns a formatted version of the given date.
95
- * The date defaults to the current date/time.
96
- * The mask defaults to dateFormat.masks.default.
97
- */
98
-
99
- var dateFormat = function () {
100
- var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
101
- timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
102
- timezoneClip = /[^-+\dA-Z]/g,
103
- pad = function (val, len) {
104
- val = String(val);
105
- len = len || 2;
106
- while (val.length < len) val = "0" + val;
107
- return val;
108
- };
109
-
110
- // Regexes and supporting functions are cached through closure
111
- return function (date, mask, utc) {
112
- var dF = dateFormat;
113
-
114
- // You can't provide utc if you skip other args (use the "UTC:" mask prefix)
115
- if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
116
- mask = date;
117
- date = undefined;
118
- }
119
-
120
- // Passing date through Date applies Date.parse, if necessary
121
- date = date ? new Date(date) : new Date;
122
- if (isNaN(date)) throw SyntaxError("invalid date");
123
-
124
- mask = String(dF.masks[mask] || mask || dF.masks["default"]);
125
-
126
- // Allow setting the utc argument via the mask
127
- if (mask.slice(0, 4) == "UTC:") {
128
- mask = mask.slice(4);
129
- utc = true;
130
- }
131
-
132
- var _ = utc ? "getUTC" : "get",
133
- d = date[_ + "Date"](),
134
- D = date[_ + "Day"](),
135
- m = date[_ + "Month"](),
136
- y = date[_ + "FullYear"](),
137
- H = date[_ + "Hours"](),
138
- M = date[_ + "Minutes"](),
139
- s = date[_ + "Seconds"](),
140
- L = date[_ + "Milliseconds"](),
141
- o = utc ? 0 : date.getTimezoneOffset(),
142
- flags = {
143
- d: d,
144
- dd: pad(d),
145
- ddd: dF.i18n.dayNames[D],
146
- dddd: dF.i18n.dayNames[D + 7],
147
- m: m + 1,
148
- mm: pad(m + 1),
149
- mmm: dF.i18n.monthNames[m],
150
- mmmm: dF.i18n.monthNames[m + 12],
151
- yy: String(y).slice(2),
152
- yyyy: y,
153
- h: H % 12 || 12,
154
- hh: pad(H % 12 || 12),
155
- H: H,
156
- HH: pad(H),
157
- M: M,
158
- MM: pad(M),
159
- s: s,
160
- ss: pad(s),
161
- l: pad(L, 3),
162
- L: pad(L > 99 ? Math.round(L / 10) : L),
163
- t: H < 12 ? "a" : "p",
164
- tt: H < 12 ? "am" : "pm",
165
- T: H < 12 ? "A" : "P",
166
- TT: H < 12 ? "AM" : "PM",
167
- Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
168
- o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
169
- S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
170
- };
171
-
172
- return mask.replace(token, function ($0) {
173
- return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
174
- });
175
- };
176
- }();
177
-
178
- // Some common format strings
179
- dateFormat.masks = {
180
- "default": "ddd mmm dd yyyy HH:MM:ss",
181
- shortDate: "m/d/yy",
182
- mediumDate: "mmm d, yyyy",
183
- longDate: "mmmm d, yyyy",
184
- fullDate: "dddd, mmmm d, yyyy",
185
- shortTime: "h:MM TT",
186
- mediumTime: "h:MM:ss TT",
187
- longTime: "h:MM:ss TT Z",
188
- isoDate: "yyyy-mm-dd",
189
- isoTime: "HH:MM:ss",
190
- isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
191
- isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
192
- };
193
-
194
- // Internationalization strings
195
- dateFormat.i18n = {
196
- dayNames: [
197
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
198
- "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
199
- ],
200
- monthNames: [
201
- "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
202
- "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
203
- ]
204
- };
205
-
206
- // For convenience...
207
- Date.prototype.format = function (mask, utc) {
208
- return dateFormat(this, mask, utc);
209
- };
210
  /* Query String for utm params
211
-
212
  // Query String Stuff
213
  var p = jQuery("pre"),
214
  result = "",
@@ -260,13 +319,10 @@ Date.prototype.format = function (mask, utc) {
260
  }
261
  */
262
 
263
- //alert(window.location);
264
-
265
- // Unique WP Lead ID
266
- var wp_lead_uid_val = generate_wp_leads_uid(35);
267
- //alert(wplft.ip_address);
268
  if(jQuery.cookie("wp_lead_uid") === null) {
269
- jQuery.cookie("wp_lead_uid", wp_lead_uid_val, { path: '/', expires: 365 });
 
270
  }
271
 
272
  /* define vars */
@@ -274,102 +330,22 @@ var referrer = document.referrer;
274
  var current_page = window.location.href;
275
  var current_page_parts = current_page.split('#');
276
  current_page = current_page_parts[0];
277
-
278
  var parts = location.hostname.split('.');
279
  var subdomain = parts.shift();
280
  var upperleveldomain = parts.join('.');
281
  var data_block = jQuery.parseJSON(jQuery.cookie('user_data_json'));
282
- // Date Data
283
  var date = new Date(wplft.track_time);
284
-
285
  var datetime = wplft.track_time;
286
-
287
  var the_time_out = add_page_timeout(date, .1);
288
-
289
  var lead_uid = jQuery.cookie("wp_lead_uid");
290
  var lead_id = jQuery.cookie("wp_lead_id");
291
  var lead_email = jQuery.cookie("wp_lead_email");
292
 
293
-
294
-
295
- /* Start LocalStorage */
296
- var trackObj = jQuery.totalStorage('cpath');
297
-
298
- if (typeof trackObj =='object' && trackObj)
299
- {
300
- session_count = countProperties(trackObj);
301
- // If session is past timout limit
302
- if(!jQuery.cookie( "lead_session_expire") ) {
303
- var session_id = generate_session_id(11);
304
- console.log("Start New Tracking Session");
305
- // Start New Tracking Block
306
- trackObj.push({
307
- session: session_count + 1,
308
- session_id: session_id,
309
- pageviews: [{id: 1,
310
- current_page: current_page,
311
- post_id : wplft.post_id,
312
- timestamp: datetime,
313
- referrer: referrer,
314
- original_referrer: referrer
315
- }],
316
- last_activity: date, // Last movement
317
- timeout: the_time_out, // Thirty minute timeout
318
- lead_uid: lead_uid,
319
- lead_id: lead_id,
320
- lead_email: lead_email,
321
- lead_ip_address: wplft.ip_address
322
- });
323
- } else {
324
- // If session still active, do this
325
- session_count = countProperties(trackObj);
326
- number = parseInt(session_count) - 1;
327
- var new_count = trackObj[number].pageviews.length;
328
- //console.log(new_count);
329
- if(jQuery.cookie('wp_lead_uid')){
330
- trackObj[number].lead_uid = lead_uid;
331
- }
332
- if(jQuery.cookie('wp_lead_id')){
333
- trackObj[number].lead_id = lead_id;
334
- }
335
- if(jQuery.cookie('wp_lead_email')){
336
- trackObj[number].lead_email = lead_email;
337
- }
338
- trackObj[number].pageviews.push(
339
- { id : new_count+1, current_page: current_page, post_id : wplft.post_id, timestamp: datetime, referrer: referrer}
340
- )
341
- }
342
- }
343
- else
344
- {
345
- // Create initial tracking block
346
- var trackObj = new Array();
347
- var session_id = generate_session_id(11);
348
- trackObj.push({
349
- session: 1,
350
- session_id: session_id,
351
- pageviews: [{id: 1,
352
- current_page: current_page,
353
- post_id : wplft.post_id,
354
- timestamp: datetime,
355
- referrer: referrer,
356
- original_referrer: referrer
357
- }],
358
- last_activity: date, // Last movement
359
- timeout: the_time_out, // Thirty minute timeout
360
- lead_uid: lead_uid,
361
- lead_id: lead_id,
362
- lead_email: lead_email,
363
- lead_ip_address: wplft.ip_address
364
- }
365
- );
366
-
367
- }
368
- jQuery.totalStorage('cpath', trackObj);
369
-
370
- // Page View Object: Sessionless and clears on form submittions
371
  var pageviewObj = jQuery.totalStorage('page_views');
372
  var current_page_id = wplft.post_id;
 
373
  if (typeof pageviewObj =='object' && pageviewObj)
374
  {
375
  // If pageviewObj exists, do this
@@ -377,22 +353,56 @@ if (typeof pageviewObj =='object' && pageviewObj)
377
  if(typeof(page_seen) != "undefined" && page_seen !== null) {
378
  var view_count = pageviewObj[current_page_id].length - 1;
379
  var last_view = pageviewObj[current_page_id][view_count];
380
-
381
- var thirty_second_timeout = new Date(last_view).getTime() + 30*1000;
382
- var thirty_second_timeout_formatted = dateFormat(thirty_second_timeout, "UTC:yyyy-mm-dd hh:MM:ss");
383
-
384
- var wait_time = Math.abs(Date.parse(last_view) - Date.parse(thirty_second_timeout_formatted)) // output timeout time 30sec;
385
- var parse_this = Date.parse(datetime);
386
- var format_date = dateFormat(parse_this, "UTC:yyyy-mm-dd hh:MM:ss");
387
- var time_check = Math.abs(Date.parse(last_view) - Date.parse(format_date));
388
- //console.log(wait_time);
389
- //console.log(time_check);
390
- if (time_check > wait_time ){
 
 
 
 
 
 
 
 
 
 
391
  console.log('time out happened');
392
- pageviewObj[current_page_id].push(datetime);
393
- // run Ajax page view saving here.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  } else {
395
- console.log('30 sec timeout not done: ' + (wait_time - time_check)*.001 + " seconds left");
396
  }
397
 
398
  } else {
@@ -410,26 +420,15 @@ if (typeof pageviewObj =='object' && pageviewObj)
410
 
411
  jQuery.totalStorage('page_views', pageviewObj);
412
  // console.log(JSON.stringify(pageviewObj)) // output the pages viewed
413
-
414
-
415
  /* End local storage */
416
 
417
  /* Start Legacy Cookie Storage */
418
- if (typeof data_block =='object' && data_block)
419
- {
420
- var count = wpl_numKeys(data_block);
421
- data_block.items.push(
422
- { id : count+1, current_page: current_page, timestamp: datetime, referrer: referrer}
423
- );
424
-
425
  jQuery.cookie('user_data_json', JSON.stringify(data_block), { expires: 1, path: '/' });
426
- }
427
- else
428
- {
429
- data_block = {items: [
430
- {id: '1', current_page: current_page,timestamp: datetime, referrer: referrer, original_referrer: referrer},
431
- ]};
432
-
433
  jQuery.cookie('user_data_json', JSON.stringify(data_block), { expires: 1, path: '/' });
434
  }
435
  /* End Legacy Cookie Storage */
1
+ /* Console.log fix for old browsers */
2
  (function() {
3
  if (!window.console) {
4
  window.console = {};
16
  }
17
  }
18
  })();
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ /** Fixes for Safari Date errors
21
+ * Version: 1.0 Alpha-1
22
+ * Build Date: 13-Nov-2007
23
+ * Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved.
24
+ * License: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
25
+ * Website: http://www.datejs.com/ or http://www.coolite.com/datejs/
26
+ */
27
+ Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};
28
+ Date.getMonthNumberFromName=function(name){var n=Date.CultureInfo.monthNames,m=Date.CultureInfo.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
29
+ return-1;};Date.getDayNumberFromName=function(name){var n=Date.CultureInfo.dayNames,m=Date.CultureInfo.abbreviatedDayNames,o=Date.CultureInfo.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
30
+ return-1;};Date.isLeapYear=function(year){return(((year%4===0)&&(year%100!==0))||(year%400===0));};Date.getDaysInMonth=function(year,month){return[31,(Date.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};Date.getTimezoneOffset=function(s,dst){return(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST[s.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[s.toUpperCase()];};Date.getTimezoneAbbreviation=function(offset,dst){var n=(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,p;for(p in n){if(n[p]===offset){return p;}}
31
+ return null;};Date.prototype.clone=function(){return new Date(this.getTime());};Date.prototype.compareTo=function(date){if(isNaN(this)){throw new Error(this);}
32
+ if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
33
+ var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
34
+ if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
35
+ if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
36
+ if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
37
+ if(x.month||x.months){this.addMonths(x.month||x.months);}
38
+ if(x.year||x.years){this.addYears(x.year||x.years);}
39
+ if(x.day||x.days){this.addDays(x.day||x.days);}
40
+ return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(value<min||value>max){throw new RangeError(value+" is not a valid value for "+name+".");}
41
+ return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;}
42
+ if(!x.second&&x.second!==0){x.second=-1;}
43
+ if(!x.minute&&x.minute!==0){x.minute=-1;}
44
+ if(!x.hour&&x.hour!==0){x.hour=-1;}
45
+ if(!x.day&&x.day!==0){x.day=-1;}
46
+ if(!x.month&&x.month!==0){x.month=-1;}
47
+ if(!x.year&&x.year!==0){x.year=-1;}
48
+ if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());}
49
+ if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());}
50
+ if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());}
51
+ if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());}
52
+ if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());}
53
+ if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());}
54
+ if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());}
55
+ if(x.timezone){this.setTimezone(x.timezone);}
56
+ if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);}
57
+ return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;}
58
+ var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}}
59
+ return w;};Date.prototype.isDST=function(){console.log('isDST');return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();};
60
+ Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
61
+ return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i<dx.length;i++){$D[dx[i]]=$D[dx[i].substring(0,3)]=df(i);}
62
+ var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
63
+ return this.moveToMonth(n,this._orient);};};for(var j=0;j<mx.length;j++){$D[mx[j]]=$D[mx[j].substring(0,3)]=mf(j);}
64
+ var ef=function(j){return function(){if(j.substring(j.length-1)!="s"){j+="s";}
65
+ return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k<px.length;k++){de=px[k].toLowerCase();$D[de]=$D[de+"s"]=ef(px[k]);$N[de]=$N[de+"s"]=nf(de);}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ");};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern);};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern);};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern);};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern);};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};
66
+ (function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
67
+ break;}
68
+ return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
69
+ rx.push(r[0]);s=r[1];}
70
+ return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
71
+ return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
72
+ throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
73
+ return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
74
+ if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
75
+ try{r=(px[i].call(this,s));}catch(e){r=null;}
76
+ if(r){return r;}}
77
+ throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
78
+ try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
79
+ rx.push(r[0]);s=r[1];}
80
+ return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
81
+ return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
82
+ rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
83
+ s=q[1];}
84
+ if(!r){throw new $P.Exception(s);}
85
+ if(q){throw new $P.Exception(q[1]);}
86
+ if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
87
+ return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
88
+ rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
89
+ if(!last&&q[1].length===0){last=true;}
90
+ if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
91
+ p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
92
+ if(rx[1].length<best[1].length){best=rx;}
93
+ if(best[1].length===0){break;}}
94
+ if(best[0].length===0){return best;}
95
+ if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
96
+ best[1]=q[1];}
97
+ return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
98
+ return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
99
+ if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
100
+ var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
101
+ return rx;};Date.Grammar={};Date.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=((s.length==3)?Date.getMonthNumberFromName(s):(Number(s)-1));};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];var now=new Date();this.year=now.getFullYear();this.month=now.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
102
+ this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
103
+ var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
104
+ return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
105
+ for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
106
+ if(this.now){return new Date();}
107
+ var today=Date.today();var method=null;var expression=!!(this.days!=null||this.orient||this.operator);if(expression){var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";gap=(Date.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
108
+ if(this.month){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
109
+ if(!this.unit){this.unit="day";}
110
+ if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
111
+ if(this.unit=="week"){this.unit="day";this.value=this.value*7;}
112
+ this[this.unit+"s"]=this.value*orient;}
113
+ return today.add(this);}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour;}
114
+ if(this.weekday&&!this.day){this.day=(today.addDays((Date.getDayNumberFromName(this.weekday)-today.getDay()))).getDate();}
115
+ if(this.month&&!this.day){this.day=1;}
116
+ return today.set(this);}}};var _=Date.Parsing.Operators,g=Date.Grammar,t=Date.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=Date.CultureInfo.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
117
+ fn=_C[keys]=_.any.apply(null,px);}
118
+ return fn;};g.ctoken2=function(key){return _.rtoken(Date.CultureInfo.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.mm,g.ss],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^(\+|\-)\s*\d\d\d\d/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[Date.CultureInfo.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw Date.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
119
+ return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
120
+ return g._start.call({},s);};}());Date._parse=Date.parse;Date.parse=function(s){var r=null;if(!s){return null;}
121
+ try{r=Date.Grammar.start.call({},s);}catch(e){return null;}
122
+ return((r[1].length===0)?r[0]:null);};Date.getParseFunction=function(fx){var fn=Date.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
123
+ return((r[1].length===0)?r[0]:null);};};Date.parseExact=function(s,fx){return Date.getParseFunction(fx)(s);};
124
+ /* End Safari Date fixes */
125
 
 
 
 
126
  /* Count number of session visits */
127
  function countProperties(obj) {
128
  var count = 0;
134
 
135
  return count;
136
  }
 
 
137
 
138
+ /* Generate tracking uid */
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  function generate_session_id(length) {
140
  var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
141
 
150
  return str;
151
  }
152
 
 
153
  /* Function for adding minutes to current time */
154
  function add_page_timeout(date, minutes) {
155
  return new Date(date.getTime() + minutes*60000);
156
  }
157
 
158
+ /* Date Format 1.2.3 */
159
+ var dateFormat = function () {
160
+ var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
161
+ timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
162
+ timezoneClip = /[^-+\dA-Z]/g,
163
+ pad = function (val, len) {
164
+ val = String(val);
165
+ len = len || 2;
166
+ while (val.length < len) val = "0" + val;
167
+ return val;
168
+ };
169
+
170
+ // Regexes and supporting functions are cached through closure
171
+ return function (date, mask, utc) {
172
+ var dF = dateFormat;
173
+
174
+ // You can't provide utc if you skip other args (use the "UTC:" mask prefix)
175
+ if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
176
+ mask = date;
177
+ date = undefined;
178
+ }
179
+
180
+ // Passing date through Date applies Date.parse, if necessary
181
+ date = date ? new Date(date) : new Date;
182
+ if (isNaN(date)) throw SyntaxError("invalid date");
183
+
184
+ mask = String(dF.masks[mask] || mask || dF.masks["default"]);
185
+
186
+ // Allow setting the utc argument via the mask
187
+ if (mask.slice(0, 4) == "UTC:") {
188
+ mask = mask.slice(4);
189
+ utc = true;
190
+ }
191
+
192
+ var _ = utc ? "getUTC" : "get",
193
+ d = date[_ + "Date"](),
194
+ D = date[_ + "Day"](),
195
+ m = date[_ + "Month"](),
196
+ y = date[_ + "FullYear"](),
197
+ H = date[_ + "Hours"](),
198
+ M = date[_ + "Minutes"](),
199
+ s = date[_ + "Seconds"](),
200
+ L = date[_ + "Milliseconds"](),
201
+ o = utc ? 0 : date.getTimezoneOffset(),
202
+ flags = {
203
+ d: d,
204
+ dd: pad(d),
205
+ ddd: dF.i18n.dayNames[D],
206
+ dddd: dF.i18n.dayNames[D + 7],
207
+ m: m + 1,
208
+ mm: pad(m + 1),
209
+ mmm: dF.i18n.monthNames[m],
210
+ mmmm: dF.i18n.monthNames[m + 12],
211
+ yy: String(y).slice(2),
212
+ yyyy: y,
213
+ h: H % 12 || 12,
214
+ hh: pad(H % 12 || 12),
215
+ H: H,
216
+ HH: pad(H),
217
+ M: M,
218
+ MM: pad(M),
219
+ s: s,
220
+ ss: pad(s),
221
+ l: pad(L, 3),
222
+ L: pad(L > 99 ? Math.round(L / 10) : L),
223
+ t: H < 12 ? "a" : "p",
224
+ tt: H < 12 ? "am" : "pm",
225
+ T: H < 12 ? "A" : "P",
226
+ TT: H < 12 ? "AM" : "PM",
227
+ Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
228
+ o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
229
+ S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
230
+ };
231
+
232
+ return mask.replace(token, function ($0) {
233
+ return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
234
+ });
235
+ };
236
+ }();
237
+
238
+ // Some common format strings
239
+ dateFormat.masks = {
240
+ "default": "ddd mmm dd yyyy HH:MM:ss",
241
+ shortDate: "m/d/yy",
242
+ mediumDate: "mmm d, yyyy",
243
+ longDate: "mmmm d, yyyy",
244
+ fullDate: "dddd, mmmm d, yyyy",
245
+ shortTime: "h:MM TT",
246
+ mediumTime: "h:MM:ss TT",
247
+ longTime: "h:MM:ss TT Z",
248
+ isoDate: "yyyy-mm-dd",
249
+ isoTime: "HH:MM:ss",
250
+ isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
251
+ isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
252
+ };
253
+
254
+ // Internationalization strings
255
+ dateFormat.i18n = {
256
+ dayNames: [
257
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
258
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
259
+ ],
260
+ monthNames: [
261
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
262
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
263
+ ]
264
+ };
265
+
266
+ // For convenience...
267
+ Date.prototype.format = function (mask, utc) {
268
+ return dateFormat(this, mask, utc);
269
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  /* Query String for utm params
 
271
  // Query String Stuff
272
  var p = jQuery("pre"),
273
  result = "",
319
  }
320
  */
321
 
322
+ /* Set Lead UID */
 
 
 
 
323
  if(jQuery.cookie("wp_lead_uid") === null) {
324
+ var wp_lead_uid_val = generate_session_id(35);
325
+ jQuery.cookie("wp_lead_uid", wp_lead_uid_val, { path: '/', expires: 365 });
326
  }
327
 
328
  /* define vars */
330
  var current_page = window.location.href;
331
  var current_page_parts = current_page.split('#');
332
  current_page = current_page_parts[0];
 
333
  var parts = location.hostname.split('.');
334
  var subdomain = parts.shift();
335
  var upperleveldomain = parts.join('.');
336
  var data_block = jQuery.parseJSON(jQuery.cookie('user_data_json'));
 
337
  var date = new Date(wplft.track_time);
 
338
  var datetime = wplft.track_time;
 
339
  var the_time_out = add_page_timeout(date, .1);
 
340
  var lead_uid = jQuery.cookie("wp_lead_uid");
341
  var lead_id = jQuery.cookie("wp_lead_id");
342
  var lead_email = jQuery.cookie("wp_lead_email");
343
 
344
+ /* Page View Object
345
+ This is a sessionless object with a 30 second timeout on identical page views */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  var pageviewObj = jQuery.totalStorage('page_views');
347
  var current_page_id = wplft.post_id;
348
+ var referrer_is = document.referrer;
349
  if (typeof pageviewObj =='object' && pageviewObj)
350
  {
351
  // If pageviewObj exists, do this
353
  if(typeof(page_seen) != "undefined" && page_seen !== null) {
354
  var view_count = pageviewObj[current_page_id].length - 1;
355
  var last_view = pageviewObj[current_page_id][view_count];
356
+ //console.log("last view" + last_view);
357
+
358
+ // Safari Timezone cleaners
359
+ var last_view = last_view.replace(/ UTC/);
360
+ var last_view = last_view.replace(/-/g, "/");
361
+ var last_view = last_view.replace(/undefined/g, "");
362
+ var datetime = datetime.replace(/ UTC/);
363
+ var datetime = datetime.replace(/-/g, "/");
364
+ var datetime = datetime.replace(/undefined/g, "");
365
+
366
+
367
+ var timeout = new Date(last_view).getTime() + 30*1000;
368
+ //console.log("timeout " + timeout);
369
+ var timeout = dateFormat(timeout, "yyyy-mm-dd hh:MM:ss");
370
+ var wait_time = Math.abs(Date.parse(last_view) - Date.parse(timeout)) // output timeout time 30sec;
371
+ var current_date = dateFormat(datetime, "yyyy-mm-dd hh:MM:ss");
372
+ var time_check = Math.abs(Date.parse(last_view) - Date.parse(current_date));
373
+ //console.log("Wait Time:" + wait_time);
374
+ //console.log("Time Check:" + time_check);
375
+
376
+ if (time_check < wait_time ){
377
  console.log('time out happened');
378
+ pageviewObj[current_page_id].push(datetime); // log page view
379
+ // run page view update for timeout
380
+ if (typeof (lead_id) != "undefined" && lead_id != null && lead_id != "") {
381
+ jQuery.ajax({
382
+ type: 'POST',
383
+ url: wplft.admin_url,
384
+ data: {
385
+ action: 'wpl_track_user',
386
+ wp_lead_uid: lead_uid,
387
+ wp_lead_id: lead_id,
388
+ page_id: current_page_id,
389
+ current_url: window.location.href,
390
+ json: '0'
391
+ },
392
+ success: function(user_id){
393
+ console.log('Page View Fired');
394
+ },
395
+ error: function(MLHttpRequest, textStatus, errorThrown){
396
+ //alert(MLHttpRequest+' '+errorThrown+' '+textStatus);
397
+ //die();
398
+ }
399
+
400
+ });
401
+ }
402
+ // Check if refferrer not main site log the referall data in lead record
403
+
404
  } else {
405
+ console.log('30 sec timeout not done: ' + Math.abs(wait_time - time_check)*.001 + " seconds left");
406
  }
407
 
408
  } else {
420
 
421
  jQuery.totalStorage('page_views', pageviewObj);
422
  // console.log(JSON.stringify(pageviewObj)) // output the pages viewed
 
 
423
  /* End local storage */
424
 
425
  /* Start Legacy Cookie Storage */
426
+ if (typeof data_block =='object' && data_block) {
427
+ var count = countProperties(data_block);
428
+ data_block.items.push({ id : count+1, current_page: current_page, timestamp: datetime, referrer: referrer});
 
 
 
 
429
  jQuery.cookie('user_data_json', JSON.stringify(data_block), { expires: 1, path: '/' });
430
+ } else {
431
+ data_block = {items: [{id: '1', current_page: current_page,timestamp: datetime, referrer: referrer, original_referrer: referrer},]};
 
 
 
 
 
432
  jQuery.cookie('user_data_json', JSON.stringify(data_block), { expires: 1, path: '/' });
433
  }
434
  /* End Legacy Cookie Storage */
shared/tracking/store.lead.php CHANGED
@@ -29,7 +29,6 @@ function inbound_store_lead()
29
  $data['phone'] = (isset($_POST['phone'])) ? $_POST['phone'] : false;
30
  $data['address'] = (isset($_POST['address'])) ? $_POST['address'] : false;
31
  $data['ip_address'] = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : false;
32
- $data['wp_lead_uid'] = (isset($_POST['wp_lead_uid'])) ? $_POST['wp_lead_uid'] : false;
33
  $data['lp_id'] = (isset($_POST['lp_id'])) ? $_POST['lp_id'] : '0';
34
  $data['post_type'] = (isset($_POST['post_type'])) ? $_POST['post_type'] : 'na';
35
  $data['lp_variation'] = (isset($_POST['lp_variation'])) ? $_POST['lp_variation'] : 'default';
@@ -129,7 +128,7 @@ function inbound_store_lead()
129
  (isset($geo_array['geoplugin_currencySymbol_UTF8'])) ? update_post_meta( $data['lead_id'], 'wpleads_currency_symbol', $geo_array['geoplugin_currencySymbol_UTF8'] ) : null;
130
  }
131
 
132
- /* Store Conversion Data */
133
  $conversion_data = get_post_meta( $data['lead_id'], 'wpleads_conversion_data', TRUE );
134
  $conversion_data = json_decode($conversion_data,true);
135
  $variation = ($data['lp_variation'] != 'default') ? $data['lp_variation'] : '0';
@@ -149,6 +148,27 @@ function inbound_store_lead()
149
  update_post_meta($data['lead_id'],'wpl-lead-conversion-count', $c_count); // Store conversions count
150
  update_post_meta($data['lead_id'], 'wpleads_conversion_data', $data['conversion_data']); // Store conversion object
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  /* Store page views for page tracking off */
153
  $page_tracking_status = get_option('wpl-main-page-view-tracking', 1);
154
  if($data['page_views'] && $page_tracking_status == 0){
29
  $data['phone'] = (isset($_POST['phone'])) ? $_POST['phone'] : false;
30
  $data['address'] = (isset($_POST['address'])) ? $_POST['address'] : false;
31
  $data['ip_address'] = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : false;
 
32
  $data['lp_id'] = (isset($_POST['lp_id'])) ? $_POST['lp_id'] : '0';
33
  $data['post_type'] = (isset($_POST['post_type'])) ? $_POST['post_type'] : 'na';
34
  $data['lp_variation'] = (isset($_POST['lp_variation'])) ? $_POST['lp_variation'] : 'default';
128
  (isset($geo_array['geoplugin_currencySymbol_UTF8'])) ? update_post_meta( $data['lead_id'], 'wpleads_currency_symbol', $geo_array['geoplugin_currencySymbol_UTF8'] ) : null;
129
  }
130
 
131
+ /* Store Conversion Data to Lead */
132
  $conversion_data = get_post_meta( $data['lead_id'], 'wpleads_conversion_data', TRUE );
133
  $conversion_data = json_decode($conversion_data,true);
134
  $variation = ($data['lp_variation'] != 'default') ? $data['lp_variation'] : '0';
148
  update_post_meta($data['lead_id'],'wpl-lead-conversion-count', $c_count); // Store conversions count
149
  update_post_meta($data['lead_id'], 'wpleads_conversion_data', $data['conversion_data']); // Store conversion object
150
 
151
+ /* Store Conversion Data to LANDING PAGE/CTA DATA */
152
+ if ($data['post_type'] == 'landing-page' || $data['post_type'] == 'wp-call-to-action'){
153
+ $page_conversion_data = get_post_meta( $data['lp_id'], 'inbound_conversion_data', TRUE );
154
+ $page_conversion_data = json_decode($page_conversion_data,true);
155
+ $version = ($data['lp_variation'] != 'default') ? $data['lp_variation'] : '0';
156
+ if (is_array($page_conversion_data)){
157
+ $convert_count = count($page_conversion_data) + 1;
158
+ $page_conversion_data[$convert_count]['lead_id'] = $data['lead_id'];
159
+ $page_conversion_data[$convert_count]['variation'] = $version;
160
+ $page_conversion_data[$convert_count]['datetime'] = $data['wordpress_date_time'];
161
+ } else {
162
+ $convert_count = 1;
163
+ $page_conversion_data[$convert_count]['lead_id'] = $data['lead_id'];
164
+ $page_conversion_data[$convert_count]['variation'] = $version;
165
+ $page_conversion_data[$convert_count]['datetime'] = $data['wordpress_date_time'];
166
+ }
167
+ $page_conversion_data = json_encode($page_conversion_data);
168
+ update_post_meta($data['lp_id'], 'inbound_conversion_data', $page_conversion_data);
169
+ }
170
+ // END LANDING PAGE/CTA DATA
171
+
172
  /* Store page views for page tracking off */
173
  $page_tracking_status = get_option('wpl-main-page-view-tracking', 1);
174
  if($data['page_views'] && $page_tracking_status == 0){