HubSpot – Free Marketing Plugin for WordPress - Version 2.2.9

Version Description

(2014.01.20) =

Download this release

Release Info

Developer AndyGCook
Plugin Icon 128x128 HubSpot – Free Marketing Plugin for WordPress
Version 2.2.9
Comparing to
See all releases

Code changes from version 2.2.8 to 2.2.9

admin/inc/class-leadin-list-table.php CHANGED
@@ -210,6 +210,9 @@ class LI_List_Table extends WP_List_Table {
210
 
211
  $ids_for_action = rtrim($ids_for_action, ',');
212
  }
 
 
 
213
 
214
  $q = $wpdb->prepare("SELECT hashkey FROM $wpdb->li_leads WHERE lead_id IN ( " . $ids_for_action . " ) ", "");
215
  $hashes = $wpdb->get_results($q);
210
 
211
  $ids_for_action = rtrim($ids_for_action, ',');
212
  }
213
+ else // default case for when it's not actually processing a bulk action
214
+ return FALSE;
215
+
216
 
217
  $q = $wpdb->prepare("SELECT hashkey FROM $wpdb->li_leads WHERE lead_id IN ( " . $ids_for_action . " ) ", "");
218
  $hashes = $wpdb->get_results($q);
admin/inc/class-leadin-tags-list-table.php CHANGED
@@ -183,7 +183,7 @@ class LI_Tags_Table extends WP_List_Table {
183
 
184
  $tag_array = array(
185
  'tag_id' => $tag->tag_id,
186
- 'tag_count' => sprintf('<a href="?page=%s&contact_type=%s">%d</a>', $_REQUEST['page'], $tag->tag_slug, ( $tag->tag_count ? $tag->tag_count : 0 )),
187
  'tag_text' => $tag->tag_text,
188
  'tag_slug' => $tag->tag_slug,
189
  'tag_form_selectors' => str_replace(',', '<br/>', $tag->tag_form_selectors),
183
 
184
  $tag_array = array(
185
  'tag_id' => $tag->tag_id,
186
+ 'tag_count' => sprintf('<a href="?page=%s&contact_type=%s">%d</a>', 'leadin_contacts', $tag->tag_slug, ( $tag->tag_count ? $tag->tag_count : 0 )),
187
  'tag_text' => $tag->tag_text,
188
  'tag_slug' => $tag->tag_slug,
189
  'tag_form_selectors' => str_replace(',', '<br/>', $tag->tag_form_selectors),
admin/leadin-admin.php CHANGED
@@ -191,10 +191,32 @@ class WPLeadInAdmin {
191
 
192
  global $submenu;
193
  global $wp_version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
 
195
  self::check_admin_action();
196
 
197
- add_menu_page('Leadin', 'Leadin', 'manage_categories', 'leadin_stats', array($this, 'leadin_build_stats_page'), LEADIN_PATH . '/images/' . ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'leadin-icon-32x32.png' : 'leadin-svg-icon.svg'), '25.100713');
198
 
199
  foreach ( $this->admin_power_ups as $power_up )
200
  {
@@ -204,13 +226,13 @@ class WPLeadInAdmin {
204
 
205
  // Creates the menu icon for power-up if it's set. Overrides the main Leadin menu to hit the contacts power-up
206
  if ( $power_up->menu_text )
207
- add_submenu_page('leadin_stats', $power_up->menu_text, $power_up->menu_text, 'manage_categories', 'leadin_' . $power_up->menu_link, array($power_up, 'power_up_setup_callback'));
208
  }
209
  }
210
 
211
- add_submenu_page('leadin_stats', 'Tags', 'Tags', 'manage_categories', 'leadin_tags', array(&$this, 'leadin_build_tag_page'));
212
- add_submenu_page('leadin_stats', 'Settings', 'Settings', 'manage_categories', 'leadin_settings', array(&$this, 'leadin_plugin_options'));
213
- add_submenu_page('leadin_stats', 'Power-ups', 'Power-ups', 'manage_categories', 'leadin_power_ups', array(&$this, 'leadin_power_ups_page'));
214
  $submenu['leadin_stats'][0][0] = 'Stats';
215
 
216
  if ( !isset($_GET['page']) || $_GET['page'] != 'leadin_settings' )
@@ -249,11 +271,6 @@ class WPLeadInAdmin {
249
  global $wp_version;
250
  $this->stats_dashboard = new LI_StatsDashboard();
251
 
252
- if ( !current_user_can( 'manage_categories' ) )
253
- {
254
- wp_die(__('You do not have sufficient permissions to access this page.'));
255
- }
256
-
257
  echo '<div id="leadin" class="li-stats wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
258
 
259
  $this->leadin_header('Leadin Stats: ' . date('F j Y, g:ia', current_time('timestamp')), 'leadin-stats__header');
@@ -282,11 +299,6 @@ class WPLeadInAdmin {
282
  {
283
  global $wp_version;
284
 
285
- if ( !current_user_can( 'manage_categories' ) )
286
- {
287
- wp_die(__('You do not have sufficient permissions to access this page.'));
288
- }
289
-
290
  if ( isset($_POST['tag_name']) )
291
  {
292
  $tag_id = ( isset($_POST['tag_id']) ? $_POST['tag_id'] : FALSE );
@@ -835,6 +847,14 @@ class WPLeadInAdmin {
835
  'leadin_settings_section'
836
  );
837
 
 
 
 
 
 
 
 
 
838
  add_filter(
839
  'update_option_leadin_options',
840
  array($this, 'update_option_leadin_options_callback'),
@@ -953,10 +973,6 @@ class WPLeadInAdmin {
953
  */
954
  function leadin_plugin_options ()
955
  {
956
- if ( !current_user_can( 'manage_categories' ) ) {
957
- wp_die(__('You do not have sufficient permissions to access this page.'));
958
- }
959
-
960
  $li_options = get_option('leadin_options');
961
 
962
  // Load onboarding if not complete
@@ -1134,7 +1150,7 @@ class WPLeadInAdmin {
1134
 
1135
  ?>
1136
  <div class="leadin-settings__content">
1137
- <form method="post" action="options.php">
1138
  <?php
1139
  settings_fields('leadin_settings_options');
1140
  do_settings_sections(LEADIN_ADMIN_PATH);
@@ -1143,7 +1159,7 @@ class WPLeadInAdmin {
1143
  </form>
1144
  </div>
1145
  <div class="leadin-settings__sidebar">
1146
- <a href="http://leadin.com/pro-upgrade?utm_campaign=repo_plugin"><img class="pro-upgrade-cta" src="<?php echo LEADIN_PATH; ?>/images/pro-upgrade-cta.png"></a>
1147
  </div>
1148
  <?php
1149
 
@@ -1204,12 +1220,14 @@ class WPLeadInAdmin {
1204
  //print_r($user_roles);
1205
  foreach ( $user_roles as $key => $role )
1206
  {
1207
- $role_id = 'li_do_not_track_' . $key;
 
1208
 
1209
- if( isset( $input[$role_id] ) )
1210
- {
1211
- $new_input[$role_id] = $input[$role_id];
1212
- }
 
1213
  }
1214
  }
1215
 
@@ -1241,7 +1259,6 @@ class WPLeadInAdmin {
1241
  $options = get_option('leadin_options');
1242
 
1243
  $user_roles = get_editable_roles();
1244
- //print_r($user_roles);
1245
  if ( count($user_roles) )
1246
  {
1247
  foreach ( $user_roles as $key => $role )
@@ -1256,16 +1273,45 @@ class WPLeadInAdmin {
1256
  }
1257
 
1258
  /**
1259
- * Creates power-up page
1260
  */
1261
- function leadin_power_ups_page ()
1262
  {
1263
- global $wp_version;
 
 
1264
 
1265
- if ( !current_user_can( 'manage_categories' ) )
 
 
 
 
1266
  {
1267
- wp_die(__('You do not have sufficient permissions to access this page.'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1268
  }
 
 
 
 
 
 
 
 
1269
 
1270
  echo '<div id="leadin" class="li-settings wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
1271
 
@@ -1293,7 +1339,7 @@ class WPLeadInAdmin {
1293
  </div>
1294
  <h2>Content Stats</h2>
1295
  <p>See where all your conversions are coming from.</p>
1296
- <p><a href="http://leadin.com/content-analytics-plugin-wordpress/" target="_blank">Learn more</a></p>
1297
  <a href="<?php echo get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_stats'; ?>" class="button button-large">View Stats</a>
1298
  </li>
1299
  <?php $power_up_count++; ?>
191
 
192
  global $submenu;
193
  global $wp_version;
194
+
195
+ // Block non-sanctioned users from accessing Leadin
196
+ $capability = 'activate_plugins';
197
+ if ( ! current_user_can('activate_plugins') )
198
+ {
199
+ if ( ! array_key_exists('li_grant_access_to_' . leadin_get_user_role(), $options ) )
200
+ return FALSE;
201
+ else
202
+ {
203
+ if ( current_user_can('manage_network') ) // super admin
204
+ $capability = 'manage_network';
205
+ else if ( current_user_can('edit_pages') ) // editor
206
+ $capability = 'edit_pages';
207
+ else if ( current_user_can('publish_posts') ) // author
208
+ $capability = 'publish_posts';
209
+ else if ( current_user_can('edit_posts') ) // contributor
210
+ $capability = 'edit_posts';
211
+ else if ( current_user_can('read') ) // subscriber
212
+ $capability = 'read';
213
+
214
+ }
215
+ }
216
 
217
  self::check_admin_action();
218
 
219
+ add_menu_page('Leadin', 'Leadin', $capability, 'leadin_stats', array($this, 'leadin_build_stats_page'), LEADIN_PATH . '/images/' . ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'leadin-icon-32x32.png' : 'leadin-svg-icon.svg'), '25.100713');
220
 
221
  foreach ( $this->admin_power_ups as $power_up )
222
  {
226
 
227
  // Creates the menu icon for power-up if it's set. Overrides the main Leadin menu to hit the contacts power-up
228
  if ( $power_up->menu_text )
229
+ add_submenu_page('leadin_stats', $power_up->menu_text, $power_up->menu_text, $capability, 'leadin_' . $power_up->menu_link, array($power_up, 'power_up_setup_callback'));
230
  }
231
  }
232
 
233
+ add_submenu_page('leadin_stats', 'Tags', 'Tags', $capability, 'leadin_tags', array(&$this, 'leadin_build_tag_page'));
234
+ add_submenu_page('leadin_stats', 'Settings', 'Settings', 'activate_plugins', 'leadin_settings', array(&$this, 'leadin_plugin_options'));
235
+ add_submenu_page('leadin_stats', 'Power-ups', 'Power-ups', 'activate_plugins', 'leadin_power_ups', array(&$this, 'leadin_power_ups_page'));
236
  $submenu['leadin_stats'][0][0] = 'Stats';
237
 
238
  if ( !isset($_GET['page']) || $_GET['page'] != 'leadin_settings' )
271
  global $wp_version;
272
  $this->stats_dashboard = new LI_StatsDashboard();
273
 
 
 
 
 
 
274
  echo '<div id="leadin" class="li-stats wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
275
 
276
  $this->leadin_header('Leadin Stats: ' . date('F j Y, g:ia', current_time('timestamp')), 'leadin-stats__header');
299
  {
300
  global $wp_version;
301
 
 
 
 
 
 
302
  if ( isset($_POST['tag_name']) )
303
  {
304
  $tag_id = ( isset($_POST['tag_id']) ? $_POST['tag_id'] : FALSE );
847
  'leadin_settings_section'
848
  );
849
 
850
+ add_settings_field(
851
+ 'li_grant_access',
852
+ 'Grant Leadin access to',
853
+ array($this, 'li_grant_access_callback'),
854
+ LEADIN_ADMIN_PATH,
855
+ 'leadin_settings_section'
856
+ );
857
+
858
  add_filter(
859
  'update_option_leadin_options',
860
  array($this, 'update_option_leadin_options_callback'),
973
  */
974
  function leadin_plugin_options ()
975
  {
 
 
 
 
976
  $li_options = get_option('leadin_options');
977
 
978
  // Load onboarding if not complete
1150
 
1151
  ?>
1152
  <div class="leadin-settings__content">
1153
+ <form method="POST" action="options.php">
1154
  <?php
1155
  settings_fields('leadin_settings_options');
1156
  do_settings_sections(LEADIN_ADMIN_PATH);
1159
  </form>
1160
  </div>
1161
  <div class="leadin-settings__sidebar">
1162
+ <a href="http://leadin.com/pro-upgrade/?utm_source=Leadin%20Repo%20Plugin&utm_medium=Settings%20Banner&utm_campaign=Repo"><img class="pro-upgrade-cta" src="<?php echo LEADIN_PATH; ?>/images/pro-upgrade-cta.png"></a>
1163
  </div>
1164
  <?php
1165
 
1220
  //print_r($user_roles);
1221
  foreach ( $user_roles as $key => $role )
1222
  {
1223
+ $role_id_tracking = 'li_do_not_track_' . $key;
1224
+ $role_id_access = 'li_grant_access_to_' . $key;
1225
 
1226
+ if ( isset( $input[$role_id_tracking] ) )
1227
+ $new_input[$role_id_tracking] = $input[$role_id_tracking];
1228
+
1229
+ if ( isset( $input[$role_id_access] ) )
1230
+ $new_input[$role_id_access] = $input[$role_id_access];
1231
  }
1232
  }
1233
 
1259
  $options = get_option('leadin_options');
1260
 
1261
  $user_roles = get_editable_roles();
 
1262
  if ( count($user_roles) )
1263
  {
1264
  foreach ( $user_roles as $key => $role )
1273
  }
1274
 
1275
  /**
1276
+ * Prints checkboxes for toggling Leadin access to specific user roles
1277
  */
1278
+ function li_grant_access_callback ()
1279
  {
1280
+ $options = get_option('leadin_options');
1281
+
1282
+ $user_roles = get_editable_roles();
1283
 
1284
+ // Show a disabled checkbox for administrative roles that always need to be enabled so users don't get locked out of the Leadin settings
1285
+ echo '<p><input id="li_grant_access_to_administrator" type="checkbox" value="1" checked disabled/>';
1286
+ echo '<label for="li_grant_access_to_administrator">Administrators</label></p>';
1287
+
1288
+ if ( count($user_roles) )
1289
  {
1290
+ foreach ( $user_roles as $key => $role )
1291
+ {
1292
+ $admin_role = FALSE;
1293
+ if ( isset($role['capabilities']['activate_plugins']) && $role['capabilities']['activate_plugins'] )
1294
+ $admin_role = TRUE;
1295
+
1296
+ $role_id = 'li_grant_access_to_' . $key;
1297
+
1298
+ if ( ! $admin_role )
1299
+ {
1300
+ printf(
1301
+ '<p><input id="' . $role_id . '" type="checkbox" name="leadin_options[' . $role_id . ']" value="1"' . checked( 1, ( isset($options[$role_id]) ? $options[$role_id] : '0' ), FALSE ) . '/>' .
1302
+ '<label for="' . $role_id . '">' . $role['name'] . 's' . '</label></p>'
1303
+ );
1304
+ }
1305
+ }
1306
  }
1307
+ }
1308
+
1309
+ /**
1310
+ * Creates power-up page
1311
+ */
1312
+ function leadin_power_ups_page ()
1313
+ {
1314
+ global $wp_version;
1315
 
1316
  echo '<div id="leadin" class="li-settings wrap '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? 'pre-mp6' : ''). '">';
1317
 
1339
  </div>
1340
  <h2>Content Stats</h2>
1341
  <p>See where all your conversions are coming from.</p>
1342
+ <p><a href="http://leadin.com/wordpress-analytics-plugin/" target="_blank">Learn more</a></p>
1343
  <a href="<?php echo get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_stats'; ?>" class="button button-large">View Stats</a>
1344
  </li>
1345
  <?php $power_up_count++; ?>
assets/js/build/leadin-subscribe.js CHANGED
@@ -465,7 +465,7 @@ function bind_leadin_subscribe_widget ( lis_heading, lis_desc, lis_show_names, l
465
  '<h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3>' +
466
  '<div id="powered-by-leadin-thank-you">' +
467
  '<span class="powered-by">Powered by Leadin</span>' +
468
- '<a href="http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=email&utm_source=' + window.location.host + '"><img alt="Leadin" height="20px" width="99px" src="' + document.location.protocol + '//leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a>' +
469
  '</div>'
470
  ).css('text-align', 'center').fadeIn(250);
471
  });
@@ -485,7 +485,7 @@ function bind_leadin_subscribe_widget ( lis_heading, lis_desc, lis_show_names, l
485
 
486
  //leadin_subscribe_show();
487
 
488
- $('.leadin-subscribe form.vex-dialog-form').append('<a href="http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=widget&utm_source=' + document.URL + '" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by Leadin</a>');
489
  };
490
 
491
  subscribe._open = function() {
465
  '<h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3>' +
466
  '<div id="powered-by-leadin-thank-you">' +
467
  '<span class="powered-by">Powered by Leadin</span>' +
468
+ '<a href="http://leadin.com/wordpress-subscribe-widget-plugin/?utm_campaign=subscribe_widget&utm_medium=email&utm_source=' + window.location.host + '"><img alt="Leadin" height="20px" width="99px" src="' + document.location.protocol + '//leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a>' +
469
  '</div>'
470
  ).css('text-align', 'center').fadeIn(250);
471
  });
485
 
486
  //leadin_subscribe_show();
487
 
488
+ $('.leadin-subscribe form.vex-dialog-form').append('<a href="http://leadin.com/wordpress-subscribe-widget-plugin/?utm_campaign=subscribe_widget&utm_medium=widget&utm_source=' + document.URL + '" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by Leadin</a>');
489
  };
490
 
491
  subscribe._open = function() {
assets/js/build/leadin-subscribe.min.js CHANGED
@@ -1 +1 @@
1
- function bind_leadin_subscribe_widget(lis_heading,lis_desc,lis_show_names,lis_show_phone,lis_btn_label,lis_vex_class){lis_heading=lis_heading?lis_heading:"Sign up for email updates",lis_desc=lis_desc?lis_desc:"",lis_btn_label=lis_btn_label?lis_btn_label:"SUBSCRIBE",lis_vex_class=lis_vex_class?lis_vex_class:"vex-theme-bottom-right-corner",function(){var $=jQuery,subscribe={};subscribe.vex=void 0,subscribe.init=function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open(),$(window).scroll(function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open()})},subscribe.open=function(){return subscribe.vex?subscribe._open():(subscribe.vex=vex.dialog.open({showCloseButton:!0,className:"leadin-subscribe "+lis_vex_class,message:"<h4>"+lis_heading+"</h4><p>"+lis_desc+"</p>",input:'<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" />'+(parseInt(lis_show_names)?'<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" />':"")+(parseInt(lis_show_phone)?'<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" />':""),buttons:[$.extend({},vex.dialog.buttons.YES,{text:lis_btn_label?lis_btn_label:"SUBSCRIBE"})],onSubmit:function(){$subscribe_form=$(this),$subscribe_form.find("input.error").removeClass("error");var form_validated=!0;return $subscribe_form.find("input").each(function(){var $input=$(this);$input.val()||($input.addClass("error"),form_validated=!1)}),form_validated?($(".vex-dialog-form").fadeOut(300,function(){$(".vex-dialog-form").html('<div class="vex-close"></div><h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3><div id="powered-by-leadin-thank-you"><span class="powered-by">Powered by Leadin</span><a href="http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=email&utm_source='+window.location.host+'"><img alt="Leadin" height="20px" width="99px" src="'+document.location.protocol+'//leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a></div>').css("text-align","center").fadeIn(250)}),leadin_submit_form($(".leadin-subscribe form"),$),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),!1):!1},callback:function(data){data===!1&&$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})}}),void $(".leadin-subscribe form.vex-dialog-form").append('<a href="http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=widget&utm_source='+document.URL+'" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by Leadin</a>'))},subscribe._open=function(){subscribe.vex.parent().removeClass("vex-closing")},subscribe.close=function(){subscribe.vex&&subscribe.vex.parent().addClass("vex-closing")},subscribe.init(),window.subscribe=subscribe}()}function leadin_subscribe_check_mobile($){var is_mobile=!1;return"none"==$("#leadin-subscribe-mobile-check").css("display")&&(is_mobile=!0),is_mobile}function leadin_subscribe_show(){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_subscribe_show"},success:function(){},error:function(){}})}function leadin_get_parameter_by_name(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}(function(){var vexFactory;vexFactory=function($){var animationEndSupport,vex;return animationEndSupport=!1,$(function(){var s;return s=(document.body||document.documentElement).style,animationEndSupport=void 0!==s.animation||void 0!==s.WebkitAnimation||void 0!==s.MozAnimation||void 0!==s.MsAnimation||void 0!==s.OAnimation,$(window).bind("keyup.vex",function(event){return 27===event.keyCode?vex.closeByEscape():void 0})}),vex={globalID:1,animationEndEvent:"animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",baseClassNames:{vex:"vex",content:"vex-content",overlay:"vex-overlay",close:"vex-close",closing:"vex-closing",open:"vex-open"},defaultOptions:{content:"",showCloseButton:!0,escapeButtonCloses:!0,overlayClosesOnClick:!0,appendLocation:"body",className:"",css:{},overlayClassName:"",overlayCSS:{},contentClassName:"",contentCSS:{},closeClassName:"",closeCSS:{}},open:function(options){return options=$.extend({},vex.defaultOptions,options),options.id=vex.globalID,vex.globalID+=1,options.$vex=$("<div>").addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({vex:options}),options.$vexOverlay=$("<div>").addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({vex:options}),options.overlayClosesOnClick&&options.$vexOverlay.bind("click.vex",function(e){return e.target===this?vex.close($(this).data().vex.id):void 0}),options.$vex.append(options.$vexOverlay),options.$vexContent=$("<div>").addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).append(options.content).data({vex:options}),options.$vex.append(options.$vexContent),options.showCloseButton&&(options.$closeButton=$("<div>").addClass(vex.baseClassNames.close).addClass(options.closeClassName).css(options.closeCSS).data({vex:options}).bind("click.vex",function(){return vex.close($(this).data().vex.id)}),options.$vexContent.append(options.$closeButton)),$(options.appendLocation).append(options.$vex),vex.setupBodyClassName(options.$vex),options.afterOpen&&options.afterOpen(options.$vexContent,options),setTimeout(function(){return options.$vexContent.trigger("vexOpen",options)},0),options.$vexContent},getAllVexes:function(){return $("."+vex.baseClassNames.vex+':not(".'+vex.baseClassNames.closing+'") .'+vex.baseClassNames.content)},getVexByID:function(id){return vex.getAllVexes().filter(function(){return $(this).data().vex.id===id})},close:function(id){var $lastVex;if(!id){if($lastVex=vex.getAllVexes().last(),!$lastVex.length)return!1;id=$lastVex.data().vex.id}return vex.closeByID(id)},closeAll:function(){var ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?($.each(ids.reverse(),function(index,id){return vex.closeByID(id)}),!0):!1},closeByID:function(id){var $vex,$vexContent,beforeClose,close,options;return $vexContent=vex.getVexByID(id),$vexContent.length?($vex=$vexContent.data().vex.$vex,options=$.extend({},$vexContent.data().vex),beforeClose=function(){return options.beforeClose?options.beforeClose($vexContent,options):void 0},close=function(){return $vexContent.trigger("vexClose",options),$vex.remove(),options.afterClose?options.afterClose($vexContent,options):void 0},animationEndSupport?(beforeClose(),$vex.unbind(vex.animationEndEvent).bind(vex.animationEndEvent,function(){return close()}).addClass(vex.baseClassNames.closing)):(beforeClose(),close()),!0):void 0},closeByEscape:function(){var $lastVex,id,ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?(id=Math.max.apply(Math,ids),$lastVex=vex.getVexByID(id),$lastVex.data().vex.escapeButtonCloses!==!0?!1:vex.closeByID(id)):!1},setupBodyClassName:function($vex){return $vex.bind("vexOpen.vex",function(){return $("body").addClass(vex.baseClassNames.open)}).bind("vexClose.vex",function(){return vex.getAllVexes().length?void 0:$("body").removeClass(vex.baseClassNames.open)})},hideLoading:function(){return $(".vex-loading-spinner").remove()},showLoading:function(){return vex.hideLoading(),$("body").append('<div class="vex-loading-spinner '+vex.defaultOptions.className+'"></div>')}}},"function"==typeof define&&define.amd?define(["jquery"],vexFactory):"object"==typeof exports?module.exports=vexFactory(require("jquery")):window.vex=vexFactory(jQuery)}).call(this),function(){var vexDialogFactory;vexDialogFactory=function($,vex){var $formToObject,dialog;return null==vex?$.error("Vex is required to use vex.dialog"):($formToObject=function($form){var object;return object={},$.each($form.serializeArray(),function(){return object[this.name]?(object[this.name].push||(object[this.name]=[object[this.name]]),object[this.name].push(this.value||"")):object[this.name]=this.value||""}),object},dialog={},dialog.buttons={YES:{text:"OK",type:"submit",className:"vex-dialog-button-primary"},NO:{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function($vexContent){return $vexContent.data().vex.value=!1,vex.close($vexContent.data().vex.id)}}},dialog.defaultOptions={callback:function(){},afterOpen:function(){},message:"Message",input:'<input name="vex" type="hidden" value="_vex-empty-value" />',value:!1,buttons:[dialog.buttons.YES,dialog.buttons.NO],showCloseButton:!1,onSubmit:function(event){var $form,$vexContent;return $form=$(this),$vexContent=$form.parent(),event.preventDefault(),event.stopPropagation(),$vexContent.data().vex.value=dialog.getFormValueOnSubmit($formToObject($form)),vex.close($vexContent.data().vex.id)},focusFirstInput:!0},dialog.defaultAlertOptions={message:"Alert",buttons:[dialog.buttons.YES]},dialog.defaultConfirmOptions={message:"Confirm"},dialog.open=function(options){var $vexContent;return options=$.extend({},vex.defaultOptions,dialog.defaultOptions,options),options.content=dialog.buildDialogForm(options),options.beforeClose=function($vexContent){return options.callback($vexContent.data().vex.value)},$vexContent=vex.open(options),options.focusFirstInput&&$vexContent.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus(),$vexContent},dialog.alert=function(options){return"string"==typeof options&&(options={message:options}),options=$.extend({},dialog.defaultAlertOptions,options),dialog.open(options)},dialog.confirm=function(options){return"string"==typeof options?$.error("dialog.confirm(options) requires options.callback."):(options=$.extend({},dialog.defaultConfirmOptions,options),dialog.open(options))},dialog.prompt=function(options){var defaultPromptOptions;return"string"==typeof options?$.error("dialog.prompt(options) requires options.callback."):(defaultPromptOptions={message:'<label for="vex">'+(options.label||"Prompt:")+"</label>",input:'<input name="vex" type="text" class="vex-dialog-prompt-input" placeholder="'+(options.placeholder||"")+'" value="'+(options.value||"")+'" />'},options=$.extend({},defaultPromptOptions,options),dialog.open(options))},dialog.buildDialogForm=function(options){var $form,$input,$message;return $form=$('<form class="vex-dialog-form" />'),$message=$('<div class="vex-dialog-message" />'),$input=$('<div class="vex-dialog-input" />'),$form.append($message.append(options.message)).append($input.append(options.input)).append(dialog.buttonsToDOM(options.buttons)).bind("submit.vex",options.onSubmit),$form},dialog.getFormValueOnSubmit=function(formData){return formData.vex||""===formData.vex?"_vex-empty-value"===formData.vex?!0:formData.vex:formData},dialog.buttonsToDOM=function(buttons){var $buttons;return $buttons=$('<div class="vex-dialog-buttons" />'),$.each(buttons,function(index,button){return $buttons.append($('<input type="'+button.type+'" />').val(button.text).addClass(button.className+" vex-dialog-button "+(0===index?"vex-first ":"")+(index===buttons.length-1?"vex-last ":"")).bind("click.vex",function(e){return button.click?button.click($(this).parents("."+vex.baseClassNames.content),e):void 0}))}),$buttons},dialog)},"function"==typeof define&&define.amd?define(["jquery","vex"],vexDialogFactory):"object"==typeof exports?module.exports=vexDialogFactory(require("jquery"),require("vex")):window.vex.dialog=vexDialogFactory(window.jQuery,window.vex)}.call(this);var ignore_date=new Date;ignore_date.setTime(ignore_date.getTime()+12096e5),jQuery(document).ready(function($){var li_subscribe_flag=$.cookie("li_subscribe"),preview_subscribe=leadin_get_parameter_by_name("preview-subscribe");leadin_subscribe_check_mobile($)||preview_subscribe?preview_subscribe&&(bind_leadin_subscribe_widget(leadin_get_parameter_by_name("lis_heading"),leadin_get_parameter_by_name("lis_desc"),leadin_get_parameter_by_name("lis_show_names"),leadin_get_parameter_by_name("lis_show_phone"),leadin_get_parameter_by_name("lis_btn_label"),leadin_get_parameter_by_name("lis_vex_class")),subscribe.open()):li_subscribe_flag?"show"==li_subscribe_flag&&bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-vex-class").val()):leadin_check_visitor_status($.cookie("li_hash"),function(data){"vex_set"!=data?($.cookie("li_subscribe","show",{path:"/",domain:""}),bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-vex-class").val())):$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})})});
1
+ function bind_leadin_subscribe_widget(lis_heading,lis_desc,lis_show_names,lis_show_phone,lis_btn_label,lis_vex_class){lis_heading=lis_heading?lis_heading:"Sign up for email updates",lis_desc=lis_desc?lis_desc:"",lis_btn_label=lis_btn_label?lis_btn_label:"SUBSCRIBE",lis_vex_class=lis_vex_class?lis_vex_class:"vex-theme-bottom-right-corner",function(){var $=jQuery,subscribe={};subscribe.vex=void 0,subscribe.init=function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open(),$(window).scroll(function(){$(window).scrollTop()+$(window).height()>$(document).height()/2&&subscribe.open()})},subscribe.open=function(){return subscribe.vex?subscribe._open():(subscribe.vex=vex.dialog.open({showCloseButton:!0,className:"leadin-subscribe "+lis_vex_class,message:"<h4>"+lis_heading+"</h4><p>"+lis_desc+"</p>",input:'<input id="leadin-subscribe-email" name="email" type="email" placeholder="Email address" />'+(parseInt(lis_show_names)?'<input id="leadin-subscribe-fname" name="fname" type="text" placeholder="First Name" /><input id="leadin-subscribe-lname" name="lname" type="text" placeholder="Last Name" />':"")+(parseInt(lis_show_phone)?'<input id="leadin-subscribe-phone" name="phone" type="tel" placeholder="Phone" />':""),buttons:[$.extend({},vex.dialog.buttons.YES,{text:lis_btn_label?lis_btn_label:"SUBSCRIBE"})],onSubmit:function(){$subscribe_form=$(this),$subscribe_form.find("input.error").removeClass("error");var form_validated=!0;return $subscribe_form.find("input").each(function(){var $input=$(this);$input.val()||($input.addClass("error"),form_validated=!1)}),form_validated?($(".vex-dialog-form").fadeOut(300,function(){$(".vex-dialog-form").html('<div class="vex-close"></div><h3>Thanks!<br>You should receive a confirmation email in your inbox shortly.</h3><div id="powered-by-leadin-thank-you"><span class="powered-by">Powered by Leadin</span><a href="http://leadin.com/wordpress-subscribe-widget-plugin/?utm_campaign=subscribe_widget&utm_medium=email&utm_source='+window.location.host+'"><img alt="Leadin" height="20px" width="99px" src="'+document.location.protocol+'//leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/Leadin_logo@2x.png" alt="leadin.com"/></a></div>').css("text-align","center").fadeIn(250)}),leadin_submit_form($(".leadin-subscribe form"),$),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),!1):!1},callback:function(data){data===!1&&$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date}),$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})}}),void $(".leadin-subscribe form.vex-dialog-form").append('<a href="http://leadin.com/wordpress-subscribe-widget-plugin/?utm_campaign=subscribe_widget&utm_medium=widget&utm_source='+document.URL+'" id="leadin-subscribe-powered-by" class="leadin-subscribe-powered-by">Powered by Leadin</a>'))},subscribe._open=function(){subscribe.vex.parent().removeClass("vex-closing")},subscribe.close=function(){subscribe.vex&&subscribe.vex.parent().addClass("vex-closing")},subscribe.init(),window.subscribe=subscribe}()}function leadin_subscribe_check_mobile($){var is_mobile=!1;return"none"==$("#leadin-subscribe-mobile-check").css("display")&&(is_mobile=!0),is_mobile}function leadin_subscribe_show(){jQuery.ajax({type:"POST",url:li_ajax.ajax_url,data:{action:"leadin_subscribe_show"},success:function(){},error:function(){}})}function leadin_get_parameter_by_name(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return null==results?"":decodeURIComponent(results[1].replace(/\+/g," "))}(function(){var vexFactory;vexFactory=function($){var animationEndSupport,vex;return animationEndSupport=!1,$(function(){var s;return s=(document.body||document.documentElement).style,animationEndSupport=void 0!==s.animation||void 0!==s.WebkitAnimation||void 0!==s.MozAnimation||void 0!==s.MsAnimation||void 0!==s.OAnimation,$(window).bind("keyup.vex",function(event){return 27===event.keyCode?vex.closeByEscape():void 0})}),vex={globalID:1,animationEndEvent:"animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",baseClassNames:{vex:"vex",content:"vex-content",overlay:"vex-overlay",close:"vex-close",closing:"vex-closing",open:"vex-open"},defaultOptions:{content:"",showCloseButton:!0,escapeButtonCloses:!0,overlayClosesOnClick:!0,appendLocation:"body",className:"",css:{},overlayClassName:"",overlayCSS:{},contentClassName:"",contentCSS:{},closeClassName:"",closeCSS:{}},open:function(options){return options=$.extend({},vex.defaultOptions,options),options.id=vex.globalID,vex.globalID+=1,options.$vex=$("<div>").addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({vex:options}),options.$vexOverlay=$("<div>").addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({vex:options}),options.overlayClosesOnClick&&options.$vexOverlay.bind("click.vex",function(e){return e.target===this?vex.close($(this).data().vex.id):void 0}),options.$vex.append(options.$vexOverlay),options.$vexContent=$("<div>").addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).append(options.content).data({vex:options}),options.$vex.append(options.$vexContent),options.showCloseButton&&(options.$closeButton=$("<div>").addClass(vex.baseClassNames.close).addClass(options.closeClassName).css(options.closeCSS).data({vex:options}).bind("click.vex",function(){return vex.close($(this).data().vex.id)}),options.$vexContent.append(options.$closeButton)),$(options.appendLocation).append(options.$vex),vex.setupBodyClassName(options.$vex),options.afterOpen&&options.afterOpen(options.$vexContent,options),setTimeout(function(){return options.$vexContent.trigger("vexOpen",options)},0),options.$vexContent},getAllVexes:function(){return $("."+vex.baseClassNames.vex+':not(".'+vex.baseClassNames.closing+'") .'+vex.baseClassNames.content)},getVexByID:function(id){return vex.getAllVexes().filter(function(){return $(this).data().vex.id===id})},close:function(id){var $lastVex;if(!id){if($lastVex=vex.getAllVexes().last(),!$lastVex.length)return!1;id=$lastVex.data().vex.id}return vex.closeByID(id)},closeAll:function(){var ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?($.each(ids.reverse(),function(index,id){return vex.closeByID(id)}),!0):!1},closeByID:function(id){var $vex,$vexContent,beforeClose,close,options;return $vexContent=vex.getVexByID(id),$vexContent.length?($vex=$vexContent.data().vex.$vex,options=$.extend({},$vexContent.data().vex),beforeClose=function(){return options.beforeClose?options.beforeClose($vexContent,options):void 0},close=function(){return $vexContent.trigger("vexClose",options),$vex.remove(),options.afterClose?options.afterClose($vexContent,options):void 0},animationEndSupport?(beforeClose(),$vex.unbind(vex.animationEndEvent).bind(vex.animationEndEvent,function(){return close()}).addClass(vex.baseClassNames.closing)):(beforeClose(),close()),!0):void 0},closeByEscape:function(){var $lastVex,id,ids;return ids=vex.getAllVexes().map(function(){return $(this).data().vex.id}).toArray(),(null!=ids?ids.length:void 0)?(id=Math.max.apply(Math,ids),$lastVex=vex.getVexByID(id),$lastVex.data().vex.escapeButtonCloses!==!0?!1:vex.closeByID(id)):!1},setupBodyClassName:function($vex){return $vex.bind("vexOpen.vex",function(){return $("body").addClass(vex.baseClassNames.open)}).bind("vexClose.vex",function(){return vex.getAllVexes().length?void 0:$("body").removeClass(vex.baseClassNames.open)})},hideLoading:function(){return $(".vex-loading-spinner").remove()},showLoading:function(){return vex.hideLoading(),$("body").append('<div class="vex-loading-spinner '+vex.defaultOptions.className+'"></div>')}}},"function"==typeof define&&define.amd?define(["jquery"],vexFactory):"object"==typeof exports?module.exports=vexFactory(require("jquery")):window.vex=vexFactory(jQuery)}).call(this),function(){var vexDialogFactory;vexDialogFactory=function($,vex){var $formToObject,dialog;return null==vex?$.error("Vex is required to use vex.dialog"):($formToObject=function($form){var object;return object={},$.each($form.serializeArray(),function(){return object[this.name]?(object[this.name].push||(object[this.name]=[object[this.name]]),object[this.name].push(this.value||"")):object[this.name]=this.value||""}),object},dialog={},dialog.buttons={YES:{text:"OK",type:"submit",className:"vex-dialog-button-primary"},NO:{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function($vexContent){return $vexContent.data().vex.value=!1,vex.close($vexContent.data().vex.id)}}},dialog.defaultOptions={callback:function(){},afterOpen:function(){},message:"Message",input:'<input name="vex" type="hidden" value="_vex-empty-value" />',value:!1,buttons:[dialog.buttons.YES,dialog.buttons.NO],showCloseButton:!1,onSubmit:function(event){var $form,$vexContent;return $form=$(this),$vexContent=$form.parent(),event.preventDefault(),event.stopPropagation(),$vexContent.data().vex.value=dialog.getFormValueOnSubmit($formToObject($form)),vex.close($vexContent.data().vex.id)},focusFirstInput:!0},dialog.defaultAlertOptions={message:"Alert",buttons:[dialog.buttons.YES]},dialog.defaultConfirmOptions={message:"Confirm"},dialog.open=function(options){var $vexContent;return options=$.extend({},vex.defaultOptions,dialog.defaultOptions,options),options.content=dialog.buildDialogForm(options),options.beforeClose=function($vexContent){return options.callback($vexContent.data().vex.value)},$vexContent=vex.open(options),options.focusFirstInput&&$vexContent.find('input[type="submit"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus(),$vexContent},dialog.alert=function(options){return"string"==typeof options&&(options={message:options}),options=$.extend({},dialog.defaultAlertOptions,options),dialog.open(options)},dialog.confirm=function(options){return"string"==typeof options?$.error("dialog.confirm(options) requires options.callback."):(options=$.extend({},dialog.defaultConfirmOptions,options),dialog.open(options))},dialog.prompt=function(options){var defaultPromptOptions;return"string"==typeof options?$.error("dialog.prompt(options) requires options.callback."):(defaultPromptOptions={message:'<label for="vex">'+(options.label||"Prompt:")+"</label>",input:'<input name="vex" type="text" class="vex-dialog-prompt-input" placeholder="'+(options.placeholder||"")+'" value="'+(options.value||"")+'" />'},options=$.extend({},defaultPromptOptions,options),dialog.open(options))},dialog.buildDialogForm=function(options){var $form,$input,$message;return $form=$('<form class="vex-dialog-form" />'),$message=$('<div class="vex-dialog-message" />'),$input=$('<div class="vex-dialog-input" />'),$form.append($message.append(options.message)).append($input.append(options.input)).append(dialog.buttonsToDOM(options.buttons)).bind("submit.vex",options.onSubmit),$form},dialog.getFormValueOnSubmit=function(formData){return formData.vex||""===formData.vex?"_vex-empty-value"===formData.vex?!0:formData.vex:formData},dialog.buttonsToDOM=function(buttons){var $buttons;return $buttons=$('<div class="vex-dialog-buttons" />'),$.each(buttons,function(index,button){return $buttons.append($('<input type="'+button.type+'" />').val(button.text).addClass(button.className+" vex-dialog-button "+(0===index?"vex-first ":"")+(index===buttons.length-1?"vex-last ":"")).bind("click.vex",function(e){return button.click?button.click($(this).parents("."+vex.baseClassNames.content),e):void 0}))}),$buttons},dialog)},"function"==typeof define&&define.amd?define(["jquery","vex"],vexDialogFactory):"object"==typeof exports?module.exports=vexDialogFactory(require("jquery"),require("vex")):window.vex.dialog=vexDialogFactory(window.jQuery,window.vex)}.call(this);var ignore_date=new Date;ignore_date.setTime(ignore_date.getTime()+12096e5),jQuery(document).ready(function($){var li_subscribe_flag=$.cookie("li_subscribe"),preview_subscribe=leadin_get_parameter_by_name("preview-subscribe");leadin_subscribe_check_mobile($)||preview_subscribe?preview_subscribe&&(bind_leadin_subscribe_widget(leadin_get_parameter_by_name("lis_heading"),leadin_get_parameter_by_name("lis_desc"),leadin_get_parameter_by_name("lis_show_names"),leadin_get_parameter_by_name("lis_show_phone"),leadin_get_parameter_by_name("lis_btn_label"),leadin_get_parameter_by_name("lis_vex_class")),subscribe.open()):li_subscribe_flag?"show"==li_subscribe_flag&&bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-vex-class").val()):leadin_check_visitor_status($.cookie("li_hash"),function(data){"vex_set"!=data?($.cookie("li_subscribe","show",{path:"/",domain:""}),bind_leadin_subscribe_widget($("#leadin-subscribe-heading").val(),$("#leadin-subscribe-text").val(),$("#leadin-subscribe-name-fields").val(),$("#leadin-subscribe-phone-field").val(),$("#leadin-subscribe-btn-label").val(),$("#leadin-subscribe-vex-class").val())):$.cookie("li_subscribe","ignore",{path:"/",domain:"",expires:ignore_date})})});
inc/class-emailer.php CHANGED
@@ -231,7 +231,7 @@ class LI_Emailer {
231
  * @return string footer content
232
  */
233
  function build_enrichment_data ( ) {
234
- $built_enrichment_data = '<table class="row contact-details" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="twelve columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 580px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><h2 class="data-lookup-header" style="color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;font-size: 20px;margin-bottom: 15px;">Data Lookup</h2><p class="data-lookup-limit" style="margin: 0;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;"><a href="http://leadin.com/pro-upgrade?utm_campaign=repo_plugin">Upgrade to Leadin Pro for free</a> to get unlimited data lookups!</p></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
235
 
236
  return $built_enrichment_data;
237
  }
@@ -363,7 +363,7 @@ class LI_Emailer {
363
  $powered_by = '';
364
 
365
  $powered_by .= "<table class='row section' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;display: block;margin-top: 20px;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 0 0px 0 0;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='padding: 10px 20px;' align='left' valign='top'><table style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;overflow: hidden;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;display: block;width: auto !important;font-size: 16px;padding: 10px 20px;' align='center' valign='top'>";
366
- $powered_by .="<div style='font-size: 11px; color: #888; padding: 0 0 5px 0;'>Powered by</div><a href='http://leadin.com/wordpress-subscribe-widget/?utm_campaign=subscribe_widget&utm_medium=email&utm_source=" . get_bloginfo('wpurl') . "'><img alt='Leadin' height='20px' width='99px' src='http://leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/leadin_logo_small_grey.png' alt='leadin.com'/></a>";
367
  $powered_by .= "</td></tr></table></td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;padding: 0;border: 0;' align='left' valign='top'></td></tr></table></td></tr></table>";
368
 
369
  return $powered_by;
231
  * @return string footer content
232
  */
233
  function build_enrichment_data ( ) {
234
+ $built_enrichment_data = '<table class="row contact-details" style="border-spacing: 0;border-collapse: collapse;padding: 0px;vertical-align: top;text-align: left;width: 100%%;position: relative;display: block;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="wrapper last" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 10px 20px 0px 0px;vertical-align: top;text-align: left;position: relative;padding-right: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><table class="twelve columns" style="border-spacing: 0;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;margin: 0 auto;width: 580px;"><tr style="padding: 0;vertical-align: top;text-align: left;"><td class="text-pad" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0px 0px 10px;vertical-align: top;text-align: left;padding-left: 10px;padding-right: 10px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"><h2 class="data-lookup-header" style="color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;font-size: 20px;margin-bottom: 15px;">Data Lookup</h2><p class="data-lookup-limit" style="margin: 0;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px;margin-bottom: 10px;"><a href="http://leadin.com/pro-upgrade/?utm_source=Leadin%20Repo%20Plugin&utm_medium=New%20Contact%20Email&utm_campaign=Repo">Upgrade to Leadin Pro for free</a> to get unlimited data lookups!</p></td><td class="expander" style="word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse;padding: 0;vertical-align: top;text-align: left;visibility: hidden;width: 0px;color: #222222;font-family: Helvetica, Arial, sans-serif;font-weight: normal;margin: 0;line-height: 19px;font-size: 14px;"></td></tr></table></td></tr></table>';
235
 
236
  return $built_enrichment_data;
237
  }
363
  $powered_by = '';
364
 
365
  $powered_by .= "<table class='row section' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;position: relative;display: block;margin-top: 20px;padding: 0px;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td class='wrapper last' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;position: relative;padding: 0 0px 0 0;' align='left' valign='top'><table class='twelve columns' style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 580px;margin: 0 auto;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='padding: 10px 20px;' align='left' valign='top'><table style='border-spacing: 0;border-collapse: collapse;vertical-align: top;text-align: left;width: 100%;overflow: hidden;padding: 0;'><tr style='vertical-align: top;text-align: left;padding: 0;' align='left'><td style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: center;display: block;width: auto !important;font-size: 16px;padding: 10px 20px;' align='center' valign='top'>";
366
+ $powered_by .="<div style='font-size: 11px; color: #888; padding: 0 0 5px 0;'>Powered by</div><a href='http://leadin.com/wordpress-subscribe-widget-plugin/?utm_campaign=subscribe_widget&utm_medium=email&utm_source=" . get_bloginfo('wpurl') . "'><img alt='Leadin' height='20px' width='99px' src='http://leadin.com/wp-content/themes/LeadIn-WP-Theme/library/images/logos/leadin_logo_small_grey.png' alt='leadin.com'/></a>";
367
  $powered_by .= "</td></tr></table></td><td class='expander' style='word-break: break-word;-webkit-hyphens: auto;-moz-hyphens: auto;hyphens: auto;border-collapse: collapse !important;vertical-align: top;text-align: left;visibility: hidden;width: 0px;padding: 0;border: 0;' align='left' valign='top'></td></tr></table></td></tr></table>";
368
 
369
  return $powered_by;
inc/class-leadin.php CHANGED
@@ -19,15 +19,14 @@ class WPLeadIn {
19
  $this->power_ups = self::get_available_power_ups();
20
 
21
  if ( is_user_logged_in() )
 
22
  add_action('admin_bar_menu', array($this, 'add_leadin_link_to_admin_bar'), 999);
 
23
 
24
  if ( is_admin() )
25
  {
26
  if ( ! defined('DOING_AJAX') || ! DOING_AJAX )
27
- {
28
- if ( current_user_can('manage_options') )
29
- $li_wp_admin = new WPLeadInAdmin($this->power_ups);
30
- }
31
  }
32
  else
33
  {
@@ -36,8 +35,6 @@ class WPLeadIn {
36
  else
37
  add_action('wp_enqueue_scripts', array($this, 'add_leadin_frontend_scripts'));
38
  }
39
-
40
- //add_action( 'admin_notices', array($this, 'deactivate_leadin_notice') );
41
  }
42
 
43
  //=============================================
@@ -64,9 +61,16 @@ class WPLeadIn {
64
  /**
65
  * Adds Leadin link to top-level admin bar
66
  */
67
- function add_leadin_link_to_admin_bar( $wp_admin_bar ) {
 
68
  global $wp_version;
69
 
 
 
 
 
 
 
70
  $args = array(
71
  'id' => 'leadin-admin-menu',
72
  'title' => '<span class="ab-icon" '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? ' style="margin-top: 3px;"' : ''). '><img src="' . content_url() . '/plugins/leadin/images/leadin-svg-icon.svg" style="height:16px; width:16px;"></span><span class="ab-label">Leadin</span>', // alter the title of existing node
19
  $this->power_ups = self::get_available_power_ups();
20
 
21
  if ( is_user_logged_in() )
22
+ {
23
  add_action('admin_bar_menu', array($this, 'add_leadin_link_to_admin_bar'), 999);
24
+ }
25
 
26
  if ( is_admin() )
27
  {
28
  if ( ! defined('DOING_AJAX') || ! DOING_AJAX )
29
+ $li_wp_admin = new WPLeadInAdmin($this->power_ups);
 
 
 
30
  }
31
  else
32
  {
35
  else
36
  add_action('wp_enqueue_scripts', array($this, 'add_leadin_frontend_scripts'));
37
  }
 
 
38
  }
39
 
40
  //=============================================
61
  /**
62
  * Adds Leadin link to top-level admin bar
63
  */
64
+ function add_leadin_link_to_admin_bar ( $wp_admin_bar )
65
+ {
66
  global $wp_version;
67
 
68
+ if ( ! current_user_can('activate_plugins') )
69
+ {
70
+ if ( ! array_key_exists('li_grant_access_to_' . leadin_get_user_role(), get_option('leadin_options') ) )
71
+ return FALSE;
72
+ }
73
+
74
  $args = array(
75
  'id' => 'leadin-admin-menu',
76
  'title' => '<span class="ab-icon" '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? ' style="margin-top: 3px;"' : ''). '><img src="' . content_url() . '/plugins/leadin/images/leadin-svg-icon.svg" style="height:16px; width:16px;"></span><span class="ab-label">Leadin</span>', // alter the title of existing node
leadin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Leadin
4
  Plugin URI: http://leadin.com
5
  Description: Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
6
- Version: 2.2.8
7
  Author: Andy Cook, Nelson Joyce
8
  Author URI: http://leadin.com
9
  License: GPL2
@@ -26,7 +26,7 @@ if ( !defined('LEADIN_DB_VERSION') )
26
  define('LEADIN_DB_VERSION', '2.2.4');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
- define('LEADIN_PLUGIN_VERSION', '2.2.8');
30
 
31
  if ( !defined('MC_KEY') )
32
  define('MC_KEY', '934aaed05049dde737d308be26167eef-us3');
@@ -55,15 +55,6 @@ require_once(LEADIN_PLUGIN_DIR . '/power-ups/constant-contact-connect.php');
55
  // Hooks & Filters
56
  //=============================================
57
 
58
- // Activate + install Leadin
59
- register_activation_hook( __FILE__, 'activate_leadin');
60
-
61
- // Deactivate Leadin
62
- register_deactivation_hook( __FILE__, 'deactivate_leadin');
63
-
64
- // Activate on newly created wpmu blog
65
- add_action('wpmu_new_blog', 'activate_leadin_on_new_blog', 10, 6);
66
-
67
  /**
68
  * Activate the plugin
69
  */
@@ -95,8 +86,10 @@ function activate_leadin ( $network_wide )
95
  // Store the array for a later function
96
  update_site_option('leadin_activated', $activated);
97
  }
98
-
99
- add_leadin_defaults();
 
 
100
  }
101
 
102
  /**
@@ -124,7 +117,19 @@ function add_leadin_defaults ( )
124
  'names_added_to_contacts' => 1
125
  );
126
 
127
- update_option('leadin_options', $opt);
 
 
 
 
 
 
 
 
 
 
 
 
128
  leadin_db_install();
129
 
130
  $multisite_prefix = ( is_multisite() ? $wpdb->prefix : '' );
3
  Plugin Name: Leadin
4
  Plugin URI: http://leadin.com
5
  Description: Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
6
+ Version: 2.2.9
7
  Author: Andy Cook, Nelson Joyce
8
  Author URI: http://leadin.com
9
  License: GPL2
26
  define('LEADIN_DB_VERSION', '2.2.4');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
+ define('LEADIN_PLUGIN_VERSION', '2.2.9');
30
 
31
  if ( !defined('MC_KEY') )
32
  define('MC_KEY', '934aaed05049dde737d308be26167eef-us3');
55
  // Hooks & Filters
56
  //=============================================
57
 
 
 
 
 
 
 
 
 
 
58
  /**
59
  * Activate the plugin
60
  */
86
  // Store the array for a later function
87
  update_site_option('leadin_activated', $activated);
88
  }
89
+ else
90
+ {
91
+ add_leadin_defaults();
92
+ }
93
  }
94
 
95
  /**
117
  'names_added_to_contacts' => 1
118
  );
119
 
120
+ // this is a hack because multisite doesn't recognize local options using either update_option or update_site_option...
121
+ if ( is_multisite() )
122
+ {
123
+ $multisite_prefix = ( is_multisite() ? $wpdb->prefix : '' );
124
+ $q = $wpdb->prepare("
125
+ INSERT INTO " . $multisite_prefix . "options
126
+ ( option_name, option_value )
127
+ VALUES ('leadin_options', %s)", serialize($opt));
128
+ $wpdb->query($q);
129
+ }
130
+ else
131
+ update_option('leadin_options', $opt);
132
+
133
  leadin_db_install();
134
 
135
  $multisite_prefix = ( is_multisite() ? $wpdb->prefix : '' );
power-ups/beta-program/admin/beta-program-admin.php CHANGED
@@ -25,6 +25,8 @@ class WPLeadInBetaAdmin extends WPLeadInAdmin {
25
 
26
  if ( is_admin() )
27
  {
 
 
28
  $this->options = get_option('leadin_options');
29
 
30
  $this->power_up_icon = '<span class="dashicons dashicons-admin-generic"></span>';
25
 
26
  if ( is_admin() )
27
  {
28
+ return FALSE;
29
+
30
  $this->options = get_option('leadin_options');
31
 
32
  $this->power_up_icon = '<span class="dashicons dashicons-admin-generic"></span>';
power-ups/contacts/admin/contacts-admin.php CHANGED
@@ -317,7 +317,7 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
317
  echo '<h4 class="leain-meta-header leadin-premium-tag">Social Info</h4>';
318
  echo '<table class="leadin-meta-table"><tbody>';
319
  echo '<tr>';
320
- echo '<td><a href="http://leadin.com/pro-upgrade?utm_campaign=repo_plugin" target="_blank">Upgrade to Leadin Pro for free</a> to get social info</td>';
321
  echo '</tr>';
322
  echo '</tbody></table>';
323
  echo '</div>'; // leadin-meta-section
@@ -325,7 +325,7 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
325
  echo '<h4 class="leain-meta-header leadin-premium-tag">Company Info</h4>';
326
  echo '<table class="leadin-meta-table"><tbody>';
327
  echo '<tr>';
328
- echo '<td><a href="http://leadin.com/pro-upgrade?utm_campaign=repo_plugin" target="_blank">Upgrade to Leadin Pro for free</a> to get company info</td>';
329
  echo '</tr>';
330
  echo '</tbody></table>';
331
  echo '</div>'; // leadin-meta-section
317
  echo '<h4 class="leain-meta-header leadin-premium-tag">Social Info</h4>';
318
  echo '<table class="leadin-meta-table"><tbody>';
319
  echo '<tr>';
320
+ echo '<td><a href="http://leadin.com/pro-upgrade/?utm_source=Leadin%20Repo%20Plugin&utm_medium=Contact%20Detail%20Screen&utm_campaign=Repo" target="_blank">Upgrade to Leadin Pro for free</a> to get social info</td>';
321
  echo '</tr>';
322
  echo '</tbody></table>';
323
  echo '</div>'; // leadin-meta-section
325
  echo '<h4 class="leain-meta-header leadin-premium-tag">Company Info</h4>';
326
  echo '<table class="leadin-meta-table"><tbody>';
327
  echo '<tr>';
328
+ echo '<td><a href="http://leadin.com/pro-upgrade/?utm_source=Leadin%20Repo%20Plugin&utm_medium=Contact%20Detail%20Screen&utm_campaign=Repo" target="_blank">Upgrade to Leadin Pro for free</a> to get company info</td>';
329
  echo '</tr>';
330
  echo '</tbody></table>';
331
  echo '</div>'; // leadin-meta-section
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: andygcook, nelsonjoyce
3
  Tags: crm, contacts, lead tracking, click tracking, visitor tracking, analytics, marketing automation, inbound marketing, subscription, marketing, lead generation, mailchimp, constant contact, newsletter, popup, popover, email list, email, contacts database, contact form, forms, form widget, popup form
4
  Requires at least: 3.7
5
- Tested up to: 4.0
6
- Stable tag: 2.2.8
7
 
8
  Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
9
 
@@ -107,8 +107,18 @@ You betcha! Leadin should work just fine on Multisite right out-of-the-box witho
107
 
108
  == Changelog ==
109
 
110
- - Current version: 2.2.8
111
- - Current version release: 2014-12-15
 
 
 
 
 
 
 
 
 
 
112
 
113
  = 2.2.8 (2014.12.15) =
114
  = Enhancements =
2
  Contributors: andygcook, nelsonjoyce
3
  Tags: crm, contacts, lead tracking, click tracking, visitor tracking, analytics, marketing automation, inbound marketing, subscription, marketing, lead generation, mailchimp, constant contact, newsletter, popup, popover, email list, email, contacts database, contact form, forms, form widget, popup form
4
  Requires at least: 3.7
5
+ Tested up to: 4.1
6
+ Stable tag: 2.2.9
7
 
8
  Leadin is an easy-to-use marketing automation and lead tracking plugin for WordPress that helps you better understand your web site visitors.
9
 
107
 
108
  == Changelog ==
109
 
110
+ - Current version: 2.2.9
111
+ - Current version release: 2014-01-20
112
+
113
+ = 2.2.9 (2014.01.20) =
114
+ = Enhancements =
115
+ - Added ability to toggle Leadin data access by user role
116
+ - Hide Leadin nav menu item for user roles without access to Leadin data
117
+ - Discountinued and disabled the beta program
118
+
119
+ - Bug fixes
120
+ - Fixed broken onboarding in WordPress Multisite after adding a new site to the network
121
+ - Contact totals in tag editor now link to tagged list
122
 
123
  = 2.2.8 (2014.12.15) =
124
  = Enhancements =