WordPress Landing Pages - Version 2.1.8

Version Description

  • Fix simple solid light
  • Fix issue with legacy image uploader issue.
Download this release

Release Info

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

Code changes from version 2.1.6 to 2.1.8

assets/css/frontend/global-landing-page-style.css CHANGED
@@ -1,40 +1,43 @@
1
- /**
2
- * WordPress required styles
3
- * Needed for editor media floats
4
- */
5
- /* ---------------------------------------------- */
6
- .wp-caption{
7
- background:#FBFBFB;
8
- border:1px solid #EEE;
9
- padding:10px;
10
  max-width: 100%;
11
  }
12
- .wp-caption img{
13
- display:block;
14
- margin-bottom:5px;
 
15
  }
 
16
  .wp-caption-text,
17
- .gallery-caption{
18
- margin:0;
19
- font-size:12px;
20
- font-style:italic
21
  }
22
- .alignright{
23
- float:right;
 
24
  margin: 10px 0px 10px 20px;
25
  }
26
- .alignleft{
27
- float:left;
 
28
  margin: 10px 20px 10px 0px;
29
  }
30
- .aligncenter{
31
- display:block;
32
- margin-left:auto;
33
- margin-right:auto;
 
34
  }
35
- .alignnone{
36
- display:block;
 
37
  margin: 10px 0px;
38
  }
39
- .bypostauthor{}
40
- /* ---------------------------------------------- */
 
1
+
2
+ .wp-caption {
3
+ background: #FBFBFB;
4
+ border: 1px solid #EEE;
5
+ padding: 10px;
 
 
 
 
6
  max-width: 100%;
7
  }
8
+
9
+ .wp-caption img {
10
+ display: block;
11
+ margin-bottom: 5px;
12
  }
13
+
14
  .wp-caption-text,
15
+ .gallery-caption {
16
+ margin: 0;
17
+ font-size: 12px;
18
+ font-style: italic
19
  }
20
+
21
+ .alignright {
22
+ float: right;
23
  margin: 10px 0px 10px 20px;
24
  }
25
+
26
+ .alignleft {
27
+ float: left;
28
  margin: 10px 20px 10px 0px;
29
  }
30
+
31
+ .aligncenter {
32
+ display: block;
33
+ margin-left: auto;
34
+ margin-right: auto;
35
  }
36
+
37
+ .alignnone {
38
+ display: block;
39
  margin: 10px 0px;
40
  }
