WordPress Landing Pages - Version 1.5.0

Version Description

  • fixed field mapping bug
  • Added better compability for js conflicts
  • Prepping for marketing automation
Download this release

Release Info

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

Code changes from version 1.4.9 to 1.5.0

Files changed (51) hide show
  1. README.md +12 -10
  2. js/page_view_track.js +1 -0
  3. landing-pages.php +2 -2
  4. modules/module.ab-testing.metaboxes.php +36 -38
  5. modules/module.ab-testing.php +21 -14
  6. modules/module.activate.php +6 -6
  7. modules/module.admin-menus.php +4 -4
  8. modules/module.ajax-setup.php +1 -1
  9. modules/module.clone.php +1 -1
  10. modules/module.customizer.php +1 -1
  11. modules/module.global-settings.php +27 -27
  12. modules/module.install.php +9 -9
  13. modules/module.javascript-admin.php +16 -4
  14. modules/module.javascript-frontend.php +14 -1
  15. modules/module.language-support.php +1 -1
  16. modules/module.lead-splash.php +7 -7
  17. modules/module.load-extensions.php +1 -1
  18. modules/module.metaboxes.php +27 -30
  19. modules/module.post-type.php +32 -32
  20. modules/module.redirect-ab-testing.php +115 -150
  21. modules/module.sidebar.php +2 -2
  22. modules/module.store.php +1 -1
  23. modules/module.subscribe.php +1 -1
  24. modules/module.templates-upload.php +14 -14
  25. modules/module.templates.php +7 -7
  26. modules/module.welcome.php +35 -35
  27. modules/module.widgets.php +3 -3
  28. phpunit.xml.dist +8 -0
  29. readme.txt +13 -4
  30. shared/assets/assets.loader.class.php +14 -3
  31. shared/assets/frontend/js/form-population.js +1 -1
  32. shared/assets/frontend/js/store.lead.ajax.js +24 -6
  33. shared/classes/form.class.php +38 -23
  34. shared/classes/welcome.class.php +202 -0
  35. shared/functions/global.shared.functions.php +60 -0
  36. shared/inbound-shortcodes/css/frontend-render.css +6 -0
  37. shared/inbound-shortcodes/inbound-shortcodes.php +20 -9
  38. shared/inbound-shortcodes/preview.php +5 -1
  39. shared/inbound-shortcodes/shortcodes-fields.php +2 -10
  40. shared/inbound-shortcodes/shortcodes/forms.php +1 -0
  41. shared/inbound-shortcodes/shortcodes/landing-page-list.php +2 -2
  42. shared/inbound-shortcodes/shortcodes/landing_pages.php +2 -2
  43. shared/inbound-shortcodes/shortcodes/teaser.php +1 -1
  44. shared/inbound-shortcodes/shortcodes/testimonial.php +2 -2
  45. shared/languages/landing-pages.po +1 -1
  46. shared/languages/landing-pages/landing-pages.po +1 -1
  47. shared/languages/leads.po +1 -1
  48. shared/metaboxes/template.metaboxes.php +8 -7
  49. shared/tracking/store.lead.php +30 -28
  50. tests/bootstrap.php +25 -0
  51. tests/test_wordpress_plugin_tests.php +30 -0
README.md CHANGED
@@ -1,3 +1,5 @@
 
 
1
  landing-pages
2
  =============
3
 
@@ -44,7 +46,7 @@ Recommended form plugins (Gravity forms, Ninja Forms or Contact form 7)
44
 
45
  http://www.youtube.com/watch?v=BzcD6PgvLP4
46
 
47
- = Developers & Designers =
48
 
49
  We built the landing page plugin as a framework! Need A/B testing out of the box implemented for your existing designs? Use WordPress Landing Pages to quickly spin up new landing pages that have all the functionality your clients will need.
50
 
@@ -71,14 +73,14 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
71
  == Changelog ==
72
 
73
  = 1.1.0.1 =
74
-
75
- * Fixed: Variation saves for custom css and custom js.
76
- * Fixed: jQuery error related to wysiwyg content formatting.
77
 
78
  = 1.0.9.9 =
79
  * Improved extension metabox loading for quicker load times and optimized meta data storage.
80
  * Phased out more 'old method' split testing components.
81
- * Improved .htaccess parsing.
82
  * Addressed issue with line breaks being removed from WYSIWYG editors.
83
 
84
  = 1.0.9.4 =
@@ -103,7 +105,7 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
103
 
104
  = 1.0.8.5 =
105
 
106
- Providing better conversion and impression tracking for landing pages that are set as homepage.
107
 
108
  = 1.0.8.4 =
109
 
@@ -139,19 +141,19 @@ Introducing version control system for extensions.
139
 
140
  = 1.0.4.4 =
141
 
142
- Migrating store to new location. Updating version control systems
143
 
144
  = 1.0.4.2 =
145
 
146
- Added new defitions to form standardization parser. Limited .htaccess rewrites to plugin activation to try and mitigate .htaccess corruptions.
147
 
148
  = 1.0.4.1 =
149
 
150
- Fixed issue with conversions not recording on some servers by forcing form submittal to wait until ajax has completely finnished loading before continuing to process form.
151
 
152
  = 1.0.3.9 =
153
 
154
- Fixed issue with plugins and wp core refusing to update on some installations when landing page plugin is activated.
155
 
156
  = 1.0.3.8 =
157
 
