HubSpot – Free Marketing Plugin for WordPress - Version 0.9.2

Version Description

(2014.05.16) =

Download this release

Release Info

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

Code changes from version 0.9.1 to 0.9.2

admin/css/leadin-admin.css CHANGED
@@ -285,12 +285,104 @@
285
  background-color: #54cc14;
286
  }
287
 
288
- /* line 1, ../sass/_settings_page.sass */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  #icon-leadin {
290
  background: url("../../images/leadin-icon-32x32.png") top center no-repeat;
291
  }
292
 
293
- /* line 4, ../sass/_settings_page.sass */
294
  .help-notification {
295
  background: #d9edf7;
296
  border: 1px solid #bce8f1;
@@ -300,18 +392,18 @@
300
  border-radius: 3px;
301
  }
302
 
303
- /* line 12, ../sass/_settings_page.sass */
304
  .toplevel_page_leadin_contacts .wp-menu-image img {
305
  width: 16px;
306
  height: 16px;
307
  }
308
 
309
- /* line 16, ../sass/_settings_page.sass */
310
  .leadin-contact-avatar {
311
  margin-right: 10px;
312
  }
313
 
314
- /* line 19, ../sass/_settings_page.sass */
315
  .power-up-settings-icon {
316
  padding-right: 10px;
317
  float: left;
@@ -319,24 +411,24 @@
319
  margin-top: -1px;
320
  }
321
 
322
- /* line 25, ../sass/_settings_page.sass */
323
  .dashicons {
324
  margin-right: 10px;
325
  float: left;
326
  margin-top: -1px;
327
  }
328
 
329
- /* line 30, ../sass/_settings_page.sass */
330
  .steps {
331
  margin: 48px auto 0;
332
  text-align: center;
333
  max-width: 600px;
334
  }
335
- /* line 35, ../sass/_settings_page.sass */
336
  .steps h3, .steps p {
337
  margin: 0;
338
  }
339
- /* line 38, ../sass/_settings_page.sass */
340
  .steps .step-names {
341
  margin: 0;
342
  *zoom: 1;
@@ -347,7 +439,7 @@
347
  display: table;
348
  clear: both;
349
  }
350
- /* line 42, ../sass/_settings_page.sass */
351
  .steps .step-names .step-name {
352
  color: #cccccc;
353
  display: list-item;
@@ -358,27 +450,27 @@
358
  font-size: 16px;
359
  list-style: decimal inside none;
360
  }
361
- /* line 52, ../sass/_settings_page.sass */
362
  .steps .step-names .step-name.active {
363
  color: #1f7d71;
364
  background-image: url(../../images/triangle.png);
365
  background-position: bottom center;
366
  background-repeat: no-repeat;
367
  }
368
- /* line 58, ../sass/_settings_page.sass */
369
  .steps .step-names .step-name.completed {
370
  list-style-image: url(../../images/checkmark.png);
371
  }
372
- /* line 61, ../sass/_settings_page.sass */
373
  .steps .step-content {
374
  margin: 0;
375
  }
376
- /* line 64, ../sass/_settings_page.sass */
377
  .steps .step-content .description {
378
  margin: 10px 0 20px;
379
  display: block;
380
  }
381
- /* line 68, ../sass/_settings_page.sass */
382
  .steps .step {
383
  display: none;
384
  padding: 18px;
@@ -389,36 +481,36 @@
389
  border-radius: 5px;
390
  color: #1f7d71;
391
  }
392
- /* line 76, ../sass/_settings_page.sass */
393
  .steps .step h2 {
394
  color: #1f7d71;
395
  margin-top: 0;
396
  margin-bottom: 18px;
397
  }
398
- /* line 82, ../sass/_settings_page.sass */
399
  .steps .step ol {
400
  text-align: left;
401
  margin-bottom: 18px;
402
  }
403
- /* line 86, ../sass/_settings_page.sass */
404
  .steps .step label {
405
  text-align: right;
406
  }
407
- /* line 89, ../sass/_settings_page.sass */
408
  .steps .step.active {
409
  display: block;
410
  }
411
- /* line 93, ../sass/_settings_page.sass */
412
  .steps .step .form-table th {
413
  display: none;
414
  }
415
- /* line 96, ../sass/_settings_page.sass */
416
  .steps .step .form-table td {
417
  text-align: center;
418
  width: auto;
419
  display: block;
420
  }
421
- /* line 101, ../sass/_settings_page.sass */
422
  .steps .step .form-table input {
423
  width: 100%;
424
  font-size: 16px;
285
  background-color: #54cc14;
286
  }
287
 
288
+ /* line 2, ../sass/_settings_page.sass */
289
+ .li-settings h3 {
290
+ border-left: 1px solid #e5e5e5;
291
+ border-right: 1px solid #e5e5e5;
292
+ border-top: 1px solid #e5e5e5;
293
+ border-bottom: 1px solid #e5e5e5;
294
+ margin-bottom: 0px;
295
+ background: white;
296
+ padding: 8px 12px;
297
+ font-size: 15px;
298
+ }
299
+ /* line 12, ../sass/_settings_page.sass */
300
+ .li-settings .form-table {
301
+ margin-top: 0px;
302
+ border-left: 1px solid #e5e5e5;
303
+ border-right: 1px solid #e5e5e5;
304
+ border-bottom: 1px solid #e5e5e5;
305
+ background-color: white;
306
+ -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
307
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
308
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
309
+ }
310
+ /* line 20, ../sass/_settings_page.sass */
311
+ .li-settings .form-table th {
312
+ padding-left: 12px;
313
+ }
314
+ /* line 23, ../sass/_settings_page.sass */
315
+ .li-settings .leadin-section {
316
+ background-color: white;
317
+ border-left: 1px solid #e5e5e5;
318
+ border-right: 1px solid #e5e5e5;
319
+ font-size: 14px;
320
+ padding: 15px 12px 5px 12px;
321
+ }
322
+ /* line 30, ../sass/_settings_page.sass */
323
+ .li-settings .leadin-section p {
324
+ margin: 0;
325
+ padding: 0;
326
+ }
327
+ /* line 35, ../sass/_settings_page.sass */
328
+ .li-settings.pre-mp6 h3 {
329
+ font-family: Georgia;
330
+ }
331
+ /* line 38, ../sass/_settings_page.sass */
332
+ .li-settings.pre-mp6 select, .li-settings.pre-mp6 input {
333
+ font-family: sans-serif;
334
+ font-size: 12px;
335
+ }
336
+ /* line 42, ../sass/_settings_page.sass */
337
+ .li-settings.pre-mp6 .form-table, .li-settings.pre-mp6 .leadin-section, .li-settings.pre-mp6 h3 {
338
+ background-color: #f9f9f9 !important;
339
+ }
340
+ /* line 45, ../sass/_settings_page.sass */
341
+ .li-settings.pre-mp6 .form-table {
342
+ -moz-border-radius-bottomleft: 3px;
343
+ -webkit-border-bottom-left-radius: 3px;
344
+ border-bottom-left-radius: 3px;
345
+ -moz-border-radius-bottomright: 3px;
346
+ -webkit-border-bottom-right-radius: 3px;
347
+ border-bottom-right-radius: 3px;
348
+ }
349
+ /* line 49, ../sass/_settings_page.sass */
350
+ .li-settings.pre-mp6 h3 {
351
+ background-color: #f9f9f9 !important;
352
+ -moz-border-radius-topleft: 3px;
353
+ -webkit-border-top-left-radius: 3px;
354
+ border-top-left-radius: 3px;
355
+ -moz-border-radius-topright: 3px;
356
+ -webkit-border-top-right-radius: 3px;
357
+ border-top-right-radius: 3px;
358
+ }
359
+ /* line 54, ../sass/_settings_page.sass */
360
+ .li-settings.pre-mp6 .leadin-section {
361
+ font-size: 12px;
362
+ padding-left: 6px;
363
+ }
364
+ /* line 58, ../sass/_settings_page.sass */
365
+ .li-settings.pre-mp6 h3 {
366
+ padding-left: 6px;
367
+ font-weight: normal;
368
+ color: #464646;
369
+ text-shadow: white 0px 1px 0px;
370
+ }
371
+ /* line 64, ../sass/_settings_page.sass */
372
+ .li-settings.pre-mp6 label {
373
+ font-size: 12px;
374
+ }
375
+ /* line 67, ../sass/_settings_page.sass */
376
+ .li-settings.pre-mp6 input[type="checkbox"], .li-settings.pre-mp6 input[type="radio"] {
377
+ margin-right: 2px;
378
+ }
379
+
380
+ /* line 70, ../sass/_settings_page.sass */
381
  #icon-leadin {