41
+
42
+ .bypostauthor {
43
+ }
assets/js/admin/admin.metaboxes.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function ($) {
2
  jQuery('.upload_image_button').click(
3
  function () {
4
  var media_name = jQuery(this).attr('id');
5
  media_name = media_name.replace('uploader_', '');
6
  //alert(media_name);
7
  jQuery.cookie('media_name', media_name);
8
  jQuery.cookie('media_init', 1);
9
  tb_show('', 'media-upload.php?type=image&type=image&TB_iframe=true');
10
  return false;
11
  }
12
  );
13
  window.tb_remove = function () {
14
  $("#TB_imageOff").unbind("click");
15
  $("#TB_closeWindowButton").unbind("click");
16
  $("#TB_window").fadeOut("fast", function () {
17
  $('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();
18
  });
19
  $("#TB_load").remove();
20
  if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
21
  $("body", "html").css({height: "auto", width: "auto"});
22
  $("html").css("overflow", "");
23
  }
24
  document.onkeydown = "";
25
  document.onkeyup = "";
26
  jQuery.cookie('media_init', 0);
27
  return false;
28
  }
29
  window.send_to_editor = function (h) {
30
  if (jQuery.cookie('media_init') == 1) {
31
  var imgurl = jQuery('img', h).attr('src');
32
  if (!imgurl) {
33
  var array = h.match("src=\"(.*?)\"");
34
  imgurl = array[1];
35
  }
36
  //alert(jQuery.cookie('media_name'));
37
  jQuery('#' + jQuery.cookie('media_name')).val(imgurl);
38
  jQuery.cookie('media_init', 0);
39
  tb_remove();
40
  }
41
  else {
42
  var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
43
  if (!wpActiveEditor) {
44
  if (mce && tinymce.activeEditor) {
45
  ed = tinymce.activeEditor;
46
  wpActiveEditor = ed.id;
47
  } else if (!qt) {
48
  return false;
49
  }
50
  } else if (mce) {
51
  if (tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen'))
52
  ed = tinymce.activeEditor;
53
  else
54
  ed = tinymce.get(wpActiveEditor);
55
  }
56
  if (ed && !ed.isHidden()) {
57
  // restore caret position on IE
58
  if (tinymce.isIE && ed.windowManager.insertimagebookmark)
59
  ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
60
  if (h.indexOf('[caption') === 0) {
61
  if (ed.wpSetImgCaption)
62
  h = ed.wpSetImgCaption(h);
63
  } else if (h.indexOf('[gallery') === 0) {
64
  if (ed.plugins.wpgallery)
65
  h = ed.plugins.wpgallery._do_gallery(h);
66
  } else if (h.indexOf('[embed') === 0) {
67
  if (ed.plugins.wordpress)
68
  h = ed.plugins.wordpress._setEmbed(h);
69
  }
70
  ed.execCommand('mceInsertContent', false, h);
71
  } else if (qt) {
72
  QTags.insertContent(h);
73
  } else {
74
  document.getElementById(wpActiveEditor).value += h;
75
  }
76
  jQuery.cookie('media_init', 0);
77
  try {
78
  tb_remove();
79
  } catch (e) {
80
  }
81
  ;
82
  }
83
  }
 
84
  jQuery( '.upload_image_button' ).on( 'click', function() {
85
  tb_show('test', 'media-upload.php?type=image&TB_iframe=1');
86
  var field_id = jQuery(this).data('field-id');
87
  window.send_to_editor = function( html ) {
88
  imgurl = jQuery( 'img', html ).attr( 'src' );
89
  jQuery( '#' + field_id ).val(imgurl);
90
  tb_remove();
91
  }
92
  return false;
93
  });
 
1
  jQuery('.upload_image_button').click(
2
  function () {
3
  var media_name = jQuery(this).attr('id');
4
  media_name = media_name.replace('uploader_', '');
5
  //alert(media_name);
6
  jQuery.cookie('media_name', media_name);
7
  jQuery.cookie('media_init', 1);
8
  tb_show('', 'media-upload.php?type=image&type=image&TB_iframe=true');
9
  return false;
10
  }
11
  );
12
  window.tb_remove = function () {
13
  $("#TB_imageOff").unbind("click");
14
  $("#TB_closeWindowButton").unbind("click");
15
  $("#TB_window").fadeOut("fast", function () {
16
  $('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();
17
  });
18
  $("#TB_load").remove();
19
  if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
20
  $("body", "html").css({height: "auto", width: "auto"});
21
  $("html").css("overflow", "");
22
  }
23
  document.onkeydown = "";
24
  document.onkeyup = "";
25
  jQuery.cookie('media_init', 0);
26
  return false;
27
  }
28
  window.send_to_editor = function (h) {
29
  if (jQuery.cookie('media_init') == 1) {
30
  var imgurl = jQuery('img', h).attr('src');
31
  if (!imgurl) {
32
  var array = h.match("src=\"(.*?)\"");
33
  imgurl = array[1];
34
  }
35
  //alert(jQuery.cookie('media_name'));
36
  jQuery('#' + jQuery.cookie('media_name')).val(imgurl);
37
  jQuery.cookie('media_init', 0);
38
  tb_remove();
39
  }
40
  else {
41
  var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
42
  if (!wpActiveEditor) {
43
  if (mce && tinymce.activeEditor) {
44
  ed = tinymce.activeEditor;
45
  wpActiveEditor = ed.id;
46
  } else if (!qt) {
47
  return false;
48
  }
49
  } else if (mce) {
50
  if (tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen'))
51
  ed = tinymce.activeEditor;
52
  else
53
  ed = tinymce.get(wpActiveEditor);
54
  }
55
  if (ed && !ed.isHidden()) {
56
  // restore caret position on IE
57
  if (tinymce.isIE && ed.windowManager.insertimagebookmark)
58
  ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
59
  if (h.indexOf('[caption') === 0) {
60
  if (ed.wpSetImgCaption)
61
  h = ed.wpSetImgCaption(h);
62
  } else if (h.indexOf('[gallery') === 0) {
63
  if (ed.plugins.wpgallery)
64
  h = ed.plugins.wpgallery._do_gallery(h);
65
  } else if (h.indexOf('[embed') === 0) {
66
  if (ed.plugins.wordpress)
67
  h = ed.plugins.wordpress._setEmbed(h);
68
  }
69
  ed.execCommand('mceInsertContent', false, h);
70
  } else if (qt) {
71
  QTags.insertContent(h);
72
  } else {
73
  document.getElementById(wpActiveEditor).value += h;
74
  }
75
  jQuery.cookie('media_init', 0);
76
  try {
77
  tb_remove();
78
  } catch (e) {
79
  }
80
  ;
81
  }
82
  }
83
+
84
  jQuery( '.upload_image_button' ).on( 'click', function() {
85
  tb_show('test', 'media-upload.php?type=image&TB_iframe=1');
86
  var field_id = jQuery(this).data('field-id');
87
  window.send_to_editor = function( html ) {
88
  imgurl = jQuery( 'img', html ).attr( 'src' );
89
  jQuery( '#' + field_id ).val(imgurl);
90
  tb_remove();
91
  }
92
  return false;
93
  });
classes/class.cloning.php CHANGED
@@ -132,9 +132,9 @@ class Landing_Pages_Cloning {
132
 
133
  if (function_exists('wp_get_current_user')) {
134
  return wp_get_current_user();
135
- } else if (function_exists('get_currentuserinfo')) {
136
  global $userdata;
137
- $userdata = get_currentuserinfo();
138
  return $userdata;
139
  } else {
140
  $user_login = $_COOKIE[USER_COOKIE];
132
 
133
  if (function_exists('wp_get_current_user')) {
134
  return wp_get_current_user();
135
+ } else if (function_exists('wp_get_current_user')) {
136
  global $userdata;
137
+ $userdata = wp_get_current_user();
138
  return $userdata;
139
  } else {
140
  $user_login = $_COOKIE[USER_COOKIE];
classes/class.metaboxes.php CHANGED
@@ -686,7 +686,7 @@ class Landing_Pages_Metaboxes {
686
  */
687
  public static function display_showcase_submission() {
688
  global $post, $current_user;
689
- get_currentuserinfo();
690
  $landing_page_url = get_permalink($post->ID);
691
  $admin_email = $current_user->user_email;
692
  $name = $current_user->display_name;
@@ -1062,7 +1062,7 @@ class Landing_Pages_Metaboxes {
1062
  /*echo 1; exit; */
1063
  echo '<label for="upload_image" data-field-type="text">';
1064
  echo '<input name="' . $field_id . '" id="' . $field_id . '" type="text" size="36" name="upload_image" value="' . $meta . '" />';
1065
- echo '<input class="upload_image_button" id="uploader_' . $field_id . '" type="button" value="Upload Image" />';
1066
  echo '<p class="description">' . $field['description'] . '</p>';
1067
  break;
1068
  /* checkbox */
686
  */
687
  public static function display_showcase_submission() {
688
  global $post, $current_user;
689
+ wp_get_current_user();
690
  $landing_page_url = get_permalink($post->ID);
691
  $admin_email = $current_user->user_email;
692
  $name = $current_user->display_name;
1062
  /*echo 1; exit; */
1063
  echo '<label for="upload_image" data-field-type="text">';
1064
  echo '<input name="' . $field_id . '" id="' . $field_id . '" type="text" size="36" name="upload_image" value="' . $meta . '" />';
1065
+ echo '<input data-field-id="' . $field_id . '" class="upload_image_button" id="uploader_' . $field_id . '" type="button" value="'.__('Upload Image' , 'inbound-pro' ) .'" />';
1066
  echo '<p class="description">' . $field['description'] . '</p>';
1067
  break;
1068
  /* checkbox */
classes/class.post-type.landing-page.php CHANGED
@@ -525,6 +525,7 @@ if ( !class_exists('Landing_Pages_Post_Type') ) {
525
  * Loads preview iframe. Currently disabled. Plans to update @DavidWells
526
  */
527
  public static function load_preview_iframe() {
 
528
  $variation_id = Landing_Pages_Variations::get_current_variation_id();
529
  $landing_page_id = $_GET['post_id'];
530
 
525
  * Loads preview iframe. Currently disabled. Plans to update @DavidWells
526
  */
527
  public static function load_preview_iframe() {
528
+
529
  $variation_id = Landing_Pages_Variations::get_current_variation_id();
530
  $landing_page_id = $_GET['post_id'];
531
 
classes/class.settings.php CHANGED
@@ -681,7 +681,7 @@ class Landing_Pages_Settings {
681
  /*echo 1; exit; */
682
  echo '<label for="upload_image">';
683
  echo '<input name="' . $field['id'] . '" id="' . $field['id'] . '" type="text" size="36" name="upload_image" value="' . $field['value'] . '" />';
684
- echo '<input class="upload_image_button" id="uploader_' . $field['id'] . '" type="button" value="Upload Image" />';
685
  continue 2;
686
  /* checkbox */
687
  case 'checkbox':
681
  /*echo 1; exit; */
682
  echo '<label for="upload_image">';
683
  echo '<input name="' . $field['id'] . '" id="' . $field['id'] . '" type="text" size="36" name="upload_image" value="' . $field['value'] . '" />';
684
+ echo '<input data-field-id="' . $field['id'] . '" class="upload_image_button" id="uploader_' . $field['id'] . '" type="button" value="'. __( 'Upload Image' , 'inbound-pro' ) .'"/>';
685
  continue 2;
686
  /* checkbox */
687
  case 'checkbox':
classes/class.variations.php CHANGED
@@ -396,7 +396,10 @@ if (!class_exists('Landing_Pages_Variations')) {
396
  $post_id = $_GET['post'];
397
  } else if (isset($post)) {
398
  $post_id = $post->ID;
 
 
399
  }
 
400
  $variations = self::get_variations($post_id);
401
  $id = array_values($variations);
402
  $current_variation_id = array_shift($id);
396
  $post_id = $_GET['post'];
397
  } else if (isset($post)) {
398
  $post_id = $post->ID;
399
+ } else {
400
+ $post_id = 0;
401
  }
402
+
403
  $variations = self::get_variations($post_id);
404
  $id = array_values($variations);
405
  $current_variation_id = array_shift($id);
landing-pages.php CHANGED
@@ -3,13 +3,12 @@
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
- Version: 2.1.6
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
10
  */
11
 
12
-
13
  if (!class_exists('Inbound_Landing_Pages_Plugin')) {
14
 
15
  final class Inbound_Landing_Pages_Plugin {
@@ -38,7 +37,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
38
  */
39
  private static function load_constants() {
40
 
41
- define('LANDINGPAGES_CURRENT_VERSION', '2.1.6' );
42
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
43
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
44
  define('LANDINGPAGES_PLUGIN_SLUG', plugin_basename( dirname(__FILE__) ) );
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
+ Version: 2.1.8
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
10
  */
11
 
 
12
  if (!class_exists('Inbound_Landing_Pages_Plugin')) {
13
 
14
  final class Inbound_Landing_Pages_Plugin {
37
  */
38
  private static function load_constants() {
39
 
40
+ define('LANDINGPAGES_CURRENT_VERSION', '2.1.8' );
41
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
42
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
43
  define('LANDINGPAGES_PLUGIN_SLUG', plugin_basename( dirname(__FILE__) ) );
modules/module.redirect-ab-testing.php CHANGED
@@ -202,7 +202,12 @@ class LP_Variation_Rotation {
202
  * Redirects to Correct Variation
203
  */
204
  static function redirect() {
205
- header("HTTP/1.1 302 Temporary Redirect");
 
 
 
 
 
206
  header("Location: ".self::$destination_url);
207
  exit;
208
  }
202
  * Redirects to Correct Variation
203
  */
204
  static function redirect() {
205
+ if (count(self::$variations) > 1) {
206
+ header("HTTP/1.1 302 Temporary Redirect");
207
+ } else {
208
+ header("HTTP/1.1 301 Moved Permanently");
209
+ }
210
+
211
  header("Location: ".self::$destination_url);
212
  exit;
213
  }
readme.txt CHANGED
@@ -7,7 +7,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
  Tested up to: 4.4.2
10
- Stable Tag: 2.1.6
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
 
@@ -70,7 +70,12 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
70
 
71
  == Changelog ==
72
 
73
- = 2.1.6 =
 
 
 
 
 
74
  * Code & responsive improvements to core free templates.
75
 
76
  = 2.1.3 =
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
  Tested up to: 4.4.2
10
+ Stable Tag: 2.1.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
 
70
 
71
  == Changelog ==
72
 
73
+ = 2.1.8 =
74
+ * Fix simple solid light
75
+ * Fix issue with legacy image uploader issue.
76
+
77
+ = 2.1.7 =
78
+ * Fix issue with Half and Half
79
  * Code & responsive improvements to core free templates.
80
 
81
  = 2.1.3 =
shared/assets/assets.loader.class.php CHANGED
@@ -22,12 +22,21 @@ if (!class_exists('Inbound_Asset_Loader')) {
22
 
23
  $screen = get_current_screen();
24
 
25
- if ( !isset($screen) || $screen->base != 'post') {
26
- return;
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
- wp_enqueue_script('inbound-editor-js', INBOUNDNOW_SHARED_URLPATH . 'assets/js/admin/editor.js');
30
- //wp_enqueue_script('inbound-forms-cpt-js', INBOUNDNOW_SHARED_URLPATH . 'assets/css/admin/inbound-metaboxes.css');
31
  }
32
  /**
33
  * Registers and enqueues stylesheets for the administration panel and the
@@ -37,49 +46,29 @@ if (!class_exists('Inbound_Asset_Loader')) {
37
  * self::enqueue_shared_file('SCRIPT-ID', INBOUNDNOW_SHARED_PATH . 'assets/js/frontend/path-in-shared-assets.js', 'localized_var_name', $localized_array_values, $dependancies_array );
38
  */
39
  static function register_scripts_and_styles() {
 
40
  /* Frontent and Backend Files */
41
 
42
 
43
- /* Conditionals for admin or frontend */
44
- if(is_admin()) {
45
-
46
- /*self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.js', array( 'jquery' ), 'inbound_settings', self::localize_lead_data()); */
47
-
48
- self::enqueue_shared_file('jquery-cookie', 'assets/js/global/jquery.cookie.js', array( 'jquery' ));
49
- self::enqueue_shared_file('jquery-total-storage', 'assets/js/global/jquery.total-storage.min.js', array( 'jquery' ));
50
- $inbound_now_screens = Inbound_Compatibility::return_inbound_now_screens(); /* list of inbound now screens */
51
- $screen = get_current_screen();
52
 
53
- /* Target Specific screen with echo $screen->id; */
54
-
55
- if ( $screen->id == 'wp-call-to-action') {
56
- self::enqueue_shared_file('image-picker-js', 'assets/js/admin/image-picker.js');
57
- self::enqueue_shared_file('image-picker-css', 'assets/css/admin/image-picker.css');
58
- }
59
-
60
-
61
- } else {
62
-
63
- global $wp_scripts;
64
- $store = false;
65
-
66
- if ( !empty( $wp_scripts->queue ) ) {
67
- $store = $wp_scripts->queue; /* store the scripts */
68
- foreach ( $wp_scripts->queue as $handle ) {
69
- wp_dequeue_script( $handle );
70
- }
71
- }
72
 
73
- /* unminified source available */
74
- self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.min.js', array( 'jquery' ), 'inbound_settings', self::localize_lead_data());
75
 
76
- if (is_array($store)) {
77
- foreach ( $store as $handle ) {
78
- wp_enqueue_script( $handle );
79
- }
80
  }
81
-
82
  }
 
83
  } /* end register_scripts_and_styles */
84
 
85
  /**
22
 
23
  $screen = get_current_screen();
24
 
25
+ self::enqueue_shared_file('jquery-cookie', 'assets/js/global/jquery.cookie.js', array( 'jquery' ));
26
+ self::enqueue_shared_file('jquery-total-storage', 'assets/js/global/jquery.total-storage.min.js', array( 'jquery' ));
27
+
28
+ if ( isset($screen) && $screen->id == 'wp-call-to-action') {
29
+ self::enqueue_shared_file('image-picker-js', 'assets/js/admin/image-picker.js');
30
+ self::enqueue_shared_file('image-picker-css', 'assets/css/admin/image-picker.css');
31
+ }
32
+
33
+
34
+ if ( isset($screen) && $screen->base == 'post') {
35
+ wp_enqueue_script('inbound-editor-js', INBOUNDNOW_SHARED_URLPATH . 'assets/js/admin/editor.js');
36
+ //wp_enqueue_script('inbound-forms-cpt-js', INBOUNDNOW_SHARED_URLPATH . 'assets/css/admin/inbound-metaboxes.css');
37
+
38
  }
39
 
 
 
40
  }
41
  /**
42
  * Registers and enqueues stylesheets for the administration panel and the
46
  * self::enqueue_shared_file('SCRIPT-ID', INBOUNDNOW_SHARED_PATH . 'assets/js/frontend/path-in-shared-assets.js', 'localized_var_name', $localized_array_values, $dependancies_array );
47
  */
48
  static function register_scripts_and_styles() {
49
+ global $post;
50
  /* Frontent and Backend Files */
51
 
52
 
53
+ global $wp_scripts;
54
+ $store = false;
 
 
 
 
 
 
 
55
 
56
+ if ( !empty( $wp_scripts->queue ) ) {
57
+ $store = $wp_scripts->queue; /* store the scripts */
58
+ foreach ( $wp_scripts->queue as $handle ) {
59
+ wp_dequeue_script( $handle );
60
+ }
61
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
+ /* unminified source available */
64
+ self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.min.js', array( 'jquery' ), 'inbound_settings', self::localize_lead_data());
65
 
66
+ if (is_array($store)) {
67
+ foreach ( $store as $handle ) {
68
+ wp_enqueue_script( $handle );
 
69
  }
 
70
  }
71
+
72
  } /* end register_scripts_and_styles */
73
 
74
  /**
shared/assets/css/admin/inbound-metaboxes.css CHANGED
@@ -1,78 +1,93 @@
1
  #inbound-meta .inbound-meta-box-row {
2
- display: block;
3
- padding-bottom: 10px;
4
  }
 
5
  .inbound-meta-box-label, .inbound-meta-box-option {
6
- display: inline-block;
7
  }
 
8
  .inbound-meta-box-label {
9
- width: 18%;
10
  }
 
11
  .inbound-wysiwyg-option, .inbound-textarea-option {
12
- width: 75%;
13
  }
 
14
  @media only screen and (max-width: 600px) {
15
- .inbound-wysiwyg-option, .inbound-textarea-option {
16
- width: 100%;
17
- }
18
  }
 
19
  .inbound-meta-box-option {
20
- position: relative;
21
  }
 
22
  .inbound-textarea-option .button-primary.new-save-wp-cta, .inbound-textarea-option .wp-cta-success-message {
23
- position: absolute;
24
  }
 
25
  .inbound-datepicker .button-primary.new-save-wp-cta {
26
- display: none;
27
  }
28
 
29
  .inbound-media-row .button-primary.new-save-wp-cta {
30
- position: absolute;
31
- right: -94px;
32
- top: 0px;
33
- text-align: center;
34
- width: 84px;
35
  }
 
36
  .inbound-meta-box-option.inbound-text-option, .inbound-meta-box-option.inbound-text-option input[type=text] {
37
- width:80%;
38
  }
 
39
  .inbound-meta-box-option.inbound-text-option input[type=text].cta-width, .inbound-meta-box-option.inbound-text-option input[type=text].cta-height {
40
- width: 100px;
41
  }
 
42
  #inbound-meta .inbound-custom-css-row {
43
- padding: 0px;
44
  }
 
45
  .inbound-media-row .wp-cta-success-message {
46
- position: absolute;
47
- right: -100px;
48
- top: 0px;
49
- text-align: center;
50
- width: 80px;
51
- margin-top: 3px;
52
- padding: 0px;
53
  }
 
54
  .inbound-wysiwyg-option .button-primary.new-save-wp-cta, .inbound-wysiwyg-option .wp-cta-success-message {
55
- width: 100%;
56
- margin: auto;
57
- text-align: center;
58
- margin-left: 0px !important;
59
- padding-left: 0px;
60
- padding-right: 0px;
61
- display: inline-block;
62
  }
 
63
  .inbound-wysiwyg, .inbound-media, .inbound-datepicker, .inbound-textarea {
64
- vertical-align: top;
65
  }
 
66
  .inbound-textarea-option .wp-cta-success-message {
67
- position: absolute;
68
- margin-top: 0px;
69
  }
 
70
  .jquery-date-picker p {
71
- margin: 0px 0 0 0;
72
  }
73
 
74
  .inbound-wysiwyg-row .wp-cta-success-message {
75
- margin-right: 40px;
76
- text-align: center;
77
- display: block;
78
  }
1
  #inbound-meta .inbound-meta-box-row {
2
+ display: block;
3
+ padding-bottom: 10px;
4
  }
5
+
6
  .inbound-meta-box-label, .inbound-meta-box-option {
7
+ display: inline-block;
8
  }
9
+
10
  .inbound-meta-box-label {
11
+ width: 18%;
12
  }
13
+
14
  .inbound-wysiwyg-option, .inbound-textarea-option {
15
+ width: 75%;
16
  }
17
+
18
  @media only screen and (max-width: 600px) {
19
+ .inbound-wysiwyg-option, .inbound-textarea-option {
20
+ width: 100%;
21
+ }
22
  }
23
+
24
  .inbound-meta-box-option {
25
+ position: relative;
26
  }
27
+
28
  .inbound-textarea-option .button-primary.new-save-wp-cta, .inbound-textarea-option .wp-cta-success-message {
29
+ position: absolute;
30
  }
31
+
32
  .inbound-datepicker .button-primary.new-save-wp-cta {
33
+ display: none;
34
  }
35
 
36
  .inbound-media-row .button-primary.new-save-wp-cta {
37
+ position: absolute;
38
+ right: -94px;
39
+ top: 0px;
40
+ text-align: center;
41
+ width: 84px;
42
  }
43
+
44
  .inbound-meta-box-option.inbound-text-option, .inbound-meta-box-option.inbound-text-option input[type=text] {
45
+ width: 80%;
46
  }
47
+
48
  .inbound-meta-box-option.inbound-text-option input[type=text].cta-width, .inbound-meta-box-option.inbound-text-option input[type=text].cta-height {
49
+ width: 100px;
50
  }
51
+
52
  #inbound-meta .inbound-custom-css-row {
53
+ padding: 0px;
54
  }
55
+
56
  .inbound-media-row .wp-cta-success-message {
57
+ position: absolute;
58
+ right: -100px;
59
+ top: 0px;
60
+ text-align: center;
61
+ width: 80px;
62
+ margin-top: 3px;
63
+ padding: 0px;
64
  }
65
+
66
  .inbound-wysiwyg-option .button-primary.new-save-wp-cta, .inbound-wysiwyg-option .wp-cta-success-message {
67
+ width: 100%;
68
+ margin: auto;
69
+ text-align: center;
70
+ margin-left: 0px !important;
71
+ padding-left: 0px;
72
+ padding-right: 0px;
73
+ display: inline-block;
74
  }
75
+
76
  .inbound-wysiwyg, .inbound-media, .inbound-datepicker, .inbound-textarea {
77
+ vertical-align: top;
78
  }
79
+
80
  .inbound-textarea-option .wp-cta-success-message {
81
+ position: absolute;
82
+ margin-top: 0px;
83
  }
84
+
85
  .jquery-date-picker p {
86
+ margin: 0px 0 0 0;
87
  }
88
 
89
  .inbound-wysiwyg-row .wp-cta-success-message {
90
+ margin-right: 40px;
91
+ text-align: center;
92
+ display: block;
93
  }
shared/assets/js/frontend/analytics-src/analytics.forms.js CHANGED
@@ -596,7 +596,6 @@ var InboundForms = (function(_inbound) {
596
  utils.createCookie("wp_lead_id", leadID);
597
  _inbound.totalStorage.deleteItem('page_views'); // remove pageviews
598
  _inbound.totalStorage.deleteItem('tracking_events'); // remove events
599
- utils.eraseCookie('inbound_page_views'); // remove events
600
  }
601
 
602
  _inbound.trigger('form_after_submission', formData);
596
  utils.createCookie("wp_lead_id", leadID);
597
  _inbound.totalStorage.deleteItem('page_views'); // remove pageviews
598
  _inbound.totalStorage.deleteItem('tracking_events'); // remove events
 
599
  }
600
 
601
  _inbound.trigger('form_after_submission', formData);
shared/classes/class.ajax.php CHANGED
@@ -76,7 +76,7 @@ if (!class_exists('Inbound_Ajax')) {
76
  }
77
  }
78
 
79
- setcookie( 'inbound_page_views' , json_encode($stored_views) , time()+3600 , "/" );
80
 
81
  /* update lead data */
82
  if(isset($_POST['wp_lead_id']) && function_exists('wp_leads_update_page_view_obj') ) {
76
  }
77
  }
78
 
79
+ $_SESSION['inbound_page_views'] = json_encode($stored_views);
80
 
81
  /* update lead data */
82
  if(isset($_POST['wp_lead_id']) && function_exists('wp_leads_update_page_view_obj') ) {
shared/classes/class.events.php CHANGED
@@ -98,7 +98,7 @@ class Inbound_Events {
98
  'variation_id' => $lead['variation'],
99
  'form_id' => (isset($raw_params['inbound_form_id'])) ? $raw_params['inbound_form_id'] : '',
100
  'lead_id' => $lead['id'],
101
- 'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : null ),
102
  'session_id' => '',
103
  'event_details' => json_encode($details),
104
  'datetime' => $lead['wordpress_date_time']
@@ -127,7 +127,7 @@ class Inbound_Events {
127
  'email_id' => $message['metadata']['email_id'],
128
  'variation_id' => $message['metadata']['variation_id'],
129
  'lead_id' => $args['urlparams']['lead_id'],
130
- 'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : null ),
131
  'event_details' => json_encode($args['urlparams']),
132
  'datetime' => $args['datetime'],
133
  'form_id' => ''
@@ -185,7 +185,7 @@ class Inbound_Events {
185
  'event_name' => $args['event_name'],
186
  'event_details' => '',
187
  'datetime' => $wordpress_date_time,
188
- 'funnel' => ( isset($_COOKIE['inbound_page_views']) ? $_COOKIE['inbound_page_views'] : '' ),
189
  'source' => ( isset($_COOKIE['inbound_referral_site']) ? $_COOKIE['inbound_referral_site'] : '' )
190
  );
191
 
98
  'variation_id' => $lead['variation'],
99
  'form_id' => (isset($raw_params['inbound_form_id'])) ? $raw_params['inbound_form_id'] : '',
100
  'lead_id' => $lead['id'],
101
+ 'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : '' ),
102
  'session_id' => '',
103
  'event_details' => json_encode($details),
104
  'datetime' => $lead['wordpress_date_time']
127
  'email_id' => $message['metadata']['email_id'],
128
  'variation_id' => $message['metadata']['variation_id'],
129
  'lead_id' => $args['urlparams']['lead_id'],
130
+ 'lead_uid' => ( isset($_COOKIE['wp_lead_uid']) ? $_COOKIE['wp_lead_uid'] : '' ),
131
  'event_details' => json_encode($args['urlparams']),
132
  'datetime' => $args['datetime'],
133
  'form_id' => ''
185
  'event_name' => $args['event_name'],
186
  'event_details' => '',
187
  'datetime' => $wordpress_date_time,
188
+ 'funnel' => ( isset($_SESSION['inbound_page_views']) ? $_SESSION['inbound_page_views'] : '' ),
189
  'source' => ( isset($_COOKIE['inbound_referral_site']) ? $_COOKIE['inbound_referral_site'] : '' )
190
  );
191
 
shared/classes/class.form.php CHANGED
@@ -485,6 +485,7 @@ if (!class_exists('Inbound_Forms')) {
485
  'id' => '',
486
  ), $atts));
487
 
 
488
  $shortcode = get_post_meta($id, 'inbound_shortcode', TRUE);
489
 
490
  /* If form id missing add it */
485
  'id' => '',
486
  ), $atts));
487
 
488
+ $id = str_replace('form_' , '' , $id );
489
  $shortcode = get_post_meta($id, 'inbound_shortcode', TRUE);
490
 
491
  /* If form id missing add it */
shared/classes/class.lead-fields.php CHANGED
@@ -13,154 +13,154 @@ if ( !class_exists('Leads_Field_Map') ) {
13
  array(
14
  'label' => __( 'First Name', INBOUNDNOW_TEXT_DOMAIN ) ,
15
  'key' => 'wpleads_first_name',
16
- 'priority' => 20,
17
  'type' => 'text',
18
  'nature' => 'core'
19
  ),
20
  array(
21
  'label' => __( 'Last Name', INBOUNDNOW_TEXT_DOMAIN ) ,
22
  'key' => 'wpleads_last_name',
23
- 'priority' => 30,
24
  'type' => 'text',
25
  'nature' => 'core'
26
  ),
27
  array(
28
  'label' => __( 'Email', INBOUNDNOW_TEXT_DOMAIN ) ,
29
  'key' => 'wpleads_email_address',
30
- 'priority' => 40,
31
  'type' => 'text',
32
  'nature' => 'core'
33
  ),
34
  array(
35
  'label' => __( 'Website', INBOUNDNOW_TEXT_DOMAIN ) ,
36
  'key' => 'wpleads_website',
37
- 'priority' => 50,
38
  'type' => 'text',
39
  'nature' => 'core'
40
  ),
41
  array(
42
  'label' => __( 'Job Title', INBOUNDNOW_TEXT_DOMAIN ) ,
43
  'key' => 'wpleads_job_title',
44
- 'priority' => 60,
45
  'type' => 'text',
46
  'nature' => 'core'
47
  ),
48
  array(
49
  'label' => __( 'Company Name', INBOUNDNOW_TEXT_DOMAIN ) ,
50
  'key' => 'wpleads_company_name',
51
- 'priority' => 70,
52
  'type' => 'text',
53
  'nature' => 'core'
54
  ),
55
  array(
56
  'label' => __( 'Mobile Phone', INBOUNDNOW_TEXT_DOMAIN ) ,
57
  'key' => 'wpleads_mobile_phone',
58
- 'priority' => 80,
59
  'type' => 'text',
60
  'nature' => 'core'
61
  ),
62
  array(
63
  'label' => __( 'Work Phone', INBOUNDNOW_TEXT_DOMAIN ) ,
64
  'key' => 'wpleads_work_phone',
65
- 'priority' => 90,
66
  'type' => 'text',
67
  'nature' => 'core'
68
  ),
69
  array(
70
  'label' => __( 'Address', INBOUNDNOW_TEXT_DOMAIN ) ,
71
  'key' => 'wpleads_address_line_1',
72
- 'priority' => 100,
73
  'type' => 'text',
74
  'nature' => 'core'
75
  ),
76
  array(
77
  'label' => __( 'Address Continued', INBOUNDNOW_TEXT_DOMAIN ) ,
78
  'key' => 'wpleads_address_line_2',
79
- 'priority' => 110,
80
  'type' => 'text',
81
  'nature' => 'core'
82
  ),
83
  array(
84
  'label' => __( 'City', INBOUNDNOW_TEXT_DOMAIN ) ,
85
  'key' => 'wpleads_city',
86
- 'priority' => 120,
87
  'type' => 'text',
88
  'nature' => 'core'
89
  ),
90
  array(
91
  'label' => __( 'State/Region', INBOUNDNOW_TEXT_DOMAIN ) ,
92
  'key' => 'wpleads_region_name',
93
- 'priority' => 130,
94
  'type' => 'text',
95
  'nature' => 'core'
96
  ),
97
  array(
98
  'label' => __( 'Zip-code', INBOUNDNOW_TEXT_DOMAIN ) ,
99
  'key' => 'wpleads_zip',
100
- 'priority' => 140,
101
  'type' => 'text',
102
  'nature' => 'core'
103
  ),
104
  array(
105
  'label' => __( 'Country', INBOUNDNOW_TEXT_DOMAIN ) ,
106
  'key' => 'wpleads_country_code',
107
- 'priority' => 150,
108
  'type' => 'text',
109
  'nature' => 'core'
110
  ),
111
  array(
112
  'label' => __( 'Billing First Name', INBOUNDNOW_TEXT_DOMAIN ) ,
113
  'key' => 'wpleads_billing_first_name',
114
- 'priority' => 160,
115
  'type' => 'text',
116
  'nature' => 'core'
117
  ),
118
  array(
119
  'label' => __( 'Billing Last Name', INBOUNDNOW_TEXT_DOMAIN ) ,
120
  'key' => 'wpleads_billing_last_name',
121
- 'priority' => 120,
122
  'type' => 'text',
123
  'nature' => 'core'
124
  ),
125
  array(
126
  'label' => __( 'Billing Company', INBOUNDNOW_TEXT_DOMAIN ) ,
127
  'key' => 'wpleads_billing_company_name',
128
- 'priority' => 170,
129
  'type' => 'text',
130
  'nature' => 'core'
131
  ),
132
  array(
133
  'label' => __( 'Billing Address', INBOUNDNOW_TEXT_DOMAIN ) ,
134
  'key' => 'wpleads_billing_address_line_1',
135
- 'priority' => 180,
136
  'type' => 'text',
137
  'nature' => 'core'
138
  ),
139
  array(
140
  'label' => __( 'Billing Address Continued', INBOUNDNOW_TEXT_DOMAIN ) ,
141
  'key' => 'wpleads_billing_address_line_2',
142
- 'priority' => 190,
143
  'type' => 'text',
144
  'nature' => 'core'
145
  ),
146
  array(
147
  'label' => __( 'Billing City', INBOUNDNOW_TEXT_DOMAIN ) ,
148
  'key' => 'wpleads_billing_city',
149
- 'priority' => 200,
150
  'type' => 'text',
151
  'nature' => 'core'
152
  ),
153
  array(
154
  'label' => __( 'Billing State/Region', INBOUNDNOW_TEXT_DOMAIN ) ,
155
  'key' => 'wpleads_billing_region_name',
156
- 'priority' => 210,
157
  'type' => 'text',
158
  'nature' => 'core'
159
  ),
160
  array(
161
  'label' => __( 'Billing Zip-code', INBOUNDNOW_TEXT_DOMAIN ) ,
162
  'key' => 'wpleads_billing_zip',
163
- 'priority' => 220,
164
  'type' => 'text',
165
  'nature' => 'core'
166
  ),
@@ -168,105 +168,105 @@ if ( !class_exists('Leads_Field_Map') ) {
168
  array(
169
  'label' => __( 'Billing Country', INBOUNDNOW_TEXT_DOMAIN ) ,
170
  'key' => 'wpleads_billing_country_code',
171
- 'priority' => 230,
172
  'type' => 'text',
173
  'nature' => 'core'
174
  ),
175
  array(
176
  'label' => __( 'Shipping First Name', INBOUNDNOW_TEXT_DOMAIN ) ,
177
  'key' => 'wpleads_shipping_first_name',
178
- 'priority' => 240,
179
  'type' => 'text',
180
  'nature' => 'core'
181
  ),
182
  array(
183
  'label' => __( 'Shipping Last Name', INBOUNDNOW_TEXT_DOMAIN ) ,
184
  'key' => 'wpleads_shipping_last_name',
185
- 'priority' => 250,
186
  'type' => 'text',
187
  'nature' => 'core'
188
  ),
189
  array(
190
  'label' => __( 'Shipping Company Name', INBOUNDNOW_TEXT_DOMAIN ) ,
191
  'key' => 'wpleads_shipping_company_name',
192
- 'priority' => 260,
193
  'type' => 'text',
194
  'nature' => 'core'
195
  ),
196
  array(
197
  'label' => __( 'Shipping Address', INBOUNDNOW_TEXT_DOMAIN ) ,
198
  'key' => 'wpleads_shipping_address_line_1',
199
- 'priority' => 270,
200
  'type' => 'text',
201
  'nature' => 'core'
202
  ),
203
  array(
204
  'label' => __( 'Shipping Address Continued', INBOUNDNOW_TEXT_DOMAIN ) ,
205
  'key' => 'wpleads_shipping_address_line_2',
206
- 'priority' => 280,
207
  'type' => 'text',
208
  'nature' => 'core'
209
  ),
210
  array(
211
  'label' => __( 'Shipping City', INBOUNDNOW_TEXT_DOMAIN ) ,
212
  'key' => 'wpleads_shipping_city',
213
- 'priority' => 290,
214
  'type' => 'text',
215
  'nature' => 'core'
216
  ),
217
  array(
218
  'label' => __( 'Shipping State/Region', INBOUNDNOW_TEXT_DOMAIN ) ,
219
  'key' => 'wpleads_shipping_region_name',
220
- 'priority' => 300,
221
  'type' => 'text',
222
  'nature' => 'core'
223
  ),
224
  array(
225
  'label' => __( 'Shipping Zip-code', INBOUNDNOW_TEXT_DOMAIN ) ,
226
  'key' => 'wpleads_shipping_zip',
227
- 'priority' => 310,
228
  'type' => 'text',
229
  'nature' => 'core'
230
  ),
231
  array(
232
  'label' => __( 'Shipping Country', INBOUNDNOW_TEXT_DOMAIN ) ,
233
  'key' => 'wpleads_shipping_country_code',
234
- 'priority' => 320,
235
  'type' => 'text',
236
  'nature' => 'core'
237
  ),
238
  array(
239
  'label' => __( 'Related Websites', INBOUNDNOW_TEXT_DOMAIN ) ,
240
  'key' => 'wpleads_websites',
241
- 'priority' => 330,
242
  'type' => 'links',
243
  'nature' => 'core'
244
  ),
245
  array(
246
  'label' => __( 'Notes', INBOUNDNOW_TEXT_DOMAIN ) ,
247
  'key' => 'wpleads_notes',
248
- 'priority' => 340,
249
  'type' => 'textarea',
250
  'nature' => 'core'
251
  ),
252
  array(
253
  'label' => __( 'Twitter Account', INBOUNDNOW_TEXT_DOMAIN ) ,
254
  'key' => 'wpleads_social_twitter',
255
- 'priority' => 350,
256
  'type' => 'text',
257
  'nature' => 'core'
258
  ),
259
  array(
260
  'label' => __( 'Youtube Account', INBOUNDNOW_TEXT_DOMAIN ) ,
261
  'key' => 'wpleads_social_youtube',
262
- 'priority' => 360,
263
  'type' => 'text',
264
  'nature' => 'core'
265
  ),
266
  array(
267
  'label' => __( 'Facebook Account', INBOUNDNOW_TEXT_DOMAIN ) ,
268
  'key' => 'wpleads_social_facebook',
269
- 'priority' => 370,
270
  'type' => 'text',
271
  'nature' => 'core'
272
  )
@@ -291,9 +291,13 @@ if ( !class_exists('Leads_Field_Map') ) {
291
  $field_map = array();
292
  $field_map[''] = 'No Mapping'; /* default empty */
293
  foreach ($lead_fields as $key=>$field) {
294
- $label = $field['label'];
295
- $key = $field['key'];
296
- $field_map[$key] = $label;
 
 
 
 
297
  }
298
 
299
  return $field_map;
13
  array(
14
  'label' => __( 'First Name', INBOUNDNOW_TEXT_DOMAIN ) ,
15
  'key' => 'wpleads_first_name',
16
+ 'priority' => 1,
17
  'type' => 'text',
18
  'nature' => 'core'
19
  ),
20
  array(
21
  'label' => __( 'Last Name', INBOUNDNOW_TEXT_DOMAIN ) ,
22
  'key' => 'wpleads_last_name',
23
+ 'priority' => 2,
24
  'type' => 'text',
25
  'nature' => 'core'
26
  ),
27
  array(
28
  'label' => __( 'Email', INBOUNDNOW_TEXT_DOMAIN ) ,
29
  'key' => 'wpleads_email_address',
30
+ 'priority' => 3,
31
  'type' => 'text',
32
  'nature' => 'core'
33
  ),
34
  array(
35
  'label' => __( 'Website', INBOUNDNOW_TEXT_DOMAIN ) ,
36
  'key' => 'wpleads_website',
37
+ 'priority' => 4,
38
  'type' => 'text',
39
  'nature' => 'core'
40
  ),
41
  array(
42
  'label' => __( 'Job Title', INBOUNDNOW_TEXT_DOMAIN ) ,
43
  'key' => 'wpleads_job_title',
44
+ 'priority' => 5,
45
  'type' => 'text',
46
  'nature' => 'core'
47
  ),
48
  array(
49
  'label' => __( 'Company Name', INBOUNDNOW_TEXT_DOMAIN ) ,
50
  'key' => 'wpleads_company_name',
51
+ 'priority' => 6,
52
  'type' => 'text',
53
  'nature' => 'core'
54
  ),
55
  array(
56
  'label' => __( 'Mobile Phone', INBOUNDNOW_TEXT_DOMAIN ) ,
57
  'key' => 'wpleads_mobile_phone',
58
+ 'priority' => 7,
59
  'type' => 'text',
60
  'nature' => 'core'
61
  ),
62
  array(
63
  'label' => __( 'Work Phone', INBOUNDNOW_TEXT_DOMAIN ) ,
64
  'key' => 'wpleads_work_phone',
65
+ 'priority' => 8,
66
  'type' => 'text',
67
  'nature' => 'core'
68
  ),
69
  array(
70
  'label' => __( 'Address', INBOUNDNOW_TEXT_DOMAIN ) ,
71
  'key' => 'wpleads_address_line_1',
72
+ 'priority' => 9,
73
  'type' => 'text',
74
  'nature' => 'core'
75
  ),
76
  array(
77
  'label' => __( 'Address Continued', INBOUNDNOW_TEXT_DOMAIN ) ,
78
  'key' => 'wpleads_address_line_2',
79
+ 'priority' => 10,
80
  'type' => 'text',
81
  'nature' => 'core'
82
  ),
83
  array(
84
  'label' => __( 'City', INBOUNDNOW_TEXT_DOMAIN ) ,
85
  'key' => 'wpleads_city',
86
+ 'priority' => 11,
87
  'type' => 'text',
88
  'nature' => 'core'
89
  ),
90
  array(
91
  'label' => __( 'State/Region', INBOUNDNOW_TEXT_DOMAIN ) ,
92
  'key' => 'wpleads_region_name',
93
+ 'priority' => 12,
94
  'type' => 'text',
95
  'nature' => 'core'
96
  ),
97
  array(
98
  'label' => __( 'Zip-code', INBOUNDNOW_TEXT_DOMAIN ) ,
99
  'key' => 'wpleads_zip',
100
+ 'priority' => 13,
101
  'type' => 'text',
102
  'nature' => 'core'
103
  ),
104
  array(
105
  'label' => __( 'Country', INBOUNDNOW_TEXT_DOMAIN ) ,
106
  'key' => 'wpleads_country_code',
107
+ 'priority' => 14,
108
  'type' => 'text',
109
  'nature' => 'core'
110
  ),
111
  array(
112
  'label' => __( 'Billing First Name', INBOUNDNOW_TEXT_DOMAIN ) ,
113
  'key' => 'wpleads_billing_first_name',
114
+ 'priority' => 15,
115
  'type' => 'text',
116
  'nature' => 'core'
117
  ),
118
  array(
119
  'label' => __( 'Billing Last Name', INBOUNDNOW_TEXT_DOMAIN ) ,
120
  'key' => 'wpleads_billing_last_name',
121
+ 'priority' => 16,
122
  'type' => 'text',
123
  'nature' => 'core'
124
  ),
125
  array(
126
  'label' => __( 'Billing Company', INBOUNDNOW_TEXT_DOMAIN ) ,
127
  'key' => 'wpleads_billing_company_name',
128
+ 'priority' => 17,
129
  'type' => 'text',
130
  'nature' => 'core'
131
  ),
132
  array(
133
  'label' => __( 'Billing Address', INBOUNDNOW_TEXT_DOMAIN ) ,
134
  'key' => 'wpleads_billing_address_line_1',
135
+ 'priority' => 18,
136
  'type' => 'text',
137
  'nature' => 'core'
138
  ),
139
  array(
140
  'label' => __( 'Billing Address Continued', INBOUNDNOW_TEXT_DOMAIN ) ,
141
  'key' => 'wpleads_billing_address_line_2',
142
+ 'priority' => 19,
143
  'type' => 'text',
144
  'nature' => 'core'
145
  ),
146
  array(
147
  'label' => __( 'Billing City', INBOUNDNOW_TEXT_DOMAIN ) ,
148
  'key' => 'wpleads_billing_city',
149
+ 'priority' => 20,
150
  'type' => 'text',
151
  'nature' => 'core'
152
  ),
153
  array(
154
  'label' => __( 'Billing State/Region', INBOUNDNOW_TEXT_DOMAIN ) ,
155
  'key' => 'wpleads_billing_region_name',
156
+ 'priority' => 21,
157
  'type' => 'text',
158
  'nature' => 'core'
159
  ),
160
  array(
161
  'label' => __( 'Billing Zip-code', INBOUNDNOW_TEXT_DOMAIN ) ,
162
  'key' => 'wpleads_billing_zip',
163
+ 'priority' => 22,
164
  'type' => 'text',
165
  'nature' => 'core'
166
  ),
168
  array(
169
  'label' => __( 'Billing Country', INBOUNDNOW_TEXT_DOMAIN ) ,
170
  'key' => 'wpleads_billing_country_code',
171
+ 'priority' => 23,
172
  'type' => 'text',
173
  'nature' => 'core'
174
  ),
175
  array(
176
  'label' => __( 'Shipping First Name', INBOUNDNOW_TEXT_DOMAIN ) ,
177
  'key' => 'wpleads_shipping_first_name',
178
+ 'priority' => 24,
179
  'type' => 'text',
180
  'nature' => 'core'
181
  ),
182
  array(
183
  'label' => __( 'Shipping Last Name', INBOUNDNOW_TEXT_DOMAIN ) ,
184
  'key' => 'wpleads_shipping_last_name',
185
+ 'priority' => 25,
186
  'type' => 'text',
187
  'nature' => 'core'
188
  ),
189
  array(
190
  'label' => __( 'Shipping Company Name', INBOUNDNOW_TEXT_DOMAIN ) ,
191
  'key' => 'wpleads_shipping_company_name',
192
+ 'priority' => 26,
193
  'type' => 'text',
194
  'nature' => 'core'
195
  ),
196
  array(
197
  'label' => __( 'Shipping Address', INBOUNDNOW_TEXT_DOMAIN ) ,
198
  'key' => 'wpleads_shipping_address_line_1',
199
+ 'priority' => 27,
200
  'type' => 'text',
201
  'nature' => 'core'
202
  ),
203
  array(
204
  'label' => __( 'Shipping Address Continued', INBOUNDNOW_TEXT_DOMAIN ) ,
205
  'key' => 'wpleads_shipping_address_line_2',
206
+ 'priority' => 28,
207
  'type' => 'text',
208
  'nature' => 'core'
209
  ),
210
  array(
211
  'label' => __( 'Shipping City', INBOUNDNOW_TEXT_DOMAIN ) ,
212
  'key' => 'wpleads_shipping_city',
213
+ 'priority' => 29,
214
  'type' => 'text',
215
  'nature' => 'core'
216
  ),
217
  array(
218
  'label' => __( 'Shipping State/Region', INBOUNDNOW_TEXT_DOMAIN ) ,
219
  'key' => 'wpleads_shipping_region_name',
220
+ 'priority' => 30,
221
  'type' => 'text',
222
  'nature' => 'core'
223
  ),
224
  array(
225
  'label' => __( 'Shipping Zip-code', INBOUNDNOW_TEXT_DOMAIN ) ,
226
  'key' => 'wpleads_shipping_zip',
227
+ 'priority' => 31,
228
  'type' => 'text',
229
  'nature' => 'core'
230
  ),
231
  array(
232
  'label' => __( 'Shipping Country', INBOUNDNOW_TEXT_DOMAIN ) ,
233
  'key' => 'wpleads_shipping_country_code',
234
+ 'priority' => 32,
235
  'type' => 'text',
236
  'nature' => 'core'
237
  ),
238
  array(
239
  'label' => __( 'Related Websites', INBOUNDNOW_TEXT_DOMAIN ) ,
240
  'key' => 'wpleads_websites',
241
+ 'priority' => 33,
242
  'type' => 'links',
243
  'nature' => 'core'
244
  ),
245
  array(
246
  'label' => __( 'Notes', INBOUNDNOW_TEXT_DOMAIN ) ,
247
  'key' => 'wpleads_notes',
248
+ 'priority' => 34,
249
  'type' => 'textarea',
250
  'nature' => 'core'
251
  ),
252
  array(
253
  'label' => __( 'Twitter Account', INBOUNDNOW_TEXT_DOMAIN ) ,
254
  'key' => 'wpleads_social_twitter',
255
+ 'priority' => 35,
256
  'type' => 'text',
257
  'nature' => 'core'
258
  ),
259
  array(
260
  'label' => __( 'Youtube Account', INBOUNDNOW_TEXT_DOMAIN ) ,
261
  'key' => 'wpleads_social_youtube',
262
+ 'priority' => 36,
263
  'type' => 'text',
264
  'nature' => 'core'
265
  ),
266
  array(
267
  'label' => __( 'Facebook Account', INBOUNDNOW_TEXT_DOMAIN ) ,
268
  'key' => 'wpleads_social_facebook',
269
+ 'priority' => 37,
270
  'type' => 'text',
271
  'nature' => 'core'
272
  )
291
  $field_map = array();
292
  $field_map[''] = 'No Mapping'; /* default empty */
293
  foreach ($lead_fields as $key=>$field) {
294
+ if (!isset($field['key'])) {
295
+ continue;
296
+ }
297
+
298
+ $label = $field['label'];
299
+ $key = $field['key'];
300
+ $field_map[$key] = $label;
301
  }
302
 
303
  return $field_map;
shared/classes/class.lead-storage.php CHANGED
@@ -1,17 +1,17 @@
1
  <?php
2
  /**
3
- * Inbound Lead Storage
4
- *
5
- * - Handles lead creation and data storage
6
- */
7
  if (!class_exists('LeadStorage')) {
8
  class LeadStorage {
9
  static $mapped_fields;
10
  static $is_ajax;
11
 
12
  /**
13
- * Initialize class
14
- */
15
  static function init() {
16
  /* determines if in ajax mode */
17
  self::set_mode();
@@ -25,8 +25,8 @@ if (!class_exists('LeadStorage')) {
25
  }
26
 
27
  /**
28
- * Checks if running in ajax mode
29
- */
30
  static function set_mode( $mode = 'auto' ) {
31
  /* http://davidwalsh.name/detect-ajax */
32
  switch( $mode ) {
@@ -43,8 +43,8 @@ if (!class_exists('LeadStorage')) {
43
  }
44
 
45
  /**
46
- * Stores lead
47
- */
48
  static function inbound_lead_store( $args ) {
49
  global $user_ID, $wpdb;
50
  if (!is_array($args)) { $args = array(); }
@@ -83,6 +83,12 @@ if (!class_exists('LeadStorage')) {
83
  $mappedData = array();
84
  }
85
 
 
 
 
 
 
 
86
  $mappedData = self::improve_mapping($mappedData, $lead);
87
 
88
  /* prepate lead lists */
@@ -107,7 +113,7 @@ if (!class_exists('LeadStorage')) {
107
  /* action hook on existing leads only */
108
  do_action('wpleads_existing_lead_update', $lead);
109
  } else {
110
- /* Create new lead if one doesnt exist */
111
  $lead['id'] = self::store_new_lead($lead);
112
  update_post_meta( $lead['id'] , 'wp_lead_status' , 'new');
113
  }
@@ -170,13 +176,19 @@ if (!class_exists('LeadStorage')) {
170
 
171
  /* Store IP addresss & Store GEO Data */
172
  if ($lead['ip_address']) {
173
- update_post_meta( $lead['id'], 'wpleads_ip_address', $lead['ip_address'] );
174
  /*self::store_geolocation_data($lead); */
175
  }
176
 
177
  /* store raw form data */
178
  self::store_raw_form_data($lead);
179
 
 
 
 
 
 
 
180
  if ( self::$is_ajax ) {
181
  echo $lead['id'];
182
  do_action('inbound_store_lead_post', $lead );
@@ -190,8 +202,8 @@ if (!class_exists('LeadStorage')) {
190
  }
191
 
192
  /**
193
- * Creates new lead in wp-lead post type
194
- */
195
  static function store_new_lead($lead){
196
  /* Create New Lead */
197
  $post = array(
@@ -215,8 +227,8 @@ if (!class_exists('LeadStorage')) {
215
  }
216
 
217
  /**
218
- * Updates pages viewed object
219
- */
220
  static function store_page_views($lead){
221
  $page_view_data = get_post_meta( $lead['id'], 'page_views', TRUE );
222
  $page_view_data = json_decode($page_view_data,true);
@@ -226,7 +238,7 @@ if (!class_exists('LeadStorage')) {
226
  $new_page_views = self::json_array_merge( $page_view_data, $lead['page_views']);
227
  $page_views = json_encode($new_page_views);
228
  } else {
229
- /* Create page_view meta if it doesn't exist */
230
  $page_views = $lead['page_views'];
231
  $page_views = json_encode($page_views);
232
  }
@@ -234,8 +246,8 @@ if (!class_exists('LeadStorage')) {
234
  }
235
 
236
  /**
237
- * Prefixes keys with wpleads_ if key is not prepended with wpleads_
238
- */
239
  static function store_mapped_data($lead, $mappedData){
240
 
241
  foreach ($mappedData as $key => $value) {
@@ -262,64 +274,64 @@ if (!class_exists('LeadStorage')) {
262
  }
263
 
264
  /**
265
- * Updates search history object
266
- */
267
  static function store_search_history($lead){
268
- $search = $lead['search_data'];
269
- $search_data = get_post_meta( $lead['id'], 'wpleads_search_data', TRUE );
270
- $search_data = json_decode($search_data,true);
271
- if (is_array($search_data)){
272
- $s_count = count($search_data) + 1;
273
- $loop_count = 1;
274
- foreach ($search as $key => $value) {
275
  $search_data[$s_count]['date'] = $search[$loop_count]['date'];
276
  $search_data[$s_count]['value'] = $search[$loop_count]['value'];
277
  $s_count++; $loop_count++;
278
- }
279
- } else {
280
- /* Create search obj */
281
- $s_count = 1;
282
- $loop_count = 1;
283
- foreach ($search as $key => $value) {
284
  $search_data[$s_count]['date'] = $search[$loop_count]['date'];
285
  $search_data[$s_count]['value'] = $search[$loop_count]['value'];
286
  $s_count++; $loop_count++;
287
- }
288
  }
289
- $search_data = json_encode($search_data);
290
- update_post_meta($lead['id'], 'wpleads_search_data', $search_data); /* Store search object */
 
291
  }
292
 
293
  /**
294
- * updates conversion data object
295
- */
296
  static function store_conversion_data( $lead ) {
297
 
298
- $conversion_data = get_post_meta( $lead['id'], 'wpleads_conversion_data', TRUE );
299
- $conversion_data = json_decode($conversion_data,true);
300
- $variation = $lead['variation'];
301
 
302
- if ( is_array($conversion_data)) {
303
- $c_count = count($conversion_data) + 1;
304
- $conversion_data[$c_count]['id'] = $lead['page_id'];
305
- $conversion_data[$c_count]['variation'] = $variation;
306
- $conversion_data[$c_count]['datetime'] = $lead['wordpress_date_time'];
307
- } else {
308
- $c_count = 1;
309
- $conversion_data[1]['id'] = $lead['page_id'];
310
- $conversion_data[1]['variation'] = $variation;
311
- $conversion_data[1]['datetime'] = $lead['wordpress_date_time'];
312
- $conversion_data[1]['first_time'] = 1;
313
- }
314
 
315
- $lead['conversion_data'] = json_encode($conversion_data);
316
- update_post_meta($lead['id'],'wpleads_conversion_count', $c_count); /* Store conversions count */
317
- update_post_meta($lead['id'], 'wpleads_conversion_data', $lead['conversion_data']);/* Store conversion obj */
318
 
319
  }
320
  /**
321
- * Store Conversion Data to LANDING PAGE/CTA DATA
322
- */
323
  static function store_conversion_stats($lead){
324
  $page_conversion_data = get_post_meta( $lead['page_id'], '_inbound_conversion_data', TRUE );
325
  $page_conversion_data = json_decode($page_conversion_data,true);
@@ -339,8 +351,8 @@ if (!class_exists('LeadStorage')) {
339
  }
340
 
341
  /**
342
- * Stores referral data
343
- */
344
  static function store_referral_data($lead) {
345
  $referral_data = get_post_meta( $lead['id'], 'wpleads_referral_data', TRUE );
346
 
@@ -354,13 +366,13 @@ if (!class_exists('LeadStorage')) {
354
  /*$array = array('http://google.com', 'http://twitter.com', 'http://tumblr.com?query=test', ''); */
355
  $referer = $parser->parse($lead['source']);
356
 
357
- if ( $referer->isKnown() ) {
358
- $ref_type = $referer->getMedium();
359
 
360
- } else {
361
- /* check if ref exists */
362
- $ref_type = ($lead['source'] === "Direct Traffic") ? 'Direct Traffic' : 'referral';
363
- }
364
 
365
  $referral_data = json_decode($referral_data,true);
366
  if (is_array($referral_data)){
@@ -382,8 +394,8 @@ if (!class_exists('LeadStorage')) {
382
  }
383
 
384
  /**
385
- * Loop trough lead_data array and update post meta
386
- */
387
  static function update_common_meta($lead) {
388
 
389
  if (!empty($lead['user_ID'])) {
@@ -443,8 +455,8 @@ if (!class_exists('LeadStorage')) {
443
  }
444
 
445
  /**
446
- * Updates raw form data object
447
- */
448
  static function store_raw_form_data($lead){
449
 
450
  /* Raw Form Values Store */
@@ -497,19 +509,19 @@ if (!class_exists('LeadStorage')) {
497
  }
498
 
499
  /**
500
- * Parses & improves lead name
501
- */
502
  static function improve_lead_name( $lead ) {
503
- /* */
504
- $lead['name'] = (isset($lead['name'])) ? $lead['name'] : '';
505
 
506
- /* do not let names with 'false' pass */
507
- if ( !empty($lead['name']) && $lead['name'] == 'false' ) {
508
- $lead['name'] = '';
509
- }
510
- if ( !empty($lead['first_name']) && $lead['first_name'] == 'false' ) {
511
- $lead['first_name'] = '';
512
- }
513
 
514
  /* if last name empty and full name present */
515
  if ( empty($lead['last_name']) && $lead['name'] ) {
@@ -545,25 +557,25 @@ if (!class_exists('LeadStorage')) {
545
  }
546
 
547
  /**
548
- * Uses mapped data if not programatically set
549
- */
550
  static function improve_mapping($mappedData, $lead) {
551
 
552
- /* check to see if there are any mapped values arriving through inbound_store_lead */
553
- $fields = Leads_Field_Map::build_map_array();
554
 
555
- foreach ($fields as $key => $label ) {
556
- if( isset( $lead[ $key ]) && !isset($mappedData[$key]) ) {
557
- $mappedData[$key] = $lead[ $key ];
558
- }
559
- }
560
 
561
  /* remove instances of wpleads_ */
562
  $newMap = array();
563
  foreach ($mappedData as $key=>$value) {
564
  $key = str_replace('wpleads_','',$key);
565
  $newMap[$key] = $value;
566
- }
567
 
568
  /* Set names if not mapped */
569
  $newMap['first_name'] = (!isset($newMap['first_name'])) ? $lead['first_name'] : $newMap['first_name'];
@@ -576,8 +588,8 @@ if (!class_exists('LeadStorage')) {
576
  }
577
 
578
  /**
579
- * Search lead by email
580
- */
581
  static function lookup_lead_by_email($email){
582
  global $wpdb;
583
  $query = $wpdb->prepare(
@@ -616,8 +628,8 @@ if (!class_exists('LeadStorage')) {
616
  }
617
 
618
  /**
619
- * Discover session IP address
620
- */
621
  static function lookup_ip_address() {
622
  if(isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
623
  if(isset($_SERVER["HTTP_CLIENT_IP"])) {
@@ -642,10 +654,10 @@ if (!class_exists('LeadStorage')) {
642
  }
643
 
644
  /**
645
- * Legacy function used by some extensions
646
- * @param ARRAY $args legacy dataset of mapped lead fields
647
- * @param BOOL $return set to true to disable printing of lead id
648
- */
649
  if (!function_exists('inbound_store_lead')) {
650
  function inbound_store_lead( $args, $return = true ) {
651
  global $user_ID, $wpdb;
@@ -690,10 +702,10 @@ if (!function_exists('inbound_store_lead')) {
690
 
691
 
692
  /**
693
- * Legacy functions for adding conversion to lead profile
694
- * @param INT $lead_id
695
- * @param ARRAY dataset of lead informaiton
696
- */
697
  if (!function_exists('inbound_add_conversion_to_lead')) {
698
  function inbound_add_conversion_to_lead( $lead_id, $lead_data ) {
699
 
1
  <?php
2
  /**
3
+ * Inbound Lead Storage
4
+ *
5
+ * - Handles lead creation and data storage
6
+ */
7
  if (!class_exists('LeadStorage')) {
8
  class LeadStorage {
9
  static $mapped_fields;
10
  static $is_ajax;
11
 
12
  /**
13
+ * Initialize class
14
+ */
15
  static function init() {
16
  /* determines if in ajax mode */
17
  self::set_mode();
25
  }
26
 
27
  /**
28
+ * Checks if running in ajax mode
29
+ */
30
  static function set_mode( $mode = 'auto' ) {
31
  /* http://davidwalsh.name/detect-ajax */
32
  switch( $mode ) {
43
  }
44
 
45
  /**
46
+ * Stores lead
47
+ */
48
  static function inbound_lead_store( $args ) {
49
  global $user_ID, $wpdb;
50
  if (!is_array($args)) { $args = array(); }
83
  $mappedData = array();
84
  }
85
 
86
+ if($lead['raw_params']){
87
+ parse_str($lead['raw_params'], $raw_params);
88
+ } else {
89
+ $raw_params = array();
90
+ }
91
+
92
  $mappedData = self::improve_mapping($mappedData, $lead);
93
 
94
  /* prepate lead lists */
113
  /* action hook on existing leads only */
114
  do_action('wpleads_existing_lead_update', $lead);
115
  } else {
116
+ /* Create new lead if one doesnt exist */
117
  $lead['id'] = self::store_new_lead($lead);
118
  update_post_meta( $lead['id'] , 'wp_lead_status' , 'new');
119
  }
176
 
177
  /* Store IP addresss & Store GEO Data */
178
  if ($lead['ip_address']) {
179
+ update_post_meta( $lead['id'], 'wpleads_ip_address', $lead['ip_address'] );
180
  /*self::store_geolocation_data($lead); */
181
  }
182
 
183
  /* store raw form data */
184
  self::store_raw_form_data($lead);
185
 
186
+ /* look for form_id and set it into main array */
187
+ if (isset($raw_params['inbound_form_id'])) {
188
+ $lead['form_id'] = $raw_params['inbound_form_id'];
189
+ $lead['form_name'] = $raw_params['inbound_form_n'];
190
+ }
191
+
192
  if ( self::$is_ajax ) {
193
  echo $lead['id'];
194
  do_action('inbound_store_lead_post', $lead );
202
  }
203
 
204
  /**
205
+ * Creates new lead in wp-lead post type
206
+ */
207
  static function store_new_lead($lead){
208
  /* Create New Lead */
209
  $post = array(
227
  }
228
 
229
  /**
230
+ * Updates pages viewed object
231
+ */
232
  static function store_page_views($lead){
233
  $page_view_data = get_post_meta( $lead['id'], 'page_views', TRUE );
234
  $page_view_data = json_decode($page_view_data,true);
238
  $new_page_views = self::json_array_merge( $page_view_data, $lead['page_views']);
239
  $page_views = json_encode($new_page_views);
240
  } else {
241
+ /* Create page_view meta if it doesn't exist */
242
  $page_views = $lead['page_views'];
243
  $page_views = json_encode($page_views);
244
  }
246
  }
247
 
248
  /**
249
+ * Prefixes keys with wpleads_ if key is not prepended with wpleads_
250
+ */
251
  static function store_mapped_data($lead, $mappedData){
252
 
253
  foreach ($mappedData as $key => $value) {
274
  }
275
 
276
  /**
277
+ * Updates search history object
278
+ */
279
  static function store_search_history($lead){
280
+ $search = $lead['search_data'];
281
+ $search_data = get_post_meta( $lead['id'], 'wpleads_search_data', TRUE );
282
+ $search_data = json_decode($search_data,true);
283
+ if (is_array($search_data)){
284
+ $s_count = count($search_data) + 1;
285
+ $loop_count = 1;
286
+ foreach ($search as $key => $value) {
287
  $search_data[$s_count]['date'] = $search[$loop_count]['date'];
288
  $search_data[$s_count]['value'] = $search[$loop_count]['value'];
289
  $s_count++; $loop_count++;
290
+ }
291
+ } else {
292
+ /* Create search obj */
293
+ $s_count = 1;
294
+ $loop_count = 1;
295
+ foreach ($search as $key => $value) {
296
  $search_data[$s_count]['date'] = $search[$loop_count]['date'];
297
  $search_data[$s_count]['value'] = $search[$loop_count]['value'];
298
  $s_count++; $loop_count++;
 
299
  }
300
+ }
301
+ $search_data = json_encode($search_data);
302
+ update_post_meta($lead['id'], 'wpleads_search_data', $search_data); /* Store search object */
303
  }
304
 
305
  /**
306
+ * updates conversion data object
307
+ */
308
  static function store_conversion_data( $lead ) {
309
 
310
+ $conversion_data = get_post_meta( $lead['id'], 'wpleads_conversion_data', TRUE );
311
+ $conversion_data = json_decode($conversion_data,true);
312
+ $variation = $lead['variation'];
313
 
314
+ if ( is_array($conversion_data)) {
315
+ $c_count = count($conversion_data) + 1;
316
+ $conversion_data[$c_count]['id'] = $lead['page_id'];
317
+ $conversion_data[$c_count]['variation'] = $variation;
318
+ $conversion_data[$c_count]['datetime'] = $lead['wordpress_date_time'];
319
+ } else {
320
+ $c_count = 1;
321
+ $conversion_data[1]['id'] = $lead['page_id'];
322
+ $conversion_data[1]['variation'] = $variation;
323
+ $conversion_data[1]['datetime'] = $lead['wordpress_date_time'];
324
+ $conversion_data[1]['first_time'] = 1;
325
+ }
326
 
327
+ $lead['conversion_data'] = json_encode($conversion_data);
328
+ update_post_meta($lead['id'],'wpleads_conversion_count', $c_count); /* Store conversions count */
329
+ update_post_meta($lead['id'], 'wpleads_conversion_data', $lead['conversion_data']);/* Store conversion obj */
330
 
331
  }
332
  /**
333
+ * Store Conversion Data to LANDING PAGE/CTA DATA
334
+ */
335
  static function store_conversion_stats($lead){
336
  $page_conversion_data = get_post_meta( $lead['page_id'], '_inbound_conversion_data', TRUE );
337
  $page_conversion_data = json_decode($page_conversion_data,true);
351
  }
352
 
353
  /**
354
+ * Stores referral data
355
+ */
356
  static function store_referral_data($lead) {
357
  $referral_data = get_post_meta( $lead['id'], 'wpleads_referral_data', TRUE );
358
 
366
  /*$array = array('http://google.com', 'http://twitter.com', 'http://tumblr.com?query=test', ''); */
367
  $referer = $parser->parse($lead['source']);
368
 
369
+ if ( $referer->isKnown() ) {
370
+ $ref_type = $referer->getMedium();
371
 
372
+ } else {
373
+ /* check if ref exists */
374
+ $ref_type = ($lead['source'] === "Direct Traffic") ? 'Direct Traffic' : 'referral';
375
+ }
376
 
377
  $referral_data = json_decode($referral_data,true);
378
  if (is_array($referral_data)){
394
  }
395
 
396
  /**
397
+ * Loop trough lead_data array and update post meta
398
+ */
399
  static function update_common_meta($lead) {
400
 
401
  if (!empty($lead['user_ID'])) {
455
  }
456
 
457
  /**
458
+ * Updates raw form data object
459
+ */
460
  static function store_raw_form_data($lead){
461
 
462
  /* Raw Form Values Store */
509
  }
510
 
511
  /**
512
+ * Parses & improves lead name
513
+ */
514
  static function improve_lead_name( $lead ) {
515
+ /* */
516
+ $lead['name'] = (isset($lead['name'])) ? $lead['name'] : '';
517
 
518
+ /* do not let names with 'false' pass */
519
+ if ( !empty($lead['name']) && $lead['name'] == 'false' ) {
520
+ $lead['name'] = '';
521
+ }
522
+ if ( !empty($lead['first_name']) && $lead['first_name'] == 'false' ) {
523
+ $lead['first_name'] = '';
524
+ }
525
 
526
  /* if last name empty and full name present */
527
  if ( empty($lead['last_name']) && $lead['name'] ) {
557
  }
558
 
559
  /**
560
+ * Uses mapped data if not programatically set
561
+ */
562
  static function improve_mapping($mappedData, $lead) {
563
 
564
+ /* check to see if there are any mapped values arriving through inbound_store_lead */
565
+ $fields = Leads_Field_Map::build_map_array();
566
 
567
+ foreach ($fields as $key => $label ) {
568
+ if( isset( $lead[ $key ]) && !isset($mappedData[$key]) ) {
569
+ $mappedData[$key] = $lead[ $key ];
570
+ }
571
+ }
572
 
573
  /* remove instances of wpleads_ */
574
  $newMap = array();
575
  foreach ($mappedData as $key=>$value) {
576
  $key = str_replace('wpleads_','',$key);
577
  $newMap[$key] = $value;
578
+ }
579
 
580
  /* Set names if not mapped */
581
  $newMap['first_name'] = (!isset($newMap['first_name'])) ? $lead['first_name'] : $newMap['first_name'];
588
  }
589
 
590
  /**
591
+ * Search lead by email
592
+ */
593
  static function lookup_lead_by_email($email){
594
  global $wpdb;
595
  $query = $wpdb->prepare(
628
  }
629
 
630
  /**
631
+ * Discover session IP address
632
+ */
633
  static function lookup_ip_address() {
634
  if(isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
635
  if(isset($_SERVER["HTTP_CLIENT_IP"])) {
654
  }
655
 
656
  /**
657
+ * Legacy function used by some extensions
658
+ * @param ARRAY $args legacy dataset of mapped lead fields
659
+ * @param BOOL $return set to true to disable printing of lead id
660
+ */
661
  if (!function_exists('inbound_store_lead')) {
662
  function inbound_store_lead( $args, $return = true ) {
663
  global $user_ID, $wpdb;
702
 
703
 
704
  /**
705
+ * Legacy functions for adding conversion to lead profile
706
+ * @param INT $lead_id
707
+ * @param ARRAY dataset of lead informaiton
708
+ */
709
  if (!function_exists('inbound_add_conversion_to_lead')) {
710
  function inbound_add_conversion_to_lead( $lead_id, $lead_data ) {
711
 
shared/shortcodes/js/shortcodes-plugins.js CHANGED
@@ -18,15 +18,3 @@
18
  */
19
 
20
  jQuery.fn.appendo=function(opt){this.each(function(){jQuery.appendo.init(this,opt)});return this};jQuery.appendo=function(){var myself=this;this.opt={};this.init=function(obj,opt){var options=jQuery.extend({labelAdd:'Add Row',labelDel:'Remove',allowDelete:true,copyHandlers:false,focusFirst:true,onAdd:function(){return true},onDel:function(){return true},maxRows:0,wrapClass:'appendoButtons',wrapStyle:{padding:'.4em .2em .5em'},buttonStyle:{marginRight:'.5em'},subSelect:'tr:last'},myself.opt,opt);var $cpy=jQuery(obj).find(options.subSelect).clone(options.copyHandlers);var rows=1;var $add_btn=jQuery('#form-child-add').click(clicked_add),$del_btn=new_button(options.labelDel).click(clicked_del).hide();function add_row(){var $dup=$cpy.clone(options.copyHandlers);$dup.appendTo(obj);update_buttons(1);if(typeof(options.onAdd)=="function")options.onAdd($dup);if(!!options.focusFirst)$dup.find('input:first').focus()};function del_row(){var $row=jQuery(obj).find(options.subSelect);if((typeof(options.onDel)!="function")||options.onDel($row)){$row.remove();update_buttons(-1)}};function update_buttons(rowdelta){rows=rows+(rowdelta||0);(options.allowDelete&&(rows>1))?$del_btn.show():$del_btn.hide()};function new_button(label){return jQuery('<button />').css(options.buttonStyle).html(label)};function nothing(e){e.stopPropagation();e.preventDefault();return false};function clicked_add(e){if(!options.maxRows||(rows<options.maxRows))add_row();return nothing(e)};function clicked_del(e){if(rows>1)del_row();return nothing(e)};update_buttons()};return this}();
21
-
22
- var default_form_2 = {
23
- form_fields: "inbound_shortcode_redirect_2=&inbound_shortcode_notify_3=&inbound_shortcode_layout=vertical&inbound_shortcode_labels=top&inbound_shortcode_submit_8=Submit&inbound_shortcode_width_9=&inbound_shortcode_mailchimp_list_id=0&inbound_shortcode_label_1=First+Name&inbound_shortcode_field_type_1=text&inbound_shortcode_dropdown_options_1=&inbound_shortcode_radio_options_1=&inbound_shortcode_checkbox_options_1=&inbound_shortcode_html_block_options_1=&inbound_shortcode_placeholder_1=Enter+Your+First+Name&inbound_shortcode_description_1=&inbound_shortcode_hidden_input_options_1=&inbound_shortcode_label_2=Last+Name&inbound_shortcode_field_type_2=text&inbound_shortcode_dropdown_options_2=&inbound_shortcode_radio_options_2=&inbound_shortcode_checkbox_options_2=&inbound_shortcode_html_block_options_2=&inbound_shortcode_placeholder_2=Enter+Your+Last+Name&inbound_shortcode_description_2=&inbound_shortcode_hidden_input_options_2=&inbound_shortcode_label_3=Email&inbound_shortcode_field_type_3=text&inbound_shortcode_dropdown_options_3=&inbound_shortcode_radio_options_3=&inbound_shortcode_checkbox_options_3=&inbound_shortcode_html_block_options_3=&inbound_shortcode_required_3=on&inbound_shortcode_placeholder_3=Enter+Your+Email+Address&inbound_shortcode_description_3=&inbound_shortcode_hidden_input_options_3=&inbound_shortcode_label_4=Company+Name&inbound_shortcode_field_type_4=text&inbound_shortcode_dropdown_options_4=&inbound_shortcode_radio_options_4=&inbound_shortcode_checkbox_options_4=&inbound_shortcode_html_block_options_4=&inbound_shortcode_placeholder_4=Enter+Your+Company+Name&inbound_shortcode_description_4=&inbound_shortcode_hidden_input_options_4=&inbound_shortcode_label_5=Job+title&inbound_shortcode_field_type_5=text&inbound_shortcode_dropdown_options_5=&inbound_shortcode_radio_options_5=&inbound_shortcode_checkbox_options_5=&inbound_shortcode_html_block_options_5=&inbound_shortcode_placeholder_5=Enter+Your+Job+Title&inbound_shortcode_description_5=&inbound_shortcode_hidden_input_options_5=",
24
- field_length: 5};
25
-
26
- var default_form_1 = {
27
- form_fields: "inbound_shortcode_redirect_2=&inbound_shortcode_notify_3=&inbound_shortcode_layout=vertical&inbound_shortcode_labels=top&inbound_shortcode_submit_8=Submit&inbound_shortcode_width_9=&inbound_shortcode_label_1=First+Name&inbound_shortcode_field_type_1=text&inbound_shortcode_dropdown_options_1=&inbound_shortcode_radio_options_1=&inbound_shortcode_checkbox_options_1=&inbound_shortcode_html_block_options_1=&inbound_shortcode_placeholder_1=Enter+Your+First+Name&inbound_shortcode_description_1=&inbound_shortcode_hidden_input_options_1=&inbound_shortcode_map_to_1=&inbound_shortcode_label_2=Last+Name&inbound_shortcode_field_type_2=text&inbound_shortcode_dropdown_options_2=&inbound_shortcode_radio_options_2=&inbound_shortcode_checkbox_options_2=&inbound_shortcode_html_block_options_2=&inbound_shortcode_placeholder_2=Enter+Your+Last+Name&inbound_shortcode_description_2=&inbound_shortcode_hidden_input_options_2=&inbound_shortcode_map_to_2=&inbound_shortcode_label_3=Email&inbound_shortcode_field_type_3=text&inbound_shortcode_dropdown_options_3=&inbound_shortcode_radio_options_3=&inbound_shortcode_checkbox_options_3=&inbound_shortcode_html_block_options_3=&inbound_shortcode_required_3=on&inbound_shortcode_placeholder_3=Enter+Your+Email+Address&inbound_shortcode_description_3=&inbound_shortcode_hidden_input_options_3=&inbound_shortcode_map_to_3=",
28
- field_length: 3};
29
-
30
- var default_form_3 = {
31
- form_fields: "inbound_shortcode_redirect_2=&inbound_shortcode_notify_3=&inbound_shortcode_layout=vertical&inbound_shortcode_labels=top&inbound_shortcode_submit_8=Submit&inbound_shortcode_width_9=&inbound_shortcode_label_1=Email&inbound_shortcode_field_type_1=text&inbound_shortcode_dropdown_options_1=&inbound_shortcode_radio_options_1=&inbound_shortcode_checkbox_options_1=&inbound_shortcode_html_block_options_1=&inbound_shortcode_required_1=on&inbound_shortcode_placeholder_1=&inbound_shortcode_description_1=&inbound_shortcode_hidden_input_options_1=&inbound_shortcode_map_to_1=wpleads_email_address",
32
- field_length: 1};
18
  */
19
 
20
  jQuery.fn.appendo=function(opt){this.each(function(){jQuery.appendo.init(this,opt)});return this};jQuery.appendo=function(){var myself=this;this.opt={};this.init=function(obj,opt){var options=jQuery.extend({labelAdd:'Add Row',labelDel:'Remove',allowDelete:true,copyHandlers:false,focusFirst:true,onAdd:function(){return true},onDel:function(){return true},maxRows:0,wrapClass:'appendoButtons',wrapStyle:{padding:'.4em .2em .5em'},buttonStyle:{marginRight:'.5em'},subSelect:'tr:last'},myself.opt,opt);var $cpy=jQuery(obj).find(options.subSelect).clone(options.copyHandlers);var rows=1;var $add_btn=jQuery('#form-child-add').click(clicked_add),$del_btn=new_button(options.labelDel).click(clicked_del).hide();function add_row(){var $dup=$cpy.clone(options.copyHandlers);$dup.appendTo(obj);update_buttons(1);if(typeof(options.onAdd)=="function")options.onAdd($dup);if(!!options.focusFirst)$dup.find('input:first').focus()};function del_row(){var $row=jQuery(obj).find(options.subSelect);if((typeof(options.onDel)!="function")||options.onDel($row)){$row.remove();update_buttons(-1)}};function update_buttons(rowdelta){rows=rows+(rowdelta||0);(options.allowDelete&&(rows>1))?$del_btn.show():$del_btn.hide()};function new_button(label){return jQuery('<button />').css(options.buttonStyle).html(label)};function nothing(e){e.stopPropagation();e.preventDefault();return false};function clicked_add(e){if(!options.maxRows||(rows<options.maxRows))add_row();return nothing(e)};function clicked_del(e){if(rows>1)del_row();return nothing(e)};update_buttons()};return this}();
 
 
 
 
 
 
 
 
 
 
 
 
shared/shortcodes/shortcodes/forms.php CHANGED
@@ -468,13 +468,7 @@ if (!function_exists('inbound_get_form_names')) {
468
  'post_type'=> 'inbound-forms');
469
  $form_list = get_posts($args);
470
  $form_array = array();
471
- $default_array = array(
472
- "none" => "None (build your own in step 2)",
473
- "default_form_3" => "Simple Email Form",
474
- "default_form_1" => "First, Last, Email Form",
475
- "default_form_2" => "Standard Company Form",
476
- // Add in other forms made here
477
- );
478
  foreach ( $form_list as $form ) {
479
  $this_id = $form->ID;
480
  $this_link = get_permalink( $this_id );
@@ -482,9 +476,8 @@ if (!function_exists('inbound_get_form_names')) {
482
  $form_array['form_' . $this_id] = $title;
483
 
484
  }
485
- $result = array_merge( $default_array, $form_array);
486
 
487
- set_transient('inbound-form-names', $result, 24 * HOUR_IN_SECONDS);
488
  }
489
 
490
  }
468
  'post_type'=> 'inbound-forms');
469
  $form_list = get_posts($args);
470
  $form_array = array();
471
+
 
 
 
 
 
 
472
  foreach ( $form_list as $form ) {
473
  $this_id = $form->ID;
474
  $this_link = get_permalink( $this_id );
476
  $form_array['form_' . $this_id] = $title;
477
 
478
  }
 
479
 
480
+ set_transient('inbound-form-names', $form_array, 24 * HOUR_IN_SECONDS);
481
  }
482
 
483
  }
templates/half-and-half/index.php CHANGED
@@ -97,7 +97,7 @@ if (have_posts()) : while (have_posts()) : the_post();
97
  /* Import Google Font Stylesheet */
98
  @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300);
99
  </style>
100
- <?php dp_action('wp_head'); // Load Regular WP Head ?>
101
  <?php do_action('lp_head'); // Load Landing Page Specific Header Items ?>
102
  </head>
103
  <body>
97
  /* Import Google Font Stylesheet */
98
  @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300);
99
  </style>
100
+ <?php do_action('wp_head'); // Load Regular WP Head ?>
101
  <?php do_action('lp_head'); // Load Landing Page Specific Header Items ?>
102
  </head>
103
  <body>
templates/simple-solid-lite/config.php CHANGED
@@ -13,7 +13,7 @@ $path = (preg_match("/uploads/", dirname(__FILE__))) ? LANDINGPAGES_UPLOADS_URLP
13
  /* Configures Template Information */
14
  $lp_data[$key]['info'] = array(
15
  'data_type' => 'acf4',
16
- 'version' => '1.0',
17
  'label' => 'Simple Solid Lite',
18
  'category' => '1 Column',
19
  'demo' => 'http://demo.inboundnow.com/go/simple/',
@@ -27,6 +27,27 @@ if( function_exists('register_field_group') ):
27
  'key' => 'group_55df73a9053d1',
28
  'title' => 'Simple Solid Lite',
29
  'fields' => array (
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  array (
31
  'key' => 'field_55df73bb3fb9a',
32
  'label' => 'Main Content',
@@ -59,6 +80,24 @@ if( function_exists('register_field_group') ):
59
  'toolbar' => 'full',
60
  'media_upload' => 1,
61
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  array (
63
  'key' => 'field_55df73e03fb9b',
64
  'label' => 'Conversion Area',
13
  /* Configures Template Information */
14
  $lp_data[$key]['info'] = array(
15
  'data_type' => 'acf4',
16
+ 'version' => '2.0.0',
17
  'label' => 'Simple Solid Lite',
18
  'category' => '1 Column',
19
  'demo' => 'http://demo.inboundnow.com/go/simple/',
27
  'key' => 'group_55df73a9053d1',
28
  'title' => 'Simple Solid Lite',
29
  'fields' => array (
30
+ array (
31
+ 'key' => 'field_55df6384rh9',
32
+ 'label' => __('Main Headline','landing-pages'),
33
+ 'name' => 'lp-main-headline',
34
+ 'type' => 'text',
35
+ 'instructions' => __('Insert the main template headline here.','landing-pages'),
36
+ 'required' => 0,
37
+ 'conditional_logic' => 0,
38
+ 'wrapper' => array (
39
+ 'width' => '',
40
+ 'class' => '',
41
+ 'id' => '',
42
+ ),
43
+ 'default_value' => '',
44
+ 'placeholder' => '',
45
+ 'prepend' => '',
46
+ 'append' => '',
47
+ 'maxlength' => '',
48
+ 'readonly' => 0,
49
+ 'disabled' => 0,
50
+ ),
51
  array (
52
  'key' => 'field_55df73bb3fb9a',
53
  'label' => 'Main Content',
80
  'toolbar' => 'full',
81
  'media_upload' => 1,
82
  ),
83
+ array (
84
+ 'key' => 'field_55df73e03fb9b',
85
+ 'label' => __('Mailn Headline'),
86
+ 'name' => 'simple-solid-lite-conversion-area-content',
87
+ 'type' => 'wysiwyg',
88
+ 'instructions' => 'Insert a call to action or Inbound form here. ',
89
+ 'required' => 0,
90
+ 'conditional_logic' => 0,
91
+ 'wrapper' => array (
92
+ 'width' => '',
93
+ 'class' => '',
94
+ 'id' => '',
95
+ ),
96
+ 'default_value' => '',
97
+ 'tabs' => 'all',
98
+ 'toolbar' => 'full',
99
+ 'media_upload' => 1,
100
+ ),
101
  array (
102
  'key' => 'field_55df73e03fb9b',
103
  'label' => 'Conversion Area',
templates/simple-solid-lite/index.php CHANGED
@@ -20,6 +20,7 @@ do_action('lp_init');
20
  if (have_posts()) : while (have_posts()) :
21
  the_post();
22
 
 
23
  $content = get_field( 'simple-solid-lite-main-content', $post->ID , false );
24
  $conversion_area = get_field( 'simple-solid-lite-conversion-area-content', $post->ID , false );
25
  $header = get_field( 'simple-solid-lite-header-display', $post->ID , false );
@@ -188,9 +189,11 @@ $test = inbound_color_scheme($background_color, 'hex');
188
  </div>
189
  </header>
190
  <section class="cf container outline-element">
191
- <?php if (get_the_title() != "") { ?>
192
- <h1><?php the_title(); ?></h1>
193
- <?php } ?>
 
 
194
  <div class="inbound-template-intro">
195
  <div class="inbound_the_content"><?php echo $content; ?></div>
196
  </div>
20
  if (have_posts()) : while (have_posts()) :
21
  the_post();
22
 
23
+ $headline = get_field( 'lp-main-headline', $post->ID , false );
24
  $content = get_field( 'simple-solid-lite-main-content', $post->ID , false );
25
  $conversion_area = get_field( 'simple-solid-lite-conversion-area-content', $post->ID , false );
26
  $header = get_field( 'simple-solid-lite-header-display', $post->ID , false );
189
  </div>
190
  </header>
191
  <section class="cf container outline-element">
192
+ <h1><?php
193
+ if ($headline) {
194
+ echo do_shortcode($headline);
195
+ } ?>
196
+ </h1>
197
  <div class="inbound-template-intro">
198
  <div class="inbound_the_content"><?php echo $content; ?></div>
199
  </div>