1
+ [![Build Status](https://travis-ci.org/inboundnow/landing-pages.png?branch=master)](https://travis-ci.org/inboundnow/landing-pages)
2
+
3
  landing-pages
4
  =============
5
 
46
 
47
  http://www.youtube.com/watch?v=BzcD6PgvLP4
48
 
49
+ = Developers & Designers =
50
 
51
  We built the landing page plugin as a framework! Need A/B testing out of the box implemented for your existing designs? Use WordPress Landing Pages to quickly spin up new landing pages that have all the functionality your clients will need.
52
 
73
  == Changelog ==
74
 
75
  = 1.1.0.1 =
76
+
77
+ * Fixed: Variation saves for custom css and custom js.
78
+ * Fixed: jQuery error related to wysiwyg content formatting.
79
 
80
  = 1.0.9.9 =
81
  * Improved extension metabox loading for quicker load times and optimized meta data storage.
82
  * Phased out more 'old method' split testing components.
83
+ * Improved .htaccess parsing.
84
  * Addressed issue with line breaks being removed from WYSIWYG editors.
85
 
86
  = 1.0.9.4 =
105
 
106
  = 1.0.8.5 =
107
 
108
+ Providing better conversion and impression tracking for landing pages that are set as homepage.
109
 
110
  = 1.0.8.4 =
111
 
141
 
142
  = 1.0.4.4 =
143
 
144
+ Migrating store to new location. Updating version control systems
145
 
146
  = 1.0.4.2 =
147
 
148
+ Added new defitions to form standardization parser. Limited .htaccess rewrites to plugin activation to try and mitigate .htaccess corruptions.
149
 
150
  = 1.0.4.1 =
151
 
152
+ Fixed issue with conversions not recording on some servers by forcing form submittal to wait until ajax has completely finnished loading before continuing to process form.
153
 
154
  = 1.0.3.9 =
155
 
156
+ Fixed issue with plugins and wp core refusing to update on some installations when landing page plugin is activated.
157
 
158
  = 1.0.3.8 =
159
 
js/page_view_track.js CHANGED
@@ -3,6 +3,7 @@
3
  jQuery('form').each(function(){
4
  jQuery(this).addClass('wpl-track-me');
5
  });
 
6
  // Saves variation page views
7
  var variation_id = landing_path_info.variation;
8
  // Save page view count
3
  jQuery('form').each(function(){
4
  jQuery(this).addClass('wpl-track-me');
5
  });
6
+
7
  // Saves variation page views
8
  var variation_id = landing_path_info.variation;
9
  // Save page view count
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.4.9
7
  Author: Inbound Now
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.4.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__) ) );
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.5.0
7
  Author: Inbound Now
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.5.0' );
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__) ) );
modules/module.ab-testing.metaboxes.php CHANGED
@@ -5,7 +5,7 @@ function lp_ab_display_stats_metabox() {
5
 
6
  add_meta_box(
7
  'lp_ab_display_stats_metabox',
8
- __( 'A/B Testing', LANDINGPAGES_TEXT_DOMAIN),
9
  'lp_ab_stats_metabox',
10
  'landing-page' ,
11
  'side',
@@ -54,9 +54,10 @@ function lp_ab_stats_metabox() {
54
  $howmany = count($variations);
55
  foreach ($variations as $key=>$vid)
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
 
@@ -100,41 +101,41 @@ function lp_ab_stats_metabox() {
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'><?php _e('Variation', LANDINGPAGES_TEXT_DOMAIN); ?> <span class='bab-stat-letter'><?php _e(lp_ab_key_to_letter($vid), LANDINGPAGES_TEXT_DOMAIN); ?></span>
104
  <?php
105
  if($variation_status!=1)
106
  {
107
  ?>
108
- <span class='is-paused'>(<?php _e('Paused', LANDINGPAGES_TEXT_DOMAIN) ?>)</span>
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="<?php _e('Delete this variations stats' , LANDINGPAGES_TEXT_DOMAIN); ?>"><?php _e('Clear Stats' , LANDINGPAGES_TEXT_DOMAIN); ?></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>
121
- <span class="bab-stat-id"><?php _e( 'Views' , LANDINGPAGES_TEXT_DOMAIN); ?> </span>
122
  </div>
123
  <div class='bab-stat-container-conversions bab-number-box'>
124
  <span class='bab-stat-span-conversions'><?php echo $conversions; ?></span>
125
- <span class="bab-stat-id"><?php _e('Conversions' , LANDINGPAGES_TEXT_DOMAIN); ?></span></span>
126
  </div>
127
  <div class='bab-stat-container-conversion_rate bab-number-box'>
128
  <span class='bab-stat-span-conversion_rate'><?php echo $conversion_rate; ?></span>
129
- <span class="bab-stat-id bab-rate"><?php _e('Conversion Rate' , LANDINGPAGES_TEXT_DOMAIN); ?></span>
130
  </div>
131
  <div class='bab-stat-control-container'>
132
- <span class='bab-stat-control-pause'><a title="<?php _e('Pause this variation' , LANDINGPAGES_TEXT_DOMAIN); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=pause-variation'><?php _e('Pause' , LANDINGPAGES_TEXT_DOMAIN); ?></a></span> <span class='bab-stat-seperator pause-sep'>|</span>
133
- <span class='bab-stat-control-play'><a title="<?php _e('Turn this variation on' , LANDINGPAGES_TEXT_DOMAIN); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=play-variation'><?php _e('Play' , LANDINGPAGES_TEXT_DOMAIN); ?></a></span> <span class='bab-stat-seperator play-sep'>|</span>
134
- <span class='bab-stat-menu-edit'><a title="<?php _e('Edit this variation' , LANDINGPAGES_TEXT_DOMAIN); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>'><?php _e('Edit' , LANDINGPAGES_TEXT_DOMAIN); ?></a></span> <span class='bab-stat-seperator'>|</span>
135
- <span class='bab-stat-menu-preview'><a title="<?php _e('Preview this variation' , LANDINGPAGES_TEXT_DOMAIN); ?>" class='thickbox' href='<?php echo $permalink; ?>&iframe_window=on&post_id=<?php echo $post->ID;?>&TB_iframe=true&width=1503&height=467' target='_blank'><?php _e('Preview' , LANDINGPAGES_TEXT_DOMAIN); ?></a></span> <span class='bab-stat-seperator'>|</span>
136
- <span class='bab-stat-menu-clone'><a title="<?php _e('Clone this variation' , LANDINGPAGES_TEXT_DOMAIN); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&new-variation=1&clone=<?php echo $vid; ?>&new_meta_key=<?php echo $howmany; ?>'><?php _e('Clone' , LANDINGPAGES_TEXT_DOMAIN); ?></a></span> <span class='bab-stat-seperator'>|</span>
137
- <span class='bab-stat-control-delete'><a title="<?php _e('Delete this variation' , LANDINGPAGES_TEXT_DOMAIN); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=delete-variation'><?php _e('Delete' , LANDINGPAGES_TEXT_DOMAIN); ?></a></span>
138
  </div>
139
  </div>
140
  </div>
@@ -170,8 +171,10 @@ function lp_ab_testing_add_tabs()
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
 
@@ -192,47 +195,42 @@ function lp_ab_testing_add_tabs()
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">'.__("<span>Version</span> <b>A</b>",LANDINGPAGES_TEXT_DOMAIN).'</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';
212
- }
213
- else
214
- {
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 , LANDINGPAGES_TEXT_DOMAIN) .'</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' , LANDINGPAGES_TEXT_DOMAIN).'</a>';
225
  }
226
  else
227
  {
228
- $variation_count = count($array_variations);
229
  $letter = lp_ab_key_to_letter($variation_count);
230
- echo '<a href="?post='.$post->ID.'&lp-variation-id='.$new_variation_id.'&action=edit" class="lp-nav-tab nav-tab nav-tab-special-active" id="tabs-add-variation">'.__($letter , LANDINGPAGES_TEXT_DOMAIN).'</a>';
231
  }
232
  $edit_link = (isset($_GET['lp-variation-id'])) ? '?lp-variation-id='.$_GET['lp-variation-id'].'' : '?lp-variation-id=0';
233
  $post_link = get_permalink($post->ID);
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' , LANDINGPAGES_TEXT_DOMAIN)."</a>";
236
  echo '</h2>';
237
  }
238
 
5
 
6
  add_meta_box(
7
  'lp_ab_display_stats_metabox',
8
+ __( 'A/B Testing', 'landing-pages'),
9
  'lp_ab_stats_metabox',
10
  'landing-page' ,
11
  'side',
54
  $howmany = count($variations);
55
  foreach ($variations as $key=>$vid)
56
  {
57
+ if (!is_numeric($vid)&&$key==0) {
58
  $vid = 0;
59
+ }
60
+
61
  $variation_status = lp_ab_get_lp_active_status($post,$vid);
62
  $variation_status_class = ($variation_status ==1) ? "variation-on" : 'variation-off';
63
 
101
 
102
  <div id="lp-variation-<?php echo lp_ab_key_to_letter($key); ?>" class="bab-variation-row <?php echo $variation_status_class;?>" >
103
  <div class='bab-varation-header'>
104
+ <span class='bab-variation-name'><?php _e('Variation', 'landing-pages'); ?> <span class='bab-stat-letter'><?php _e(lp_ab_key_to_letter($key), 'landing-pages'); ?></span>
105
  <?php
106
  if($variation_status!=1)
107
  {
108
  ?>
109
+ <span class='is-paused'>(<?php _e('Paused', 'landing-pages') ?>)</span>
110
  <?php
111
  }
112
  ?>
113
  </span>
114
 
115
 
116
+ <span class="lp-delete-var-stats" data-letter='<?php echo lp_ab_key_to_letter($key); ?>' data-vid='<?php echo $vid; ?>' rel='<?php echo $post->ID;?>' title="<?php _e('Delete this variations stats' , 'landing-pages'); ?>"><?php _e('Clear Stats' , 'landing-pages'); ?></span>
117
  </div>
118
  <div class="bab-stat-row">
119
  <div class='bab-stat-stats' colspan='2'>
120
  <div class='bab-stat-container-impressions bab-number-box'>
121
  <span class='bab-stat-span-impressions'><?php echo $impressions; ?></span>
122
+ <span class="bab-stat-id"><?php _e( 'Views' , 'landing-pages'); ?> </span>
123
  </div>
124
  <div class='bab-stat-container-conversions bab-number-box'>
125
  <span class='bab-stat-span-conversions'><?php echo $conversions; ?></span>
126
+ <span class="bab-stat-id"><?php _e('Conversions' , 'landing-pages'); ?></span></span>
127
  </div>
128
  <div class='bab-stat-container-conversion_rate bab-number-box'>
129
  <span class='bab-stat-span-conversion_rate'><?php echo $conversion_rate; ?></span>
130
+ <span class="bab-stat-id bab-rate"><?php _e('Conversion Rate' , 'landing-pages'); ?></span>
131
  </div>
132
  <div class='bab-stat-control-container'>
133
+ <span class='bab-stat-control-pause'><a title="<?php _e('Pause this variation' , 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=pause-variation'><?php _e('Pause' , 'landing-pages'); ?></a></span> <span class='bab-stat-seperator pause-sep'>|</span>
134
+ <span class='bab-stat-control-play'><a title="<?php _e('Turn this variation on' , 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=play-variation'><?php _e('Play' , 'landing-pages'); ?></a></span> <span class='bab-stat-seperator play-sep'>|</span>
135
+ <span class='bab-stat-menu-edit'><a title="<?php _e('Edit this variation' , 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>'><?php _e('Edit' , 'landing-pages'); ?></a></span> <span class='bab-stat-seperator'>|</span>
136
+ <span class='bab-stat-menu-preview'><a title="<?php _e('Preview this variation' , 'landing-pages'); ?>" class='thickbox' href='<?php echo $permalink; ?>&iframe_window=on&post_id=<?php echo $post->ID;?>&TB_iframe=true&width=1503&height=467' target='_blank'><?php _e('Preview' , 'landing-pages'); ?></a></span> <span class='bab-stat-seperator'>|</span>
137
+ <span class='bab-stat-menu-clone'><a title="<?php _e('Clone this variation' , 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&new-variation=1&clone=<?php echo $vid; ?>&new_meta_key=<?php echo $howmany; ?>'><?php _e('Clone' , 'landing-pages'); ?></a></span> <span class='bab-stat-seperator'>|</span>
138
+ <span class='bab-stat-control-delete'><a title="<?php _e('Delete this variation' , 'landing-pages'); ?>" href='?post=<?php echo $post->ID; ?>&action=edit&lp-variation-id=<?php echo $vid; ?>&ab-action=delete-variation'><?php _e('Delete' , 'landing-pages'); ?></a></span>
139
  </div>
140
  </div>
141
  </div>
171
  if ($post_type_is === "landing-page")
172
  {
173
  $current_variation_id = lp_ab_testing_get_current_variation_id();
174
+
175
+ if (isset($_GET['new_meta_key'])) {
176
  $current_variation_id = $_GET['new_meta_key'];
177
+ }
178
 
179
  echo "<input type='hidden' id='open_variation' value='{$current_variation_id}'>";
180
 
195
  $first_class = 'active';
196
  }
197
 
198
+
 
 
199
  $var_id_marker = 1;
200
+
201
+
202
+ echo '<h2 class="nav-tab-wrapper a_b_tabs">';
203
 
204
  foreach ($array_variations as $i => $vid)
205
  {
206
+ $letter = lp_ab_key_to_letter($i);
207
+ ($i<1) ? $pre = __( 'Version ' , 'landing-pages' ) : $pre = '';
208
 
209
+ if ($current_variation_id==$vid&&!isset($_GET['new-variation']))
210
  {
211
+ $cur_class = 'active';
212
+ }
213
+ else
214
+ {
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">'. $pre.$letter .'</a>';
218
  }
219
 
220
  if (!isset($_GET['new-variation']))
221
  {
222
+ 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' , 'landing-pages').'</a>';
223
  }
224
  else
225
  {
226
+ $variation_count = $i + 1;
227
  $letter = lp_ab_key_to_letter($variation_count);
228
+ echo '<a href="?post='.$post->ID.'&lp-variation-id='.$new_variation_id.'&action=edit" class="lp-nav-tab nav-tab nav-tab-special-active" id="tabs-add-variation">'.$letter.'</a>';
229
  }
230
  $edit_link = (isset($_GET['lp-variation-id'])) ? '?lp-variation-id='.$_GET['lp-variation-id'].'' : '?lp-variation-id=0';
231
  $post_link = get_permalink($post->ID);
232
  $post_link = preg_replace('/\?.*/', '', $post_link);
233
+ 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' , 'landing-pages')."</a>";
234
  echo '</h2>';
235
  }
236
 
modules/module.ab-testing.php CHANGED
@@ -63,7 +63,6 @@ if (is_admin())
63
  //echo $current_variation_id;
64
  $variations = get_post_meta($post->ID,'lp-ab-variations', true);
65
 
66
- //echo $variations;exit;
67
  //remove landing page's main save_post action
68
  if ($current_variation_id>0)
69
  {
@@ -75,12 +74,23 @@ if (is_admin())
75
  {
76
  $array_variations = explode(',',$variations);
77
  $array_variations = lp_ab_unset_variation($array_variations,$_GET['lp-variation-id']);
 
 
 
 
 
78
  $variations = implode(',' , $array_variations);
79
  update_post_meta($post->ID,'lp-ab-variations', $variations);
80
-
81
- $suffix = '-'.$_GET['lp-variation-id'];
82
- $len = strlen($suffix);
83
-
 
 
 
 
 
 
84
  //delete each meta value associated with variation
85
  global $wpdb;
86
  $data = array();
@@ -101,9 +111,8 @@ if (is_admin())
101
  delete_post_meta($_GET['post'], $key, $value);
102
  }
103
  }
104
-
105
- $current_variation_id = 0;
106
- $_SESSION['lp_ab_test_open_variation'] = 0;
107
  }
108
 
109
  //check for pause command
@@ -133,7 +142,6 @@ if (is_admin())
133
  }
134
 
135
  //return;
136
- //echo $current_variation_id;;
137
 
138
  (isset($_GET['new-variation'])&&$_GET['new-variation']==1) ? $new_variation = 1 : $new_variation = 0;
139
 
@@ -207,7 +215,6 @@ if (is_admin())
207
 
208
  if (!$main_headline&&isset($_REQUEST['post']))
209
  {
210
- //echo 1;exit;
211
  get_post_meta($_REQUEST['post'],'lp-main-headline', true);
212
  }
213
 
@@ -269,7 +276,6 @@ if (is_admin())
269
 
270
  if (!$variation_notes&&isset($_REQUEST['post']))
271
  {
272
- //echo 1;exit;
273
  get_post_meta($_REQUEST['post'],'lp-variation-notes', true);
274
  }
275
 
@@ -330,8 +336,9 @@ if (is_admin())
330
 
331
  $current_variation_id = lp_ab_testing_get_current_variation_id();
332
 
333
- if (isset($_GET['clone']))
334
  $current_variation_id = $_GET['clone'];
 
335
 
336
  if ($current_variation_id>0)
337
  {
@@ -626,9 +633,9 @@ function lp_ab_key_to_letter($key) {
626
  /* GET CURRENT VARIATION ID */
627
  function lp_ab_testing_get_current_variation_id()
628
  {
629
- if (!isset($_REQUEST['lp-variation-id'])&&isset($_SESSION['lp_ab_test_open_variation'])&&is_admin())
630
  {
631
- //$current_variation_id = $_SESSION['lp_ab_test_open_variation'];
632
  }
633
 
634
  if (!isset($_SESSION['lp_ab_test_open_variation'])&&!isset($_REQUEST['lp-variation-id']))
63
  //echo $current_variation_id;
64
  $variations = get_post_meta($post->ID,'lp-ab-variations', true);
65
 
 
66
  //remove landing page's main save_post action
67
  if ($current_variation_id>0)
68
  {
74
  {
75
  $array_variations = explode(',',$variations);
76
  $array_variations = lp_ab_unset_variation($array_variations,$_GET['lp-variation-id']);
77
+
78
+ /* set next variation to be open */
79
+ $current_variation_id = current($array_variations);
80
+ $_SESSION['lp_ab_test_open_variation'] = $current_variation_id;
81
+
82
  $variations = implode(',' , $array_variations);
83
  update_post_meta($post->ID,'lp-ab-variations', $variations);
84
+
85
+
86
+ if (isset($_GET['lp-variation-id']) && $_GET['lp-variation-id'] > 0 ) {
87
+ $suffix = '-'.$_GET['lp-variation-id'];
88
+ $len = strlen($suffix);
89
+ } else {
90
+ $suffix = '';
91
+ $len = strlen($suffix);
92
+ }
93
+
94
  //delete each meta value associated with variation
95
  global $wpdb;
96
  $data = array();
111
  delete_post_meta($_GET['post'], $key, $value);
112
  }
113
  }
114
+
115
+ $_GET['lp-variation-id'] = $current_variation_id;
 
116
  }
117
 
118
  //check for pause command
142
  }
143
 
144
  //return;
 
145
 
146
  (isset($_GET['new-variation'])&&$_GET['new-variation']==1) ? $new_variation = 1 : $new_variation = 0;
147
 
215
 
216
  if (!$main_headline&&isset($_REQUEST['post']))
217
  {
 
218
  get_post_meta($_REQUEST['post'],'lp-main-headline', true);
219
  }
220
 
276
 
277
  if (!$variation_notes&&isset($_REQUEST['post']))
278
  {
 
279
  get_post_meta($_REQUEST['post'],'lp-variation-notes', true);
280
  }
281
 
336
 
337
  $current_variation_id = lp_ab_testing_get_current_variation_id();
338
 
339
+ if (isset($_GET['clone'])) {
340
  $current_variation_id = $_GET['clone'];
341
+ }
342
 
343
  if ($current_variation_id>0)
344
  {
633
  /* GET CURRENT VARIATION ID */
634
  function lp_ab_testing_get_current_variation_id()
635
  {
636
+ if ( isset($_GET['ab-action']) &&is_admin())
637
  {
638
+ return $_SESSION['lp_ab_test_open_variation'];
639
  }
640
 
641
  if (!isset($_SESSION['lp_ab_test_open_variation'])&&!isset($_REQUEST['lp-variation-id']))
modules/module.activate.php CHANGED
@@ -11,21 +11,21 @@ function landing_page_activate($wp = '3.6', $php = '5.3', $cta = '1.2.1', $leads
11
  $flag = 'PHP';
12
  $php_version = phpversion();
13
  $version = 'PHP' == $flag ? $php : $wp;
14
- wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version '.$php.' or greater.</p> Your server is running version '. $php_version . '. Please Contact your hosting provider to update your PHP version. PHP 5.3 came out in December of 2010.' , LANDINGPAGES_TEXT_DOMAIN) , __( 'Plugin Activation Error' , LANDINGPAGES_TEXT_DOMAIN) , array( 'response'=>200, 'back_link'=>TRUE ) );
15
  deactivate_plugins( basename( __FILE__ ) );
16
  } elseif ( version_compare( $wp_version, $wp, '<' ) ) {
17
  $flag = 'WordPress';
18
- wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires'.$flag.' version '.$wp.' or greater.</p>' , LANDINGPAGES_TEXT_DOMAIN), __('Plugin Activation Error' , LANDINGPAGES_TEXT_DOMAIN), array( 'response'=>200, 'back_link'=>TRUE ) );
19
  deactivate_plugins( basename( __FILE__ ) );
20
  } elseif (defined('WP_CTA_CURRENT_VERSION') && version_compare( WP_CTA_CURRENT_VERSION, $cta, '<' )) {
21
- $flag = __('WordPress Calls to Action' , LANDINGPAGES_TEXT_DOMAIN);
22
- wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version '.$cta.' or greater. <br><br>Please Update WordPress Call to Action Plugin to update & install WordPress Landing Pages</p>' , LANDINGPAGES_TEXT_DOMAIN) , __('Plugin Activation Error' , LANDINGPAGES_TEXT_DOMAIN) , array( 'response'=>200, 'back_link'=>TRUE ) );
23
  } elseif (defined('WPL_CURRENT_VERSION') && version_compare( WPL_CURRENT_VERSION, $leads, '<' )) {
24
  $flag = 'WordPress Leads';
25
- wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version '.$leads.' or greater. <br><br>Please Update WordPress Leads Plugin to update & install WordPress Landing Pages</p>' , INBOUDNOW_LABEL ) , __( 'Plugin Activation Error' , LANDINGPAGES_TEXT_DOMAIN) , array( 'response'=>200, 'back_link'=>TRUE ) );
26
  } elseif (defined('LP_HOMEPAGE_CURRENT_VERSION') && version_compare( LP_HOMEPAGE_CURRENT_VERSION, '1.0.8', '<' )) {
27
  $flag = 'Homepage Addon';
28
- wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version 1.0.8 or greater. <br><br>Please Update Homepage Addon to update & install WordPress Landing Pages</p>' , INBOUDNOW_LABEL ) , __( 'Plugin Activation Error' , LANDINGPAGES_TEXT_DOMAIN) , array( 'response'=>200, 'back_link'=>TRUE ) );
29
  } else {
30
  // Activate Plugin
31
  // Add Upgraded From Option
11
  $flag = 'PHP';
12
  $php_version = phpversion();
13
  $version = 'PHP' == $flag ? $php : $wp;
14
+ wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version '.$php.' or greater.</p> Your server is running version '. $php_version . '. Please Contact your hosting provider to update your PHP version. PHP 5.3 came out in December of 2010.' , 'landing-pages') , __( 'Plugin Activation Error' , 'landing-pages') , array( 'response'=>200, 'back_link'=>TRUE ) );
15
  deactivate_plugins( basename( __FILE__ ) );
16
  } elseif ( version_compare( $wp_version, $wp, '<' ) ) {
17
  $flag = 'WordPress';
18
+ wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires'.$flag.' version '.$wp.' or greater.</p>' , 'landing-pages'), __('Plugin Activation Error' , 'landing-pages'), array( 'response'=>200, 'back_link'=>TRUE ) );
19
  deactivate_plugins( basename( __FILE__ ) );
20
  } elseif (defined('WP_CTA_CURRENT_VERSION') && version_compare( WP_CTA_CURRENT_VERSION, $cta, '<' )) {
21
+ $flag = __('WordPress Calls to Action' , 'landing-pages');
22
+ wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version '.$cta.' or greater. <br><br>Please Update WordPress Call to Action Plugin to update & install WordPress Landing Pages</p>' , 'landing-pages') , __('Plugin Activation Error' , 'landing-pages') , array( 'response'=>200, 'back_link'=>TRUE ) );
23
  } elseif (defined('WPL_CURRENT_VERSION') && version_compare( WPL_CURRENT_VERSION, $leads, '<' )) {
24
  $flag = 'WordPress Leads';
25
+ wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version '.$leads.' or greater. <br><br>Please Update WordPress Leads Plugin to update & install WordPress Landing Pages</p>' , 'landing-pages' ) , __( 'Plugin Activation Error' , 'landing-pages') , array( 'response'=>200, 'back_link'=>TRUE ) );
26
  } elseif (defined('LP_HOMEPAGE_CURRENT_VERSION') && version_compare( LP_HOMEPAGE_CURRENT_VERSION, '1.0.8', '<' )) {
27
  $flag = 'Homepage Addon';
28
+ wp_die( __('<p>The <strong>WordPress Landing Pages</strong> plugin requires '.$flag.' version 1.0.8 or greater. <br><br>Please Update Homepage Addon to update & install WordPress Landing Pages</p>' , 'landing-pages' ) , __( 'Plugin Activation Error' , 'landing-pages') , array( 'response'=>200, 'back_link'=>TRUE ) );
29
  } else {
30
  // Activate Plugin
31
  // Add Upgraded From Option
modules/module.admin-menus.php CHANGED
@@ -9,13 +9,13 @@ function lp_add_menu()
9
  if (current_user_can('manage_options'))
10
  {
11
 
12
- add_submenu_page('edit.php?post_type=landing-page', __('Forms' , LANDINGPAGES_TEXT_DOMAIN), __('Create Forms' , LANDINGPAGES_TEXT_DOMAIN), 'manage_options', 'inbound-forms-redirect',100);
13
 
14
- add_submenu_page('edit.php?post_type=landing-page',__('Templates' , LANDINGPAGES_TEXT_DOMAIN), __('Manage Templates' , LANDINGPAGES_TEXT_DOMAIN), 'manage_options', 'lp_manage_templates','lp_manage_templates',100);
15
 
16
- add_submenu_page('edit.php?post_type=landing-page', __('Get Addons' , LANDINGPAGES_TEXT_DOMAIN), __('Get Addons' , LANDINGPAGES_TEXT_DOMAIN), 'manage_options', 'lp_store','lp_store_display',100);
17
 
18
- add_submenu_page('edit.php?post_type=landing-page', __('Global Settings' , LANDINGPAGES_TEXT_DOMAIN), __('Global Settings' , LANDINGPAGES_TEXT_DOMAIN), 'manage_options', 'lp_global_settings','lp_display_global_settings');
19
 
20
  }
21
  }
9
  if (current_user_can('manage_options'))
10
  {
11
 
12
+ add_submenu_page('edit.php?post_type=landing-page', __('Forms' , 'landing-pages'), __('Create Forms' , 'landing-pages'), 'manage_options', 'inbound-forms-redirect',100);
13
 
14
+ add_submenu_page('edit.php?post_type=landing-page',__('Templates' , 'landing-pages'), __('Manage Templates' , 'landing-pages'), 'manage_options', 'lp_manage_templates','lp_manage_templates',100);
15
 
16
+ add_submenu_page('edit.php?post_type=landing-page', __('Get Addons' , 'landing-pages'), __('Get Addons' , 'landing-pages'), 'manage_options', 'lp_store','lp_store_display',100);
17
 
18
+ add_submenu_page('edit.php?post_type=landing-page', __('Global Settings' , 'landing-pages'), __('Global Settings' , 'landing-pages'), 'manage_options', 'lp_global_settings','lp_display_global_settings');
19
 
20
  }
21
  }
modules/module.ajax-setup.php CHANGED
@@ -1 +1 @@
1
- <?php
2
  * Adds Ajax for Clear Stats button
3
  * clear stats for all variations
4
  */
5
  * Adds Ajax for Clear Stats button
6
  * clear stats for single variations
7
  */
8
  * Click tracking moved to module.click-tracking.php
9
  * Adds ajax to record landing page impressions
10
  * future plans to integrate with google analytics
11
  * Adds Ajax Template Selection
12
  * @return prints out landing page meta options
13
  */
14
  * Add ajax for post meta save options
15
  */
 
16
  * Adds Ajax for Clear Stats button
17
  * clear stats for all variations
18
  */
19
  * Adds Ajax for Clear Stats button
20
  * clear stats for single variations
21
  */
22
  * Click tracking moved to module.click-tracking.php
23
  * Adds ajax to record landing page impressions
24
  * future plans to integrate with google analytics
25
  * Adds Ajax Template Selection
26
  * @return prints out landing page meta options
27
  */
28
  * Add ajax for post meta save options
29
  */
 
1
  * Adds Ajax for Clear Stats button
2
  * clear stats for all variations
3
  */
4
  * Adds Ajax for Clear Stats button
5
  * clear stats for single variations
6
  */
7
  * Click tracking moved to module.click-tracking.php
8
  * Adds ajax to record landing page impressions
9
  * future plans to integrate with google analytics
10
  * Adds Ajax Template Selection
11
  * @return prints out landing page meta options
12
  */
13
  * Add ajax for post meta save options
14
  */
15
+ <?php
16
  * Adds Ajax for Clear Stats button
17
  * clear stats for all variations
18
  */
19
  * Adds Ajax for Clear Stats button
20
  * clear stats for single variations
21
  */
22
  * Click tracking moved to module.click-tracking.php
23
  * Adds ajax to record landing page impressions
24
  * future plans to integrate with google analytics
25
  * Adds Ajax Template Selection
26
  * @return prints out landing page meta options
27
  */
28
  * Add ajax for post meta save options
29
  */
modules/module.clone.php CHANGED
@@ -1 +1 @@
1
- <?php
1
+ <?php
modules/module.customizer.php CHANGED
@@ -1 +1 @@
1
- <?php
2
  wp_register_script('lp-customizer-load-js', LANDINGPAGES_URLPATH . 'js/customizer.load.js', array('jquery'));
3
  wp_enqueue_script('lp-customizer-load-js');
 
4
  wp_register_script('lp-customizer-load-js', LANDINGPAGES_URLPATH . 'js/customizer.load.js', array('jquery'));
5
  wp_enqueue_script('lp-customizer-load-js');
 
1
  wp_register_script('lp-customizer-load-js', LANDINGPAGES_URLPATH . 'js/customizer.load.js', array('jquery'));
2
  wp_enqueue_script('lp-customizer-load-js');
3
+ <?php
4
  wp_register_script('lp-customizer-load-js', LANDINGPAGES_URLPATH . 'js/customizer.load.js', array('jquery'));
5
  wp_enqueue_script('lp-customizer-load-js');
modules/module.global-settings.php CHANGED
@@ -26,53 +26,53 @@ function lp_get_global_settings()
26
  array(
27
  'id' => 'lp_global_settings_main_header',
28
  'type' => 'header',
29
- 'default' => __('<h4>Landing Pages Core Settings</h4>' , LANDINGPAGES_TEXT_DOMAIN) ,
30
  'options' => null
31
  ),
32
  array(
33
  'id' => 'landing-page-permalink-prefix',
34
- 'label' => __( 'Default Landing Page Permalink Prefix' , LANDINGPAGES_TEXT_DOMAIN),
35
- 'description' => __("Enter in the <span style='color:red;'>prefix</span> for landing page URLs (aka permalinks).<br><br>This is the URL Slug that will be in the landing page URL.<br><br> Example: http://www.yoursite.com/<span style='color:red;'>PREFIX</span>/landing-page . Enter in a single word like 'go'" , LANDINGPAGES_TEXT_DOMAIN) ,
36
  'type' => 'text',
37
  'default' => 'go',
38
  'options' => null
39
  ),
40
  array(
41
  'id' => 'landing-page-prepopulate-forms',
42
- 'label' => __( 'Enable Form Prepopulation' , LANDINGPAGES_TEXT_DOMAIN) ,
43
- 'description' => __("With this setting enabled landing pages plugin will remember form input data that the user submits to a form and attempt to pre-populate all other forms with the same user's data when applicable." , LANDINGPAGES_TEXT_DOMAIN),
44
  'type' => 'radio',
45
  'default' => '1',
46
  'options' => array('1'=>'on','0'=>'off')
47
  ),
48
  array(
49
  'id' => 'landing-page-disable-admin-tracking',
50
- 'label' => __('Disable Admin Impression/Conversion Tracking' , LANDINGPAGES_TEXT_DOMAIN) ,
51
- 'description' => __("With this setting enabled landing pages plugin will not record visits and conversions for administrative users that are logged in." , LANDINGPAGES_TEXT_DOMAIN),
52
  'type' => 'radio',
53
  'default' => '0',
54
  'options' => array('1'=>'on','0'=>'off')
55
  ),
56
  array(
57
  'id' => 'landing-page-rotation-halt',
58
- 'label' => __('Sticky Variations' , LANDINGPAGES_TEXT_DOMAIN),
59
- 'description' => __("With this setting enabled the landing pages plugin will prevent landing page version a/b rotation for a specific visitor that has viewed the page.<br><br>This pause on the a/b rotation will automatically expire after 30 days." , LANDINGPAGES_TEXT_DOMAIN),
60
  'type' => 'radio',
61
  'default' => '0',
62
  'options' => array('1'=>'on','0'=>'off')
63
  ),
64
  array(
65
  'id' => 'landing-page-auto-format-forms',
66
- 'label' => __('Enable Form Standardization' , LANDINGPAGES_TEXT_DOMAIN),
67
- 'description' => __("With this setting enabled landing pages plugin will clean and standardize all input ids and classnames. Uncheck this setting to disable standardization." , LANDINGPAGES_TEXT_DOMAIN),
68
  'type' => 'radio',
69
  'default' => '0',
70
  'options' => array('1'=>'on','0'=>'off')
71
  ),
72
  array(
73
  'id' => 'main-landing-page-auto-format-forms-retain-elements',
74
- 'label' => __('Form Standardization Element Whitelist' , LANDINGPAGES_TEXT_DOMAIN),
75
- 'description' => __("Form standardization strips the conversion area content of html elements. Add the elements you do not want to be stripped to this list." , LANDINGPAGES_TEXT_DOMAIN) ,
76
  'type' => 'textarea',
77
  'default' => '<button><script><textarea><style><input><form><select><label><a><p><b><u><strong><i><img><strong><span><font><h1><h2><h3><center><blockquote><embed><object><small>',
78
  'options' => null
@@ -90,10 +90,10 @@ function lp_get_global_settings()
90
 
91
  /* Setup License Keys Tab */
92
  $tab_slug = 'lp-license-keys';
93
- $lp_global_settings[$tab_slug]['label'] = __( 'License Keys' , LANDINGPAGES_TEXT_DOMAIN);
94
 
95
  /* Setup Extensions Tab */
96
- $lp_global_settings['lp-extensions']['label'] = __( 'Extensions' , LANDINGPAGES_TEXT_DOMAIN);
97
  $lp_global_settings['lp-extensions']['settings'] = array(
98
  array(
99
  'id' => 'lp-ext-header',
@@ -105,7 +105,7 @@ function lp_get_global_settings()
105
 
106
  /* Setup Debug Tab */
107
 
108
- $lp_global_settings['lp-debug']['label'] = __( 'Debug' , LANDINGPAGES_TEXT_DOMAIN);
109
  $lp_global_settings['lp-debug']['settings'] = array(
110
  array(
111
  'id' => 'lp-debug-header',
@@ -129,9 +129,9 @@ function lp_add_extension_license_key_header($lp_global_settings)
129
  {
130
  $lp_global_settings['lp-license-keys']['settings'][] = array(
131
  'id' => 'extensions-license-keys-header',
132
- 'description' => __( "Head to http://www.inboundnow.com/ to retrieve your license key for this template." , LANDINGPAGES_TEXT_DOMAIN),
133
  'type' => 'header',
134
- 'default' => '<h3 class="lp_global_settings_header">'. __( 'Extension Licensing' , LANDINGPAGES_TEXT_DOMAIN) .'</h3>'
135
  );
136
  }
137
 
@@ -223,7 +223,7 @@ function lp_display_global_settings()
223
  $contentht = esc_textarea( $contentht );
224
 
225
  if ( !is_writable( $htaccess_file ) ) {
226
- $content = " <div class=\"error\"><h3>" . __( "Oh no! Your .htaccess is not writable and A/B testing won't work unless you make your .htaccess file writable.", LANDINGPAGES_TEXT_DOMAIN) . "</h3></div>";
227
  echo $content;
228
  }
229
  else {
@@ -303,11 +303,11 @@ function lp_display_global_settings()
303
  </script>
304
  <div id="php-sql-lp-version" style="display:none;">
305
  <div id="inbound-install-status">
306
- <h3><?php _e( 'Installation Status' , LANDINGPAGES_TEXT_DOMAIN); ?></h3>
307
  <table id="lp-wordpress-site-status">
308
 
309
  <tr valign="top">
310
- <th scope="row"><label><?php _e( 'PHP Version' , LANDINGPAGES_TEXT_DOMAIN); ?></label></th>
311
  <td class="installation_item_cell">
312
  <strong><?php echo phpversion(); ?></strong>
313
  </td>
@@ -328,7 +328,7 @@ function lp_display_global_settings()
328
  </td>
329
  </tr>
330
  <tr valign="top">
331
- <th scope="row"><label><?php _e( 'MySQL Version' , LANDINGPAGES_TEXT_DOMAIN); ?></label></th>
332
  <td class="installation_item_cell">
333
  <strong><?php echo $wpdb->db_version();?></strong>
334
  </td>
@@ -349,7 +349,7 @@ function lp_display_global_settings()
349
  </td>
350
  </tr>
351
  <tr valign="top">
352
- <th scope="row"><label><?php _e( 'WordPress Version' , LANDINGPAGES_TEXT_DOMAIN); ?></label></th>
353
  <td class="installation_item_cell">
354
  <strong><?php echo get_bloginfo("version"); ?></strong>
355
  </td>
@@ -363,16 +363,16 @@ function lp_display_global_settings()
363
  else{
364
  ?>
365
  <img src="<?php echo LANDINGPAGES_URLPATH;?>/images/cross.png"/>
366
- <span class="installation_item_message"><?php _e( 'landing pages requires version X or higher' , LANDINGPAGES_TEXT_DOMAIN); ?></span>
367
  <?php
368
  }
369
  ?>
370
  </td>
371
  </tr>
372
  <tr valign="top">
373
- <th scope="row"><label><?php _e( 'Landing Page Version' , LANDINGPAGES_TEXT_DOMAIN); ?></label></th>
374
  <td class="installation_item_cell">
375
- <strong><?php _e('Version' , LANDINGPAGES_TEXT_DOMAIN); ?> <?php echo LANDINGPAGES_CURRENT_VERSION;?></strong>
376
  </td>
377
  <td>
378
 
@@ -386,7 +386,7 @@ function lp_display_global_settings()
386
  <div id="htaccess-contents">
387
 
388
  <?php if ($htaccess != "") {
389
- echo "<h3>". __('The contents of your .htaccess file' , LANDINGPAGES_TEXT_DOMAIN) .":</h3>";
390
  echo $htaccess;
391
  } ?>
392
  </div>
26
  array(
27
  'id' => 'lp_global_settings_main_header',
28
  'type' => 'header',
29
+ 'default' => __('<h4>Landing Pages Core Settings</h4>' , 'landing-pages') ,
30
  'options' => null
31
  ),
32
  array(
33
  'id' => 'landing-page-permalink-prefix',
34
+ 'label' => __( 'Default Landing Page Permalink Prefix' , 'landing-pages'),
35
+ 'description' => __("Enter in the <span style='color:red;'>prefix</span> for landing page URLs (aka permalinks).<br><br>This is the URL Slug that will be in the landing page URL.<br><br> Example: http://www.yoursite.com/<span style='color:red;'>PREFIX</span>/landing-page . Enter in a single word like 'go'" , 'landing-pages') ,
36
  'type' => 'text',
37
  'default' => 'go',
38
  'options' => null
39
  ),
40
  array(
41
  'id' => 'landing-page-prepopulate-forms',
42
+ 'label' => __( 'Enable Form Prepopulation' , 'landing-pages') ,
43
+ 'description' => __("With this setting enabled landing pages plugin will remember form input data that the user submits to a form and attempt to pre-populate all other forms with the same user's data when applicable." , 'landing-pages'),
44
  'type' => 'radio',
45
  'default' => '1',
46
  'options' => array('1'=>'on','0'=>'off')
47
  ),
48
  array(
49
  'id' => 'landing-page-disable-admin-tracking',
50
+ 'label' => __('Disable Admin Impression/Conversion Tracking' , 'landing-pages') ,
51
+ 'description' => __("With this setting enabled landing pages plugin will not record visits and conversions for administrative users that are logged in." , 'landing-pages'),
52
  'type' => 'radio',
53
  'default' => '0',
54
  'options' => array('1'=>'on','0'=>'off')
55
  ),
56
  array(
57
  'id' => 'landing-page-rotation-halt',
58
+ 'label' => __('Sticky Variations' , 'landing-pages'),
59
+ 'description' => __("With this setting enabled the landing pages plugin will prevent landing page version a/b rotation for a specific visitor that has viewed the page.<br><br>This pause on the a/b rotation will automatically expire after 30 days." , 'landing-pages'),
60
  'type' => 'radio',
61
  'default' => '0',
62
  'options' => array('1'=>'on','0'=>'off')
63
  ),
64
  array(
65
  'id' => 'landing-page-auto-format-forms',
66
+ 'label' => __('Enable Form Standardization' , 'landing-pages'),
67
+ 'description' => __("With this setting enabled landing pages plugin will clean and standardize all input ids and classnames. Uncheck this setting to disable standardization." , 'landing-pages'),
68
  'type' => 'radio',
69
  'default' => '0',
70
  'options' => array('1'=>'on','0'=>'off')
71
  ),
72
  array(
73
  'id' => 'main-landing-page-auto-format-forms-retain-elements',
74
+ 'label' => __('Form Standardization Element Whitelist' , 'landing-pages'),
75
+ 'description' => __("Form standardization strips the conversion area content of html elements. Add the elements you do not want to be stripped to this list." , 'landing-pages') ,
76
  'type' => 'textarea',
77
  'default' => '<button><script><textarea><style><input><form><select><label><a><p><b><u><strong><i><img><strong><span><font><h1><h2><h3><center><blockquote><embed><object><small>',
78
  'options' => null
90
 
91
  /* Setup License Keys Tab */
92
  $tab_slug = 'lp-license-keys';
93
+ $lp_global_settings[$tab_slug]['label'] = __( 'License Keys' , 'landing-pages');
94
 
95
  /* Setup Extensions Tab */
96
+ $lp_global_settings['lp-extensions']['label'] = __( 'Extensions' , 'landing-pages');
97
  $lp_global_settings['lp-extensions']['settings'] = array(
98
  array(
99
  'id' => 'lp-ext-header',
105
 
106
  /* Setup Debug Tab */
107
 
108
+ $lp_global_settings['lp-debug']['label'] = __( 'Debug' , 'landing-pages');
109
  $lp_global_settings['lp-debug']['settings'] = array(
110
  array(
111
  'id' => 'lp-debug-header',
129
  {
130
  $lp_global_settings['lp-license-keys']['settings'][] = array(
131
  'id' => 'extensions-license-keys-header',
132
+ 'description' => __( "Head to http://www.inboundnow.com/ to retrieve your license key for this template." , 'landing-pages'),
133
  'type' => 'header',
134
+ 'default' => '<h3 class="lp_global_settings_header">'. __( 'Extension Licensing' , 'landing-pages') .'</h3>'
135
  );
136
  }
137
 
223
  $contentht = esc_textarea( $contentht );
224
 
225
  if ( !is_writable( $htaccess_file ) ) {
226
+ $content = " <div class=\"error\"><h3>" . __( "Oh no! Your .htaccess is not writable and A/B testing won't work unless you make your .htaccess file writable.", 'landing-pages') . "</h3></div>";
227
  echo $content;
228
  }
229
  else {
303
  </script>
304
  <div id="php-sql-lp-version" style="display:none;">
305
  <div id="inbound-install-status">
306
+ <h3><?php _e( 'Installation Status' , 'landing-pages'); ?></h3>
307
  <table id="lp-wordpress-site-status">
308
 
309
  <tr valign="top">
310
+ <th scope="row"><label><?php _e( 'PHP Version' , 'landing-pages'); ?></label></th>
311
  <td class="installation_item_cell">
312
  <strong><?php echo phpversion(); ?></strong>
313
  </td>
328
  </td>
329
  </tr>
330
  <tr valign="top">
331
+ <th scope="row"><label><?php _e( 'MySQL Version' , 'landing-pages'); ?></label></th>
332
  <td class="installation_item_cell">
333
  <strong><?php echo $wpdb->db_version();?></strong>
334
  </td>
349
  </td>
350
  </tr>
351
  <tr valign="top">
352
+ <th scope="row"><label><?php _e( 'WordPress Version' , 'landing-pages'); ?></label></th>
353
  <td class="installation_item_cell">
354
  <strong><?php echo get_bloginfo("version"); ?></strong>
355
  </td>
363
  else{
364
  ?>
365
  <img src="<?php echo LANDINGPAGES_URLPATH;?>/images/cross.png"/>
366
+ <span class="installation_item_message"><?php _e( 'landing pages requires version X or higher' , 'landing-pages'); ?></span>
367
  <?php
368
  }
369
  ?>
370
  </td>
371
  </tr>
372
  <tr valign="top">
373
+ <th scope="row"><label><?php _e( 'Landing Page Version' , 'landing-pages'); ?></label></th>
374
  <td class="installation_item_cell">
375
+ <strong><?php _e('Version' , 'landing-pages'); ?> <?php echo LANDINGPAGES_CURRENT_VERSION;?></strong>
376
  </td>
377
  <td>
378
 
386
  <div id="htaccess-contents">
387
 
388
  <?php if ($htaccess != "") {
389
+ echo "<h3>". __('The contents of your .htaccess file' , 'landing-pages') .":</h3>";
390
  echo $htaccess;
391
  } ?>
392
  </div>
modules/module.install.php CHANGED
@@ -17,8 +17,8 @@ function inbound_create_default_post_type(){
17
  {
18
  $default_lander = wp_insert_post(
19
  array(
20
- 'post_title' => __( 'A/B Testing Landing Page Example' , LANDINGPAGES_TEXT_DOMAIN),
21
- 'post_content' => __( '<p>This is the first paragraph of your landing page where you want to draw the viewer in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>' , LANDINGPAGES_TEXT_DOMAIN),
22
  'post_status' => 'publish',
23
  'post_author' => $current_user->ID,
24
  'post_type' => 'landing-page',
@@ -27,14 +27,14 @@ function inbound_create_default_post_type(){
27
  );
28
 
29
  // Variation A
30
- add_post_meta($default_lander, 'lp-main-headline', __( 'Main Catchy Headline (A)' , LANDINGPAGES_TEXT_DOMAIN) );
31
  add_post_meta($default_lander, 'lp-selected-template', 'svtle');
32
- add_post_meta($default_lander, 'lp-conversion-area', '<h2>'.__( 'Form a' , LANDINGPAGES_TEXT_DOMAIN) .'</h2><form action="" method="post">'. __( 'First Name' , LANDINGPAGES_TEXT_DOMAIN) .': <input name="first-name" type="text" /><br>'. __('Last Name' , LANDINGPAGES_TEXT_DOMAIN) .': <input name="last-name" type="text" /><br>'.__('Email' , LANDINGPAGES_TEXT_DOMAIN) .':<input name="email" type="text" /><br><input name="submit" type="submit" value="'.__('Submit' , LANDINGPAGES_TEXT_DOMAIN).'" /></form>' );
33
 
34
  // variation B
35
- add_post_meta($default_lander, 'lp-main-headline-1', __('Main Catchy Headline Two (B)' , LANDINGPAGES_TEXT_DOMAIN) );
36
  add_post_meta($default_lander, 'lp-selected-template-1', 'svtle');
37
- add_post_meta($default_lander, 'landing-page-myeditor-1', '<h2>'.__( 'Form B' , LANDINGPAGES_TEXT_DOMAIN) .'</h2><form action="" method="post">'. __( 'First Name' , LANDINGPAGES_TEXT_DOMAIN) .': <input name="first-name" type="text" /><br>'. __('Last Name' , LANDINGPAGES_TEXT_DOMAIN) .': <input name="last-name" type="text" /><br>'.__('Email' , LANDINGPAGES_TEXT_DOMAIN) .':<input name="email" type="text" /><br><input name="submit" type="submit" value="'.__('Submit' , LANDINGPAGES_TEXT_DOMAIN).'" /></form>' , LANDINGPAGES_TEXT_DOMAIN);
38
  add_post_meta($default_lander, 'content-1', '<p>(Version B) This is the first paragraph of your landing page where you want to draw the viewer in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>');
39
 
40
  // Add A/B Testing meta
@@ -129,12 +129,12 @@ function lp_install_register_required_plugins() {
129
 
130
  // This is an example of how to include a plugin from the WordPress Plugin Repository
131
  array(
132
- 'name' => __('WordPress Leads' , LANDINGPAGES_TEXT_DOMAIN) .' <span class=\'inbound-install-notice\'> - '. __('This <b>free</b> landing page addon will give you the ability to track and manage incoming web leads. Gather advanced Lead Intelligence and close more deals.' , LANDINGPAGES_TEXT_DOMAIN) .' <a class=\'inbound-install-notice-links\' href=\'http://wordpress.org/plugins/leads/\'> '. __('Learn more about WordPress Leads' , LANDINGPAGES_TEXT_DOMAIN) .'</a></span>',
133
  'slug' => 'leads',
134
  'required' => false,
135
  ),
136
  array(
137
- 'name' => __('WordPress Calls to Action' , LANDINGPAGES_TEXT_DOMAIN) .' <span class=\'inbound-install-notice\'> - '. __('This <b>free</b> landing page addon will drive more traffic into your Landing Pages with Targeted Calls to Action in your sites sidebars & content. Create popups to capture visitor attention and convert more leads.' , LANDINGPAGES_TEXT_DOMAIN) . ' <a class=\'inbound-install-notice-links\' href=\'http://wordpress.org/plugins/cta/\'> ' . __('Learn more about WordPress Calls to Action' , LANDINGPAGES_TEXT_DOMAIN) . '</a></span>',
138
  'slug' => 'cta',
139
  'required' => false,
140
  ),
@@ -142,7 +142,7 @@ function lp_install_register_required_plugins() {
142
  );
143
 
144
  // Change this to your theme text domain, used for internationalising strings
145
- $theme_text_domain = LANDINGPAGES_TEXT_DOMAIN;
146
 
147
  /**
148
  * Array of configuration settings. Amend each line as needed.
17
  {
18
  $default_lander = wp_insert_post(
19
  array(
20
+ 'post_title' => __( 'A/B Testing Landing Page Example' , 'landing-pages'),
21
+ 'post_content' => __( '<p>This is the first paragraph of your landing page where you want to draw the viewer in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>' , 'landing-pages'),
22
  'post_status' => 'publish',
23
  'post_author' => $current_user->ID,
24
  'post_type' => 'landing-page',
27
  );
28
 
29
  // Variation A
30
+ add_post_meta($default_lander, 'lp-main-headline', __( 'Main Catchy Headline (A)' , 'landing-pages') );
31
  add_post_meta($default_lander, 'lp-selected-template', 'svtle');
32
+ add_post_meta($default_lander, 'lp-conversion-area', '<h2>'.__( 'Form a' , 'landing-pages') .'</h2><form action="" method="post">'. __( 'First Name' , 'landing-pages') .': <input name="first-name" type="text" /><br>'. __('Last Name' , 'landing-pages') .': <input name="last-name" type="text" /><br>'.__('Email' , 'landing-pages') .':<input name="email" type="text" /><br><input name="submit" type="submit" value="'.__('Submit' , 'landing-pages').'" /></form>' );
33
 
34
  // variation B
35
+ add_post_meta($default_lander, 'lp-main-headline-1', __('Main Catchy Headline Two (B)' , 'landing-pages') );
36
  add_post_meta($default_lander, 'lp-selected-template-1', 'svtle');
37
+ add_post_meta($default_lander, 'landing-page-myeditor-1', '<h2>'.__( 'Form B' , 'landing-pages') .'</h2><form action="" method="post">'. __( 'First Name' , 'landing-pages') .': <input name="first-name" type="text" /><br>'. __('Last Name' , 'landing-pages') .': <input name="last-name" type="text" /><br>'.__('Email' , 'landing-pages') .':<input name="email" type="text" /><br><input name="submit" type="submit" value="'.__('Submit' , 'landing-pages').'" /></form>' , 'landing-pages');
38
  add_post_meta($default_lander, 'content-1', '<p>(Version B) This is the first paragraph of your landing page where you want to draw the viewer in and quickly explain your value proposition.</p><p><strong>Use Bullet Points to:</strong><ul><li>Explain why they should fill out the form</li><li>What they will learn if they download</li><li>A problem this form will solve for them</li></ul></p><p>Short ending paragraph reiterating the value behind the form</p>');
39
 
40
  // Add A/B Testing meta
129
 
130
  // This is an example of how to include a plugin from the WordPress Plugin Repository
131
  array(
132
+ 'name' => __('WordPress Leads' , 'landing-pages') .' <span class=\'inbound-install-notice\'> - '. __('This <b>free</b> landing page addon will give you the ability to track and manage incoming web leads. Gather advanced Lead Intelligence and close more deals.' , 'landing-pages') .' <a class=\'inbound-install-notice-links\' href=\'http://wordpress.org/plugins/leads/\'> '. __('Learn more about WordPress Leads' , 'landing-pages') .'</a></span>',
133
  'slug' => 'leads',
134
  'required' => false,
135
  ),
136
  array(
137
+ 'name' => __('WordPress Calls to Action' , 'landing-pages') .' <span class=\'inbound-install-notice\'> - '. __('This <b>free</b> landing page addon will drive more traffic into your Landing Pages with Targeted Calls to Action in your sites sidebars & content. Create popups to capture visitor attention and convert more leads.' , 'landing-pages') . ' <a class=\'inbound-install-notice-links\' href=\'http://wordpress.org/plugins/cta/\'> ' . __('Learn more about WordPress Calls to Action' , 'landing-pages') . '</a></span>',
138
  'slug' => 'cta',
139
  'required' => false,
140
  ),
142
  );
143
 
144
  // Change this to your theme text domain, used for internationalising strings
145
+ $theme_text_domain = 'landing-pages';
146
 
147
  /**
148
  * Array of configuration settings. Amend each line as needed.
modules/module.javascript-admin.php CHANGED
@@ -6,7 +6,14 @@ function lp_admin_enqueue($hook)
6
  {
7
  global $post;
8
  $screen = get_current_screen(); //print_r($screen);
9
-
 
 
 
 
 
 
 
10
  //enqueue styles and scripts
11
  wp_enqueue_style('lp-admin-css', LANDINGPAGES_URLPATH . 'css/admin-style.css');
12
 
@@ -30,9 +37,8 @@ function lp_admin_enqueue($hook)
30
  }
31
 
32
  // Admin enqueue - Landing Page CPT only
33
- if (( isset($post) && 'landing-page' == $post->post_type ) || ( isset($_GET['post_type']) && $_GET['post_type']=='landing-page' ))
34
- {
35
-
36
  wp_enqueue_script('jpicker', LANDINGPAGES_URLPATH . 'js/libraries/jpicker/jpicker-1.1.6.min.js');
37
  wp_localize_script( 'jpicker', 'jpicker', array( 'thispath' => LANDINGPAGES_URLPATH.'js/libraries/jpicker/images/' ));
38
  wp_enqueue_style('jpicker-css', LANDINGPAGES_URLPATH . 'js/libraries/jpicker/css/jPicker-1.1.6.min.css');
@@ -109,4 +115,10 @@ function lp_admin_enqueue($hook)
109
  }
110
 
111
  }
 
 
 
 
 
 
112
  }
6
  {
7
  global $post;
8
  $screen = get_current_screen(); //print_r($screen);
9
+ /* dequeue third party scripts */
10
+ global $wp_scripts;
11
+ if ( !empty( $wp_scripts->queue ) ) {
12
+ $store = $wp_scripts->queue; // store the scripts
13
+ foreach ( $wp_scripts->queue as $handle ) {
14
+ wp_dequeue_script( $handle );
15
+ }
16
+ }
17
  //enqueue styles and scripts
18
  wp_enqueue_style('lp-admin-css', LANDINGPAGES_URLPATH . 'css/admin-style.css');
19
 
37
  }
38
 
39
  // Admin enqueue - Landing Page CPT only
40
+ if ((isset($post) && 'landing-page'== $post->post_type)|| (isset($_GET['post_type']) && $_GET['post_type']=='landing-page' )) {
41
+ wp_enqueue_script(array('jquery', 'editor', 'thickbox', 'media-upload'));
 
42
  wp_enqueue_script('jpicker', LANDINGPAGES_URLPATH . 'js/libraries/jpicker/jpicker-1.1.6.min.js');
43
  wp_localize_script( 'jpicker', 'jpicker', array( 'thispath' => LANDINGPAGES_URLPATH.'js/libraries/jpicker/images/' ));
44
  wp_enqueue_style('jpicker-css', LANDINGPAGES_URLPATH . 'js/libraries/jpicker/css/jPicker-1.1.6.min.css');
115
  }
116
 
117
  }
118
+ /* Requeue third party scripts */
119
+ if(is_array($store)) {
120
+ foreach ( $store as $handle ) {
121
+ wp_enqueue_script( $handle );
122
+ }
123
+ }
124
  }
modules/module.javascript-frontend.php CHANGED
@@ -7,7 +7,14 @@ function lp_fontend_enqueue_scripts($hook) {
7
 
8
  if (!isset($post))
9
  return;
10
-
 
 
 
 
 
 
 
11
  $post_type = $post->post_type;
12
  wp_enqueue_script('jquery');
13
 
@@ -94,6 +101,12 @@ function lp_fontend_enqueue_scripts($hook) {
94
  } */
95
  }
96
  }
 
 
 
 
 
 
97
 
98
  }
99
 
7
 
8
  if (!isset($post))
9
  return;
10
+ /* dequeue third party scripts */
11
+ global $wp_scripts;
12
+ if ( !empty( $wp_scripts->queue ) ) {
13
+ $store = $wp_scripts->queue; // store the scripts
14
+ foreach ( $wp_scripts->queue as $handle ) {
15
+ wp_dequeue_script( $handle );
16
+ }
17
+ }
18
  $post_type = $post->post_type;
19
  wp_enqueue_script('jquery');
20
 
101
  } */
102
  }
103
  }
104
+ /* Requeue third party scripts */
105
+ if(is_array($store)) {
106
+ foreach ( $store as $handle ) {
107
+ wp_enqueue_script( $handle );
108
+ }
109
+ }
110
 
111
  }
112
 
modules/module.language-support.php CHANGED
@@ -3,5 +3,5 @@
3
  add_action('init' , 'lp_load_text_domain');
4
  function lp_load_text_domain()
5
  {
6
- load_plugin_textdomain( LANDINGPAGES_TEXT_DOMAIN , false , LANDINGPAGES_PLUGIN_SLUG.'/shared/languages/landing-pages/' );
7
  }
3
  add_action('init' , 'lp_load_text_domain');
4
  function lp_load_text_domain()
5
  {
6
+ load_plugin_textdomain( 'landing-pages' , false , LANDINGPAGES_PLUGIN_SLUG.'/shared/languages/landing-pages/' );
7
  }
modules/module.lead-splash.php CHANGED
@@ -21,25 +21,25 @@ $data['lead_custom_fields'] = $wplead_data;
21
 
22
  <div id='lead-details-container'>
23
  <div id="wp-leads-splash-header">
24
- <h3 class='lp-lead-splash-h3'><?php _e('Lead Details ' , LANDINGPAGES_TEXT_DOMAIN) ?>: </h3>
25
  <?php // Conditional check for wp leads add on ?>
26
- <a href="/wp-admin/post.php?post=<?php echo $lead_id . "&action=edit";?>" class="wplp-green-button wplp-right" target="_blank"> <?php _e( 'View/Edit Lead' , LANDINGPAGES_TEXT_DOMAIN); ?> </a>
27
  </div>
28
  <div id="wp-leads-splash-name">
29
- <div class="wp-lead-label"><?php _e('Name' , LANDINGPAGES_TEXT_DOMAIN); ?>:</div> <?php echo $wplead_data['wpleads_first_name'][0]; ?> <?php echo $wplead_data['wpleads_last_name'][0]; ?>
30
  </div>
31
 
32
  <div id="wp-leads-splash-email">
33
- <div class="wp-lead-label"><?php _e('Email Address' , LANDINGPAGES_TEXT_DOMAIN); ?>:</div> <?php echo $wplead_data['wpleads_email_address'][0]; ?>
34
  </div>
35
  <div id="wp-leads-splash-ip">
36
- <div class="wp-lead-label"><?php _e('IP Address' , LANDINGPAGES_TEXT_DOMAIN); ?>: </div> <?php echo $wplead_data['wpleads_ip_address'][0]; ?>
37
  </div>
38
  <div id="wp-leads-splash-city">
39
- <div class="wp-lead-label"><?php _e('City' , LANDINGPAGES_TEXT_DOMAIN); ?>: </div> <?php echo $city; ?>
40
  </div>
41
  <div id="wp-leads-splash-state">
42
- <div class="wp-lead-label"><?php _e('State' , LANDINGPAGES_TEXT_DOMAIN); ?>: </div> <?php echo $region; ?>
43
  </div>
44
 
45
  <div id="wp-leads-extra-data">
21
 
22
  <div id='lead-details-container'>
23
  <div id="wp-leads-splash-header">
24
+ <h3 class='lp-lead-splash-h3'><?php _e('Lead Details ' , 'landing-pages') ?>: </h3>
25
  <?php // Conditional check for wp leads add on ?>
26
+ <a href="/wp-admin/post.php?post=<?php echo $lead_id . "&action=edit";?>" class="wplp-green-button wplp-right" target="_blank"> <?php _e( 'View/Edit Lead' , 'landing-pages'); ?> </a>
27
  </div>
28
  <div id="wp-leads-splash-name">
29
+ <div class="wp-lead-label"><?php _e('Name' , 'landing-pages'); ?>:</div> <?php echo $wplead_data['wpleads_first_name'][0]; ?> <?php echo $wplead_data['wpleads_last_name'][0]; ?>
30
  </div>
31
 
32
  <div id="wp-leads-splash-email">
33
+ <div class="wp-lead-label"><?php _e('Email Address' , 'landing-pages'); ?>:</div> <?php echo $wplead_data['wpleads_email_address'][0]; ?>
34
  </div>
35
  <div id="wp-leads-splash-ip">
36
+ <div class="wp-lead-label"><?php _e('IP Address' , 'landing-pages'); ?>: </div> <?php echo $wplead_data['wpleads_ip_address'][0]; ?>
37
  </div>
38
  <div id="wp-leads-splash-city">
39
+ <div class="wp-lead-label"><?php _e('City' , 'landing-pages'); ?>: </div> <?php echo $city; ?>
40
  </div>
41
  <div id="wp-leads-splash-state">
42
+ <div class="wp-lead-label"><?php _e('State' , 'landing-pages'); ?>: </div> <?php echo $region; ?>
43
  </div>
44
 
45
  <div id="wp-leads-extra-data">
modules/module.load-extensions.php CHANGED
@@ -1 +1 @@
1
- <?php
2
  * LOAD NATIVE TEMPLATES FROM WP-CONTENT/PLUGINS LANDING-PAGES/TEMPLATES/
3
  */
4
  * LOAD NON-NATIVE TEMPLATES FROM WP-CONTENT/UPLOADS/LANDING-PAGES/TEMPLATES/
5
  */
6
  /**
7
  * DECLARE HELPER FUNCTIONS
8
  */
 
9
  * LOAD NATIVE TEMPLATES FROM WP-CONTENT/PLUGINS LANDING-PAGES/TEMPLATES/
10
  */
11
  * LOAD NON-NATIVE TEMPLATES FROM WP-CONTENT/UPLOADS/LANDING-PAGES/TEMPLATES/
12
  */
13
  /**
14
  * DECLARE HELPER FUNCTIONS
15
  */
 
1
  * LOAD NATIVE TEMPLATES FROM WP-CONTENT/PLUGINS LANDING-PAGES/TEMPLATES/
2
  */
3
  * LOAD NON-NATIVE TEMPLATES FROM WP-CONTENT/UPLOADS/LANDING-PAGES/TEMPLATES/
4
  */
5
  /**
6
  * DECLARE HELPER FUNCTIONS
7
  */
8
+ <?php
9
  * LOAD NATIVE TEMPLATES FROM WP-CONTENT/PLUGINS LANDING-PAGES/TEMPLATES/
10
  */
11
  * LOAD NON-NATIVE TEMPLATES FROM WP-CONTENT/UPLOADS/LANDING-PAGES/TEMPLATES/
12
  */
13
  /**
14
  * DECLARE HELPER FUNCTIONS
15
  */
modules/module.metaboxes.php CHANGED
@@ -15,7 +15,7 @@ function lp_display_thumbnail_metabox() {
15
 
16
  add_meta_box(
17
  'lp-thumbnail-sidebar-preview',
18
- __( 'Template Preview', LANDINGPAGES_TEXT_DOMAIN),
19
  'lp_thumbnail_metabox',
20
  'landing-page' ,
21
  'side',
@@ -41,7 +41,7 @@ function lp_thumbnail_metabox() {
41
  <td>
42
  <?php
43
 
44
- echo "<a href='$permalink' target='_blank' ><img src='$thumbnail' style='width:250px;height:250px;' title='". __( 'Preveiw this theme' , LANDINGPAGES_TEXT_DOMAIN) ." , ({$template})'></a>";
45
  ?>
46
  </td>
47
  </tr>
@@ -56,7 +56,7 @@ function lp_thumbnail_metabox() {
56
 
57
  add_action('add_meta_boxes', 'lp_display_meta_box_lp_conversion_area');
58
  function lp_display_meta_box_lp_conversion_area(){
59
- add_meta_box( WYSIWYG_META_BOX_ID, __('Landing Page Form or Conversion Button - <em>click the black & blue power button icon to build forms/buttons</em>', LANDINGPAGES_TEXT_DOMAIN), 'lp_meta_box_conversion_area', 'landing-page', 'normal', 'high' );
60
  //add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );
61
  }
62
 
@@ -116,7 +116,7 @@ function lp_meta_box_conversion_area(){
116
 
117
  //Clear The Room!
118
  echo "<div style='clear:both; display:block;'></div>";
119
- echo "<div style='width:100%;text-align:right;margin-top:11px;'><div class='lp_tooltip' title=\"". __('To help track conversions Landing Pages Plugin will automatically add a tracking class to forms. If you would like to track a link add this class to it' , LANDINGPAGES_TEXT_DOMAIN) ." class='wpl-track-me-link'\" ></div></div>";
120
 
121
  }
122
 
@@ -163,8 +163,8 @@ function lp_landing_page_header_area()
163
  //print_r($page_conversion_data);
164
  //echo "TEST";
165
  echo "<div id='lp-notes-area'>";
166
- 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'>";
167
- 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>';
168
  echo ""; ?>
169
 
170
  <?php
@@ -212,7 +212,7 @@ add_filter( 'enter_title_here', 'lp_change_enter_title_text', 10, 2 );
212
  function lp_change_enter_title_text( $text, $post ) {
213
  if ($post->post_type=='landing-page')
214
  {
215
- return __( 'Enter Landing Page Description' , LANDINGPAGES_TEXT_DOMAIN);
216
  }
217
  else
218
  {
@@ -226,7 +226,7 @@ function add_custom_meta_box_select_templates() {
226
 
227
  add_meta_box(
228
  'lp_metabox_select_template', // $id
229
- __( 'Landing Page Templates', LANDINGPAGES_TEXT_DOMAIN),
230
  'lp_display_meta_box_select_template', // $callback
231
  'landing-page', // $page
232
  'normal', // $context
@@ -248,7 +248,7 @@ function lp_display_meta_box_select_template() {
248
  echo "<input type='hidden' name='lp_lp_custom_fields_nonce' value='".wp_create_nonce('lp-nonce')."' />";
249
  ?>
250
 
251
- <div id="lp_template_change"><h2><a class="button" id="lp-change-template-button"><?php _e( 'Choose Another Template' , LANDINGPAGES_TEXT_DOMAIN); ?></a></div>
252
  <input type='hidden' id='lp_select_template' name='<?php echo $name; ?>' value='<?php echo $template; ?>'>
253
  <div id="template-display-options"></div>
254
 
@@ -283,12 +283,12 @@ function lp_display_meta_box_select_template_container() {
283
 
284
  echo "<div class='lp-template-selector-container' style='{$toggle}'>";
285
  echo "<div class='lp-selection-heading'>";
286
- echo "<h1>". __( 'Select Your Landing Page Template!' , LANDINGPAGES_TEXT_DOMAIN) ."</h1>";
287
- echo '<a class="button-secondary" style="display:none;" id="lp-cancel-selection">'. __('Cancel Template Change' , LANDINGPAGES_TEXT_DOMAIN) .'</a>';
288
  echo "</div>";
289
  echo '<ul id="template-filter" >';
290
- echo '<li class="button-primary button"><a href="#" data-filter=".template-item-boxes">'. __( 'All' , LANDINGPAGES_TEXT_DOMAIN) .'</a></li>';
291
- echo '<li class="button-primary button"><a href="#" data-filter=".theme">'. __( 'Theme' , LANDINGPAGES_TEXT_DOMAIN ) .'</a></li>';
292
  $categories = array('Theme');
293
  foreach ($extension_data_cats as $cat)
294
  {
@@ -356,8 +356,8 @@ function lp_display_meta_box_select_template_container() {
356
  </a>
357
  <p>
358
  <div id="template-title"><?php echo $data['info']['label']; ?></div>
359
- <a href='#' label='<?php echo $data['info']['label']; ?>' id='<?php echo $this_extension; ?>' class='lp_select_template'><?php _e( 'Select' , LANDINGPAGES_TEXT_DOMAIN); ?></a> |
360
- <a class='<?php echo $cat_slug;?>' target="_blank" href='<?php echo $demo_link;?>' id='lp_preview_this_template'><?php _e( 'Preview' , LANDINGPAGES_TEXT_DOMAIN); ?></a>
361
  </p>
362
  </div>
363
  </div>
@@ -366,7 +366,7 @@ function lp_display_meta_box_select_template_container() {
366
  echo '</div>';
367
  echo "<div class='clear'></div>";
368
  echo "</div>";
369
- echo "<div style='display:none;' class='currently_selected'>". __( 'This is Currently Selected' , LANDINGPAGES_TEXT_DOMAIN) ."</a></div>";
370
  }
371
 
372
  // Custom CSS Widget
@@ -374,13 +374,13 @@ add_action('add_meta_boxes', 'add_custom_meta_box_lp_custom_css');
374
  add_action('save_post', 'landing_pages_save_custom_css');
375
 
376
  function add_custom_meta_box_lp_custom_css() {
377
- add_meta_box('lp_3_custom_css', __( 'Custom CSS' , LANDINGPAGES_TEXT_DOMAIN) , 'lp_custom_css_input', 'landing-page', 'normal', 'low');
378
  }
379
 
380
  function lp_custom_css_input() {
381
  global $post;
382
 
383
- _e("<em>Custom CSS may be required to customize this landing page.</em><strong> <u>Format</u>: #element-id { display:none !important; }</strong>" , LANDINGPAGES_TEXT_DOMAIN);
384
  echo '<input type="hidden" name="lp-custom-css-noncename" id="lp_custom_css_noncename" value="'.wp_create_nonce(basename(__FILE__)).'" />';
385
  $custom_css_name = apply_filters('lp_custom_css_name','lp-custom-css');
386
  echo '<textarea name="'.$custom_css_name.'" id="lp-custom-css" rows="5" cols="30" style="width:100%;">'.get_post_meta($post->ID,$custom_css_name,true).'</textarea>';
@@ -407,7 +407,7 @@ add_action('add_meta_boxes', 'add_custom_meta_box_lp_custom_js');
407
  add_action('save_post', 'landing_pages_save_custom_js');
408
 
409
  function add_custom_meta_box_lp_custom_js() {
410
- add_meta_box('lp_3_custom_js', __('Custom JS' , LANDINGPAGES_TEXT_DOMAIN) , 'lp_custom_js_input', 'landing-page', 'normal', 'low');
411
  }
412
 
413
  function lp_custom_js_input() {
@@ -439,7 +439,7 @@ function landing_pages_save_custom_js($post_id) {
439
  add_action('add_meta_boxes', 'add_custom_meta_box_lp_conversion_log');
440
 
441
  function add_custom_meta_box_lp_conversion_log() {
442
- add_meta_box('lp_conversion_log_metabox', __( 'Lead Captures' , LANDINGPAGES_TEXT_DOMAIN) , 'lp_conversion_log_metabox', 'landing-page', 'normal', 'low');
443
  }
444
 
445
  function lp_conversion_log_metabox() {
@@ -621,12 +621,12 @@ function lp_conversion_log_metabox() {
621
  case 'email':
622
  return "<a href='mailto:".$item[ $column_name ]."'>".$item[ $column_name ]."</a>";
623
  case 'details':
624
- echo '<a href="' . LANDINGPAGES_URLPATH.'modules/module.lead-splash.php?lead_id=' . $item[ 'ID' ] . '&post_id=' . $post->ID . '&height=400&width=600&TB_iframe=true" class="thickbox">' . __( 'View Lead' ,LANDINGPAGES_TEXT_DOMAIN) .'</a>';
625
  echo '&nbsp;&nbsp;';
626
  //print_r($item);
627
  if ($item[ 'first_time' ]==1)
628
  {
629
- echo '<img src="'.LANDINGPAGES_URLPATH.'images/new-lead.png" title="' . __( 'First timer!' , LANDINGPAGES_TEXT_DOMAIN) .'" style="float:right;">';
630
  }
631
  do_action('lp_lead_table_data_is_details_column',$item);
632
  return;
@@ -646,7 +646,7 @@ function lp_conversion_log_metabox() {
646
 
647
  function no_items()
648
  {
649
- _e( 'No conversions recorded yet...' , LANDINGPAGES_TEXT_DOMAIN);
650
  }
651
 
652
  function get_bulk_actions()
@@ -663,7 +663,7 @@ function lp_conversion_log_metabox() {
663
 
664
  }
665
  echo '<div id="leads-table-container">';
666
- echo '<h2 id="convert-header">'. __( 'Conversion logs:' , LANDINGPAGES_TEXT_DOMAIN) .'</h2>';
667
  echo '<div id="leads-table-container-inside">';
668
  $myListTable = new LP_LEAD_LOG();
669
  $myListTable->prepare_items();
@@ -700,7 +700,7 @@ function lp_generate_meta()
700
  //echo $key."<br>";
701
  add_meta_box(
702
  "lp_{$id}_custom_meta_box", // $id
703
- __( "<small>$template_name Options:</small>", LANDINGPAGES_TEXT_DOMAIN),
704
  'lp_show_metabox', // $callback
705
  'landing-page', // post-type
706
  'normal', // $context
@@ -725,7 +725,7 @@ function lp_generate_meta()
725
  //echo $key."<br>";
726
  add_meta_box(
727
  "lp_{$id}_custom_meta_box", // $id
728
- __( "$name", LANDINGPAGES_TEXT_DOMAIN),
729
  'lp_show_metabox', // $callback
730
  'landing-page', // post-type
731
  $position , // $context
@@ -783,11 +783,8 @@ function lp_render_metabox($key,$custom_fields,$post)
783
  $global_meta = $field['default'];
784
  }
785
 
786
- //print_r($field);
787
- if ((!isset($meta)&&isset($field['default'])&&!is_numeric($meta))||isset($meta)&&empty($meta)&&isset($field['default'])&&!is_numeric($meta))
788
  {
789
- //echo $field['id'].":".$meta;
790
- //echo "<br>";
791
  $meta = $field['default'];
792
  }
793
 
15
 
16
  add_meta_box(
17
  'lp-thumbnail-sidebar-preview',
18
+ __( 'Template Preview', 'landing-pages'),
19
  'lp_thumbnail_metabox',
20
  'landing-page' ,
21
  'side',
41
  <td>
42
  <?php
43
 
44
+ echo "<a href='$permalink' target='_blank' ><img src='$thumbnail' style='width:250px;height:250px;' title='". __( 'Preveiw this theme' , 'landing-pages') ." , ({$template})'></a>";
45
  ?>
46
  </td>
47
  </tr>
56
 
57
  add_action('add_meta_boxes', 'lp_display_meta_box_lp_conversion_area');
58
  function lp_display_meta_box_lp_conversion_area(){
59
+ add_meta_box( WYSIWYG_META_BOX_ID, __('Landing Page Form or Conversion Button - <em>click the black & blue power button icon to build forms/buttons</em>', 'landing-pages'), 'lp_meta_box_conversion_area', 'landing-page', 'normal', 'high' );
60
  //add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );
61
  }
62
 
116
 
117
  //Clear The Room!
118
  echo "<div style='clear:both; display:block;'></div>";
119
+ echo "<div style='width:100%;text-align:right;margin-top:11px;'><div class='lp_tooltip' title=\"". __('To help track conversions Landing Pages Plugin will automatically add a tracking class to forms. If you would like to track a link add this class to it' , 'landing-pages') ." class='wpl-track-me-link'\" ></div></div>";
120
 
121
  }
122
 
163
  //print_r($page_conversion_data);
164
  //echo "TEST";
165
  echo "<div id='lp-notes-area'>";
166
+ echo "<span id='add-lp-notes'>". __('Notes' , 'landing-pages') .":</span><input placeholder='". __('Add Notes to your variation. Example: This version is testing a green submit button ' , 'landing-pages') ."' type='text' class='lp-notes' name='{$variation_id}' id='{$variation_id}' value='{$variation_notes}' size='30'>";
167
+ 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' , 'landing-pages') .'" id="lp-main-headline" value="'.$main_title.'" title="'. __('This headline will appear in the landing page template.' , 'landing-pages') .'"></div><div id="lp-current-view">'.$lp_variation.'</div><div id="switch-lp">0</div>';
168
  echo ""; ?>
169
 
170
  <?php
212
  function lp_change_enter_title_text( $text, $post ) {
213
  if ($post->post_type=='landing-page')
214
  {
215
+ return __( 'Enter Landing Page Description' , 'landing-pages');
216
  }
217
  else
218
  {
226
 
227
  add_meta_box(
228
  'lp_metabox_select_template', // $id
229
+ __( 'Landing Page Templates', 'landing-pages'),
230
  'lp_display_meta_box_select_template', // $callback
231
  'landing-page', // $page
232
  'normal', // $context
248
  echo "<input type='hidden' name='lp_lp_custom_fields_nonce' value='".wp_create_nonce('lp-nonce')."' />";
249
  ?>
250
 
251
+ <div id="lp_template_change"><h2><a class="button" id="lp-change-template-button"><?php _e( 'Choose Another Template' , 'landing-pages'); ?></a></div>
252
  <input type='hidden' id='lp_select_template' name='<?php echo $name; ?>' value='<?php echo $template; ?>'>
253
  <div id="template-display-options"></div>
254
 
283
 
284
  echo "<div class='lp-template-selector-container' style='{$toggle}'>";
285
  echo "<div class='lp-selection-heading'>";
286
+ echo "<h1>". __( 'Select Your Landing Page Template!' , 'landing-pages') ."</h1>";
287
+ echo '<a class="button-secondary" style="display:none;" id="lp-cancel-selection">'. __('Cancel Template Change' , 'landing-pages') .'</a>';
288
  echo "</div>";
289
  echo '<ul id="template-filter" >';
290
+ echo '<li class="button-primary button"><a href="#" data-filter=".template-item-boxes">'. __( 'All' , 'landing-pages') .'</a></li>';
291
+ echo '<li class="button-primary button"><a href="#" data-filter=".theme">'. __( 'Theme' , 'landing-pages' ) .'</a></li>';
292
  $categories = array('Theme');
293
  foreach ($extension_data_cats as $cat)
294
  {
356
  </a>
357
  <p>
358
  <div id="template-title"><?php echo $data['info']['label']; ?></div>
359
+ <a href='#' label='<?php echo $data['info']['label']; ?>' id='<?php echo $this_extension; ?>' class='lp_select_template'><?php _e( 'Select' , 'landing-pages'); ?></a> |
360
+ <a class='<?php echo $cat_slug;?>' target="_blank" href='<?php echo $demo_link;?>' id='lp_preview_this_template'><?php _e( 'Preview' , 'landing-pages'); ?></a>
361
  </p>
362
  </div>
363
  </div>
366
  echo '</div>';
367
  echo "<div class='clear'></div>";
368
  echo "</div>";
369
+ echo "<div style='display:none;' class='currently_selected'>". __( 'This is Currently Selected' , 'landing-pages') ."</a></div>";
370
  }
371
 
372
  // Custom CSS Widget
374
  add_action('save_post', 'landing_pages_save_custom_css');
375
 
376
  function add_custom_meta_box_lp_custom_css() {
377
+ add_meta_box('lp_3_custom_css', __( 'Custom CSS' , 'landing-pages') , 'lp_custom_css_input', 'landing-page', 'normal', 'low');
378
  }
379
 
380
  function lp_custom_css_input() {
381
  global $post;
382
 
383
+ _e("<em>Custom CSS may be required to customize this landing page.</em><strong> <u>Format</u>: #element-id { display:none !important; }</strong>" , 'landing-pages');
384
  echo '<input type="hidden" name="lp-custom-css-noncename" id="lp_custom_css_noncename" value="'.wp_create_nonce(basename(__FILE__)).'" />';
385
  $custom_css_name = apply_filters('lp_custom_css_name','lp-custom-css');
386
  echo '<textarea name="'.$custom_css_name.'" id="lp-custom-css" rows="5" cols="30" style="width:100%;">'.get_post_meta($post->ID,$custom_css_name,true).'</textarea>';
407
  add_action('save_post', 'landing_pages_save_custom_js');
408
 
409
  function add_custom_meta_box_lp_custom_js() {
410
+ add_meta_box('lp_3_custom_js', __('Custom JS' , 'landing-pages') , 'lp_custom_js_input', 'landing-page', 'normal', 'low');
411
  }
412
 
413
  function lp_custom_js_input() {
439
  add_action('add_meta_boxes', 'add_custom_meta_box_lp_conversion_log');
440
 
441
  function add_custom_meta_box_lp_conversion_log() {
442
+ add_meta_box('lp_conversion_log_metabox', __( 'Lead Captures' , 'landing-pages') , 'lp_conversion_log_metabox', 'landing-page', 'normal', 'low');
443
  }
444
 
445
  function lp_conversion_log_metabox() {
621
  case 'email':
622
  return "<a href='mailto:".$item[ $column_name ]."'>".$item[ $column_name ]."</a>";
623
  case 'details':
624
+ echo '<a href="' . LANDINGPAGES_URLPATH.'modules/module.lead-splash.php?lead_id=' . $item[ 'ID' ] . '&post_id=' . $post->ID . '&height=400&width=600&TB_iframe=true" class="thickbox">' . __( 'View Lead' ,'landing-pages') .'</a>';
625
  echo '&nbsp;&nbsp;';
626
  //print_r($item);
627
  if ($item[ 'first_time' ]==1)
628
  {
629
+ echo '<img src="'.LANDINGPAGES_URLPATH.'images/new-lead.png" title="' . __( 'First timer!' , 'landing-pages') .'" style="float:right;">';
630
  }
631
  do_action('lp_lead_table_data_is_details_column',$item);
632
  return;
646
 
647
  function no_items()
648
  {
649
+ _e( 'No conversions recorded yet...' , 'landing-pages');
650
  }
651
 
652
  function get_bulk_actions()
663
 
664
  }
665
  echo '<div id="leads-table-container">';
666
+ echo '<h2 id="convert-header">'. __( 'Conversion logs:' , 'landing-pages') .'</h2>';
667
  echo '<div id="leads-table-container-inside">';
668
  $myListTable = new LP_LEAD_LOG();
669
  $myListTable->prepare_items();
700
  //echo $key."<br>";
701
  add_meta_box(
702
  "lp_{$id}_custom_meta_box", // $id
703
+ __( "<small>$template_name Options:</small>", 'landing-pages'),
704
  'lp_show_metabox', // $callback
705
  'landing-page', // post-type
706
  'normal', // $context
725
  //echo $key."<br>";
726
  add_meta_box(
727
  "lp_{$id}_custom_meta_box", // $id
728
+ __( "$name", 'landing-pages'),
729
  'lp_show_metabox', // $callback
730
  'landing-page', // post-type
731
  $position , // $context
783
  $global_meta = $field['default'];
784
  }
785
 
786
+ if (!metadata_exists('post',$post->ID,$field_id))
 
787
  {
 
 
788
  $meta = $field['default'];
789
  }
790
 
modules/module.post-type.php CHANGED
@@ -16,16 +16,16 @@ function landing_page_register() {
16
 
17
  $slug = get_option( 'lp-main-landing-page-permalink-prefix', 'go' );
18
  $labels = array(
19
- 'name' => _x('Landing Pages', 'post type general name' , LANDINGPAGES_TEXT_DOMAIN),
20
- 'singular_name' => _x('Landing Page', 'post type singular name' , LANDINGPAGES_TEXT_DOMAIN),
21
- 'add_new' => _x('Add New', 'Landing Page' , LANDINGPAGES_TEXT_DOMAIN),
22
- 'add_new_item' => __('Add New Landing Page' , LANDINGPAGES_TEXT_DOMAIN),
23
- 'edit_item' => __('Edit Landing Page' , LANDINGPAGES_TEXT_DOMAIN),
24
- 'new_item' => __('New Landing Page' , LANDINGPAGES_TEXT_DOMAIN),
25
- 'view_item' => __('View Landing Page' , LANDINGPAGES_TEXT_DOMAIN),
26
- 'search_items' => __('Search Landing Page' , LANDINGPAGES_TEXT_DOMAIN),
27
- 'not_found' => __('Nothing found' , LANDINGPAGES_TEXT_DOMAIN),
28
- 'not_found_in_trash' => __('Nothing found in Trash' , LANDINGPAGES_TEXT_DOMAIN),
29
  'parent_item_colon' => ''
30
  );
31
 
@@ -52,8 +52,8 @@ add_action('init', 'landing_page_category_registerTaxonomy');
52
  function landing_page_category_registerTaxonomy() {
53
  $args = array(
54
  'hierarchical' => true,
55
- 'label' => __("Categories" , LANDINGPAGES_TEXT_DOMAIN),
56
- 'singular_label' => __("Landing Page Category" , LANDINGPAGES_TEXT_DOMAIN),
57
  'show_ui' => true,
58
  'query_var' => true,
59
  "rewrite" => true
@@ -65,7 +65,7 @@ function landing_page_category_registerTaxonomy() {
65
  $lp_cats = get_transient( 'landing-page-cats' );
66
  if ( false === $lp_cats ) {
67
  $options_categories = array();
68
- $options_categories['all'] = __('All Landing Page Categories' , LANDINGPAGES_TEXT_DOMAIN);
69
  foreach ($terms as $term) {
70
  $options_categories[$term->term_id] = $term->name;
71
  }
@@ -79,7 +79,7 @@ add_action( 'admin_init', 'lp_change_excerpt_to_summary' );
79
  function lp_change_excerpt_to_summary() {
80
  $post_type = "landing-page";
81
  if ( post_type_supports($post_type, 'excerpt') ) {
82
- add_meta_box('postexcerpt', __('Short Description' , LANDINGPAGES_TEXT_DOMAIN), 'post_excerpt_meta_box', $post_type, 'normal', 'core'); }
83
  }
84
 
85
 
@@ -125,12 +125,12 @@ if (is_admin()) {
125
  $columns = array(
126
  "cb" => "<input type=\"checkbox\" />",
127
  //"ID" => "ID",
128
- "thumbnail-lander" => __( "Preview" , LANDINGPAGES_TEXT_DOMAIN),
129
- "title" => __( "Landing Page Title" , LANDINGPAGES_TEXT_DOMAIN),
130
- "stats" => __( "Variation Testing Stats" , LANDINGPAGES_TEXT_DOMAIN),
131
- "impressions" => __( "Total<br>Visits" , LANDINGPAGES_TEXT_DOMAIN),
132
- "actions" => __( "Total<br>Conversions" , LANDINGPAGES_TEXT_DOMAIN),
133
- "cr" => __( "Total<br>Conversion Rate" , LANDINGPAGES_TEXT_DOMAIN)
134
 
135
  );
136
  return $columns;
@@ -156,9 +156,9 @@ if (is_admin()) {
156
  $i = 0;
157
  $impressions = 0;
158
  $conversions = 0;
159
- foreach ($variations as $vid)
160
  {
161
- $letter = lp_ab_key_to_letter($vid); // convert to letter
162
  $each_impression = get_post_meta($post->ID,'lp-ab-variation-impressions-'.$vid, true); // get impressions
163
  $v_status = get_post_meta($post->ID,'lp_ab_variation_status-'.$vid, true); // Current status
164
 
@@ -188,7 +188,7 @@ if (is_admin()) {
188
 
189
  if ($v_status === "0")
190
  {
191
- $final_status = __( "(Paused)" , LANDINGPAGES_TEXT_DOMAIN);
192
  }
193
  else
194
  {
@@ -198,9 +198,9 @@ if (is_admin()) {
198
  $largest = $cr_array[$i];
199
  }
200
  (($largest === $conversion_rate)) ? $winner_class = 'lp-current-winner' : $winner_class = ""; */
201
- (($final_conversion === "1")) ? $c_text = __( 'conversion' , LANDINGPAGES_TEXT_DOMAIN) : $c_text = __( "conversions" , LANDINGPAGES_TEXT_DOMAIN);
202
- (($each_impression === "1")) ? $i_text = __( 'visit' , LANDINGPAGES_TEXT_DOMAIN) : $i_text = __( "visits" , LANDINGPAGES_TEXT_DOMAIN);
203
- (($each_notes === "")) ? $each_notes = __( 'No notes' , LANDINGPAGES_TEXT_DOMAIN) : $each_notes = $each_notes;
204
  $data_letter = "data-letter=\"".$letter."\"";
205
  $popup = "data-notes=\"<span class='lp-pop-description'>".$each_notes."</span><span class='lp-pop-controls'><span class='lp-pop-edit button-primary'><a href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=".$vid."&action=edit'>Edit This variation</a></span><span class='lp-pop-preview button'><a title='Click to Preview this variation' class='thickbox' href='".$permalink."?lp-variation-id=".$vid."&iframe_window=on&post_id=".$post->ID."&TB_iframe=true&width=640&height=703' target='_blank'>Preview This variation</a></span><span class='lp-bottom-controls'><span class='lp-delete-var-stats' data-letter='".$letter."' data-vid='".$vid."' rel='".$post->ID."'>Clear These Stats</span></span></span>\"";
206
 
@@ -219,11 +219,11 @@ if (is_admin()) {
219
  } else {
220
  $notes = get_post_meta($post->ID,'lp-variation-notes', true); // Get Notes
221
  $cr = lp_show_aggregated_stats("cr");
222
- (($notes === "")) ? $notes = __( 'No notes' , LANDINGPAGES_TEXT_DOMAIN) : $notes = $notes;
223
- $popup = "data-notes=\"<span class='lp-pop-description'>".$notes."</span><span class='lp-pop-controls'><span class='lp-pop-edit button-primary'><a href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=0&action=edit'>Edit This variation</a></span><span class='lp-pop-preview button'><a title='Click to Preview this variation' class='thickbox' href='".$permalink."?lp-variation-id=0&iframe_window=on&post_id=".$post->ID."&TB_iframe=true&width=640&height=703' target='_blank'>". __( 'Preview This variation' , LANDINGPAGES_TEXT_DOMAIN) ."</a></span><span class='lp-bottom-controls'><span class='lp-delete-var-stats' data-letter='A' data-vid='0' rel='".$post->ID."'>". __( 'Clear These Stats' , LANDINGPAGES_TEXT_DOMAIN) ."</span></span></span>\"";
224
 
225
  echo "<ul class='lp-varation-stat-ul'><li rel='' data-postid='".$post->ID."' data-letter='A' data-lp=''><a ".$popup." data-letter=\"A\" class='lp-letter' title='click to edit this variation' href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=0&action=edit'>A</a><span class='lp-numbers'> <span class='lp-impress-num'>" . lp_show_aggregated_stats("impressions") . "</span><span class='visit-text'>visits with</span><span class='lp-con-num'>". lp_show_aggregated_stats("actions") . "</span> conversions</span><a class='cr-number cr-empty-".$cr."' href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=0&action=edit'>". $cr . "%</a></li></ul>";
226
- echo "<div class='no-stats-yet'>". __('No A/B Tests running for this landing page' , LANDINGPAGES_TEXT_DOMAIN).". <a href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=1&action=edit&new-variation=1&lp-message=go'>". __('Start one' , LANDINGPAGES_TEXT_DOMAIN) ."</a></div>";
227
 
228
 
229
  }
@@ -298,7 +298,7 @@ if (is_admin()) {
298
  if (in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
299
  $thumbnail = LANDINGPAGES_URLPATH . '/images/localhost.png';
300
  }
301
- echo "<a title='".__('Click to Preview this variation' , LANDINGPAGES_TEXT_DOMAIN) ."' class='thickbox' href='".$permalink."?lp-variation-id=0&iframe_window=on&post_id=".$post->ID."&TB_iframe=true&width=640&height=703' target='_blank'><img src=".$thumbnail."' style='width:150px;height:110px;' title='Click to Preview'></a>";
302
 
303
  }
304
  else if ("stats" == $column)
@@ -395,8 +395,8 @@ if (is_admin()) {
395
  if ($post->post_type=='landing-page')
396
  {
397
  $actions['clear'] = '<a href="#clear-stats" id="lp_clear_'.$post->ID.'" class="clear_stats" title="'
398
- . esc_attr(__("Clear impression and conversion records", LANDINGPAGES_TEXT_DOMAIN))
399
- . '" >' . __('Clear All Stats', LANDINGPAGES_TEXT_DOMAIN) . '</a><span class="hover-description">'. __('Hover over the letters to the right for more options' , LANDINGPAGES_TEXT_DOMAIN) .'</span>';
400
  }
401
  return $actions;
402
  }
16
 
17
  $slug = get_option( 'lp-main-landing-page-permalink-prefix', 'go' );
18
  $labels = array(
19
+ 'name' => _x('Landing Pages', 'post type general name' , 'landing-pages'),
20
+ 'singular_name' => _x('Landing Page', 'post type singular name' , 'landing-pages'),
21
+ 'add_new' => _x('Add New', 'Landing Page' , 'landing-pages'),
22
+ 'add_new_item' => __('Add New Landing Page' , 'landing-pages'),
23
+ 'edit_item' => __('Edit Landing Page' , 'landing-pages'),
24
+ 'new_item' => __('New Landing Page' , 'landing-pages'),
25
+ 'view_item' => __('View Landing Page' , 'landing-pages'),
26
+ 'search_items' => __('Search Landing Page' , 'landing-pages'),
27
+ 'not_found' => __('Nothing found' , 'landing-pages'),
28
+ 'not_found_in_trash' => __('Nothing found in Trash' , 'landing-pages'),
29
  'parent_item_colon' => ''
30
  );
31
 
52
  function landing_page_category_registerTaxonomy() {
53
  $args = array(
54
  'hierarchical' => true,
55
+ 'label' => __("Categories" , 'landing-pages'),
56
+ 'singular_label' => __("Landing Page Category" , 'landing-pages'),
57
  'show_ui' => true,
58
  'query_var' => true,
59
  "rewrite" => true
65
  $lp_cats = get_transient( 'landing-page-cats' );
66
  if ( false === $lp_cats ) {
67
  $options_categories = array();
68
+ $options_categories['all'] = __('All Landing Page Categories' , 'landing-pages');
69
  foreach ($terms as $term) {
70
  $options_categories[$term->term_id] = $term->name;
71
  }
79
  function lp_change_excerpt_to_summary() {
80
  $post_type = "landing-page";
81
  if ( post_type_supports($post_type, 'excerpt') ) {
82
+ add_meta_box('postexcerpt', __('Short Description' , 'landing-pages'), 'post_excerpt_meta_box', $post_type, 'normal', 'core'); }
83
  }
84
 
85
 
125
  $columns = array(
126
  "cb" => "<input type=\"checkbox\" />",
127
  //"ID" => "ID",
128
+ "thumbnail-lander" => __( "Preview" , 'landing-pages'),
129
+ "title" => __( "Landing Page Title" , 'landing-pages'),
130
+ "stats" => __( "Variation Testing Stats" , 'landing-pages'),
131
+ "impressions" => __( "Total<br>Visits" , 'landing-pages'),
132
+ "actions" => __( "Total<br>Conversions" , 'landing-pages'),
133
+ "cr" => __( "Total<br>Conversion Rate" , 'landing-pages')
134
 
135
  );
136
  return $columns;
156
  $i = 0;
157
  $impressions = 0;
158
  $conversions = 0;
159
+ foreach ($variations as $key => $vid)
160
  {
161
+ $letter = lp_ab_key_to_letter($key); // convert to letter
162
  $each_impression = get_post_meta($post->ID,'lp-ab-variation-impressions-'.$vid, true); // get impressions
163
  $v_status = get_post_meta($post->ID,'lp_ab_variation_status-'.$vid, true); // Current status
164
 
188
 
189
  if ($v_status === "0")
190
  {
191
+ $final_status = __( "(Paused)" , 'landing-pages');
192
  }
193
  else
194
  {
198
  $largest = $cr_array[$i];
199
  }
200
  (($largest === $conversion_rate)) ? $winner_class = 'lp-current-winner' : $winner_class = ""; */
201
+ (($final_conversion === "1")) ? $c_text = __( 'conversion' , 'landing-pages') : $c_text = __( "conversions" , 'landing-pages');
202
+ (($each_impression === "1")) ? $i_text = __( 'visit' , 'landing-pages') : $i_text = __( "visits" , 'landing-pages');
203
+ (($each_notes === "")) ? $each_notes = __( 'No notes' , 'landing-pages') : $each_notes = $each_notes;
204
  $data_letter = "data-letter=\"".$letter."\"";
205
  $popup = "data-notes=\"<span class='lp-pop-description'>".$each_notes."</span><span class='lp-pop-controls'><span class='lp-pop-edit button-primary'><a href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=".$vid."&action=edit'>Edit This variation</a></span><span class='lp-pop-preview button'><a title='Click to Preview this variation' class='thickbox' href='".$permalink."?lp-variation-id=".$vid."&iframe_window=on&post_id=".$post->ID."&TB_iframe=true&width=640&height=703' target='_blank'>Preview This variation</a></span><span class='lp-bottom-controls'><span class='lp-delete-var-stats' data-letter='".$letter."' data-vid='".$vid."' rel='".$post->ID."'>Clear These Stats</span></span></span>\"";
206
 
219
  } else {
220
  $notes = get_post_meta($post->ID,'lp-variation-notes', true); // Get Notes
221
  $cr = lp_show_aggregated_stats("cr");
222
+ (($notes === "")) ? $notes = __( 'No notes' , 'landing-pages') : $notes = $notes;
223
+ $popup = "data-notes=\"<span class='lp-pop-description'>".$notes."</span><span class='lp-pop-controls'><span class='lp-pop-edit button-primary'><a href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=0&action=edit'>Edit This variation</a></span><span class='lp-pop-preview button'><a title='Click to Preview this variation' class='thickbox' href='".$permalink."?lp-variation-id=0&iframe_window=on&post_id=".$post->ID."&TB_iframe=true&width=640&height=703' target='_blank'>". __( 'Preview This variation' , 'landing-pages') ."</a></span><span class='lp-bottom-controls'><span class='lp-delete-var-stats' data-letter='A' data-vid='0' rel='".$post->ID."'>". __( 'Clear These Stats' , 'landing-pages') ."</span></span></span>\"";
224
 
225
  echo "<ul class='lp-varation-stat-ul'><li rel='' data-postid='".$post->ID."' data-letter='A' data-lp=''><a ".$popup." data-letter=\"A\" class='lp-letter' title='click to edit this variation' href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=0&action=edit'>A</a><span class='lp-numbers'> <span class='lp-impress-num'>" . lp_show_aggregated_stats("impressions") . "</span><span class='visit-text'>visits with</span><span class='lp-con-num'>". lp_show_aggregated_stats("actions") . "</span> conversions</span><a class='cr-number cr-empty-".$cr."' href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=0&action=edit'>". $cr . "%</a></li></ul>";
226
+ echo "<div class='no-stats-yet'>". __('No A/B Tests running for this landing page' , 'landing-pages').". <a href='/wp-admin/post.php?post=".$post->ID."&lp-variation-id=1&action=edit&new-variation=1&lp-message=go'>". __('Start one' , 'landing-pages') ."</a></div>";
227
 
228
 
229
  }
298
  if (in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
299
  $thumbnail = LANDINGPAGES_URLPATH . '/images/localhost.png';
300
  }
301
+ echo "<a title='".__('Click to Preview this variation' , 'landing-pages') ."' class='thickbox' href='".$permalink."?lp-variation-id=0&iframe_window=on&post_id=".$post->ID."&TB_iframe=true&width=640&height=703' target='_blank'><img src=".$thumbnail."' style='width:150px;height:110px;' title='Click to Preview'></a>";
302
 
303
  }
304
  else if ("stats" == $column)
395
  if ($post->post_type=='landing-page')
396
  {
397
  $actions['clear'] = '<a href="#clear-stats" id="lp_clear_'.$post->ID.'" class="clear_stats" title="'
398
+ . esc_attr(__("Clear impression and conversion records", 'landing-pages'))
399
+ . '" >' . __('Clear All Stats', 'landing-pages') . '</a><span class="hover-description">'. __('Hover over the letters to the right for more options' , 'landing-pages') .'</span>';
400
  }
401
  return $actions;
402
  }
modules/module.redirect-ab-testing.php CHANGED
@@ -15,182 +15,147 @@ else if ( file_exists ( './../../../../../wp-config.php' ) )
15
  include_once ( './../../../../../wp-config.php' );
16
  }
17
 
 
18
 
19
- if (isset($_COOKIE['lp-loaded-variation-'.$_GET['permalink_name']]) && get_option('lp-main-landing-page-rotation-halt' , 0))
20
- {
21
- $url = $_COOKIE['lp-loaded-variation-'.$_GET['permalink_name']];
22
- }
23
- else
24
- {
25
- //echo "here";
26
- //echo $_GET['permalink_name'];exit;
27
- $query = "SELECT * FROM {$table_prefix}posts WHERE post_name='".mysql_real_escape_string($_GET['permalink_name'])."' AND post_type='landing-page' LIMIT 1";
28
- $result = mysql_query($query);
29
- if (!$result){ echo $query; echo mysql_error(); exit;}
30
- //echo mysql_num_rows($result);
31
 
32
- $arr = mysql_fetch_array($result);
33
- $pid = $arr['ID'];
 
 
 
 
 
34
 
35
- $variations = get_post_meta($pid,'lp-ab-variations', true);
36
- $marker = get_post_meta($pid,'lp-ab-variations-marker', true);
37
- if (!is_numeric($marker))
38
- $marker = 0;
39
 
 
 
 
 
 
40
 
41
- //echo "marker$marker";
42
- //echo "<br>";
43
- //echo $variations;
44
-
45
- $variations = explode(',',$variations);
46
- $variations = array_filter($variations,'is_numeric');
 
 
 
 
 
47
 
48
- //echo "<br>";
49
- //echo count($variations);
50
- //echo "<br>";
 
51
 
52
- if ($variations)
53
- {
54
- foreach ($variations as $key=>$vid)
55
- {
 
 
 
56
 
57
- if ($vid==0)
58
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  $variation_status = get_post_meta( $pid , 'lp_ab_variation_status' , true );
60
- }
61
- else
62
- {
63
  $variation_status = get_post_meta( $pid , 'lp_ab_variation_status-'.$vid , true );
64
  }
65
 
66
- if (!is_numeric($variation_status)||$variation_status==1)
67
- {
68
  $live_variations[] = $vid;
69
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  }
71
 
72
- if (!$live_variations)
73
- {
74
- $live_variations[] = 0;
 
 
 
 
 
 
75
  }
76
 
77
- $keys_as_values = array_flip($live_variations);
 
78
 
79
- //set pointer to beginning of array;
80
- reset($keys_as_values);
 
 
81
 
82
- //print_r($live_variations);
 
83
 
84
- if (!isset($live_variations[$marker]))
85
- {
86
- //echo "reset pointer!"; exit;
87
- //echo "<br>";
88
- $marker= reset($keys_as_values);
89
- //echo next($live_variations);
90
- }
91
 
92
- //if ($marker == end($live_variations))
93
- //{
94
- //echo "reset pointer!";
95
- //echo "<br>";
96
- //$marker= reset($live_variations);
97
- //echo next($live_variations);
98
- //}
99
-
100
-
101
- //echo key($live_variations);exit;
102
- $i = 0;
103
- if (key($keys_as_values)!=$marker)
104
- {
105
- while ((next($keys_as_values) != $marker ))
106
- {
107
- if ($i>100)
108
- break;
109
-
110
- //echo "here";
111
-
112
- //next($live_variations);
113
- //echo "<br>";
114
- //echo "key:".key($live_variations);
115
- //echo "<br>";
116
- //echo "marker:$marker <br>";
117
- $i++;
118
  }
119
  }
120
-
121
- //echo "<br>";
122
- //echo "Marker:".$marker;
123
- //echo "<br>";
124
-
125
- $variation_id = $live_variations[$marker];
126
- //echo "first vid:$variation_id";
127
- //echo "<br>";
128
- //echo $variation_status;
129
- //echo "<br>";
130
-
131
- //echo "fire:";
132
- //set next marker
133
- //print_r($live_variations);
134
- //echo "<br>";
135
-
136
- //echo "premarker:".$marker;
137
- //echo "<br>";
138
- //echo current($live_variations);
139
- //echo each($live_variations);
140
- //next($live_variations);
141
- $marker = next($keys_as_values);
142
- //echo $marker;exit;
143
- //echo "<br>";
144
- //echo next($live_variations);
145
- //echo "<br>";
146
- //echo next($live_variations);
147
- //echo "<br>";
148
- //echo "final marker: $marker";
149
- //echo "<br>";
150
- //
151
- //exit;
152
- if (!$marker)
153
- {
154
- //echo "here";exit;
155
- $marker = reset($keys_as_values);
156
- }
157
-
158
- //echo "final marker:$marker";
159
- //echo "<br>";
160
 
161
- update_post_meta($pid, 'lp-ab-variations-marker', $marker);
 
162
 
163
- }
164
- else
165
- {
166
- $variation_id = 0;
167
- }
168
 
169
- //echo "<br>";
170
- //echo "final vid:".$variation_id;exit;
171
- $url = get_permalink($pid);
172
- $old_params = "";
173
- foreach ($_GET as $key=>$value) {
174
- if ($key != "permalink_name"){
175
- $old_params .= "&$key=" . $value;
176
- }
177
- }
178
- $url = $url."?lp-variation-id=".$variation_id.$old_params;
179
- setcookie('lp-loaded-variation-'.$_GET['permalink_name'], $url, time()+ 60 * 60 * 24 * 30 ,"/");
180
- }
181
- //echo "<br>";
182
- //echo $url;
183
- setcookie('lp-variation-id', $variation_id,time()+3600,"/");
184
- //$page = lp_remote_connect($url);
185
-
186
- @header("HTTP/1.1 307 Temporary Redirect");
187
- @header("Location: $url");
188
 
189
- function lp_get_next($array, $key) {
190
- $currentKey = key($array);
191
- while ($currentKey !== null && $currentKey != $key) {
192
- next($array);
193
- $currentKey = key($array);
194
- }
195
- return next($array);
196
  }
15
  include_once ( './../../../../../wp-config.php' );
16
  }
17
 
18
+ $VariationRoation = new LP_Variation_Rotation;
19
 
20
+ class LP_Variation_Rotation {
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ private $permalink_name;
23
+ private $post_id;
24
+ private $last_loaded_variation;
25
+ private $variations;
26
+ private $marker;
27
+ private $next_marker;
28
+ private $destination_url;
29
 
30
+ /* Exectutes Class */
31
+ function __construct() {
 
 
32
 
33
+ self::load_variables();
34
+ //self::run_debug();
35
+ self::redirect();
36
+
37
+ }
38
 
39
+ /* Loads Variables */
40
+ function load_variables()
41
+ {
42
+ $this->permalink_name = (isset($_GET['permalink_name'])) ? $_GET['permalink_name'] : null;
43
+ $this->post_id = $this->load_post_id();
44
+ $this->last_loaded_variation = ( isset( $_COOKIE['lp-loaded-variation-'.$this->permalink_name] ) ) ? $_COOKIE['lp-loaded-variation-'.$this->permalink_name] : null;
45
+ $this->variations = $this->load_variations();
46
+ $this->marker = $this->load_marker();
47
+ $this->next_marker = $this->discover_next_variation();
48
+ $this->destination_url = $this->build_destination_url();
49
+ }
50
 
51
+ /* Debug Information - Prints Class Variable Data */
52
+ private function run_debug() {
53
+ print_r($this);exit;
54
+ }
55
 
56
+ /* Loads the ID of the Landing Page */
57
+ private function load_post_id() {
58
+ global $table_prefix;
59
+
60
+ $query = "SELECT * FROM {$table_prefix}posts WHERE post_name='".mysql_real_escape_string($_GET['permalink_name'])."' AND post_type='landing-page' LIMIT 1";
61
+ $result = mysql_query($query);
62
+ if (!$result){ echo $query; echo mysql_error(); exit;}
63
 
64
+ $array = mysql_fetch_array($result);
65
+ $post_id = $array['ID'];
66
+
67
+ return $post_id;
68
+ }
69
+
70
+ /* Loads an Array of Active Variations Associated with Landing Page */
71
+ private function load_variations() {
72
+
73
+ $live_variations = array();
74
+
75
+ $variations_string = get_post_meta( $this->post_id , 'lp-ab-variations' , true );
76
+ $variations = explode(',',$variations_string);
77
+ $variations = array_filter($variations,'is_numeric');
78
+
79
+ /* Check the Status of Each Variation and Keep Live Ones */
80
+ foreach ($variations as $key=>$vid) {
81
+
82
+ if ($vid==0) {
83
  $variation_status = get_post_meta( $pid , 'lp_ab_variation_status' , true );
84
+ } else {
 
 
85
  $variation_status = get_post_meta( $pid , 'lp_ab_variation_status-'.$vid , true );
86
  }
87
 
88
+ if (!is_numeric($variation_status) || $variation_status==1) {
 
89
  $live_variations[] = $vid;
90
  }
91
+
92
+ }
93
+
94
+ return $live_variations;
95
+ }
96
+
97
+ /* Loads Variation ID of Last Variation Loaded */
98
+ private function load_marker() {
99
+
100
+ $marker = get_post_meta( $this->post_id , 'lp-ab-variations-marker' , true );
101
+
102
+ if ( !is_numeric($marker) || !in_array( $marker , $this->variations ) ) {
103
+
104
+ $marker = current($this->variations);
105
  }
106
 
107
+ return $marker;
108
+ }
109
+
110
+ /* Discovers Next Variation in Line */
111
+ private function discover_next_variation() {
112
+
113
+ /* Set Pointer to Correct Location in Variations Array */
114
+ while ( $this->marker != current( $this->variations) ) {
115
+ next($this->variations);
116
  }
117
 
118
+ /* Discover the next variation in the array */
119
+ next($this->variations);
120
 
121
+ /* If the pointer is empty then reset array */
122
+ if ( !is_numeric(current( $this->variations ) ) ) {
123
+ reset( $this->variations );
124
+ }
125
 
126
+ /* Save as Historical Data */
127
+ update_post_meta( $this->post_id , 'lp-ab-variations-marker' , current( $this->variations ) );
128
 
129
+ return current( $this->variations );
 
 
 
 
 
 
130
 
131
+ }
132
+
133
+ /* Builds Redirect URL & Stores Cookie Data */
134
+ private function build_destination_url() {
135
+
136
+ /* Load Base URL */
137
+ $url = get_permalink($this->post_id);
138
+
139
+ /* Keep GET Params */
140
+ foreach ($_GET as $key=>$value) {
141
+ if ($key != "permalink_name"){
142
+ $old_params .= "&$key=" . $value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  }
144
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
 
146
+ /* Build Final URL and Set Memory Cookies */
147
+ $url = $url."?lp-variation-id=".$this->next_marker.$old_params;
148
 
149
+ /* Set Memory Cookies */
150
+ setcookie('lp-loaded-variation-'.$this->permalink_name , $url , time()+ 60 * 60 * 24 * 30 , "/" );
151
+ setcookie( 'lp-variation-id' , $this->variation_id , time()+3600 , "/" );
 
 
152
 
153
+ return $url;
154
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
+ /* Redirects to Correct Variation */
157
+ private function redirect() {
158
+ @header("HTTP/1.1 307 Temporary Redirect");
159
+ @header("Location: ".$this->destination_url);
160
+ }
 
 
161
  }
modules/module.sidebar.php CHANGED
@@ -9,8 +9,8 @@ function lp_register_sidebars()
9
  {
10
  register_sidebar(array(
11
  'id' => 'lp_sidebar',
12
- 'name' => __( 'Landing Pages Sidebar' , LANDINGPAGES_TEXT_DOMAIN),
13
- 'description' => __( 'Landing Pages Sidebar Area: For default and native theme templates only.' , LANDINGPAGES_TEXT_DOMAIN),
14
  'before_widget' => '<div id="%1$s" class="widget %2$s">',
15
  'after_widget' => '</div>',
16
  'before_title' => '<h3 class="widget-title">',
9
  {
10
  register_sidebar(array(
11
  'id' => 'lp_sidebar',
12
+ 'name' => __( 'Landing Pages Sidebar' , 'landing-pages'),
13
+ 'description' => __( 'Landing Pages Sidebar Area: For default and native theme templates only.' , 'landing-pages'),
14
  'before_widget' => '<div id="%1$s" class="widget %2$s">',
15
  'after_widget' => '</div>',
16
  'before_title' => '<h3 class="widget-title">',
modules/module.store.php CHANGED
@@ -1 +1 @@
1
- <?php
2
  </div>
 
3
  </div>
 
1
  </div>
2
+ <?php
3
  </div>
modules/module.subscribe.php CHANGED
@@ -1 +1 @@
1
- <?php
1
+ <?php
modules/module.templates-upload.php CHANGED
@@ -11,21 +11,21 @@ function lp_display_upload()
11
  {
12
  ?>
13
  <div class="wrap templates_upload">
14
- <div class="icon32" id="icon-plugins"><br></div><h2><?php _e( 'Install Templates' , LANDINGPAGES_TEXT_DOMAIN); ?></h2>
15
 
16
  <ul class="subsubsub">
17
- <li class="plugin-install-dashboard"><a href="#search" id='menu_search'><?php _e( 'Search' ,LANDINGPAGES_TEXT_DOMAIN); ?></a> |</li>
18
- <li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , LANDINGPAGES_TEXT_DOMAIN); ?></a> </li>
19
  </ul>
20
 
21
  <br class="clear">
22
- <h4><?php _e('Install Landing Pages template by uploading them here in .zip format' , LANDINGPAGES_TEXT_DOMAIN); ?></h4>
23
 
24
- <p class="install-help"><?php _e( 'Warning: Do not upload landing page extensions here or you will break the plugin! <br>Extensions are uploaded in the WordPress plugins section.' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
25
  <form action="" class="wp-upload-form" enctype="multipart/form-data" method="post">
26
  <input type="hidden" value="<?php echo wp_create_nonce('lp-nonce'); ?>" name="lp_wpnonce" id="_wpnonce">
27
  <input type="hidden" value="/wp-admin/plugin-install.php?tab=upload" name="_wp_http_referer">
28
- <label for="pluginzip" class="screen-reader-text"><?php _e( 'Template zip file' , LANDINGPAGES_TEXT_DOMAIN); ?></label>
29
  <input type="file" name="templatezip" id="templatezip">
30
  <input type="submit" value="Install Now" class="button" id="install-template-submit" name="install-template-submit" disabled="">
31
  </form>
@@ -39,18 +39,18 @@ function lp_templates_search()
39
  ?>
40
 
41
  <div class="wrap templates_search" style='display:none'>
42
- <div class="icon32" id="icon-plugins"><br></div><h2><?php _e( 'Search Templates' , LANDINGPAGES_TEXT_DOMAIN); ?></h2>
43
 
44
  <ul class="subsubsub">
45
- <li class="plugin-install-dashboard"><a href="#search" id='menu_search'><?php _e( 'Search' , LANDINGPAGES_TEXT_DOMAIN); ?></a> |</li>
46
- <li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , LANDINGPAGES_TEXT_DOMAIN); ?></a> </li>
47
  </ul>
48
 
49
  <br class="clear">
50
- <p class="install-help"><?php _e( 'Search the Inboundnow marketplace for free and premium templates.' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
51
  <form action="edit.php?post_type=landing-page&page=lp_store" method="POST" id="">
52
  <input type="search" autofocus="autofocus" value="" name="search">
53
- <label for="plugin-search-input" class="screen-reader-text"><?php _e( 'Search Templates' , LANDINGPAGES_TEXT_DOMAIN); ?></label>
54
  <input type="submit" value="Search Templates" class="button" id="plugin-search-input" name="plugin-search-input">
55
  </form>
56
  </div>
@@ -113,19 +113,19 @@ function lp_templates_upload_execute()
113
  if (!$is_template)
114
  {
115
  echo "<br><br><br><br>";
116
- die(__("WARNING! This zip file does not seem to be a template file! If you are trying to install a Landing Page extension please use the Plugin's upload section! Please press the back button and try again!" , LANDINGPAGES_TEXT_DOMAIN));
117
  }
118
  //exit;
119
  //$result = $zip->extract(PCLZIP_OPT_PATH, $extended_path );
120
 
121
  if ($result = $zip->extract(PCLZIP_OPT_PATH, $extended_path , PCLZIP_OPT_REPLACE_NEWER ) == 0)
122
  {
123
- die(__( "There was a problem. Please try again!" , LANDINGPAGES_TEXT_DOMAIN));
124
  }
125
  else
126
  {
127
  unlink( $_FILES['templatezip']["tmp_name"]);
128
- echo '<div class="updated"><p>'. __( 'Template uploaded successfully!' , LANDINGPAGES_TEXT_DOMAIN).'</div>';
129
  }
130
  }
131
  }
11
  {
12
  ?>
13
  <div class="wrap templates_upload">
14
+ <div class="icon32" id="icon-plugins"><br></div><h2><?php _e( 'Install Templates' , 'landing-pages'); ?></h2>
15
 
16
  <ul class="subsubsub">
17
+ <li class="plugin-install-dashboard"><a href="#search" id='menu_search'><?php _e( 'Search' ,'landing-pages'); ?></a> |</li>
18
+ <li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , 'landing-pages'); ?></a> </li>
19
  </ul>
20
 
21
  <br class="clear">
22
+ <h4><?php _e('Install Landing Pages template by uploading them here in .zip format' , 'landing-pages'); ?></h4>
23
 
24
+ <p class="install-help"><?php _e( 'Warning: Do not upload landing page extensions here or you will break the plugin! <br>Extensions are uploaded in the WordPress plugins section.' , 'landing-pages'); ?></p>
25
  <form action="" class="wp-upload-form" enctype="multipart/form-data" method="post">
26
  <input type="hidden" value="<?php echo wp_create_nonce('lp-nonce'); ?>" name="lp_wpnonce" id="_wpnonce">
27
  <input type="hidden" value="/wp-admin/plugin-install.php?tab=upload" name="_wp_http_referer">
28
+ <label for="pluginzip" class="screen-reader-text"><?php _e( 'Template zip file' , 'landing-pages'); ?></label>
29
  <input type="file" name="templatezip" id="templatezip">
30
  <input type="submit" value="Install Now" class="button" id="install-template-submit" name="install-template-submit" disabled="">
31
  </form>
39
  ?>
40
 
41
  <div class="wrap templates_search" style='display:none'>
42
+ <div class="icon32" id="icon-plugins"><br></div><h2><?php _e( 'Search Templates' , 'landing-pages'); ?></h2>
43
 
44
  <ul class="subsubsub">
45
+ <li class="plugin-install-dashboard"><a href="#search" id='menu_search'><?php _e( 'Search' , 'landing-pages'); ?></a> |</li>
46
+ <li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , 'landing-pages'); ?></a> </li>
47
  </ul>
48
 
49
  <br class="clear">
50
+ <p class="install-help"><?php _e( 'Search the Inboundnow marketplace for free and premium templates.' , 'landing-pages'); ?></p>
51
  <form action="edit.php?post_type=landing-page&page=lp_store" method="POST" id="">
52
  <input type="search" autofocus="autofocus" value="" name="search">
53
+ <label for="plugin-search-input" class="screen-reader-text"><?php _e( 'Search Templates' , 'landing-pages'); ?></label>
54
  <input type="submit" value="Search Templates" class="button" id="plugin-search-input" name="plugin-search-input">
55
  </form>
56
  </div>
113
  if (!$is_template)
114
  {
115
  echo "<br><br><br><br>";
116
+ die(__("WARNING! This zip file does not seem to be a template file! If you are trying to install a Landing Page extension please use the Plugin's upload section! Please press the back button and try again!" , 'landing-pages'));
117
  }
118
  //exit;
119
  //$result = $zip->extract(PCLZIP_OPT_PATH, $extended_path );
120
 
121
  if ($result = $zip->extract(PCLZIP_OPT_PATH, $extended_path , PCLZIP_OPT_REPLACE_NEWER ) == 0)
122
  {
123
+ die(__( "There was a problem. Please try again!" , 'landing-pages'));
124
  }
125
  else
126
  {
127
  unlink( $_FILES['templatezip']["tmp_name"]);
128
+ echo '<div class="updated"><p>'. __( 'Template uploaded successfully!' , 'landing-pages').'</div>';
129
  }
130
  }
131
  }
modules/module.templates.php CHANGED
@@ -107,10 +107,10 @@ else if (isset($_GET['page'])&&$_GET['page']=='lp_manage_templates')
107
  {
108
  $columns = array(
109
  'cb' => '<input type="checkbox" />',
110
- 'template' => __( 'Template' , LANDINGPAGES_TEXT_DOMAIN),
111
- 'description' => __( 'Description' , LANDINGPAGES_TEXT_DOMAIN),
112
- 'category' => __( 'Category' , LANDINGPAGES_TEXT_DOMAIN),
113
- 'version' => __( 'Current Version' , LANDINGPAGES_TEXT_DOMAIN)
114
 
115
  );
116
  return $columns;
@@ -216,15 +216,15 @@ else if (isset($_GET['page'])&&$_GET['page']=='lp_manage_templates')
216
 
217
  function no_items()
218
  {
219
- _e( 'No premium templates installed. Templates included in the Landing Pages core plugin will not be listed here.' , LANDINGPAGES_TEXT_DOMAIN);
220
  }
221
 
222
  function get_bulk_actions()
223
  {
224
  $actions = array(
225
 
226
- 'upgrade' => __( 'Upgrade' , LANDINGPAGES_TEXT_DOMAIN),
227
- 'delete' => __( 'Delete' , LANDINGPAGES_TEXT_DOMAIN),
228
 
229
  );
230
 
107
  {
108
  $columns = array(
109
  'cb' => '<input type="checkbox" />',
110
+ 'template' => __( 'Template' , 'landing-pages'),
111
+ 'description' => __( 'Description' , 'landing-pages'),
112
+ 'category' => __( 'Category' , 'landing-pages'),
113
+ 'version' => __( 'Current Version' , 'landing-pages')
114
 
115
  );
116
  return $columns;
216
 
217
  function no_items()
218
  {
219
+ _e( 'No premium templates installed. Templates included in the Landing Pages core plugin will not be listed here.' , 'landing-pages');
220
  }
221
 
222
  function get_bulk_actions()
223
  {
224
  $actions = array(
225
 
226
+ 'upgrade' => __( 'Upgrade' , 'landing-pages'),
227
+ 'delete' => __( 'Delete' , 'landing-pages'),
228
 
229
  );
230
 
modules/module.welcome.php CHANGED
@@ -49,24 +49,24 @@ class LandingPages_Welcome {
49
  public function admin_menus() {
50
  // About Page
51
  add_dashboard_page(
52
- __( 'Welcome to WordPress Landing Pages', LANDINGPAGES_TEXT_DOMAIN),
53
- __( 'Welcome to WordPress Landing Pages', LANDINGPAGES_TEXT_DOMAIN),
54
  $this->minimum_capability,
55
  'lp-quick-start',
56
  array( $this, 'quick_start_screen' )
57
  );
58
  // About InboundNow Page
59
  add_dashboard_page(
60
- __( 'About the Inbound Now Marketing Platform', LANDINGPAGES_TEXT_DOMAIN),
61
- __( 'About the Inbound Now Marketing Platform', LANDINGPAGES_TEXT_DOMAIN),
62
  $this->minimum_capability,
63
  'about-inboundnow',
64
  array( $this, 'about_inboundnow_screen' )
65
  );
66
  // Developer Page
67
  add_dashboard_page(
68
- __( 'Developers and Designers', LANDINGPAGES_TEXT_DOMAIN),
69
- __( 'Developers and Designers', LANDINGPAGES_TEXT_DOMAIN),
70
  $this->minimum_capability,
71
  'inbound-developers',
72
  array( $this, 'dev_designer_screen' )
@@ -262,7 +262,7 @@ class LandingPages_Welcome {
262
  $active = ($current_view === $key) ? 'nav-tab-active' : '';
263
 
264
  echo '<a class="nav-tab '.$active.'" href="'.esc_url( admin_url( add_query_arg( array( 'page' => $key ), 'index.php' ) ) ).'">';
265
- echo _e( $value, LANDINGPAGES_TEXT_DOMAIN);
266
  echo '</a>';
267
 
268
  }
@@ -301,23 +301,23 @@ class LandingPages_Welcome {
301
  font-size: 19px;
302
  }</style>
303
  <div class="wrap about-wrap" id="inbound-plugins">
304
- <h1><?php printf( __( 'Welcome to WordPress Landing Pages %s', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></h1>
305
- <div class="about-text" id="in-sub-head"><?php printf( __( 'Thank you for updating to the latest version! WordPress Landing Pages %s is help you convert more leads!', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></div>
306
- <div class="edd-badge"><?php printf( __( 'Version %s', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></div>
307
 
308
  <?php self::render_nav_menu();?>
309
  <div class="row">
310
  <div class='grid two-third'>
311
  <div id="creating-landing-page">
312
- <h4><?php _e( 'Create Your First Landing Page', LANDINGPAGES_TEXT_DOMAIN);?></h4>
313
  <iframe width="640" height="360" src="//www.youtube.com/embed/-VuaBUc_yfk" frameborder="0" allowfullscreen></iframe>
314
  </div>
315
  <div id="creating-landing-page">
316
- <h4><?php _e( 'How to Create Forms', LANDINGPAGES_TEXT_DOMAIN);?></h4>
317
  <iframe width="640" height="360" src="//www.youtube.com/embed/Y4M_g9wkRXw" frameborder="0" allowfullscreen></iframe>
318
  </div>
319
  <div id="creating-landing-page">
320
- <h4><?php _e( 'Creating Landing Pages with your Current Theme Template', LANDINGPAGES_TEXT_DOMAIN);?></h4>
321
  <iframe width="640" height="360" src="//www.youtube.com/embed/pQzmx4ooL1M?list=UUCqiE-EcfDjaKGXSxtegcyg" frameborder="0" allowfullscreen></iframe>
322
  </div>
323
  <div id="creating-landing-page">
@@ -337,16 +337,16 @@ class LandingPages_Welcome {
337
  <h4>Quick Links</h4>
338
  <ul id="inbound-setting-links">
339
  <li>
340
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page', 'page' => 'lp_global_settings' ), 'edit.php' ) ) ); ?>"><?php _e( 'Go to WordPress Landing Pages Settings', LANDINGPAGES_TEXT_DOMAIN); ?></a>
341
  </li>
342
  <li>
343
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page', 'page' => 'lp_manage_templates' ), 'edit.php' ) ) ); ?>"><?php _e( 'Manage Your Landing Page Templates', LANDINGPAGES_TEXT_DOMAIN); ?></a>
344
  </li>
345
  <li>
346
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page' ), 'post-new.php' ) ) ); ?>"><?php _e( 'Create New Landing Page', LANDINGPAGES_TEXT_DOMAIN); ?></a>
347
  </li>
348
  <li>
349
- <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page', 'page' => 'inbound-forms-redirect' ), 'edit.php' ) ) ); ?>"><?php _e( 'Create Landing Page Forms', LANDINGPAGES_TEXT_DOMAIN); ?></a>
350
  </li>
351
  </ul>
352
  </div>
@@ -437,18 +437,18 @@ class LandingPages_Welcome {
437
  </style>
438
 
439
  <div class="wrap about-wrap">
440
- <h1><?php printf( __( 'Turbo Charge Your Marketing', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></h1>
441
- <div class="about-text" id="in-sub-head"><?php printf( __( 'WordPress Landing Pages is only one piece of Inbound Now\'s Marketing Platform', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></div>
442
 
443
  <?php self::render_nav_menu();?>
444
 
445
 
446
- <p class="about-description"><?php _e( 'To have an effective marketing strategy for your site you need to incorporate a comprehensive conversion strategy to capture visitors attention, get them clicking, and convert them on a web form or landing page.', LANDINGPAGES_TEXT_DOMAIN); ?></p>
447
 
448
  <div class="row" id="inbound-plugins">
449
  <div class="grid one-third">
450
  <div class="content-box default">
451
- <h4><?php _e('Capture visitor attention with' , LANDINGPAGES_TEXT_DOMAIN); ?></h4>
452
 
453
  <h3 style="text-align: center;">WordPress Calls to Action</h3>
454
 
@@ -457,14 +457,14 @@ class LandingPages_Welcome {
457
  </div>
458
 
459
  <p class="intro-p"><?php _e('<b>Convert more website traffic</b> with visually
460
- appealing calls to action' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
461
 
462
  <div class='circle-wrap'>
463
  <span class="inbound-check">✔</span>
464
  </div>
465
 
466
  <p class="intro-p"><?php _e('A/B test your marketing tactics and <b>improve your
467
- sites conversion rates' , LANDINGPAGES_TEXT_DOMAIN); ?></b></p>
468
 
469
  <div class="inbound-button-holder">
470
  <div class='dl-button'>
@@ -478,7 +478,7 @@ class LandingPages_Welcome {
478
 
479
  <div class="grid one-third">
480
  <div class="content-box default">
481
- <h4><?php _e( 'Convert website visitors with' , LANDINGPAGES_TEXT_DOMAIN); ?></h4>
482
 
483
  <h3>WordPress Landing Pages</h3>
484
 
@@ -486,13 +486,13 @@ class LandingPages_Welcome {
486
  <span class="inbound-check">✔</span>
487
  </div>
488
 
489
- <p class="intro-p"><?php _e('<b>Generate more web leads</b> with pages specifically designed for conversion' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
490
 
491
  <div class='circle-wrap'>
492
  <span class="inbound-check">✔</span>
493
  </div>
494
 
495
- <p class="intro-p"><?php _e('A/B Test Landing Page effectiveness for <b>continual optimization & improvement</b>' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
496
 
497
  <div class="inbound-button-holder">
498
  <div class='dl-button'>
@@ -506,7 +506,7 @@ class LandingPages_Welcome {
506
 
507
  <div class="grid one-third">
508
  <div class="content-box default">
509
- <h4><?php _e('Followup &amp; Close the deal with' , LANDINGPAGES_TEXT_DOMAIN); ?></h4>
510
 
511
  <h3>WordPress Leads</h3>
512
 
@@ -515,16 +515,16 @@ class LandingPages_Welcome {
515
  </div>
516
 
517
  <p class="intro-p"><?php _e('Gather & leverage lead intelligence on
518
- visitors to <b>close more deals</b>' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
519
 
520
  <div class='circle-wrap'>
521
  <span class="inbound-check">✔</span>
522
  </div>
523
 
524
  <p class="intro-p"><?php _e('Track page views, site conversions,
525
- demographics, geolocation, social media data and more.' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
526
 
527
- <p class="intro-p"><?php _e('Know everything a lead has seen and done on your site before you contact them' , LANDINGPAGES_TEXT_DOMAIN); ?></p>
528
 
529
  <div class="inbound-button-holder">
530
  <div class='dl-button'>
@@ -564,16 +564,16 @@ class LandingPages_Welcome {
564
  color: #21759B;
565
  }</style>
566
  <div class="wrap about-wrap" id="inbound-plugins">
567
- <h1><?php printf( __( 'Welcome to WordPress Landing Pages %s', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></h1>
568
- <div class="about-text" id="in-sub-head"><?php printf( __( 'Learn How to Build Custom Templates & Add Value to Your Clients', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></div>
569
- <div class="edd-badge"><?php printf( __( 'Version %s', LANDINGPAGES_TEXT_DOMAIN), $display_version ); ?></div>
570
 
571
  <?php self::render_nav_menu();?>
572
  <div class="row">
573
  <div class='grid two-third'>
574
- <p class="about-description"><?php _e( 'WordPress Landing Pages was built as a platform to allow anyone to create and use their own landing page designs.', LANDINGPAGES_TEXT_DOMAIN); ?></p>
575
 
576
- <p class="about-description"><?php _e( 'Infuse your designs with powerful A/B testing functionality and give clients the ability to edit options on the backend with ease.', LANDINGPAGES_TEXT_DOMAIN); ?></p>
577
 
578
  <h1 style="text-decoration: none; text-align: center;"><a target="_blank" id="create-templates" class='button' href="http://docs.inboundnow.com/guide/creating-landing-page-templates/">Create Your Own Templates</a></h1>
579
 
49
  public function admin_menus() {
50
  // About Page
51
  add_dashboard_page(
52
+ __( 'Welcome to WordPress Landing Pages', 'landing-pages'),
53
+ __( 'Welcome to WordPress Landing Pages', 'landing-pages'),
54
  $this->minimum_capability,
55
  'lp-quick-start',
56
  array( $this, 'quick_start_screen' )
57
  );
58
  // About InboundNow Page
59
  add_dashboard_page(
60
+ __( 'About the Inbound Now Marketing Platform', 'landing-pages'),
61
+ __( 'About the Inbound Now Marketing Platform', 'landing-pages'),
62
  $this->minimum_capability,
63
  'about-inboundnow',
64
  array( $this, 'about_inboundnow_screen' )
65
  );
66
  // Developer Page
67
  add_dashboard_page(
68
+ __( 'Developers and Designers', 'landing-pages'),
69
+ __( 'Developers and Designers', 'landing-pages'),
70
  $this->minimum_capability,
71
  'inbound-developers',
72
  array( $this, 'dev_designer_screen' )
262
  $active = ($current_view === $key) ? 'nav-tab-active' : '';
263
 
264
  echo '<a class="nav-tab '.$active.'" href="'.esc_url( admin_url( add_query_arg( array( 'page' => $key ), 'index.php' ) ) ).'">';
265
+ echo _e( $value, 'landing-pages');
266
  echo '</a>';
267
 
268
  }
301
  font-size: 19px;
302
  }</style>
303
  <div class="wrap about-wrap" id="inbound-plugins">
304
+ <h1><?php printf( __( 'Welcome to WordPress Landing Pages %s', 'landing-pages'), $display_version ); ?></h1>
305
+ <div class="about-text" id="in-sub-head"><?php printf( __( 'Thank you for updating to the latest version! WordPress Landing Pages %s is help you convert more leads!', 'landing-pages'), $display_version ); ?></div>
306
+ <div class="edd-badge"><?php printf( __( 'Version %s', 'landing-pages'), $display_version ); ?></div>
307
 
308
  <?php self::render_nav_menu();?>
309
  <div class="row">
310
  <div class='grid two-third'>
311
  <div id="creating-landing-page">
312
+ <h4><?php _e( 'Create Your First Landing Page', 'landing-pages');?></h4>
313
  <iframe width="640" height="360" src="//www.youtube.com/embed/-VuaBUc_yfk" frameborder="0" allowfullscreen></iframe>
314
  </div>
315
  <div id="creating-landing-page">
316
+ <h4><?php _e( 'How to Create Forms', 'landing-pages');?></h4>
317
  <iframe width="640" height="360" src="//www.youtube.com/embed/Y4M_g9wkRXw" frameborder="0" allowfullscreen></iframe>
318
  </div>
319
  <div id="creating-landing-page">
320
+ <h4><?php _e( 'Creating Landing Pages with your Current Theme Template', 'landing-pages');?></h4>
321
  <iframe width="640" height="360" src="//www.youtube.com/embed/pQzmx4ooL1M?list=UUCqiE-EcfDjaKGXSxtegcyg" frameborder="0" allowfullscreen></iframe>
322
  </div>
323
  <div id="creating-landing-page">
337
  <h4>Quick Links</h4>
338
  <ul id="inbound-setting-links">
339
  <li>
340
+ <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page', 'page' => 'lp_global_settings' ), 'edit.php' ) ) ); ?>"><?php _e( 'Go to WordPress Landing Pages Settings', 'landing-pages'); ?></a>
341
  </li>
342
  <li>
343
+ <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page', 'page' => 'lp_manage_templates' ), 'edit.php' ) ) ); ?>"><?php _e( 'Manage Your Landing Page Templates', 'landing-pages'); ?></a>
344
  </li>
345
  <li>
346
+ <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page' ), 'post-new.php' ) ) ); ?>"><?php _e( 'Create New Landing Page', 'landing-pages'); ?></a>
347
  </li>
348
  <li>
349
+ <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'post_type' => 'landing-page', 'page' => 'inbound-forms-redirect' ), 'edit.php' ) ) ); ?>"><?php _e( 'Create Landing Page Forms', 'landing-pages'); ?></a>
350
  </li>
351
  </ul>
352
  </div>
437
  </style>
438
 
439
  <div class="wrap about-wrap">
440
+ <h1><?php printf( __( 'Turbo Charge Your Marketing', 'landing-pages'), $display_version ); ?></h1>
441
+ <div class="about-text" id="in-sub-head"><?php printf( __( 'WordPress Landing Pages is only one piece of Inbound Now\'s Marketing Platform', 'landing-pages'), $display_version ); ?></div>
442
 
443
  <?php self::render_nav_menu();?>
444
 
445
 
446
+ <p class="about-description"><?php _e( 'To have an effective marketing strategy for your site you need to incorporate a comprehensive conversion strategy to capture visitors attention, get them clicking, and convert them on a web form or landing page.', 'landing-pages'); ?></p>
447
 
448
  <div class="row" id="inbound-plugins">
449
  <div class="grid one-third">
450
  <div class="content-box default">
451
+ <h4><?php _e('Capture visitor attention with' , 'landing-pages'); ?></h4>
452
 
453
  <h3 style="text-align: center;">WordPress Calls to Action</h3>
454
 
457
  </div>
458
 
459
  <p class="intro-p"><?php _e('<b>Convert more website traffic</b> with visually
460
+ appealing calls to action' , 'landing-pages'); ?></p>
461
 
462
  <div class='circle-wrap'>
463
  <span class="inbound-check">✔</span>
464
  </div>
465
 
466
  <p class="intro-p"><?php _e('A/B test your marketing tactics and <b>improve your
467
+ sites conversion rates' , 'landing-pages'); ?></b></p>
468
 
469
  <div class="inbound-button-holder">
470
  <div class='dl-button'>
478
 
479
  <div class="grid one-third">
480
  <div class="content-box default">
481
+ <h4><?php _e( 'Convert website visitors with' , 'landing-pages'); ?></h4>
482
 
483
  <h3>WordPress Landing Pages</h3>
484
 
486
  <span class="inbound-check">✔</span>
487
  </div>
488
 
489
+ <p class="intro-p"><?php _e('<b>Generate more web leads</b> with pages specifically designed for conversion' , 'landing-pages'); ?></p>
490
 
491
  <div class='circle-wrap'>
492
  <span class="inbound-check">✔</span>
493
  </div>
494
 
495
+ <p class="intro-p"><?php _e('A/B Test Landing Page effectiveness for <b>continual optimization & improvement</b>' , 'landing-pages'); ?></p>
496
 
497
  <div class="inbound-button-holder">
498
  <div class='dl-button'>
506
 
507
  <div class="grid one-third">
508
  <div class="content-box default">
509
+ <h4><?php _e('Followup &amp; Close the deal with' , 'landing-pages'); ?></h4>
510
 
511
  <h3>WordPress Leads</h3>
512
 
515
  </div>
516
 
517
  <p class="intro-p"><?php _e('Gather & leverage lead intelligence on
518
+ visitors to <b>close more deals</b>' , 'landing-pages'); ?></p>
519
 
520
  <div class='circle-wrap'>
521
  <span class="inbound-check">✔</span>
522
  </div>
523
 
524
  <p class="intro-p"><?php _e('Track page views, site conversions,
525
+ demographics, geolocation, social media data and more.' , 'landing-pages'); ?></p>
526
 
527
+ <p class="intro-p"><?php _e('Know everything a lead has seen and done on your site before you contact them' , 'landing-pages'); ?></p>
528
 
529
  <div class="inbound-button-holder">
530
  <div class='dl-button'>
564
  color: #21759B;
565
  }</style>
566
  <div class="wrap about-wrap" id="inbound-plugins">
567
+ <h1><?php printf( __( 'Welcome to WordPress Landing Pages %s', 'landing-pages'), $display_version ); ?></h1>
568
+ <div class="about-text" id="in-sub-head"><?php printf( __( 'Learn How to Build Custom Templates & Add Value to Your Clients', 'landing-pages'), $display_version ); ?></div>
569
+ <div class="edd-badge"><?php printf( __( 'Version %s', 'landing-pages'), $display_version ); ?></div>
570
 
571
  <?php self::render_nav_menu();?>
572
  <div class="row">
573
  <div class='grid two-third'>
574
+ <p class="about-description"><?php _e( 'WordPress Landing Pages was built as a platform to allow anyone to create and use their own landing page designs.', 'landing-pages'); ?></p>
575
 
576
+ <p class="about-description"><?php _e( 'Infuse your designs with powerful A/B testing functionality and give clients the ability to edit options on the backend with ease.', 'landing-pages'); ?></p>
577
 
578
  <h1 style="text-decoration: none; text-align: center;"><a target="_blank" id="create-templates" class='button' href="http://docs.inboundnow.com/guide/creating-landing-page-templates/">Create Your Own Templates</a></h1>
579
 
modules/module.widgets.php CHANGED
@@ -14,13 +14,13 @@ class LandingPages_Widget_ConversionArea extends WP_Widget
14
  function LandingPages_Widget_ConversionArea() {
15
 
16
  /* Widget settings. */
17
- $widget_ops = array( 'classname' => 'class_LandingPages_Widget_ConversionArea', 'description' => __('Use this widget on your landing page sidebar. This sidebar replaces the normal sidebar while using your default theme as a template, or other inactive themes as landing page templates.', LANDINGPAGES_TEXT_DOMAIN) );
18
 
19
  /* Widget control settings. */
20
  $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'id_lp_conversion_area_widget' );
21
 
22
  /* Create the widget. */
23
- $this->WP_Widget( 'id_lp_conversion_area_widget', __('Landing Pages: Conversion Area Widget', LANDINGPAGES_TEXT_DOMAIN), $widget_ops, $control_ops );
24
  }
25
 
26
  /**
@@ -85,7 +85,7 @@ class LandingPages_Widget_ConversionArea extends WP_Widget
85
 
86
  <!-- Widget Title: Text Input -->
87
  <p>
88
- <?php _e("This box will render the landing page conversion area on the 'default' template." , LANDINGPAGES_TEXT_DOMAIN); ?>
89
  </p>
90
 
91
  <?php
14
  function LandingPages_Widget_ConversionArea() {
15
 
16
  /* Widget settings. */
17
+ $widget_ops = array( 'classname' => 'class_LandingPages_Widget_ConversionArea', 'description' => __('Use this widget on your landing page sidebar. This sidebar replaces the normal sidebar while using your default theme as a template, or other inactive themes as landing page templates.', 'landing-pages') );
18
 
19
  /* Widget control settings. */
20
  $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'id_lp_conversion_area_widget' );
21
 
22
  /* Create the widget. */
23
+ $this->WP_Widget( 'id_lp_conversion_area_widget', __('Landing Pages: Conversion Area Widget', 'landing-pages'), $widget_ops, $control_ops );
24
  }
25
 
26
  /**
85
 
86
  <!-- Widget Title: Text Input -->
87
  <p>
88
+ <?php _e("This box will render the landing page conversion area on the 'default' template." , 'landing-pages'); ?>
89
  </p>
90
 
91
  <?php
phpunit.xml.dist ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <phpunit bootstrap="tests/bootstrap.php" backupGlobals="false" colors="true">
2
+ <testsuites>
3
+ <!-- Default test suite to run all tests -->
4
+ <testsuite>
5
+ <directory prefix="test_" suffix=".php">tests</directory>
6
+ </testsuite>
7
+ </testsuites>
8
+ </phpunit>
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.4.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
 
@@ -33,6 +33,10 @@ Landing pages are an ideal way to convert more of your passive website visitors
33
  * Extend functionality with our growing repository of <a href="http://www.inboundnow.com/market/category/landing-pages/extensions/">third party add ons</a>.
34
  * Easily implement your own custom landing page design.
35
 
 
 
 
 
36
  = About the Plugin =
37
 
38
  http://www.youtube.com/watch?v=flEd0sRTFUo
@@ -41,9 +45,9 @@ http://www.youtube.com/watch?v=flEd0sRTFUo
41
 
42
  We built the landing page plugin as a framework! Need A/B testing out of the box implemented for your existing designs? Use WordPress Landing Pages to quickly spin up new landing pages that have all the functionality your clients will need.
43
 
44
- You can quickly take your existing designs and implement them using our <a href="http://docs.inboundnow.com/guide/creating-landing-page-templates/">templating framework</a>.
45
 
46
- The plugin is also fully extendable and has a number of <a href='http://docs.inboundnow.com/section/developer/'>actions, filters</a>, and hooks available for use. If a hook doesn't exist, simply ask and we can implement custom changes.
47
 
48
  <b>You can also follow us on <a href="https://github.com/inboundnow/landing-pages/">GitHub</a></b>
49
 
@@ -64,6 +68,11 @@ The plugin is also fully extendable and has a number of <a href='http://docs.inb
64
  4. Choose from a ton of pre-made templates, use your existing design, or design your own theme!
65
 
66
  == Changelog ==
 
 
 
 
 
67
  = 1.4.9 =
68
  * Fixed and improved default landing page templates
69
  * Updates to work with V2 of the CTA plugins
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.8
9
  Tested up to: 3.8
10
+ Stable Tag: 1.5.0
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
 
33
  * Extend functionality with our growing repository of <a href="http://www.inboundnow.com/market/category/landing-pages/extensions/">third party add ons</a>.
34
  * Easily implement your own custom landing page design.
35
 
36
+ This plugin is form agnostic meaning it will work with any form system you use.
37
+
38
+ Recommended form plugins (Gravity forms, Ninja Forms or Contact form 7)
39
+
40
  = About the Plugin =
41
 
42
  http://www.youtube.com/watch?v=flEd0sRTFUo
45
 
46
  We built the landing page plugin as a framework! Need A/B testing out of the box implemented for your existing designs? Use WordPress Landing Pages to quickly spin up new landing pages that have all the functionality your clients will need.
47
 
48
+ You can quickly take your existing designs and implement them using our <a href="http://docs.inboundnow.com/landing-pages/dev">templating framework</a>.
49
 
50
+ The plugin is also fully extendable and has a number of <a href='http://docs.inboundnow.com/landing-pages/dev/core-hooks-filters'>actions, filters</a>, and hooks available for use. If a hook doesn't exist, simply ask and we can implement custom changes.
51
 
52
  <b>You can also follow us on <a href="https://github.com/inboundnow/landing-pages/">GitHub</a></b>
53
 
68
  4. Choose from a ton of pre-made templates, use your existing design, or design your own theme!
69
 
70
  == Changelog ==
71
+ = 1.5.0 =
72
+ * fixed field mapping bug
73
+ * Added better compability for js conflicts
74
+ * Prepping for marketing automation
75
+
76
  = 1.4.9 =
77
  * Fixed and improved default landing page templates
78
  * Updates to work with V2 of the CTA plugins
shared/assets/assets.loader.class.php CHANGED
@@ -32,7 +32,6 @@ class Inbound_Asset_Loader {
32
  /* Frontent and Backend Files */
33
  self::load_file('jquery-cookie', 'global/js/jquery.cookie.js', array( 'jquery' ));
34
  self::load_file('jquery-total-storage', 'global/js/jquery.total-storage.min.js', array( 'jquery' ));
35
-
36
  if(is_user_logged_in()){
37
  self::load_file('inbound-admin', 'admin/css/global-inbound-admin.css');
38
  }
@@ -52,10 +51,22 @@ class Inbound_Asset_Loader {
52
 
53
  //self::load_file('script-test', 'admin/js/test.js');
54
  } else {
 
 
 
 
 
 
 
 
55
 
56
- self::load_file('funnel-tracking', 'frontend/js/page-tracking.js', array(), 'wplft', self::localize_lead_data());
57
  // TODO: Merge Localize of wplft into inbound_ajax
58
- self::load_file('store-lead-ajax', 'frontend/js/store.lead.ajax.js', array( 'jquery','jquery-cookie'), 'inbound_ajax', self::localize_lead_data());
 
 
 
 
59
  /* Target Specific post type with
60
  if ( is_singular( 'landing-page' ) ) {
61
 
32
  /* Frontent and Backend Files */
33
  self::load_file('jquery-cookie', 'global/js/jquery.cookie.js', array( 'jquery' ));
34
  self::load_file('jquery-total-storage', 'global/js/jquery.total-storage.min.js', array( 'jquery' ));
 
35
  if(is_user_logged_in()){
36
  self::load_file('inbound-admin', 'admin/css/global-inbound-admin.css');
37
  }
51
 
52
  //self::load_file('script-test', 'admin/js/test.js');
53
  } else {
54
+ global $wp_scripts;
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
+ self::load_file('funnel-tracking', 'frontend/js/page-tracking.js', array( 'jquery','jquery-cookie', 'jquery-total-storage'), 'wplft', self::localize_lead_data());
64
  // TODO: Merge Localize of wplft into inbound_ajax
65
+ self::load_file('store-lead-ajax', 'frontend/js/store.lead.ajax.js', array( 'jquery','jquery-cookie', 'jquery-total-storage'), 'inbound_ajax', self::localize_lead_data());
66
+
67
+ foreach ( $store as $handle ) {
68
+ wp_enqueue_script( $handle );
69
+ }
70
  /* Target Specific post type with
71
  if ( is_singular( 'landing-page' ) ) {
72
 
shared/assets/frontend/js/form-population.js CHANGED
@@ -1 +1 @@
1
- function wpl_remember_inputs( selector ){
2
  jQuery(selector).each(
3
  function(){
4
  //if this item has been cookied, restore it
5
  var name = jQuery(this).attr('name');
6
  if( jQuery.cookie( name ) ){
7
  jQuery(this).val( jQuery.cookie(name) );
8
  }
9
  //assign a change function to the item to cookie it
10
  jQuery(this).change(
11
  function(){
12
  jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
13
  }
14
  );
15
  }
16
  );
17
  jQuery(selector).each(
18
  function(){
19
  var form_name = jQuery(this).attr('name');
20
  var form_id = jQuery(this).attr('id');
21
  var form_class = jQuery(this).attr('class');
22
  if(typeof(form_name) != "undefined" && form_name !== null) {
23
  jQuery.cookie("wp_cta_form_uid", form_name, { path: '/', expires: 365 });
24
  }
25
  else if(typeof(form_id) != "undefined" && form_id !== null) {
26
  jQuery.cookie("wp_cta_form_uid", form_id, { path: '/', expires: 365 });
27
  }
28
  else if (typeof(form_class) != "undefined" && form_class !== null) {
29
  jQuery.cookie("wp_cta_form_uid", form_class, { path: '/', expires: 365 });
30
  } else {
31
  jQuery.cookie("wp_cta_form_uid", 'form_generic', { path: '/', expires: 365 });
32
  }
33
  }
34
  );
35
  // Fill Form Inputs from Cookies
36
  });
 
37
  jQuery(selector).each(
38
  function(){
39
  //if this item has been cookied, restore it
40
  var name = jQuery(this).attr('name');
41
  if( jQuery.cookie( name ) ){
42
  jQuery(this).val( jQuery.cookie(name) );
43
  }
44
  //assign a change function to the item to cookie it
45
  jQuery(this).change(
46
  function(){
47
  jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
48
  }
49
  );
50
  }
51
  );
52
  jQuery(selector).each(
53
  function(){
54
  var form_name = jQuery(this).attr('name');
55
  var form_id = jQuery(this).attr('id');
56
  var form_class = jQuery(this).attr('class');
57
  if(typeof(form_name) != "undefined" && form_name !== null) {
58
  jQuery.cookie("wp_cta_form_uid", form_name, { path: '/', expires: 365 });
59
  }
60
  else if(typeof(form_id) != "undefined" && form_id !== null) {
61
  jQuery.cookie("wp_cta_form_uid", form_id, { path: '/', expires: 365 });
62
  }
63
  else if (typeof(form_class) != "undefined" && form_class !== null) {
64
  jQuery.cookie("wp_cta_form_uid", form_class, { path: '/', expires: 365 });
65
  } else {
66
  jQuery.cookie("wp_cta_form_uid", 'form_generic', { path: '/', expires: 365 });
67
  }
68
  }
69
  );
70
  // Fill Form Inputs from Cookies
71
  });
 
1
  jQuery(selector).each(
2
  function(){
3
  //if this item has been cookied, restore it
4
  var name = jQuery(this).attr('name');
5
  if( jQuery.cookie( name ) ){
6
  jQuery(this).val( jQuery.cookie(name) );
7
  }
8
  //assign a change function to the item to cookie it
9
  jQuery(this).change(
10
  function(){
11
  jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
12
  }
13
  );
14
  }
15
  );
16
  jQuery(selector).each(
17
  function(){
18
  var form_name = jQuery(this).attr('name');
19
  var form_id = jQuery(this).attr('id');
20
  var form_class = jQuery(this).attr('class');
21
  if(typeof(form_name) != "undefined" && form_name !== null) {
22
  jQuery.cookie("wp_cta_form_uid", form_name, { path: '/', expires: 365 });
23
  }
24
  else if(typeof(form_id) != "undefined" && form_id !== null) {
25
  jQuery.cookie("wp_cta_form_uid", form_id, { path: '/', expires: 365 });
26
  }
27
  else if (typeof(form_class) != "undefined" && form_class !== null) {
28
  jQuery.cookie("wp_cta_form_uid", form_class, { path: '/', expires: 365 });
29
  } else {
30
  jQuery.cookie("wp_cta_form_uid", 'form_generic', { path: '/', expires: 365 });
31
  }
32
  }
33
  );
34
  // Fill Form Inputs from Cookies
35
  });
36
+ function wpl_remember_inputs( selector ){
37
  jQuery(selector).each(
38
  function(){
39
  //if this item has been cookied, restore it
40
  var name = jQuery(this).attr('name');
41
  if( jQuery.cookie( name ) ){
42
  jQuery(this).val( jQuery.cookie(name) );
43
  }
44
  //assign a change function to the item to cookie it
45
  jQuery(this).change(
46
  function(){
47
  jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
48
  }
49
  );
50
  }
51
  );
52
  jQuery(selector).each(
53
  function(){
54
  var form_name = jQuery(this).attr('name');
55
  var form_id = jQuery(this).attr('id');
56
  var form_class = jQuery(this).attr('class');
57
  if(typeof(form_name) != "undefined" && form_name !== null) {
58
  jQuery.cookie("wp_cta_form_uid", form_name, { path: '/', expires: 365 });
59
  }
60
  else if(typeof(form_id) != "undefined" && form_id !== null) {
61
  jQuery.cookie("wp_cta_form_uid", form_id, { path: '/', expires: 365 });
62
  }
63
  else if (typeof(form_class) != "undefined" && form_class !== null) {
64
  jQuery.cookie("wp_cta_form_uid", form_class, { path: '/', expires: 365 });
65
  } else {
66
  jQuery.cookie("wp_cta_form_uid", 'form_generic', { path: '/', expires: 365 });
67
  }
68
  }
69
  );
70
  // Fill Form Inputs from Cookies
71
  });
shared/assets/frontend/js/store.lead.ajax.js CHANGED
@@ -235,7 +235,7 @@ function run_field_map_function(el, lookingfor) {
235
 
236
  function return_mapped_values(this_form) {
237
  // Map form fields
238
- jQuery(this_form).find('input[type=text],input[type=email],textarea,select').each(function() {
239
  console.log('run');
240
  var this_input = jQuery(this);
241
  var this_input_val = this_input.val();
@@ -310,22 +310,40 @@ function inbound_form_type(this_form) {
310
  function grab_all_form_input_vals(this_form){
311
  var post_values = post_values || {},
312
  inbound_exclude = inbound_exclude || [],
313
- form_inputs = this_form.find('input[type=text],input[type=hidden],textarea,select');
314
  inbound_exclude.push('inbound_furl', 'inbound_current_page_url', 'inbound_notify', 'inbound_submitted', 'post_type', 'post_status', 's', 'inbound_form_name', 'inbound_form_id', 'inbound_form_lists');
315
  var form_type = inbound_form_type(this_form),
316
  inbound_data = inbound_data || {},
317
  email = inbound_data['email'] || false;
318
 
319
  form_inputs.each(function() {
320
- if (jQuery.inArray(this.name, inbound_exclude) === -1){
321
- post_values[this.name] = jQuery(this).val();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  }
323
  if (this.value.indexOf('@')>-1&&!email){
324
- email = jQuery(this).val();
325
  inbound_data['email'] = email;
326
  }
327
  if (form_type === 'search') {
328
- inbound_data['search_keyword'] = jQuery(this).val().replace('"', "'");
329
  }
330
  });
331
  var all_form_fields = JSON.stringify(post_values);
235
 
236
  function return_mapped_values(this_form) {
237
  // Map form fields
238
+ jQuery(this_form).find('input,textarea,select').each(function() {
239
  console.log('run');
240
  var this_input = jQuery(this);
241
  var this_input_val = this_input.val();
310
  function grab_all_form_input_vals(this_form){
311
  var post_values = post_values || {},
312
  inbound_exclude = inbound_exclude || [],
313
+ form_inputs = this_form.find('input,textarea,select');
314
  inbound_exclude.push('inbound_furl', 'inbound_current_page_url', 'inbound_notify', 'inbound_submitted', 'post_type', 'post_status', 's', 'inbound_form_name', 'inbound_form_id', 'inbound_form_lists');
315
  var form_type = inbound_form_type(this_form),
316
  inbound_data = inbound_data || {},
317
  email = inbound_data['email'] || false;
318
 
319
  form_inputs.each(function() {
320
+ var $input = jQuery(this),
321
+ input_type = $input.attr('type'),
322
+ input_val = $input.val();
323
+ if (input_type === 'checkbox') {
324
+ input_checked = $input.attr("checked");
325
+ console.log(input_val);
326
+ console.log(input_checked);
327
+ console.log(post_values[this.name]);
328
+ if (input_checked === "checked"){
329
+ if (typeof (post_values[this.name]) != "undefined") {
330
+ post_values[this.name] = post_values[this.name] + "," + input_val;
331
+ console.log(post_values[this.name]);
332
+ } else {
333
+ post_values[this.name] = input_val;
334
+ }
335
+
336
+ }
337
+ }
338
+ if (jQuery.inArray(this.name, inbound_exclude) === -1 && input_type != 'checkbox'){
339
+ post_values[this.name] = input_val;
340
  }
341
  if (this.value.indexOf('@')>-1&&!email){
342
+ email = input_val;
343
  inbound_data['email'] = email;
344
  }
345
  if (form_type === 'search') {
346
+ inbound_data['search_keyword'] = input_val.replace('"', "'");
347
  }
348
  });
349
  var all_form_fields = JSON.stringify(post_values);
shared/classes/form.class.php CHANGED
@@ -222,12 +222,16 @@ class InboundForms {
222
 
223
  $checkbox = $matches[3][$i]['checkbox'];
224
  $checkbox_fields = explode(",", $checkbox);
 
225
  // $clean_radio = str_replace(array(' ','_'),'-',$value) // clean leading spaces. finish
 
226
  foreach ($checkbox_fields as $key => $value) {
227
- $checkbox_val_trimmed = trim($value);
228
  $checkbox_val = strtolower(str_replace(array(' ','_'),'-',$checkbox_val_trimmed));
229
- $form .= '<input class="checkbox-'.$main_layout.' checkbox-'.$form_labels_class.'" type="checkbox" name="'. $field_name .'" value="'. $checkbox_val .'">'.$checkbox_val_trimmed.'<br>';
230
  }
 
 
231
  }
232
  else if ($type === 'html-block')
233
  {
@@ -422,9 +426,13 @@ class InboundForms {
422
  $multi_send = true;
423
  }
424
  }
 
 
 
425
 
426
- /* print_r($form_meta_data); exit; */
427
- /* print_r($form_data); exit; */
 
428
 
429
  $form_email = false;
430
  foreach ($form_data as $key => $value) {
@@ -518,7 +526,7 @@ class InboundForms {
518
  </td>
519
  </tr>';
520
  // working!
521
- $exclude_array = array('Inbound Redirect', 'Inbound Submitted', 'Inbound Notify', 'Inbound Parent Page', 'Send', 'Inbound Furl' );
522
 
523
  $main_count = 0;
524
  $url_request = "";
@@ -731,7 +739,7 @@ class InboundForms {
731
 
732
  }
733
  // Send Confirmation Email to Form Converter
734
- if ($notification_status == 'on' && isset($form_email)) {
735
 
736
  $my_postid = $form_meta_data['post_id']; //This is page id or post id
737
  $content_post = get_post($my_postid);
@@ -808,28 +816,35 @@ class InboundForms {
808
 
809
  //print_r($_POST);
810
  foreach ( $_POST as $field => $value ) {
811
- if ( get_magic_quotes_gpc() ) {
812
- $value = stripslashes( $value );
813
- }
814
- $field = strtolower($field);
815
 
816
- if (preg_match( '/Email|e-mail|email/i', $value)) {
817
- $field = "email";
818
- }
 
 
 
 
 
819
 
820
- if (preg_match( '/(?<!((last |last_)))name(?!\=)/im', $value) && !isset($form_data['first-name'])) {
821
- $field = "first-name";
822
- }
823
 
824
- if (preg_match( '/(?<!((first)))(last name|last_name|last)(?!\=)/im', $value) && !isset($form_data['last-name'])) {
825
- $field = "last-name";
826
- }
827
 
828
- if (preg_match( '/Phone|phone number|telephone/i', $value)) {
829
- $field = "phone";
830
- }
 
 
 
 
 
 
 
831
 
832
- $form_post_data[$field] = strip_tags( $value );
833
 
834
  }
835
  $form_meta_data['post_id'] = $_POST['inbound_form_id']; // pass in form id
222
 
223
  $checkbox = $matches[3][$i]['checkbox'];
224
  $checkbox_fields = explode(",", $checkbox);
225
+ $checkbox_array = (count($checkbox_fields) > 1) ? '[]' : ''; // set checkbox array or not array
226
  // $clean_radio = str_replace(array(' ','_'),'-',$value) // clean leading spaces. finish
227
+ $checkboxes = '';
228
  foreach ($checkbox_fields as $key => $value) {
229
+ $checkbox_val_trimmed = trim($value);
230
  $checkbox_val = strtolower(str_replace(array(' ','_'),'-',$checkbox_val_trimmed));
231
+ $checkboxes .= '<input class="checkbox-'.$main_layout.' checkbox-'.$form_labels_class.'" type="checkbox" name="'. $field_name .$checkbox_array.'" id="'.$formatted_label.'" value="'.$checkbox_val_trimmed.'">'.$checkbox_val_trimmed.'<br>';
232
  }
233
+
234
+ $form .= $checkboxes;
235
  }
236
  else if ($type === 'html-block')
237
  {
426
  $multi_send = true;
427
  }
428
  }
429
+ /*
430
+ print_r($form_meta_data); exit;
431
+ /**/
432
 
433
+ /*
434
+ print_r($form_data); exit;
435
+ /**/
436
 
437
  $form_email = false;
438
  foreach ($form_data as $key => $value) {
526
  </td>
527
  </tr>';
528
  // working!
529
+ $exclude_array = array('Inbound Redirect', 'Inbound Submitted', 'Inbound Notify', 'Inbound Parent Page', 'Send', 'Inbound Furl', 'Inbound Form Lists' );
530
 
531
  $main_count = 0;
532
  $url_request = "";
739
 
740
  }
741
  // Send Confirmation Email to Form Converter
742
+ if ($notification_status === 'on' && $form_email) {
743
 
744
  $my_postid = $form_meta_data['post_id']; //This is page id or post id
745
  $content_post = get_post($my_postid);
816
 
817
  //print_r($_POST);
818
  foreach ( $_POST as $field => $value ) {
 
 
 
 
819
 
820
+ if(is_array($value)) {
821
+ $value = implode(', ',$value);
822
+ $form_post_data[$field] = strip_tags( $value );
823
+ } else {
824
+ if ( get_magic_quotes_gpc() ) {
825
+ $value = stripslashes( $value );
826
+ }
827
+ $field = strtolower($field);
828
 
829
+ if (preg_match( '/Email|e-mail|email/i', $value)) {
830
+ $field = "email";
831
+ }
832
 
833
+ if (preg_match( '/(?<!((last |last_)))name(?!\=)/im', $value) && !isset($form_data['first-name'])) {
834
+ $field = "first-name";
835
+ }
836
 
837
+ if (preg_match( '/(?<!((first)))(last name|last_name|last)(?!\=)/im', $value) && !isset($form_data['last-name'])) {
838
+ $field = "last-name";
839
+ }
840
+
841
+ if (preg_match( '/Phone|phone number|telephone/i', $value)) {
842
+ $field = "phone";
843
+ }
844
+
845
+ $form_post_data[$field] = strip_tags( $value );
846
+ }
847
 
 
848
 
849
  }
850
  $form_meta_data['post_id'] = $_POST['inbound_form_id']; // pass in form id
shared/classes/welcome.class.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Inbound Now Weclome Page Class
4
+ *
5
+ * @package Landing Pages
6
+ * @subpackage Admin/Welcome
7
+ * @copyright Copyright (c) 2014, David Wells
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 1.4
10
+ * Forked from pippin's https://easydigitaldownloads.com/
11
+ */
12
+
13
+ // Exit if accessed directly
14
+ if ( ! defined( 'ABSPATH' ) ) exit;
15
+ if(!defined('INBOUND_NOW_PATH')) { define('INBOUND_NOW_PATH', WP_PLUGIN_DIR . '/inbound-now-pro'); }
16
+ /**
17
+ * Inbound_Now_Welcome Class
18
+ *
19
+ * A general class for About and Credits page.
20
+ *
21
+ * @since 1.4
22
+ */
23
+
24
+ class Inbound_Now_Welcome {
25
+
26
+ /**
27
+ * @var string The capability users should have to view the page
28
+ */
29
+ public $minimum_capability = 'manage_options';
30
+ private $welcome_folder_exists = false;
31
+ private $plugin_type = 'addon';
32
+
33
+ /* Get things started */
34
+ public function __construct($plugin_slug, $plugin_name, $type) {
35
+ add_action( 'admin_menu', array( $this, 'admin_menus') );
36
+ add_action( 'admin_head', array( $this, 'admin_head' ) );
37
+ add_action( 'admin_init', array( $this, 'welcome' ) );
38
+
39
+ /* Auto set class vars. Works but is lazy coding
40
+ $arguments = func_get_args();
41
+ if(!empty($arguments)) {
42
+ foreach($arguments[0] as $key => $property) {
43
+ if(property_exists($this, $key)) {
44
+ $this->{$key} = $property;
45
+ }
46
+ }
47
+ }
48
+ Person(array('isFat' => true, 'canRunFast' => false))
49
+ */
50
+ if (preg_match('/components/', $type)) {
51
+ $this->plugin_type = 'pro'; // check if loaded from pro or from addon plugin
52
+ }
53
+
54
+ $this->plugin_slug = $plugin_slug;
55
+ $this->plugin_name = $plugin_name;
56
+
57
+ // Set Variable if welcome folder exists
58
+ $dir = INBOUND_NOW_PATH . '/components/'. $plugin_slug . '/welcome/';
59
+ $plugin_dir = WP_PLUGIN_DIR . '/' . $plugin_slug;
60
+ if(file_exists($dir)) {
61
+ $this->welcome_folder_exists = true;
62
+ } elseif (file_exists($plugin_dir)) {
63
+ $this->welcome_folder_exists = true;
64
+ }
65
+
66
+ }
67
+
68
+ /* Register the Dashboard Pages which are later hidden but these pages are used to render the Welcome pages. */
69
+ public function admin_menus() {
70
+ if ( !$this->welcome_folder_exists ) {
71
+ return;
72
+ }
73
+ // Add menu page
74
+ add_dashboard_page(
75
+ __( 'Welcome to', $this->plugin_name),
76
+ __( 'Welcome to', $this->plugin_name),
77
+ $this->minimum_capability,
78
+ $this->plugin_slug . '-welcome',
79
+ array( $this, 'quick_start_screen' )
80
+ );
81
+
82
+ }
83
+
84
+ public function get_plugin_slug() {
85
+ return $this->plugin_slug;
86
+ }
87
+
88
+ /* Hide Individual Dashboard Pages */
89
+ public function admin_head() {
90
+ $plugin = $this->plugin_slug;
91
+ remove_submenu_page( 'index.php', $plugin . '-welcome' );
92
+ // GET style.css from /welcome folder of target
93
+ }
94
+ /* Render About Welcome Nav */
95
+ public function render_nav_menu() {
96
+ $current_view = $_GET['page'];
97
+ $plugin_slug = $this->plugin_slug;
98
+ $plugin_name = $this->plugin_name;
99
+ $page_array = array($plugin_slug .'-welcome' => "Welcome to " . $plugin_name);
100
+ echo '<h2 class="nav-tab-wrapper" style="margin-left: -40px; padding-left: 40px;">';
101
+ foreach ($page_array as $key => $value) {
102
+ $active = ($current_view === $key) ? 'nav-tab-active' : '';
103
+
104
+ echo '<a class="nav-tab '.$active.'" href="'.esc_url( admin_url( add_query_arg( array( 'page' => $key ), 'index.php' ) ) ).'">';
105
+ echo _e( $value, 'inbound-now');
106
+ echo '</a>';
107
+
108
+ }
109
+ echo '</h2>';
110
+
111
+
112
+ }
113
+ static function check_for_welcome() {
114
+
115
+ }
116
+ /* Render About Screen */
117
+ public function quick_start_screen() {
118
+ // If no /welcome folder exists exit class
119
+ if ( !$this->welcome_folder_exists ) {
120
+ return;
121
+ }
122
+ $display_version = '1.1.1.1.1'; // Parse main file for version #;
123
+ $plugin_name = $this->plugin_name;
124
+ $plugin_slug = $this->plugin_slug;
125
+ $Recommended = "";
126
+ $cta_install = "";
127
+ $leads_install = "";
128
+ $rec_end = "";
129
+ //$test = get_transient('_inboundnow_zapier_activation_redirect', true, 30 );
130
+
131
+ $current_view = $_GET['page'];
132
+ if (function_exists( 'is_plugin_active' ) && is_plugin_active('inbound-now-pro/inbound-now-pro.php')) {
133
+ //echo 'Pro on';
134
+ $dir = INBOUND_NOW_PATH . '/components/'. $plugin_slug . '/welcome/';
135
+
136
+ } else if (function_exists( 'is_plugin_active' ) && is_plugin_active($plugin_slug .'/'. $plugin_slug . '.php')) {
137
+ //echo 'Pro off';
138
+ $dir = WP_PLUGIN_DIR . '/' . $plugin_slug . '/welcome/';
139
+ }
140
+
141
+ if(file_exists($dir)) {
142
+ //$contents = file_get_contents($file);
143
+ $results = scandir($dir);
144
+ //print_r($results);
145
+ $contents = '';
146
+ $nav_items = '<h2 class="nav-tab-wrapper" style="margin-left: -40px; padding-left: 40px;">';
147
+ foreach ($results as $name) {
148
+ if($name != '.' && $name != '..' && $name != 'index.php') {
149
+ $clean_name = trim(substr($name, 2));
150
+ $clean_id_name = trim(ucwords(str_replace(array('.php', "_"), "-", $clean_name)));
151
+ $clean_tab_name = trim(ucwords(str_replace(array('.php', '-', "_"), " ", $clean_name)));
152
+ $active = ($current_view === $name) ? 'nav-tab-active' : '';
153
+ $nav_items .= '<a class="nav-tab '.$active.'" id="tab-'.$clean_id_name.'">';
154
+ $nav_items .= __( $clean_tab_name, 'inbound-now');
155
+ $nav_items .= '</a>';
156
+ $contents .= '<div id="content-'.$clean_id_name.'">';
157
+ $contents .= file_get_contents($dir . $name);
158
+ $contents .= '</div>';
159
+ }
160
+ }
161
+ $nav_items .= '<h2>';
162
+ }
163
+
164
+ ?>
165
+
166
+ <div class="wrap about-wrap" id="inbound-plugins">
167
+ <h1><?php printf( __( 'Welcome to '.$plugin_name.' %s', 'inbound-now'), $display_version ); ?></h1>
168
+ <div class="about-text" id="in-sub-head"><?php printf( __( 'Thank you for updating to the latest version! '.$plugin_name.' %s is help you customize your site!', 'inbound-now'), $display_version ); ?></div>
169
+ <div class="edd-badge"><?php printf( __( 'Version %s', 'inbound-now'), $display_version ); ?></div>
170
+
171
+ <?php echo $nav_items; ?>
172
+ <div id="inbound-welcome-wrapper">
173
+ <?php echo $contents; ?>
174
+ </div>
175
+ </div>
176
+ <?php
177
+ }
178
+
179
+ /* Sends user to the Welcome page on first activation of plugin as well as each time plugin is upgraded to a new version */
180
+ public function welcome() {
181
+ $slug = self::get_plugin_slug();
182
+ $transient = "_" . str_replace('-', "_", $slug) . '_activation_redirect';
183
+
184
+ // Bail if no activation redirect
185
+ if ( ! get_transient( $transient ) )
186
+ return;
187
+
188
+ // Delete the redirect transient
189
+ delete_transient( $transient );
190
+
191
+ // Bail if activating from network, or bulk
192
+ if ( is_network_admin() || isset( $_GET['activate-multi'] ) )
193
+ return;
194
+
195
+ if ($this->plugin_type != 'pro') {
196
+ wp_safe_redirect( admin_url( 'index.php?page='.$slug . '-welcome' ) ); exit;
197
+ } else {
198
+ wp_safe_redirect( admin_url( 'index.php?page=inbound-now-welcome' ) ); exit;
199
+ }
200
+
201
+ }
202
+ }
shared/functions/global.shared.functions.php CHANGED
@@ -180,6 +180,66 @@ if (!function_exists('wp_leads_get_page_final_id')) {
180
  }
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  /* Potentially Legacy is this being used anywhere?
184
  if (!function_exists('wpl_url_to_postid_final')) {
185
  function wpl_url_to_postid_final($url) {
180
  }
181
  }
182
 
183
+ /* PHP 5.2 json encode fallback */
184
+ if (!function_exists('json_encode_fallback')) {
185
+ function json_encode_fallback($a=false)
186
+ {
187
+ if (is_null($a)) return 'null';
188
+ if ($a === false) return 'false';
189
+ if ($a === true) return 'true';
190
+ if (is_scalar($a))
191
+ {
192
+ if (is_float($a))
193
+ {
194
+ // Always use "." for floats.
195
+ return floatval(str_replace(",", ".", strval($a)));
196
+ }
197
+
198
+ if (is_string($a))
199
+ {
200
+ static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
201
+ return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
202
+ }
203
+ else
204
+ return $a;
205
+ }
206
+ $isList = true;
207
+ for ($i = 0, reset($a); $i < count($a); $i++, next($a))
208
+ {
209
+ if (key($a) !== $i)
210
+ {
211
+ $isList = false;
212
+ break;
213
+ }
214
+ }
215
+ $result = array();
216
+ if ($isList)
217
+ {
218
+ foreach ($a as $v) $result[] = json_encode($v);
219
+ return '[' . join(',', $result) . ']';
220
+ }
221
+ else
222
+ {
223
+ foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
224
+ return '{' . join(',', $result) . '}';
225
+ }
226
+ }
227
+ }
228
+ /* Usage of JSON fallback
229
+
230
+ $output = array('inbound_shortcode'=> $shortcode,
231
+ 'field_count'=>$field_count,
232
+ 'form_settings_data' => $form_settings_data,
233
+ 'field_values'=>$inbound_form_values);
234
+
235
+ if ( version_compare( phpversion(), '5.3', '<' ) ) {
236
+ echo json_encode_fallback($output);
237
+ } else {
238
+ echo json_encode($output,JSON_FORCE_OBJECT);
239
+ }
240
+
241
+ */
242
+
243
  /* Potentially Legacy is this being used anywhere?
244
  if (!function_exists('wpl_url_to_postid_final')) {
245
  function wpl_url_to_postid_final($url) {
shared/inbound-shortcodes/css/frontend-render.css CHANGED
@@ -89,6 +89,12 @@ max-width: 98%;
89
  width: 88%;
90
  }
91
 
 
 
 
 
 
 
92
  #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=text], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=url], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=email], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=tel], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=number], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=password] {
93
  width: 130px;
94
  }
89
  width: 88%;
90
  }
91
 
92
+ .inbound-field input[type="checkbox"],.inbound-field input[type="radio"] {
93
+ display: inline-block;
94
+ width: auto;
95
+ margin: 10px;
96
+ }
97
+
98
  #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=text], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=url], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=email], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=tel], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=number], #inbound-form-wrapper .inbound-horizontal.label-inbound-label-inline input[type=password] {
99
  width: 130px;
100
  }
shared/inbound-shortcodes/inbound-shortcodes.php CHANGED
@@ -67,15 +67,23 @@ class InboundShortcodes {
67
  static function loads($hook) {
68
  global $post;
69
  $final_path = self::set_file_path();
70
- if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' )
71
- {
72
-
 
 
 
 
 
 
 
 
 
73
  wp_enqueue_style('inbound-shortcodes', $final_path.'shared/inbound-shortcodes/css/shortcodes.css');
74
  wp_enqueue_script('jquery-ui-sortable' );
75
  wp_enqueue_script('inbound-shortcodes-plugins', $final_path.'shared/inbound-shortcodes/js/shortcodes-plugins.js');
76
 
77
- if (isset($post) && post_type_supports( $post->post_type, 'editor') || isset($post) && 'wp-call-to-action' === $post->post_type )
78
- {
79
  wp_enqueue_script('inbound-shortcodes', $final_path.'shared/inbound-shortcodes/js/shortcodes.js');
80
  $form_id = (isset($_GET['post'])) ? $_GET['post'] : '';
81
  wp_localize_script( 'inbound-shortcodes', 'inbound_shortcodes', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) , 'adminurl' => admin_url(), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce') , 'form_id' => $form_id ) );
@@ -84,7 +92,7 @@ class InboundShortcodes {
84
  }
85
 
86
  // Forms CPT only
87
- if ( ( isset($post) && 'inbound-forms' === $post->post_type ) || ( isset($_GET['post_type']) && $_GET['post_type']==='inbound-forms' ) ) {
88
  wp_enqueue_style('inbound-forms-css', $final_path.'shared/inbound-shortcodes/css/form-cpt.css');
89
  wp_enqueue_script('inbound-forms-cpt-js', $final_path.'shared/inbound-shortcodes/js/form-cpt.js');
90
  wp_localize_script( 'inbound-forms-cpt-js', 'inbound_forms', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce'), 'form_cpt' => 'on' ) );
@@ -106,13 +114,16 @@ class InboundShortcodes {
106
 
107
  wp_localize_script( 'inbound-shortcodes-plugins', 'inbound_load', array( 'image_dir' => $final_path.'shared/inbound-shortcodes/', 'inbound_plugins' => $plugins_loaded, 'pop_title' => 'Insert Shortcode' ));
108
 
109
- if (isset($post)&&$post->post_type=='inbound-forms')
110
- {
111
  require_once( 'shortcodes-fields.php' );
112
  add_action( 'admin_footer', array(__CLASS__, 'inbound_forms_header_area'));
113
  }
114
 
115
- //add_action('admin_head', array( __CLASS__, 'shortcodes_admin_head' ));
 
 
 
 
116
  }
117
  }
118
 
67
  static function loads($hook) {
68
  global $post;
69
  $final_path = self::set_file_path();
70
+ if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' ) {
71
+ /* dequeue third party scripts */
72
+ global $wp_scripts;
73
+ if ( !empty( $wp_scripts->queue ) ) {
74
+ $store = $wp_scripts->queue; // store the scripts
75
+ foreach ( $wp_scripts->queue as $handle ) {
76
+ wp_dequeue_script( $handle );
77
+ }
78
+ }
79
+ wp_enqueue_script('jquery' );
80
+ wp_enqueue_script('jquery-cookie', $final_path. 'shared/assets/global/js/jquery.cookie.js', array( 'jquery' ));
81
+ wp_enqueue_script('jquery-total-storage', $final_path. 'shared/assets/global/js/jquery.total-storage.min.js', array( 'jquery' ));
82
  wp_enqueue_style('inbound-shortcodes', $final_path.'shared/inbound-shortcodes/css/shortcodes.css');
83
  wp_enqueue_script('jquery-ui-sortable' );
84
  wp_enqueue_script('inbound-shortcodes-plugins', $final_path.'shared/inbound-shortcodes/js/shortcodes-plugins.js');
85
 
86
+ if (isset($post)&&post_type_supports($post->post_type,'editor')||isset($post)&&'wp-call-to-action' === $post->post_type) {
 
87
  wp_enqueue_script('inbound-shortcodes', $final_path.'shared/inbound-shortcodes/js/shortcodes.js');
88
  $form_id = (isset($_GET['post'])) ? $_GET['post'] : '';
89
  wp_localize_script( 'inbound-shortcodes', 'inbound_shortcodes', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) , 'adminurl' => admin_url(), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce') , 'form_id' => $form_id ) );
92
  }
93
 
94
  // Forms CPT only
95
+ if ((isset($post)&&'inbound-forms'=== $post->post_type)||( isset($_GET['post_type']) && $_GET['post_type']==='inbound-forms')) {
96
  wp_enqueue_style('inbound-forms-css', $final_path.'shared/inbound-shortcodes/css/form-cpt.css');
97
  wp_enqueue_script('inbound-forms-cpt-js', $final_path.'shared/inbound-shortcodes/js/form-cpt.js');
98
  wp_localize_script( 'inbound-forms-cpt-js', 'inbound_forms', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce'), 'form_cpt' => 'on' ) );
114
 
115
  wp_localize_script( 'inbound-shortcodes-plugins', 'inbound_load', array( 'image_dir' => $final_path.'shared/inbound-shortcodes/', 'inbound_plugins' => $plugins_loaded, 'pop_title' => 'Insert Shortcode' ));
116
 
117
+ if (isset($post)&&$post->post_type=='inbound-forms') {
 
118
  require_once( 'shortcodes-fields.php' );
119
  add_action( 'admin_footer', array(__CLASS__, 'inbound_forms_header_area'));
120
  }
121
 
122
+ /* Requeue third party scripts */
123
+ foreach ( $store as $handle ) {
124
+ wp_enqueue_script( $handle );
125
+ }
126
+ //add_action('admin_head', array( __CLASS__, 'shortcodes_admin_head' ));
127
  }
128
  }
129
 
shared/inbound-shortcodes/preview.php CHANGED
@@ -2,11 +2,15 @@
2
 
3
  /* Include Wordpress
4
  * --------------------------------------------------------------------------- */
 
 
 
5
  $absolute_path = __FILE__;
6
  $path_to_file = explode( 'wp-content', $absolute_path );
7
  $path_to_wp = $path_to_file[0];
8
-
9
  require_once( $path_to_wp . '/wp-load.php' );
 
 
10
 
11
  /* Get Shortcodes
12
  * --------------------------------------------------------------------------- */
2
 
3
  /* Include Wordpress
4
  * --------------------------------------------------------------------------- */
5
+ if (defined('ABSPATH')) {
6
+ require_once( ABSPATH . 'wp-load.php' );
7
+ } else {
8
  $absolute_path = __FILE__;
9
  $path_to_file = explode( 'wp-content', $absolute_path );
10
  $path_to_wp = $path_to_file[0];
 
11
  require_once( $path_to_wp . '/wp-load.php' );
12
+ }
13
+
14
 
15
  /* Get Shortcodes
16
  * --------------------------------------------------------------------------- */
shared/inbound-shortcodes/shortcodes-fields.php CHANGED
@@ -1,19 +1,11 @@
1
  <?php
2
- /**
3
- * FreshThemes Shortcodes Field Class
4
- * ---------------------------------------------------------------------------
5
- * @author : Rifki A.G
6
- * @version : 1.3
7
- * @copyright : Copyright (c) 2013, FreshThemes
8
- * http://www.freshthemes.net
9
- * http://www.rifki.net
10
- * --------------------------------------------------------------------------- */
11
 
 
 
12
  /* Include wp-load
13
  * ----------------------------------------------------- */
14
  $path_to_file = explode( 'wp-content', __FILE__ );
15
  $path_to_wp = $path_to_file[0];
16
-
17
  require_once( $path_to_wp . '/wp-load.php' );
18
 
19
  /* The Class
1
  <?php
 
 
 
 
 
 
 
 
 
2
 
3
+ /* Include wp-load
4
+ * ----------------------------------------------------- */
5
  /* Include wp-load
6
  * ----------------------------------------------------- */
7
  $path_to_file = explode( 'wp-content', __FILE__ );
8
  $path_to_wp = $path_to_file[0];
 
9
  require_once( $path_to_wp . '/wp-load.php' );
10
 
11
  /* The Class
shared/inbound-shortcodes/shortcodes/forms.php CHANGED
@@ -8,6 +8,7 @@
8
  // if lead transient doesn't exist use defaults
9
  $lead_mapping_fields = array(
10
  'null' => 'No Mapping',
 
11
  "wpleads_first_name" => "First Name",
12
  "wpleads_last_name" => "Last Name",
13
  "wpleads_email_address" => "Email",
8
  // if lead transient doesn't exist use defaults
9
  $lead_mapping_fields = array(
10
  'null' => 'No Mapping',
11
+ "wpleads_full_name" => "Full Name",
12
  "wpleads_first_name" => "First Name",
13
  "wpleads_last_name" => "Last Name",
14
  "wpleads_email_address" => "Email",
shared/inbound-shortcodes/shortcodes/landing-page-list.php CHANGED
@@ -18,7 +18,7 @@
18
  ),
19
  'column' => array(
20
  'name' => __('Column', 'leads'),
21
- 'desc' => __('Select the number of column.', 'leads'),
22
  'type' => 'select',
23
  'options' => array(
24
  '2' => __('2 Columns', 'leads'),
@@ -54,7 +54,7 @@
54
  ),
55
  'column' => array(
56
  'name' => __('Column', 'leads'),
57
- 'desc' => __('Select the number of column.', 'leads'),
58
  'type' => 'select',
59
  'options' => array(
60
  '2' => __('2 Columns', 'leads'),
18
  ),
19
  'column' => array(
20
  'name' => __('Column', 'leads'),
21
+ 'desc' => __('Select the number of column(s).', 'leads'),
22
  'type' => 'select',
23
  'options' => array(
24
  '2' => __('2 Columns', 'leads'),
54
  ),
55
  'column' => array(
56
  'name' => __('Column', 'leads'),
57
+ 'desc' => __('Select the number of column(s).', 'leads'),
58
  'type' => 'select',
59
  'options' => array(
60
  '2' => __('2 Columns', 'leads'),
shared/inbound-shortcodes/shortcodes/landing_pages.php CHANGED
@@ -16,7 +16,7 @@
16
  ),
17
  'column' => array(
18
  'name' => __('Column', 'leads'),
19
- 'desc' => __('Select the number of column.', 'leads'),
20
  'type' => 'select',
21
  'options' => array(
22
  '1' => __('1 Column', 'leads'),
@@ -74,7 +74,7 @@
74
  ),
75
  'column' => array(
76
  'name' => __('Column', 'leads'),
77
- 'desc' => __('Select the number of column.', 'leads'),
78
  'type' => 'select',
79
  'options' => array(
80
  '1' => __('1 Column', 'leads'),
16
  ),
17
  'column' => array(
18
  'name' => __('Column', 'leads'),
19
+ 'desc' => __('Select the number of column(s).', 'leads'),
20
  'type' => 'select',
21
  'options' => array(
22
  '1' => __('1 Column', 'leads'),
74
  ),
75
  'column' => array(
76
  'name' => __('Column', 'leads'),
77
+ 'desc' => __('Select the number of column(s).', 'leads'),
78
  'type' => 'select',
79
  'options' => array(
80
  '1' => __('1 Column', 'leads'),
shared/inbound-shortcodes/shortcodes/teaser.php CHANGED
@@ -27,7 +27,7 @@
27
  ),
28
  'column' => array(
29
  'name' => __('Column', 'leads'),
30
- 'desc' => __('Select the number of column.', 'leads'),
31
  'type' => 'select',
32
  'options' => array(
33
  '1' => __('1 Column', 'leads'),
27
  ),
28
  'column' => array(
29
  'name' => __('Column', 'leads'),
30
+ 'desc' => __('Select the number of column(s).', 'leads'),
31
  'type' => 'select',
32
  'options' => array(
33
  '1' => __('1 Column', 'leads'),
shared/inbound-shortcodes/shortcodes/testimonial.php CHANGED
@@ -16,7 +16,7 @@
16
  ),
17
  'column' => array(
18
  'name' => __('Column', 'leads'),
19
- 'desc' => __('Select the number of column.', 'leads'),
20
  'type' => 'select',
21
  'options' => array(
22
  '1' => __('1 Column', 'leads'),
@@ -72,7 +72,7 @@
72
  ),
73
  'column' => array(
74
  'name' => __('Column', 'leads'),
75
- 'desc' => __('Select the number of column.', 'leads'),
76
  'type' => 'select',
77
  'options' => array(
78
  '1' => __('1 Column', 'leads'),
16
  ),
17
  'column' => array(
18
  'name' => __('Column', 'leads'),
19
+ 'desc' => __('Select the number of column(s).', 'leads'),
20
  'type' => 'select',
21
  'options' => array(
22
  '1' => __('1 Column', 'leads'),
72
  ),
73
  'column' => array(
74
  'name' => __('Column', 'leads'),
75
+ 'desc' => __('Select the number of column(s).', 'leads'),
76
  'type' => 'select',
77
  'options' => array(
78
  '1' => __('1 Column', 'leads'),
shared/languages/landing-pages.po CHANGED
@@ -1842,7 +1842,7 @@ msgstr ""
1842
  #: shared/inbound-shortcodes/shortcodes/teaser.php:30
1843
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:19
1844
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:75
1845
- msgid "Select the number of column."
1846
  msgstr ""
1847
 
1848
  #: shared/inbound-shortcodes/shortcodes/landing-page-list.php:24
1842
  #: shared/inbound-shortcodes/shortcodes/teaser.php:30
1843
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:19
1844
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:75
1845
+ msgid "Select the number of column(s)."
1846
  msgstr ""
1847
 
1848
  #: shared/inbound-shortcodes/shortcodes/landing-page-list.php:24
shared/languages/landing-pages/landing-pages.po CHANGED
@@ -1842,7 +1842,7 @@ msgstr ""
1842
  #: shared/inbound-shortcodes/shortcodes/teaser.php:30
1843
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:19
1844
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:75
1845
- msgid "Select the number of column."
1846
  msgstr ""
1847
 
1848
  #: shared/inbound-shortcodes/shortcodes/landing-page-list.php:24
1842
  #: shared/inbound-shortcodes/shortcodes/teaser.php:30
1843
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:19
1844
  #: shared/inbound-shortcodes/shortcodes/testimonial.php:75
1845
+ msgid "Select the number of column(s)."
1846
  msgstr ""
1847
 
1848
  #: shared/inbound-shortcodes/shortcodes/landing-page-list.php:24
shared/languages/leads.po CHANGED
@@ -3124,7 +3124,7 @@ msgstr ""
3124
  #: ../../shared/inbound-shortcodes/shortcodes/teaser.php:30
3125
  #: ../../shared/inbound-shortcodes/shortcodes/testimonial.php:19
3126
  #: ../../shared/inbound-shortcodes/shortcodes/testimonial.php:75
3127
- msgid "Select the number of column."
3128
  msgstr ""
3129
 
3130
  #: ../../shared/inbound-shortcodes/shortcodes/landing-page-list.php:24
3124
  #: ../../shared/inbound-shortcodes/shortcodes/teaser.php:30
3125
  #: ../../shared/inbound-shortcodes/shortcodes/testimonial.php:19
3126
  #: ../../shared/inbound-shortcodes/shortcodes/testimonial.php:75
3127
+ msgid "Select the number of column(s)."
3128
  msgstr ""
3129
 
3130
  #: ../../shared/inbound-shortcodes/shortcodes/landing-page-list.php:24
shared/metaboxes/template.metaboxes.php CHANGED
@@ -11,7 +11,7 @@ function inbound_template_metabox_render( $plugin , $key , $custom_fields , $pos
11
  $extension_data = $CTAExtensions->definitions;
12
  break;
13
  }
14
-
15
 
16
  // Use nonce for verification
17
  echo "<input type='hidden' name='{$prefix}_{$key}_custom_fields_nonce' value='".wp_create_nonce(''.$prefix_dash.'-nonce')."' />";
@@ -19,8 +19,9 @@ function inbound_template_metabox_render( $plugin , $key , $custom_fields , $pos
19
  // Begin the field table and loop
20
  echo '<div class="form-table" id="inbound-meta">';
21
 
 
22
  $current_var = wp_cta_ab_testing_get_current_variation_id();
23
-
24
  foreach ($custom_fields as $field)
25
  {
26
  $field_id = $key . "-" .$field['id'];
@@ -28,16 +29,16 @@ function inbound_template_metabox_render( $plugin , $key , $custom_fields , $pos
28
  $type_class = " inbound-" . $field['type'];
29
  $type_class_row = " inbound-" . $field['type'] . "-row";
30
  $type_class_option = " inbound-" . $field['type'] . "-option";
31
- $option_class = (isset($field['class'])) ? $field['class'] : '';
32
 
33
  $meta = get_post_meta($post->ID, $field_id, true);
34
 
35
  //print_r($field);
36
- if ((!isset($meta)&&isset($field['default'])&&!is_numeric($meta))||isset($meta)&&empty($meta)&&isset($field['default'])&&!is_numeric($meta))
37
  {
38
  $meta = $field['default'];
39
  }
40
-
41
  // Remove prefixes on global => true template options
42
  if (isset($field['global']) && $field['global'] === true) {
43
  $field_id = $field['id'];
@@ -156,9 +157,9 @@ function inbound_template_metabox_render( $plugin , $key , $custom_fields , $pos
156
  case 'image-select':
157
  echo '<select name="'.$field_id.'" id="'.$field_id.'" class="image-picker">';
158
  foreach ($field['options'] as $value=>$label) {
159
- echo '<option', $meta == $value ? ' selected="selected"' : '', ' value="'.$value.'" data-img-src="'.$extension_data[$key]['info']['path'].'assets/img/'.$value.'.'.$field['image_type'].'" >'.$label.'</option>';
160
  }
161
- echo '</select><div class="wp-cta-image-container" style="display:inline;"></div><div class="wp_cta_tooltip" title="'.$field['description'].'"></div>';
162
  break;
163
 
164
 
11
  $extension_data = $CTAExtensions->definitions;
12
  break;
13
  }
14
+
15
 
16
  // Use nonce for verification
17
  echo "<input type='hidden' name='{$prefix}_{$key}_custom_fields_nonce' value='".wp_create_nonce(''.$prefix_dash.'-nonce')."' />";
19
  // Begin the field table and loop
20
  echo '<div class="form-table" id="inbound-meta">';
21
 
22
+ //print_r($custom_fields);exit;
23
  $current_var = wp_cta_ab_testing_get_current_variation_id();
24
+
25
  foreach ($custom_fields as $field)
26
  {
27
  $field_id = $key . "-" .$field['id'];
29
  $type_class = " inbound-" . $field['type'];
30
  $type_class_row = " inbound-" . $field['type'] . "-row";
31
  $type_class_option = " inbound-" . $field['type'] . "-option";
32
+ $option_class = (isset($field['class'])) ? $field['class'] : '';
33
 
34
  $meta = get_post_meta($post->ID, $field_id, true);
35
 
36
  //print_r($field);
37
+ if (!metadata_exists('post',$post->ID,$field_id))
38
  {
39
  $meta = $field['default'];
40
  }
41
+
42
  // Remove prefixes on global => true template options
43
  if (isset($field['global']) && $field['global'] === true) {
44
  $field_id = $field['id'];
157
  case 'image-select':
158
  echo '<select name="'.$field_id.'" id="'.$field_id.'" class="image-picker">';
159
  foreach ($field['options'] as $value=>$label) {
160
+ echo '<option', $meta == $value ? ' selected="selected"' : '', ' value="'.$value.'" data-img-src="'.$extension_data[$key]['info']['urlpath'].'assets/img/'.$value.'.'.$field['image_type'].'" >'.$label.'</option>';
161
  }
162
+ echo '</select><div class="wp-cta-image-container" style="display:inline;min-height:200px;margin-top:10px;"></div><div class="wp_cta_tooltip" title="'.$field['description'].'"></div>';
163
  break;
164
 
165
 
shared/tracking/store.lead.php CHANGED
@@ -13,12 +13,12 @@ add_action('wp_ajax_inbound_store_lead_search', 'inbound_store_lead_search');
13
  add_action('wp_ajax_nopriv_inbound_store_lead_search', 'inbound_store_lead_search');
14
  function inbound_store_lead_search($args = array()) {
15
  global $wpdb;
16
-
17
  $search = (isset($_POST['search_data'] )) ? $_POST['search_data'] : null; // mapped data
18
  $email = (isset($_POST['email'] )) ? $_POST['email'] : null; // mapped data
19
  $date = (isset($_POST['date'] )) ? $_POST['date'] : null; // mapped data
20
-
21
- if ( ( isset( $email ) && !empty( $email ) && strstr( $email ,'@') ))
22
  {
23
  $query = $wpdb->prepare(
24
  'SELECT ID FROM ' . $wpdb->posts . '
@@ -26,11 +26,11 @@ function inbound_store_lead_search($args = array()) {
26
  AND post_type = \'wp-lead\'',
27
  $email
28
  );
29
-
30
  $wpdb->query( $query );
31
 
32
  // Add lookup fallbacks
33
- if ( $wpdb->num_rows )
34
  {
35
  /* Update Existing Lead */
36
  $lead_id = $wpdb->get_var( $query );
@@ -101,7 +101,7 @@ function inbound_store_lead( $args = array() ) {
101
  $lead_data['wp_lead_uid'] = (array_key_exists('wp_lead_uid', $mapped_data)) ? $mapped_data['wp_lead_uid'] : false;
102
  $lead_data['lead_lists'] = (array_key_exists('leads_list', $mapped_data)) ? explode(",", $mapped_data['leads_list']) : false;
103
  $lead_data['ip_address'] = (array_key_exists('ip_address', $mapped_data)) ? $mapped_data['ip_address'] : false;
104
-
105
  /* POST Vars */
106
  $raw_search_data = (isset($_POST['Search_Data'])) ? $_POST['Search_Data'] : false;
107
  $search_data = json_decode(stripslashes($raw_search_data), true ); // mapped data array
@@ -149,7 +149,7 @@ function inbound_store_lead( $args = array() ) {
149
  do_action('inbound_store_lead_pre' , $lead_data); // Global lead storage action hook
150
 
151
  // check for set email
152
- if ( ( isset( $lead_data['wpleads_email_address'] ) && !empty( $lead_data['wpleads_email_address'] ) && strstr( $lead_data['wpleads_email_address'] ,'@') ))
153
  {
154
  $query = $wpdb->prepare(
155
  'SELECT ID FROM ' . $wpdb->posts . '
@@ -160,7 +160,7 @@ function inbound_store_lead( $args = array() ) {
160
  $wpdb->query( $query );
161
 
162
  /* Update Lead if Exists else Create New Lead */
163
- if ( $wpdb->num_rows )
164
  {
165
  /* Update Existing Lead */
166
  $lead_data['lead_id'] = $wpdb->get_var( $query );
@@ -169,8 +169,8 @@ function inbound_store_lead( $args = array() ) {
169
 
170
  do_action('wpleads_existing_lead_insert',$lead_id); // action hook on existing leads only
171
 
172
- }
173
- else
174
  {
175
  /* Create New Lead */
176
  $post = array(
@@ -293,28 +293,28 @@ function inbound_store_lead( $args = array() ) {
293
 
294
 
295
  /* Store Conversion Data to LANDING PAGE/CTA DATA */
296
- if ($lead_data['post_type'] == 'landing-page' || $lead_data['post_type'] == 'wp-call-to-action')
297
  {
298
  $page_conversion_data = get_post_meta( $lead_data['page_id'], 'inbound_conversion_data', TRUE );
299
  $page_conversion_data = json_decode($page_conversion_data,true);
300
  $version = ($lead_data['variation'] != 'default') ? $lead_data['variation'] : '0';
301
-
302
  if (is_array($page_conversion_data))
303
  {
304
  $convert_count = count($page_conversion_data) + 1;
305
  $page_conversion_data[$convert_count]['lead_id'] = $lead_id;
306
  $page_conversion_data[$convert_count]['variation'] = $version;
307
  $page_conversion_data[$convert_count]['datetime'] = $lead_data['wordpress_date_time'];
308
-
309
  } else {
310
-
311
  $convert_count = 1;
312
  $page_conversion_data[$convert_count]['lead_id'] = $lead_id;
313
  $page_conversion_data[$convert_count]['variation'] = $version;
314
  $page_conversion_data[$convert_count]['datetime'] = $lead_data['wordpress_date_time'];
315
-
316
  }
317
-
318
  $page_conversion_data = json_encode($page_conversion_data);
319
  update_post_meta($lead_data['page_id'], 'inbound_conversion_data', $page_conversion_data);
320
  }
@@ -350,7 +350,7 @@ function inbound_store_lead( $args = array() ) {
350
  }
351
 
352
  /* Raw Form Values Store */
353
- if ($lead_data['form_input_values'])
354
  {
355
  $raw_post_data = get_post_meta($lead_id,'wpleads_raw_post_data', true);
356
  $a1 = json_decode( $raw_post_data, true );
@@ -358,22 +358,24 @@ function inbound_store_lead( $args = array() ) {
358
  $exclude_array = array('card_number','card_cvc','card_exp_month','card_exp_year'); // add filter
359
  $lead_mapping_fields = get_transient( 'wp-lead-fields' );
360
 
361
- foreach ($a2 as $key=>$value)
362
  {
363
  if (array_key_exists( $key , $exclude_array )) {
364
  unset($a2[$key]);
365
  continue;
366
  }
367
-
 
 
368
  if (array_key_exists($key, $lead_mapping_fields)) {
369
  update_post_meta( $lead_id, $key, $value );
370
  }
371
-
372
- if (stristr($key,'company'))
373
  {
374
  update_post_meta( $lead_id, 'wpleads_company_name', $value );
375
- }
376
- else if (stristr($key,'website'))
377
  {
378
  $websites = get_post_meta( $lead_id, 'wpleads_websites', $value );
379
  if(is_array($websites)) {
@@ -416,22 +418,22 @@ function inbound_store_lead( $args = array() ) {
416
  }
417
 
418
 
419
- if (!function_exists('inbound_update_common_meta'))
420
  {
421
  function inbound_update_common_meta($lead_data)
422
  {
423
  if (!empty($lead_data['user_ID'])) {
424
  update_post_meta( $lead_data['lead_id'], 'wpleads_wordpress_user_id', $lead_data['user_ID'] );
425
- }
426
  if (!empty($lead_data['wpleads_first_name'])) {
427
  update_post_meta( $lead_data['lead_id'], 'wpleads_first_name', $lead_data['wpleads_first_name'] );
428
- }
429
  if (!empty($lead_data['wpleads_last_name'])) {
430
  update_post_meta( $lead_data['lead_id'], 'wpleads_last_name', $lead_data['wpleads_last_name'] );
431
- }
432
  if (!empty($lead_data['wpleads_mobile_phone'])) {
433
  update_post_meta( $lead_data['lead_id'], 'wpleads_work_phone', $lead_data['wpleads_mobile_phone'] );
434
- }
435
  if (!empty($lead_data['wpleads_company_name'])) {
436
  update_post_meta( $lead_data['lead_id'], 'wpleads_company_name', $lead_data['wpleads_company_name'] );
437
  }
13
  add_action('wp_ajax_nopriv_inbound_store_lead_search', 'inbound_store_lead_search');
14
  function inbound_store_lead_search($args = array()) {
15
  global $wpdb;
16
+
17
  $search = (isset($_POST['search_data'] )) ? $_POST['search_data'] : null; // mapped data
18
  $email = (isset($_POST['email'] )) ? $_POST['email'] : null; // mapped data
19
  $date = (isset($_POST['date'] )) ? $_POST['date'] : null; // mapped data
20
+
21
+ if ( ( isset( $email ) && !empty( $email ) && strstr( $email ,'@') ))
22
  {
23
  $query = $wpdb->prepare(
24
  'SELECT ID FROM ' . $wpdb->posts . '
26
  AND post_type = \'wp-lead\'',
27
  $email
28
  );
29
+
30
  $wpdb->query( $query );
31
 
32
  // Add lookup fallbacks
33
+ if ( $wpdb->num_rows )
34
  {
35
  /* Update Existing Lead */
36
  $lead_id = $wpdb->get_var( $query );
101
  $lead_data['wp_lead_uid'] = (array_key_exists('wp_lead_uid', $mapped_data)) ? $mapped_data['wp_lead_uid'] : false;
102
  $lead_data['lead_lists'] = (array_key_exists('leads_list', $mapped_data)) ? explode(",", $mapped_data['leads_list']) : false;
103
  $lead_data['ip_address'] = (array_key_exists('ip_address', $mapped_data)) ? $mapped_data['ip_address'] : false;
104
+
105
  /* POST Vars */
106
  $raw_search_data = (isset($_POST['Search_Data'])) ? $_POST['Search_Data'] : false;
107
  $search_data = json_decode(stripslashes($raw_search_data), true ); // mapped data array
149
  do_action('inbound_store_lead_pre' , $lead_data); // Global lead storage action hook
150
 
151
  // check for set email
152
+ if ( ( isset( $lead_data['wpleads_email_address'] ) && !empty( $lead_data['wpleads_email_address'] ) && strstr( $lead_data['wpleads_email_address'] ,'@') ))
153
  {
154
  $query = $wpdb->prepare(
155
  'SELECT ID FROM ' . $wpdb->posts . '
160
  $wpdb->query( $query );
161
 
162
  /* Update Lead if Exists else Create New Lead */
163
+ if ( $wpdb->num_rows )
164
  {
165
  /* Update Existing Lead */
166
  $lead_data['lead_id'] = $wpdb->get_var( $query );
169
 
170
  do_action('wpleads_existing_lead_insert',$lead_id); // action hook on existing leads only
171
 
172
+ }
173
+ else
174
  {
175
  /* Create New Lead */
176
  $post = array(
293
 
294
 
295
  /* Store Conversion Data to LANDING PAGE/CTA DATA */
296
+ if ($lead_data['post_type'] == 'landing-page' || $lead_data['post_type'] == 'wp-call-to-action')
297
  {
298
  $page_conversion_data = get_post_meta( $lead_data['page_id'], 'inbound_conversion_data', TRUE );
299
  $page_conversion_data = json_decode($page_conversion_data,true);
300
  $version = ($lead_data['variation'] != 'default') ? $lead_data['variation'] : '0';
301
+
302
  if (is_array($page_conversion_data))
303
  {
304
  $convert_count = count($page_conversion_data) + 1;
305
  $page_conversion_data[$convert_count]['lead_id'] = $lead_id;
306
  $page_conversion_data[$convert_count]['variation'] = $version;
307
  $page_conversion_data[$convert_count]['datetime'] = $lead_data['wordpress_date_time'];
308
+
309
  } else {
310
+
311
  $convert_count = 1;
312
  $page_conversion_data[$convert_count]['lead_id'] = $lead_id;
313
  $page_conversion_data[$convert_count]['variation'] = $version;
314
  $page_conversion_data[$convert_count]['datetime'] = $lead_data['wordpress_date_time'];
315
+
316
  }
317
+
318
  $page_conversion_data = json_encode($page_conversion_data);
319
  update_post_meta($lead_data['page_id'], 'inbound_conversion_data', $page_conversion_data);
320
  }
350
  }
351
 
352
  /* Raw Form Values Store */
353
+ if ($lead_data['form_input_values'])
354
  {
355
  $raw_post_data = get_post_meta($lead_id,'wpleads_raw_post_data', true);
356
  $a1 = json_decode( $raw_post_data, true );
358
  $exclude_array = array('card_number','card_cvc','card_exp_month','card_exp_year'); // add filter
359
  $lead_mapping_fields = get_transient( 'wp-lead-fields' );
360
 
361
+ foreach ($a2 as $key=>$value)
362
  {
363
  if (array_key_exists( $key , $exclude_array )) {
364
  unset($a2[$key]);
365
  continue;
366
  }
367
+ if (preg_match("/\[\]/", $key)) {
368
+ $key = str_replace("[]", "", $key); // fix array value keys
369
+ }
370
  if (array_key_exists($key, $lead_mapping_fields)) {
371
  update_post_meta( $lead_id, $key, $value );
372
  }
373
+
374
+ if (stristr($key,'company'))
375
  {
376
  update_post_meta( $lead_id, 'wpleads_company_name', $value );
377
+ }
378
+ else if (stristr($key,'website'))
379
  {
380
  $websites = get_post_meta( $lead_id, 'wpleads_websites', $value );
381
  if(is_array($websites)) {
418
  }
419
 
420
 
421
+ if (!function_exists('inbound_update_common_meta'))
422
  {
423
  function inbound_update_common_meta($lead_data)
424
  {
425
  if (!empty($lead_data['user_ID'])) {
426
  update_post_meta( $lead_data['lead_id'], 'wpleads_wordpress_user_id', $lead_data['user_ID'] );
427
+ }
428
  if (!empty($lead_data['wpleads_first_name'])) {
429
  update_post_meta( $lead_data['lead_id'], 'wpleads_first_name', $lead_data['wpleads_first_name'] );
430
+ }
431
  if (!empty($lead_data['wpleads_last_name'])) {
432
  update_post_meta( $lead_data['lead_id'], 'wpleads_last_name', $lead_data['wpleads_last_name'] );
433
+ }
434
  if (!empty($lead_data['wpleads_mobile_phone'])) {
435
  update_post_meta( $lead_data['lead_id'], 'wpleads_work_phone', $lead_data['wpleads_mobile_phone'] );
436
+ }
437
  if (!empty($lead_data['wpleads_company_name'])) {
438
  update_post_meta( $lead_data['lead_id'], 'wpleads_company_name', $lead_data['wpleads_company_name'] );
439
  }
tests/bootstrap.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Bootstrap the plugin unit testing environment.
4
+ *
5
+ * Edit 'active_plugins' setting below to point to your main plugin file.
6
+ *
7
+ * @package wordpress-plugin-tests
8
+ */
9
+
10
+ // Activates this plugin in WordPress so it can be tested.
11
+ $GLOBALS['wp_tests_options'] = array(
12
+ 'active_plugins' => array( 'plugin-slug/main-plugin-file.php' ),
13
+ );
14
+
15
+ // If the develop repo location is defined (as WP_DEVELOP_DIR), use that
16
+ // location. Otherwise, we'll just assume that this plugin is installed in a
17
+ // WordPress develop SVN checkout.
18
+
19
+ if( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
20
+ require getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/bootstrap.php';
21
+ } else {
22
+ require '../../../../tests/phpunit/includes/bootstrap.php';
23
+ }
24
+
25
+ ?>
tests/test_wordpress_plugin_tests.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Tests to test that that testing framework is testing tests. Meta, huh?
5
+ *
6
+ * @package wordpress-plugins-tests
7
+ */
8
+ class WP_Test_WordPress_Plugin_Tests extends WP_UnitTestCase {
9
+
10
+ /**
11
+ * Run a simple test to ensure that the tests are running
12
+ */
13
+ function test_tests() {
14
+
15
+ $this->assertTrue( true );
16
+
17
+ }
18
+
19
+ /**
20
+ * Ensure that the plugin has been installed and activated.
21
+ */
22
+ function test_plugin_activated() {
23
+
24
+ $this->assertTrue( is_plugin_active( 'plugin-slug/main-plugin-file.php' ) );
25
+
26
+ }
27
+
28
+ }
29
+
30
+ ?>