382
  background: url("../../images/leadin-icon-32x32.png") top center no-repeat;
383
  }
384
 
385
+ /* line 73, ../sass/_settings_page.sass */
386
  .help-notification {
387
  background: #d9edf7;
388
  border: 1px solid #bce8f1;
392
  border-radius: 3px;
393
  }
394
 
395
+ /* line 81, ../sass/_settings_page.sass */
396
  .toplevel_page_leadin_contacts .wp-menu-image img {
397
  width: 16px;
398
  height: 16px;
399
  }
400
 
401
+ /* line 85, ../sass/_settings_page.sass */
402
  .leadin-contact-avatar {
403
  margin-right: 10px;
404
  }
405
 
406
+ /* line 88, ../sass/_settings_page.sass */
407
  .power-up-settings-icon {
408
  padding-right: 10px;
409
  float: left;
411
  margin-top: -1px;
412
  }
413
 
414
+ /* line 94, ../sass/_settings_page.sass */
415
  .dashicons {
416
  margin-right: 10px;
417
  float: left;
418
  margin-top: -1px;
419
  }
420
 
421
+ /* line 99, ../sass/_settings_page.sass */
422
  .steps {
423
  margin: 48px auto 0;
424
  text-align: center;
425
  max-width: 600px;
426
  }
427
+ /* line 104, ../sass/_settings_page.sass */
428
  .steps h3, .steps p {
429
  margin: 0;
430
  }
431
+ /* line 107, ../sass/_settings_page.sass */
432
  .steps .step-names {
433
  margin: 0;
434
  *zoom: 1;
439
  display: table;
440
  clear: both;
441
  }
442
+ /* line 111, ../sass/_settings_page.sass */
443
  .steps .step-names .step-name {
444
  color: #cccccc;
445
  display: list-item;
450
  font-size: 16px;
451
  list-style: decimal inside none;
452
  }
453
+ /* line 121, ../sass/_settings_page.sass */
454
  .steps .step-names .step-name.active {
455
  color: #1f7d71;
456
  background-image: url(../../images/triangle.png);
457
  background-position: bottom center;
458
  background-repeat: no-repeat;
459
  }
460
+ /* line 127, ../sass/_settings_page.sass */
461
  .steps .step-names .step-name.completed {
462
  list-style-image: url(../../images/checkmark.png);
463
  }
464
+ /* line 130, ../sass/_settings_page.sass */
465
  .steps .step-content {
466
  margin: 0;
467
  }
468
+ /* line 133, ../sass/_settings_page.sass */
469
  .steps .step-content .description {
470
  margin: 10px 0 20px;
471
  display: block;
472
  }
473
+ /* line 137, ../sass/_settings_page.sass */
474
  .steps .step {
475
  display: none;
476
  padding: 18px;
481
  border-radius: 5px;
482
  color: #1f7d71;
483
  }
484
+ /* line 145, ../sass/_settings_page.sass */
485
  .steps .step h2 {
486
  color: #1f7d71;
487
  margin-top: 0;
488
  margin-bottom: 18px;
489
  }
490
+ /* line 151, ../sass/_settings_page.sass */
491
  .steps .step ol {
492
  text-align: left;
493
  margin-bottom: 18px;
494
  }
495
+ /* line 155, ../sass/_settings_page.sass */
496
  .steps .step label {
497
  text-align: right;
498
  }
499
+ /* line 158, ../sass/_settings_page.sass */
500
  .steps .step.active {
501
  display: block;
502
  }
503
+ /* line 162, ../sass/_settings_page.sass */
504
  .steps .step .form-table th {
505
  display: none;
506
  }
507
+ /* line 165, ../sass/_settings_page.sass */
508
  .steps .step .form-table td {
509
  text-align: center;
510
  width: auto;
511
  display: block;
512
  }
513
+ /* line 170, ../sass/_settings_page.sass */
514
  .steps .step .form-table input {
515
  width: 100%;
516
  font-size: 16px;
admin/leadin-admin.php CHANGED
@@ -38,6 +38,7 @@ class WPLeadInAdmin {
38
 
39
  var $admin_power_ups;
40
  var $li_viewers;
 
41
 
42
  /**
43
  * Class constructor
@@ -122,6 +123,8 @@ class WPLeadInAdmin {
122
  */
123
  function leadin_build_settings_page ()
124
  {
 
 
125
  // Show the settings popup on all pages except the settings page
126
  if( isset($_GET['settings-updated']) )
127
  {
@@ -135,7 +138,9 @@ class WPLeadInAdmin {
135
  }
136
 
137
  register_setting('leadin_settings_options', 'leadin_options', array($this, 'sanitize'));
138
- add_settings_section('leadin_settings_section', 'Visitor Tracking', array($this, 'leadin_options_section_heading'), LEADIN_ADMIN_PATH);
 
 
139
  add_settings_field('li_email', 'Email', array($this, 'li_email_callback'), LEADIN_ADMIN_PATH, 'leadin_settings_section');
140
 
141
  add_filter( 'update_option_leadin_options', array($this, 'update_option_leadin_options_callback'), 10, 2 );
@@ -143,12 +148,8 @@ class WPLeadInAdmin {
143
 
144
  function leadin_options_section_heading ( )
145
  {
146
- ?>
147
- <p style='color: #090; font-weight: bold;'>Visitor tracking is installed and tracking visitors.</p>
148
- <p>The next time a visitor fills out a form on your WordPress site with an email address, LeadIn will send you an email with the contact's referral source and page view history.</p>
149
- <?php
150
-
151
- $this->print_hidden_settings_fields();
152
  }
153
 
154
  function print_hidden_settings_fields ()
@@ -162,8 +163,6 @@ class WPLeadInAdmin {
162
  $data_recovered = ( $options['data_recovered'] ? $options['data_recovered'] : 0 );
163
  $delete_flags_fixed = ( $options['delete_flags_fixed'] ? $options['delete_flags_fixed'] : 0 );
164
 
165
-
166
-
167
  printf(
168
  '<input id="li_installed" type="hidden" name="leadin_options[li_installed]" value="%d"/>',
169
  $li_installed
@@ -195,6 +194,14 @@ class WPLeadInAdmin {
195
  );
196
  }
197
 
 
 
 
 
 
 
 
 
198
  function update_option_leadin_options_callback ( $old_value, $new_value )
199
  {
200
  $user_email = $new_value["li_email"];
@@ -207,7 +214,7 @@ class WPLeadInAdmin {
207
  function leadin_plugin_options ()
208
  {
209
  global $wp_version;
210
-
211
  if ( !current_user_can( 'manage_categories' ) )
212
  {
213
  wp_die(__('You do not have sufficient permissions to access this page.'));
@@ -225,7 +232,6 @@ class WPLeadInAdmin {
225
  else
226
  $this->leadin_plugin_settings();
227
 
228
-
229
  $this->leadin_footer();
230
 
231
  //end wrap
@@ -311,6 +317,9 @@ class WPLeadInAdmin {
311
  if( isset( $input['ignore_settings_popup'] ) )
312
  $new_input['ignore_settings_popup'] = $input['ignore_settings_popup'];
313
 
 
 
 
314
  return $new_input;
315
  }
316
 
@@ -321,7 +330,7 @@ class WPLeadInAdmin {
321
  {
322
  $options = get_option('leadin_options');
323
  $li_email = ( isset($options['li_email']) && $options['li_email'] ? $options['li_email'] : '' ); // Get email from plugin settings, if none set, use admin email
324
-
325
  printf(
326
  '<input id="li_email" type="text" id="title" name="leadin_options[li_email]" value="%s" size="50"/><br/><span class="description">Separate multiple emails with commas. Leave blank to disable email notifications.</span>',
327
  $li_email
@@ -353,9 +362,19 @@ class WPLeadInAdmin {
353
  <ul class="powerup-list">
354
 
355
  <?php foreach ( $this->admin_power_ups as $power_up ) : ?>
 
 
 
 
 
 
356
  <li class="powerup <?php echo ( $power_up->activated ? 'activated' : ''); ?>">
357
  <h2><?php echo $power_up->power_up_name; ?></h2>
358
- <img src="<?php echo LEADIN_PATH . '/images/' . $power_up->icon . '@2x.png'; ?>" height="80px" width="80px"/>
 
 
 
 
359
  <p><?php echo $power_up->description; ?></p>
360
  <p><a href="<?php echo $power_up->link_uri; ?>" target="_blank">Learn more</a></p>
361
  <?php if ( $power_up->activated ) : ?>
@@ -377,6 +396,7 @@ class WPLeadInAdmin {
377
  </li>
378
  <?php endforeach; ?>
379
 
 
380
  <li class="powerup">
381
  <h2>Content Analytics</h2>
382
  <img src="<?php echo LEADIN_PATH; ?>/images/powerup-icon-analytics@2x.png" height="80px" width="80px">
@@ -465,7 +485,7 @@ class WPLeadInAdmin {
465
  $postbox_wrap = "";
466
  $postbox_wrap .= '<div id="' . $id . '" class="postbox leadin-admin-postbox">';
467
  $postbox_wrap .= ( $handle ? '<div class="handlediv" title="Click to toggle"><br /></div>' : '' );
468
- $postbox_wrap .= '<h3><span>' . $title . '</span></h3>';
469
  $postbox_wrap .= '<div class="inside">' . $content . '</div>';
470
  $postbox_wrap .= '</div>';
471
  return $postbox_wrap;
@@ -600,8 +620,7 @@ class WPLeadInAdmin {
600
  </tr>
601
  </tbody></table>
602
  <?php
603
- }
604
-
605
  }
606
 
607
  ?>
38
 
39
  var $admin_power_ups;
40
  var $li_viewers;
41
+ var $power_up_icon;
42
 
43
  /**
44
  * Class constructor
123
  */
124
  function leadin_build_settings_page ()
125
  {
126
+ global $leadin_contacts;
127
+
128
  // Show the settings popup on all pages except the settings page
129
  if( isset($_GET['settings-updated']) )
130
  {
138
  }
139
 
140
  register_setting('leadin_settings_options', 'leadin_options', array($this, 'sanitize'));
141
+
142
+ $visitor_tracking_icon = $leadin_contacts->icon_small;
143
+ add_settings_section('leadin_settings_section', $visitor_tracking_icon . 'Visitor Tracking', array($this, 'leadin_options_section_heading'), LEADIN_ADMIN_PATH);
144
  add_settings_field('li_email', 'Email', array($this, 'li_email_callback'), LEADIN_ADMIN_PATH, 'leadin_settings_section');
145
 
146
  add_filter( 'update_option_leadin_options', array($this, 'update_option_leadin_options_callback'), 10, 2 );
148
 
149
  function leadin_options_section_heading ( )
150
  {
151
+ $this->print_hidden_settings_fields();
152
+ $this->tracking_code_installed_message();
 
 
 
 
153
  }
154
 
155
  function print_hidden_settings_fields ()
163
  $data_recovered = ( $options['data_recovered'] ? $options['data_recovered'] : 0 );
164
  $delete_flags_fixed = ( $options['delete_flags_fixed'] ? $options['delete_flags_fixed'] : 0 );
165
 
 
 
166
  printf(
167
  '<input id="li_installed" type="hidden" name="leadin_options[li_installed]" value="%d"/>',
168
  $li_installed
194
  );
195
  }
196
 
197
+ function tracking_code_installed_message ( )
198
+ {
199
+ echo '<div class="leadin-section">';
200
+ echo '<p style="color: #090; font-weight: bold;">Visitor tracking is installed and tracking visitors.</p>';
201
+ echo '<p>The next time a visitor fills out a form on your WordPress site with an email address, LeadIn will send you an email with the contact\'s referral source and page view history.</p>';
202
+ echo '</div>';
203
+ }
204
+
205
  function update_option_leadin_options_callback ( $old_value, $new_value )
206
  {
207
  $user_email = $new_value["li_email"];
214
  function leadin_plugin_options ()
215
  {
216
  global $wp_version;
217
+
218
  if ( !current_user_can( 'manage_categories' ) )
219
  {
220
  wp_die(__('You do not have sufficient permissions to access this page.'));
232
  else
233
  $this->leadin_plugin_settings();
234
 
 
235
  $this->leadin_footer();
236
 
237
  //end wrap
317
  if( isset( $input['ignore_settings_popup'] ) )
318
  $new_input['ignore_settings_popup'] = $input['ignore_settings_popup'];
319
 
320
+ if( isset( $input['beta_tester'] ) )
321
+ $new_input['beta_tester'] = sanitize_text_field($input['beta_tester']);
322
+
323
  return $new_input;
324
  }
325
 
330
  {
331
  $options = get_option('leadin_options');
332
  $li_email = ( isset($options['li_email']) && $options['li_email'] ? $options['li_email'] : '' ); // Get email from plugin settings, if none set, use admin email
333
+
334
  printf(
335
  '<input id="li_email" type="text" id="title" name="leadin_options[li_email]" value="%s" size="50"/><br/><span class="description">Separate multiple emails with commas. Leave blank to disable email notifications.</span>',
336
  $li_email
362
  <ul class="powerup-list">
363
 
364
  <?php foreach ( $this->admin_power_ups as $power_up ) : ?>
365
+ <?php
366
+ // Skip displaying the power-up on the power-ups page if it's hidden
367
+ if ( $power_up->hidden )
368
+ continue;
369
+ ?>
370
+
371
  <li class="powerup <?php echo ( $power_up->activated ? 'activated' : ''); ?>">
372
  <h2><?php echo $power_up->power_up_name; ?></h2>
373
+ <?php if ( strstr($power_up->icon, 'dashicons') ) : ?>
374
+ <div class="power-up-icon dashicons <?php echo $power_up->icon; ?>"></div>
375
+ <?php else : ?>
376
+ <img src="<?php echo LEADIN_PATH . '/images/' . $power_up->icon . '@2x.png'; ?>" height="80px" width="80px"/>
377
+ <?php endif; ?>
378
  <p><?php echo $power_up->description; ?></p>
379
  <p><a href="<?php echo $power_up->link_uri; ?>" target="_blank">Learn more</a></p>
380
  <?php if ( $power_up->activated ) : ?>
396
  </li>
397
  <?php endforeach; ?>
398
 
399
+ <!-- static power-ups -->
400
  <li class="powerup">
401
  <h2>Content Analytics</h2>
402
  <img src="<?php echo LEADIN_PATH; ?>/images/powerup-icon-analytics@2x.png" height="80px" width="80px">
485
  $postbox_wrap = "";
486
  $postbox_wrap .= '<div id="' . $id . '" class="postbox leadin-admin-postbox">';
487
  $postbox_wrap .= ( $handle ? '<div class="handlediv" title="Click to toggle"><br /></div>' : '' );
488
+ $postbox_wrap .= '<h3 class="hndle"><span>' . $title . '</span></h3>';
489
  $postbox_wrap .= '<div class="inside">' . $content . '</div>';
490
  $postbox_wrap .= '</div>';
491
  return $postbox_wrap;
620
  </tr>
621
  </tbody></table>
622
  <?php
623
+ }
 
624
  }
625
 
626
  ?>
admin/sass/.sass-cache/7feb88049015a4dff396a24786f85814ae06425c/_settings_page.sassc DELETED
Binary file
admin/sass/_settings_page.sass CHANGED
@@ -1,3 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #icon-leadin
2
  background: url('../../images/leadin-icon-32x32.png') top center no-repeat
3
 
1
+ .li-settings
2
+ h3
3
+ border-left: 1px solid #e5e5e5
4
+ border-right: 1px solid #e5e5e5
5
+ border-top: 1px solid #e5e5e5
6
+ border-bottom: 1px solid #e5e5e5
7
+ margin-bottom: 0px
8
+ background: #fff
9
+ padding: 8px 12px
10
+ font-size: 15px
11
+
12
+ .form-table
13
+ margin-top: 0px
14
+ border-left: 1px solid #e5e5e5
15
+ border-right: 1px solid #e5e5e5
16
+ border-bottom: 1px solid #e5e5e5
17
+ background-color: #fff
18
+ +box-shadow(0 1px 1px rgba(0,0,0,.04))
19
+
20
+ th
21
+ padding-left: 12px
22
+
23
+ .leadin-section
24
+ background-color: #fff
25
+ border-left: 1px solid #e5e5e5
26
+ border-right: 1px solid #e5e5e5
27
+ font-size: 14px
28
+ padding: 15px 12px 5px 12px
29
+
30
+ p
31
+ margin: 0
32
+ padding: 0
33
+
34
+ &.pre-mp6
35
+ h3
36
+ font-family: Georgia
37
+
38
+ select, input
39
+ font-family: sans-serif
40
+ font-size: 12px
41
+
42
+ .form-table, .leadin-section, h3
43
+ background-color: #f9f9f9 !important
44
+
45
+ .form-table
46
+ +border-bottom-left-radius(3px)
47
+ +border-bottom-right-radius(3px)
48
+
49
+ h3
50
+ background-color: #f9f9f9 !important
51
+ +border-top-left-radius(3px)
52
+ +border-top-right-radius(3px)
53
+
54
+ .leadin-section
55
+ font-size: 12px
56
+ padding-left: 6px
57
+
58
+ h3
59
+ padding-left: 6px
60
+ font-weight: normal
61
+ color: #464646
62
+ text-shadow: #fff 0px 1px 0px
63
+
64
+ label
65
+ font-size: 12px
66
+
67
+ input[type="checkbox"], input[type="radio"]
68
+ margin-right: 2px
69
+
70
  #icon-leadin
71
  background: url('../../images/leadin-icon-32x32.png') top center no-repeat
72
 
inc/class-leadin-updater.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined('LEADIN_PLUGIN_VERSION') )
4
+ {
5
+ header('HTTP/1.0 403 Forbidden');
6
+ die;
7
+ }
8
+
9
+ //=============================================
10
+ // WPLeadInUpdater Class
11
+ //=============================================
12
+ class WPLeadInUpdater {
13
+
14
+ var $api_url = '';
15
+ var $plugin_slug = '';
16
+
17
+ /**
18
+ * Class constructor
19
+ */
20
+ function __construct ()
21
+ {
22
+ $this->api_url = 'http://leadin.com/plugins/index.php';
23
+ $this->plugin_slug = LEADIN_PLUGIN_SLUG;
24
+
25
+ //=============================================
26
+ // Hooks & Filters
27
+ //=============================================
28
+
29
+ if( is_admin() )
30
+ {
31
+ add_filter('pre_set_site_transient_update_plugins', array($this, 'check_for_plugin_update'));
32
+ add_filter('plugins_api', array($this, 'plugin_api_call'), 10, 3);
33
+ }
34
+ }
35
+
36
+ //=============================================
37
+ // Update API
38
+ //=============================================
39
+
40
+ /**
41
+ * Adds setting link for LeadIn to plugins management page
42
+ *
43
+ * @param array $transient_data plugins that have updates
44
+ * @return array
45
+ */
46
+ function check_for_plugin_update ( $transient_data )
47
+ {
48
+ global $wp_version;
49
+
50
+ //Comment out these two lines during testing.
51
+ if ( empty($transient_data->checked) )
52
+ return $transient_data;
53
+
54
+ $args = array(
55
+ 'slug' => $this->plugin_slug,
56
+ 'version' => $transient_data->checked[$this->plugin_slug . '/' . $this->plugin_slug . '.php'],
57
+ );
58
+
59
+ $request_string = array(
60
+ 'body' => array(
61
+ 'action' => 'basic_check',
62
+ 'request' => serialize($args),
63
+ 'api-key' => md5(get_bloginfo('url'))
64
+ ),
65
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
66
+ );
67
+
68
+ // Start checking for an update
69
+ $raw_response = wp_remote_post($this->api_url, $request_string);
70
+
71
+ if ( !is_wp_error($raw_response) && ($raw_response['response']['code'] == 200) )
72
+ {
73
+ $response = unserialize($raw_response['body']);
74
+ }
75
+
76
+ if ( is_object($response) && !empty($response) ) // Feed the update data into WP updater
77
+ $transient_data->response[$this->plugin_slug . '/' . $this->plugin_slug . '.php'] = $response;
78
+
79
+ $plugin_file = $this->plugin_slug .'/'. $this->plugin_slug .'.php';
80
+
81
+ add_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 );
82
+
83
+ return $transient_data;
84
+ }
85
+
86
+ /**
87
+ * Adds setting link for LeadIn to plugins management page
88
+ *
89
+ * @param string $checked_data plugins that have updates
90
+ * @return object on success, WP_Error on failure.
91
+ */
92
+ function plugin_api_call ( $def, $action, $args )
93
+ {
94
+ global $wp_version;
95
+
96
+ if ( $args->slug != $this->plugin_slug )
97
+ return false;
98
+
99
+ // Get the current version
100
+ $plugin_info = get_site_transient('update_plugins');
101
+ $current_version = $plugin_info->checked[$this->plugin_slug . '/' . $this->plugin_slug . '.php'];
102
+ $args->version = $current_version;
103
+
104
+ $request_string = array(
105
+ 'body' => array(
106
+ 'action' => $action,
107
+ 'request' => serialize($args),
108
+ 'api-key' => md5(get_bloginfo('url'))
109
+ ),
110
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
111
+ );
112
+
113
+ $request = wp_remote_post($this->api_url, $request_string);
114
+
115
+ if ( is_wp_error($request) )
116
+ {
117
+ $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message());
118
+ }
119
+ else
120
+ {
121
+ $res = unserialize($request['body']);
122
+
123
+ if ( $res === false )
124
+ $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']);
125
+ }
126
+
127
+ return $res;
128
+ }
129
+ }
130
+
131
+ ?>
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: 0.9.1
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', '0.8.3');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
- define('LEADIN_PLUGIN_VERSION', '0.9.1');
30
 
31
  if ( !defined('MIXPANEL_PROJECT_TOKEN') )
32
  define('MIXPANEL_PROJECT_TOKEN', 'a9615503ec58a6bce2c646a58390eac1');
@@ -40,10 +40,12 @@ require_once(LEADIN_PLUGIN_DIR . '/admin/leadin-admin.php');
40
  require_once(LEADIN_PLUGIN_DIR . '/inc/class-emailer.php');
41
  require_once(LEADIN_PLUGIN_DIR . '/inc/leadin-ajax-functions.php');
42
  require_once(LEADIN_PLUGIN_DIR . '/inc/leadin-functions.php');
 
43
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/subscribe-widget.php');
44
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/contacts.php');
45
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/mailchimp-list-sync.php');
46
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/constant-contact-list-sync.php');
 
47
  require_once(LEADIN_PLUGIN_DIR . '/lib/mixpanel/LI_Mixpanel.php');
48
 
49
  //=============================================
@@ -52,6 +54,7 @@ require_once(LEADIN_PLUGIN_DIR . '/lib/mixpanel/LI_Mixpanel.php');
52
  class WPLeadIn {
53
 
54
  var $power_ups;
 
55
 
56
  /**
57
  * Class constructor
@@ -69,6 +72,7 @@ class WPLeadIn {
69
  register_deactivation_hook( __FILE__, array(&$this, 'deactivate_leadin'));
70
 
71
  $this->power_ups = $this->get_available_power_ups();
 
72
 
73
  add_action('plugins_loaded', array($this, 'leadin_update_check'));
74
  add_filter('init', array($this, 'add_leadin_frontend_scripts'));
@@ -76,10 +80,10 @@ class WPLeadIn {
76
  add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$li_wp_admin, 'leadin_plugin_settings_link'));
77
  add_action( 'admin_bar_menu', array($this, 'add_leadin_link_to_admin_bar'), 999 );
78
 
79
- $li_wp_admin = new WPLeadInAdmin($this->power_ups);
80
 
81
- if ( is_single() )
82
- echo 'leadin single';
83
  }
84
 
85
  /**
@@ -87,9 +91,9 @@ class WPLeadIn {
87
  */
88
  function add_leadin_defaults ()
89
  {
90
- $li_options = get_option('leadin_options');
91
 
92
- if ( ($li_options['li_installed'] != 1) || (!is_array($li_options)) )
93
  {
94
  $opt = array(
95
  'li_installed' => 1,
@@ -98,7 +102,8 @@ class WPLeadIn {
98
  'onboarding_complete' => 0,
99
  'ignore_settings_popup' => 0,
100
  'data_recovered' => 1,
101
- 'delete_flags_fixed' => 1
 
102
  );
103
 
104
  update_option('leadin_options', $opt);
@@ -110,7 +115,8 @@ class WPLeadIn {
110
  if ( !$leadin_active_power_ups )
111
  {
112
  $auto_activate = array(
113
- 'contacts'
 
114
  );
115
 
116
  update_option('leadin_active_power_ups', serialize($auto_activate));
@@ -202,7 +208,7 @@ class WPLeadIn {
202
  function leadin_update_check ()
203
  {
204
  global $wpdb;
205
- $li_options = get_option('leadin_options');
206
 
207
  // 0.4.0 upgrade - Delete legacy db option version 0.4.0 (remove after beta is launched)
208
  if ( get_option('leadin_db_version') )
@@ -221,22 +227,30 @@ class WPLeadIn {
221
  if ( !$leadin_active_power_ups )
222
  {
223
  $auto_activate = array(
224
- 'contacts'
 
225
  );
226
 
227
  update_option('leadin_active_power_ups', serialize($auto_activate));
228
  }
 
 
 
 
 
 
 
229
 
230
  // 0.7.2 bug fix - data recovery algorithm for deleted contacts
231
- if ( ! isset($li_options['data_recovered']) )
232
  {
233
  leadin_recover_contact_data();
234
  }
235
 
236
  // Set the database version if it doesn't exist
237
- if ( isset($li_options['li_db_version']) )
238
  {
239
- if ( $li_options['li_db_version'] != LEADIN_DB_VERSION ) {
240
  $this->leadin_db_install();
241
 
242
  // 0.4.2 upgrade - After the DB installation converts the set structure from contact to lead, update all the blank contacts = leads
@@ -254,7 +268,7 @@ class WPLeadIn {
254
  }
255
 
256
  // 0.8.3 bug fix - bug fix for duplicated contacts that should be merged
257
- if ( ! isset($li_options['delete_flags_fixed']) )
258
  {
259
  leadin_delete_flag_fix();
260
  }
@@ -281,10 +295,15 @@ class WPLeadIn {
281
  }
282
  }
283
 
 
 
 
284
  function add_leadin_link_to_admin_bar( $wp_admin_bar ) {
 
 
285
  $args = array(
286
  'id' => 'leadin-admin-menu', // id of the existing child node (New > Post)
287
- 'title' => '<span class="ab-icon"><img src="/wp-content/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
288
  'parent' => false, // set parent to false to make it a top level (parent) node
289
  'href' => get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_contacts',
290
  'meta' => array('title' => 'LeadIn')
@@ -318,11 +337,17 @@ class WPLeadIn {
318
  $power_up->link_uri = $headers['uri'];
319
  $power_up->description = $headers['description'];
320
  $power_up->icon = $headers['icon'];
321
- $power_up->icon_small = $headers['icon_small'];
322
- $power_up->permanent = $headers['permanent'];
323
- $power_up->auto_activate = $headers['auto_activate'];
324
  $power_up->activated = $headers['activated'];
325
 
 
 
 
 
 
 
326
  array_push($power_ups, $power_up);
327
  }
328
  }
@@ -367,7 +392,8 @@ class WPLeadIn {
367
  'introduced' => 'First Introduced',
368
  'auto_activate' => 'Auto Activate',
369
  'permanent' => 'Permanently Enabled',
370
- 'power_up_tags' => 'Power-up Tags'
 
371
  );
372
 
373
  $file = WPLeadIn::get_power_up_path( WPLeadIn::get_power_up_slug( $power_up ) );
@@ -413,7 +439,11 @@ class WPLeadIn {
413
  }
414
 
415
  $files = leadin_sort_power_ups($files, array(
416
- LEADIN_PLUGIN_DIR . '/power-ups/contacts' . '.php', LEADIN_PLUGIN_DIR . '/power-ups/subscribe-widget' . '.php', LEADIN_PLUGIN_DIR . '/power-ups/mailchimp-list-sync' . '.php', LEADIN_PLUGIN_DIR . '/power-ups/constant-contact-list-sync' . '.php'
 
 
 
 
417
  ));
418
 
419
  closedir( $dir );
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: 0.9.2
7
  Author: Andy Cook, Nelson Joyce
8
  Author URI: http://leadin.com
9
  License: GPL2
26
  define('LEADIN_DB_VERSION', '0.8.3');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
+ define('LEADIN_PLUGIN_VERSION', '0.9.2');
30
 
31
  if ( !defined('MIXPANEL_PROJECT_TOKEN') )
32
  define('MIXPANEL_PROJECT_TOKEN', 'a9615503ec58a6bce2c646a58390eac1');
40
  require_once(LEADIN_PLUGIN_DIR . '/inc/class-emailer.php');
41
  require_once(LEADIN_PLUGIN_DIR . '/inc/leadin-ajax-functions.php');
42
  require_once(LEADIN_PLUGIN_DIR . '/inc/leadin-functions.php');
43
+ require_once(LEADIN_PLUGIN_DIR . '/inc/class-leadin-updater.php');
44
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/subscribe-widget.php');
45
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/contacts.php');
46
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/mailchimp-list-sync.php');
47
  require_once(LEADIN_PLUGIN_DIR . '/power-ups/constant-contact-list-sync.php');
48
+ require_once(LEADIN_PLUGIN_DIR . '/power-ups/beta-program.php');
49
  require_once(LEADIN_PLUGIN_DIR . '/lib/mixpanel/LI_Mixpanel.php');
50
 
51
  //=============================================
54
  class WPLeadIn {
55
 
56
  var $power_ups;
57
+ var $options;
58
 
59
  /**
60
  * Class constructor
72
  register_deactivation_hook( __FILE__, array(&$this, 'deactivate_leadin'));
73
 
74
  $this->power_ups = $this->get_available_power_ups();
75
+ $this->options = get_option('leadin_options');
76
 
77
  add_action('plugins_loaded', array($this, 'leadin_update_check'));
78
  add_filter('init', array($this, 'add_leadin_frontend_scripts'));
80
  add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$li_wp_admin, 'leadin_plugin_settings_link'));
81
  add_action( 'admin_bar_menu', array($this, 'add_leadin_link_to_admin_bar'), 999 );
82
 
83
+ $li_wp_admin = new WPLeadInAdmin($this->power_ups);
84
 
85
+ if ( isset($this->options['beta_tester']) && $this->options['beta_tester'] )
86
+ $li_wp_updater = new WPLeadInUpdater();
87
  }
88
 
89
  /**
91
  */
92
  function add_leadin_defaults ()
93
  {
94
+ $options = $this->options;
95
 
96
+ if ( ($options['li_installed'] != 1) || (!is_array($options)) )
97
  {
98
  $opt = array(
99
  'li_installed' => 1,
102
  'onboarding_complete' => 0,
103
  'ignore_settings_popup' => 0,
104
  'data_recovered' => 1,
105
+ 'delete_flags_fixed' => 1,
106
+ 'beta_tester' => 0
107
  );
108
 
109
  update_option('leadin_options', $opt);
115
  if ( !$leadin_active_power_ups )
116
  {
117
  $auto_activate = array(
118
+ 'contacts',
119
+ 'beta_program'
120
  );
121
 
122
  update_option('leadin_active_power_ups', serialize($auto_activate));
208
  function leadin_update_check ()
209
  {
210
  global $wpdb;
211
+ $options = $this->options;
212
 
213
  // 0.4.0 upgrade - Delete legacy db option version 0.4.0 (remove after beta is launched)
214
  if ( get_option('leadin_db_version') )
227
  if ( !$leadin_active_power_ups )
228
  {
229
  $auto_activate = array(
230
+ 'contacts',
231
+ 'beta_program'
232
  );
233
 
234
  update_option('leadin_active_power_ups', serialize($auto_activate));
235
  }
236
+ else
237
+ {
238
+ // 0.9.2 upgrade - set beta program power-up to auto-activate
239
+ $activated_power_ups = unserialize($leadin_active_power_ups);
240
+ $activated_power_ups[] = 'beta_program';
241
+ update_option('leadin_active_power_ups', serialize($activated_power_ups));
242
+ }
243
 
244
  // 0.7.2 bug fix - data recovery algorithm for deleted contacts
245
+ if ( ! isset($options['data_recovered']) )
246
  {
247
  leadin_recover_contact_data();
248
  }
249
 
250
  // Set the database version if it doesn't exist
251
+ if ( isset($options['li_db_version']) )
252
  {
253
+ if ( $options['li_db_version'] != LEADIN_DB_VERSION ) {
254
  $this->leadin_db_install();
255
 
256
  // 0.4.2 upgrade - After the DB installation converts the set structure from contact to lead, update all the blank contacts = leads
268
  }
269
 
270
  // 0.8.3 bug fix - bug fix for duplicated contacts that should be merged
271
+ if ( ! isset($options['delete_flags_fixed']) )
272
  {
273
  leadin_delete_flag_fix();
274
  }
295
  }
296
  }
297
 
298
+ /**
299
+ * Adds LeadIn link to top-level admin bar
300
+ */
301
  function add_leadin_link_to_admin_bar( $wp_admin_bar ) {
302
+ global $wp_version;
303
+
304
  $args = array(
305
  'id' => 'leadin-admin-menu', // id of the existing child node (New > Post)
306
+ 'title' => '<span class="ab-icon" '. ( $wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? ' style="margin-top: 3px;"' : ''). '><img src="/wp-content/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
307
  'parent' => false, // set parent to false to make it a top level (parent) node
308
  'href' => get_bloginfo('wpurl') . '/wp-admin/admin.php?page=leadin_contacts',
309
  'meta' => array('title' => 'LeadIn')
337
  $power_up->link_uri = $headers['uri'];
338
  $power_up->description = $headers['description'];
339
  $power_up->icon = $headers['icon'];
340
+ $power_up->permanent = ( $headers['permanent'] == 'Yes' ? 1 : 0 );
341
+ $power_up->auto_activate = ( $headers['auto_activate'] == 'Yes' ? 1 : 0 );
342
+ $power_up->hidden = ( $headers['hidden'] == 'Yes' ? 1 : 0 );
343
  $power_up->activated = $headers['activated'];
344
 
345
+ // Set the small icons HTML for the settings page
346
+ if ( strstr($headers['icon_small'], 'dashicons') )
347
+ $power_up->icon_small = '<span class="dashicons ' . $headers['icon_small'] . '"></span>';
348
+ else
349
+ $power_up->icon_small = '<img src="' . LEADIN_PATH . '/images/' . $headers['icon_small'] . '.png" class="power-up-settings-icon"/>';
350
+
351
  array_push($power_ups, $power_up);
352
  }
353
  }
392
  'introduced' => 'First Introduced',
393
  'auto_activate' => 'Auto Activate',
394
  'permanent' => 'Permanently Enabled',
395
+ 'power_up_tags' => 'Power-up Tags',
396
+ 'hidden' => 'Hidden'
397
  );
398
 
399
  $file = WPLeadIn::get_power_up_path( WPLeadIn::get_power_up_slug( $power_up ) );
439
  }
440
 
441
  $files = leadin_sort_power_ups($files, array(
442
+ LEADIN_PLUGIN_DIR . '/power-ups/contacts.php',
443
+ LEADIN_PLUGIN_DIR . '/power-ups/subscribe-widget.php',
444
+ LEADIN_PLUGIN_DIR . '/power-ups/mailchimp-list-sync.php',
445
+ LEADIN_PLUGIN_DIR . '/power-ups/constant-contact-list-sync.php',
446
+ LEADIN_PLUGIN_DIR . '/power-ups/beta-program.php'
447
  ));
448
 
449
  closedir( $dir );
power-ups/beta-program.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Power-up Name: Beta Program
4
+ * Power-up Class: WPLeadInBeta
5
+ * Power-up Menu Text:
6
+ * Power-up Slug: beta_program
7
+ * Power-up Menu Link: settings
8
+ * Power-up URI: http://leadin.com/beta-program
9
+ * Power-up Description: Get early access to product updates in development
10
+ * Power-up Icon: powerup-icon-subscribe
11
+ * Power-up Icon Small: powerup-icon-subscribe
12
+ * First Introduced: 0.9.1
13
+ * Power-up Tags: Lead Generation
14
+ * Auto Activate: Yes
15
+ * Permanently Enabled: Yes
16
+ * Hidden: Yes
17
+ */
18
+
19
+ //=============================================
20
+ // Define Constants
21
+ //=============================================
22
+
23
+ if ( !defined('LEADIN_BETA_PROGRAM_PATH') )
24
+ define('LEADIN_BETA_PROGRAM_PATH', LEADIN_PATH . '/power-ups/beta-program');
25
+
26
+ if ( !defined('LEADIN_BETA_PROGRAM_PLUGIN_DIR') )
27
+ define('LEADIN_BETA_PROGRAM_PLUGIN_DIR', LEADIN_PLUGIN_DIR . '/power-ups/beta-program');
28
+
29
+ if ( !defined('LEADIN_BETA_PROGRAM_PLUGIN_SLUG') )
30
+ define('LEADIN_BETA_PROGRAM_SLUG', basename(dirname(__FILE__)));
31
+
32
+ //=============================================
33
+ // Include Needed Files
34
+ //=============================================
35
+ require_once(LEADIN_BETA_PROGRAM_PLUGIN_DIR . '/admin/beta-program-admin.php');
36
+
37
+ //=============================================
38
+ // WPLeadIn Class
39
+ //=============================================
40
+ class WPLeadInBeta extends WPLeadIn {
41
+
42
+ var $admin;
43
+ var $options;
44
+
45
+ /**
46
+ * Class constructor
47
+ */
48
+ function __construct ( $activated )
49
+ {
50
+ //=============================================
51
+ // Hooks & Filters
52
+ //=============================================
53
+
54
+ if ( ! $activated )
55
+ return false;
56
+ }
57
+
58
+ /**
59
+ * Initilizes the admin class and calls the constructor
60
+ */
61
+ public function admin_init ( )
62
+ {
63
+ $admin_class = get_class($this) . 'Admin';
64
+ $this->admin = new $admin_class($this->icon_small);
65
+ }
66
+
67
+ /**
68
+ * This is called for power-ups that menu-text set and therefore a submenu
69
+ */
70
+ function power_up_setup_callback ( )
71
+ {
72
+ $this->admin->power_up_setup_callback();
73
+ }
74
+ }
75
+
76
+ //=============================================
77
+ // Beta Program Widget Init
78
+ //=============================================
79
+
80
+ global $leadin_beta_program_wp;
81
+
82
+ ?>
power-ups/beta-program/admin/beta-program-admin.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //=============================================
4
+ // Include Needed Files
5
+ //=============================================
6
+
7
+
8
+ //=============================================
9
+ // WPLeadInAdmin Class
10
+ //=============================================
11
+ class WPLeadInBetaAdmin extends WPLeadInAdmin {
12
+
13
+ var $power_up_settings_section = 'leadin_beta_testing_section';
14
+ var $power_up_icon;
15
+ var $options;
16
+
17
+ /**
18
+ * Class constructor
19
+ */
20
+ function __construct ( $power_up_icon_small )
21
+ {
22
+ //=============================================
23
+ // Hooks & Filters
24
+ //=============================================
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>';
31
+ add_action('admin_init', array($this, 'leadin_beta_program_build_settings_page'));
32
+ }
33
+ }
34
+
35
+ //=============================================
36
+ // Settings Page
37
+ //=============================================
38
+
39
+ /**
40
+ * Creates settings options
41
+ */
42
+ function leadin_beta_program_build_settings_page ()
43
+ {
44
+ // Need to use the santize function from the main admin class because that is where leadin_options is set
45
+ global $li_wp_admin;
46
+
47
+ add_settings_section(
48
+ $this->power_up_settings_section,
49
+ $this->power_up_icon . 'LeadIn Beta Program',
50
+ array($this, 'beta_tester_callback'),
51
+ LEADIN_ADMIN_PATH
52
+ );
53
+ }
54
+
55
+ function beta_tester_callback ( )
56
+ {
57
+ $options = $this->options;
58
+
59
+ echo '<table class="form-table">';
60
+ echo '<div class="leadin-section">';
61
+ echo 'As a beta tester, you\'ll get early access to product updates in development and we\'ll ask you to provide feedback which helps decide new features for the plugin.';
62
+ echo '</div>';
63
+
64
+ echo '<div class="leadin-section">';
65
+ echo ' <b>By definition, some of the beta features may not work as intended though, so this program is only for people who enjoy being on the bleeding-edge of technology.</b>';
66
+ echo '</div>';
67
+
68
+ echo '<div class="leadin-section">';
69
+ echo 'If you\'re the adventurous type, we\'d love to have you aboard our beta program as we build the future of the product.';
70
+ echo '</div>';
71
+
72
+ printf(
73
+ '<tr><td><label for="beta_tester"><input id="beta_tester" type="checkbox" name="leadin_options[beta_tester]" value="1"' . checked( 1, $options['beta_tester'], false ) . '/>' .
74
+ 'Yes, I\'d like to participate in the LeadIn Beta Program</label></td></tr>'
75
+ );
76
+
77
+ echo '</table>';
78
+ }
79
+ }
80
+
81
+ ?>
power-ups/constant-contact-list-sync.php CHANGED
@@ -12,6 +12,8 @@
12
  * First Introduced: 0.8.0
13
  * Power-up Tags: Newsletter, Email
14
  * Auto Activate: No
 
 
15
  */
16
 
17
  //=============================================
12
  * First Introduced: 0.8.0
13
  * Power-up Tags: Newsletter, Email
14
  * Auto Activate: No
15
+ * Permanently Enabled: No
16
+ * Hidden: No
17
  */
18
 
19
  //=============================================
power-ups/constant-contact-list-sync/admin/constant-contact-list-sync-admin.php CHANGED
@@ -14,7 +14,7 @@ class WPConstantContactListSyncAdmin extends WPLeadInAdmin {
14
  /**
15
  * Class constructor
16
  */
17
- function __construct ( $small_icon )
18
  {
19
  //=============================================
20
  // Hooks & Filters
@@ -22,7 +22,7 @@ class WPConstantContactListSyncAdmin extends WPLeadInAdmin {
22
 
23
  if ( is_admin() )
24
  {
25
- $this->power_up_icon = '<img src="' . LEADIN_PATH . '/images/' . $small_icon . '.png" class="power-up-settings-icon"/>';
26
  add_action('admin_init', array($this, 'leadin_cc_build_settings_page'));
27
  }
28
  }
14
  /**
15
  * Class constructor
16
  */
17
+ function __construct ( $power_up_icon_small )
18
  {
19
  //=============================================
20
  // Hooks & Filters
22
 
23
  if ( is_admin() )
24
  {
25
+ $this->power_up_icon = $power_up_icon_small;
26
  add_action('admin_init', array($this, 'leadin_cc_build_settings_page'));
27
  }
28
  }
power-ups/contacts.php CHANGED
@@ -13,6 +13,7 @@
13
  * Power-up Tags: Lead Tracking
14
  * Auto Activate: Yes
15
  * Permanently Enabled: Yes
 
16
  */
17
 
18
  //=============================================
@@ -54,13 +55,16 @@ class WPLeadInContacts extends WPLeadIn {
54
  if ( ! $activated )
55
  return false;
56
 
 
 
 
57
  add_action('admin_print_scripts', array(&$this, 'add_leadin_contacts_admin_scripts'));
58
  }
59
 
60
  public function admin_init ( )
61
  {
62
  $admin_class = get_class($this) . 'Admin';
63
- $this->admin = new $admin_class();
64
  }
65
 
66
  function power_up_setup_callback ( )
13
  * Power-up Tags: Lead Tracking
14
  * Auto Activate: Yes
15
  * Permanently Enabled: Yes
16
+ * Hidden: No
17
  */
18
 
19
  //=============================================
55
  if ( ! $activated )
56
  return false;
57
 
58
+ global $leadin_contacts;
59
+ $leadin_contacts = $this;
60
+
61
  add_action('admin_print_scripts', array(&$this, 'add_leadin_contacts_admin_scripts'));
62
  }
63
 
64
  public function admin_init ( )
65
  {
66
  $admin_class = get_class($this) . 'Admin';
67
+ $this->admin = new $admin_class($this->icon_small);
68
  }
69
 
70
  function power_up_setup_callback ( )
power-ups/contacts/admin/contacts-admin.php CHANGED
@@ -13,7 +13,7 @@ class WPLeadInContactsAdmin extends WPLeadInAdmin {
13
  /**
14
  * Class constructor
15
  */
16
- function __construct ()
17
  {
18
  //=============================================
19
  // Hooks & Filters
13
  /**
14
  * Class constructor
15
  */
16
+ function __construct ( $power_up_icon_small )
17
  {
18
  //=============================================
19
  // Hooks & Filters
power-ups/mailchimp-list-sync.php CHANGED
@@ -12,6 +12,8 @@
12
  * First Introduced: 0.7.0
13
  * Power-up Tags: Newsletter, Email
14
  * Auto Activate: No
 
 
15
  */
16
 
17
  //=============================================
12
  * First Introduced: 0.7.0
13
  * Power-up Tags: Newsletter, Email
14
  * Auto Activate: No
15
+ * Permanently Enabled: No
16
+ * Hidden: No
17
  */
18
 
19
  //=============================================
power-ups/mailchimp-list-sync/admin/mailchimp-list-sync-admin.php CHANGED
@@ -10,7 +10,7 @@ class WPMailChimpListSyncAdmin extends WPLeadInAdmin {
10
  /**
11
  * Class constructor
12
  */
13
- function __construct ( $small_icon )
14
  {
15
  //=============================================
16
  // Hooks & Filters
@@ -18,7 +18,7 @@ class WPMailChimpListSyncAdmin extends WPLeadInAdmin {
18
 
19
  if ( is_admin() )
20
  {
21
- $this->power_up_icon = '<img src="' . LEADIN_PATH . '/images/' . $small_icon . '.png" class="power-up-settings-icon"/>';
22
  add_action('admin_init', array($this, 'leadin_mls_build_settings_page'));
23
  }
24
  }
10
  /**
11
  * Class constructor
12
  */
13
+ function __construct ( $power_up_icon_small )
14
  {
15
  //=============================================
16
  // Hooks & Filters
18
 
19
  if ( is_admin() )
20
  {
21
+ $this->power_up_icon = $power_up_icon_small;
22
  add_action('admin_init', array($this, 'leadin_mls_build_settings_page'));
23
  }
24
  }
power-ups/mailchimp-list-sync/inc/MailChimp-API.php CHANGED
@@ -27,6 +27,9 @@ class LI_MailChimp
27
  function __construct($api_key)
28
  {
29
  $this->api_key = $api_key;
 
 
 
30
  list(, $datacentre) = explode('-', $this->api_key);
31
  $this->api_endpoint = str_replace('<dc>', $datacentre, $this->api_endpoint);
32
  }
27
  function __construct($api_key)
28
  {
29
  $this->api_key = $api_key;
30
+ if ( !strstr($this->api_key, '-') )
31
+ return FALSE;
32
+
33
  list(, $datacentre) = explode('-', $this->api_key);
34
  $this->api_endpoint = str_replace('<dc>', $datacentre, $this->api_endpoint);
35
  }
power-ups/subscribe-widget.php CHANGED
@@ -12,6 +12,8 @@
12
  * First Introduced: 0.4.7
13
  * Power-up Tags: Lead Generation
14
  * Auto Activate: Yes
 
 
15
  */
16
 
17
  //=============================================
@@ -52,7 +54,6 @@ class WPLeadInSubscribe extends WPLeadIn {
52
  if ( ! $activated )
53
  return false;
54
 
55
-
56
  $this->options = get_option('leadin_subscribe_options');
57
  add_action('get_footer', array(&$this, 'append_leadin_subscribe_settings'));
58
 
@@ -65,7 +66,7 @@ class WPLeadInSubscribe extends WPLeadIn {
65
  public function admin_init ( )
66
  {
67
  $admin_class = get_class($this) . 'Admin';
68
- $this->admin = new $admin_class($this->icon);
69
  }
70
 
71
  function power_up_setup_callback ( )
12
  * First Introduced: 0.4.7
13
  * Power-up Tags: Lead Generation
14
  * Auto Activate: Yes
15
+ * Permanently Enabled: No
16
+ * Hidden: No
17
  */
18
 
19
  //=============================================
54
  if ( ! $activated )
55
  return false;
56
 
 
57
  $this->options = get_option('leadin_subscribe_options');
58
  add_action('get_footer', array(&$this, 'append_leadin_subscribe_settings'));
59
 
66
  public function admin_init ( )
67
  {
68
  $admin_class = get_class($this) . 'Admin';
69
+ $this->admin = new $admin_class($this->icon_small);
70
  }
71
 
72
  function power_up_setup_callback ( )
power-ups/subscribe-widget/admin/subscribe-widget-admin.php CHANGED
@@ -17,7 +17,7 @@ class WPLeadInSubscribeAdmin extends WPLeadInAdmin {
17
  /**
18
  * Class constructor
19
  */
20
- function __construct ( $power_up_icon )
21
  {
22
  //=============================================
23
  // Hooks & Filters
@@ -25,7 +25,7 @@ class WPLeadInSubscribeAdmin extends WPLeadInAdmin {
25
 
26
  if ( is_admin() )
27
  {
28
- $this->power_up_icon = '<span class="dashicons dashicons-email-alt"></span>';
29
  add_action('admin_init', array($this, 'leadin_subscribe_build_settings_page'));
30
  $this->options = get_option('leadin_subscribe_options');
31
  }
@@ -190,16 +190,14 @@ class WPLeadInSubscribeAdmin extends WPLeadInAdmin {
190
  function li_subscribe_additional_fields_callback ()
191
  {
192
  $options = $this->options;
193
- $li_subscribe_name_fields = ( $options['li_subscribe_name_fields'] ? $options['li_subscribe_name_fields'] : '0' ); // Get name field options from options, or show default
194
- $li_subscribe_phone_field = ( $options['li_subscribe_phone_field'] ? $options['li_subscribe_phone_field'] : '0' ); // Get phone field preference from options, or show default
195
 
196
  printf(
197
- '<p><input id="li_subscribe_name_fields" type="checkbox" name="leadin_subscribe_options[li_subscribe_name_fields]" value="1"' . checked( 1, $options['li_subscribe_name_fields'], false ) . '/>' .
198
  '<label for="li_subscribe_name_fields">First + last name</label></p>'
199
  );
200
 
201
  printf(
202
- '<p><input id="li_subscribe_phone_field" type="checkbox" name="leadin_subscribe_options[li_subscribe_phone_field]" value="1"' . checked( 1, $options['li_subscribe_phone_field'], false ) . '/>' .
203
  '<label for="li_subscribe_phone_field">Phone number</label></p>'
204
  );
205
  }
@@ -221,22 +219,22 @@ class WPLeadInSubscribeAdmin extends WPLeadInAdmin {
221
  }
222
 
223
  printf(
224
- '<p><input id="li_subscribe_template_posts" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_posts]" value="1"' . checked( 1, $options['li_subscribe_template_posts'], false ) . '/>' .
225
  '<label for="li_subscribe_template_posts">Posts</label></p>'
226
  );
227
 
228
  printf(
229
- '<p><input id="li_subscribe_template_pages" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_pages]" value="1"' . checked( 1, $options['li_subscribe_template_pages'], false ) . '/>' .
230
  '<label for="li_subscribe_template_pages">Pages</label></p>'
231
  );
232
 
233
  printf(
234
- '<p><input id="li_subscribe_template_archives" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_archives]" value="1"' . checked( 1, $options['li_subscribe_template_archives'], false ) . '/>' .
235
  '<label for="li_subscribe_template_archives">Archives</label></p>'
236
  );
237
 
238
  printf(
239
- '<p><input id="li_subscribe_template_home" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_home]" value="1"' . checked( 1, $options['li_subscribe_template_home'], false ) . '/>' .
240
  '<label for="li_subscribe_template_home">Homepage</label></p>'
241
  );
242
  }
17
  /**
18
  * Class constructor
19
  */
20
+ function __construct ( $power_up_icon_small )
21
  {
22
  //=============================================
23
  // Hooks & Filters
25
 
26
  if ( is_admin() )
27
  {
28
+ $this->power_up_icon = $power_up_icon_small;
29
  add_action('admin_init', array($this, 'leadin_subscribe_build_settings_page'));
30
  $this->options = get_option('leadin_subscribe_options');
31
  }
190
  function li_subscribe_additional_fields_callback ()
191
  {
192
  $options = $this->options;
 
 
193
 
194
  printf(
195
+ '<p><input id="li_subscribe_name_fields" type="checkbox" name="leadin_subscribe_options[li_subscribe_name_fields]" value="1"' . checked( 1, ( isset($options['li_subscribe_name_fields']) ? $options['li_subscribe_name_fields'] : '0' ), false ) . '/>' .
196
  '<label for="li_subscribe_name_fields">First + last name</label></p>'
197
  );
198
 
199
  printf(
200
+ '<p><input id="li_subscribe_phone_field" type="checkbox" name="leadin_subscribe_options[li_subscribe_phone_field]" value="1"' . checked( 1, ( isset($options['li_subscribe_phone_field']) ? $options['li_subscribe_phone_field'] : '0' ), false ) . '/>' .
201
  '<label for="li_subscribe_phone_field">Phone number</label></p>'
202
  );
203
  }
219
  }
220
 
221
  printf(
222
+ '<p><input id="li_subscribe_template_posts" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_posts]" value="1"' . checked( 1, ( isset($options['li_subscribe_template_posts']) ? $options['li_subscribe_template_posts'] : '0' ), false ) . '/>' .
223
  '<label for="li_subscribe_template_posts">Posts</label></p>'
224
  );
225
 
226
  printf(
227
+ '<p><input id="li_subscribe_template_pages" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_pages]" value="1"' . checked( 1, ( isset($options['li_subscribe_template_pages']) ? $options['li_subscribe_template_pages'] : '0' ), false ) . '/>' .
228
  '<label for="li_subscribe_template_pages">Pages</label></p>'
229
  );
230
 
231
  printf(
232
+ '<p><input id="li_subscribe_template_archives" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_archives]" value="1"' . checked( 1, ( isset($options['li_subscribe_template_archives']) ? $options['li_subscribe_template_archives'] : '0' ), false ) . '/>' .
233
  '<label for="li_subscribe_template_archives">Archives</label></p>'
234
  );
235
 
236
  printf(
237
+ '<p><input id="li_subscribe_template_home" type="checkbox" name="leadin_subscribe_options[li_subscribe_template_home]" value="1"' . checked( 1, ( isset($options['li_subscribe_template_home']) ? $options['li_subscribe_template_home'] : '0' ), false ) . '/>' .
238
  '<label for="li_subscribe_template_home">Homepage</label></p>'
239
  );
240
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: andygcook, nelsonjoyce
3
  Tags: lead tracking, visitor tracking, analytics, crm, marketing automation, inbound marketing, subscription, marketing, lead generation, mailchimp
4
  Requires at least: 3.7
5
  Tested up to: 3.9.1
6
- Stable tag: 0.9.1
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
 
@@ -89,8 +89,14 @@ To ensure quality we've tested the most popular WordPress form builder plugins.
89
 
90
  == Changelog ==
91
 
92
- - Current version: 0.9.1
93
- - Current version release: 2014-05-14
 
 
 
 
 
 
94
 
95
  = 0.9.1 (2014.05.14) =
96
  - Bug fixes
3
  Tags: lead tracking, visitor tracking, analytics, crm, marketing automation, inbound marketing, subscription, marketing, lead generation, mailchimp
4
  Requires at least: 3.7
5
  Tested up to: 3.9.1
6
+ Stable tag: 0.9.2
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
 
89
 
90
  == Changelog ==
91
 
92
+ - Current version: 0.9.2
93
+ - Current version release: 2014-05-16
94
+
95
+ = 0.9.2 (2014.05.16) =
96
+
97
+ = Enhancements =
98
+ - Overhaul of settings page to make it easier to see which settings go with each power-up
99
+ - Launched LeadIn Beta Program
100
 
101
  = 0.9.1 (2014.05.14) =
102
  - Bug fixes