HubSpot – Free Marketing Plugin for WordPress - Version 1.2.0

Version Description

(2014.06.25) = - Bug fixes - Contacts with default "contact status" were not showing up in the contact list - WordPress admin backends secured with SSL can now be used with LeadIn - Namespaced the referrer parsing library for the Sources widget

Download this release

Release Info

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

Code changes from version 1.1.1 to 1.2.0

admin/inc/class-leadin-list-table.php CHANGED
@@ -269,7 +269,7 @@ class LI_List_Table extends WP_List_Table {
269
  }
270
  else
271
  {
272
- $mysql_contact_type_filter = " AND ( l.lead_status = 'comment' OR l.lead_status = 'subscribe' OR l.lead_status = 'lead' OR l.lead_status = 'contacted' OR l.lead_status = 'customer' ) ";
273
  }
274
 
275
  // filter for visiting a specific page
@@ -453,7 +453,7 @@ class LI_List_Table extends WP_List_Table {
453
 
454
  // All link
455
  $class = ( $current == 'all' ? ' class="current"' :'' );
456
- $views['all'] = "<a href='{$all_url }' {$class} >" . ( $this->totals->total_leads + $this->totals->total_comments + $this->totals->total_subscribes + $this->totals->total_contacted + $this->totals->total_customers ) . " total contacts</a>";
457
 
458
  // Commenters link
459
  $comments_url = add_query_arg('contact_type','comment', $all_url);
@@ -522,7 +522,7 @@ class LI_List_Table extends WP_List_Table {
522
 
523
  default:
524
  $this->view_label = 'Contacts';
525
- $this->view_count = $this->totals->total_leads + $this->totals->total_comments + $this->totals->total_subscribes + $this->totals->total_contacted + $this->totals->total_customers;
526
  break;
527
  }
528
 
269
  }
270
  else
271
  {
272
+ $mysql_contact_type_filter = " AND ( l.lead_status = 'contact' OR l.lead_status = 'comment' OR l.lead_status = 'subscribe' OR l.lead_status = 'lead' OR l.lead_status = 'contacted' OR l.lead_status = 'customer' ) ";
273
  }
274
 
275
  // filter for visiting a specific page
453
 
454
  // All link
455
  $class = ( $current == 'all' ? ' class="current"' :'' );
456
+ $views['all'] = "<a href='{$all_url }' {$class} >" . ( $this->totals->total_contacts ) . " total contacts</a>";
457
 
458
  // Commenters link
459
  $comments_url = add_query_arg('contact_type','comment', $all_url);
522
 
523
  default:
524
  $this->view_label = 'Contacts';
525
+ $this->view_count = $this->totals->total_contacts;
526
  break;
527
  }
528
 
admin/inc/class-stats-dashboard.php CHANGED
@@ -4,9 +4,9 @@
4
  // Include Needed Files
5
  //=============================================
6
 
7
- include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/Parser.php');
8
- include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/Referer.php');
9
- include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/Medium.php');
10
 
11
  //=============================================
12
  // WPStatsDashboard Class
@@ -51,7 +51,7 @@ class LI_StatsDashboard {
51
 
52
  function __construct ()
53
  {
54
- $this->parser = new Parser();
55
  $this->get_data_last_30_days_graph();
56
  $this->get_sources();
57
 
4
  // Include Needed Files
5
  //=============================================
6
 
7
+ include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/LI_Parser.php');
8
+ include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/LI_Referer.php');
9
+ include_once(LEADIN_PLUGIN_DIR . '/admin/inc/sources/Snowplow/RefererParser/LI_Medium.php');
10
 
11
  //=============================================
12
  // WPStatsDashboard Class
51
 
52
  function __construct ()
53
  {
54
+ $this->parser = new LI_Parser();
55
  $this->get_data_last_30_days_graph();
56
  $this->get_sources();
57
 
admin/inc/sources/Snowplow/RefererParser/Config/{ConfigFileReaderTrait.php → LI_ConfigFileReaderTrait.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- abstract class ConfigFileReaderTrait
4
  {
5
  /** @var string */
6
  private $fileName;
@@ -16,7 +16,7 @@ abstract class ConfigFileReaderTrait
16
  private function init($fileName)
17
  {
18
  if (!file_exists($fileName)) {
19
- throw InvalidArgumentException::fileNotExists($fileName);
20
  }
21
 
22
  $this->fileName = $fileName;
1
  <?php
2
 
3
+ abstract class LI_ConfigFileReaderTrait
4
  {
5
  /** @var string */
6
  private $fileName;
16
  private function init($fileName)
17
  {
18
  if (!file_exists($fileName)) {
19
+ throw LI_InvalidArgumentException::fileNotExists($fileName);
20
  }
21
 
22
  $this->fileName = $fileName;
admin/inc/sources/Snowplow/RefererParser/Config/{ConfigReaderInterface.php → LI_ConfigReaderInterface.php} RENAMED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
- include('ConfigFileReaderTrait.php');
4
 
5
- abstract class ConfigReaderInterface extends ConfigFileReaderTrait
6
  {
7
  /**
8
  * @param string $lookupString
1
  <?php
2
 
3
+ include('LI_ConfigFileReaderTrait.php');
4
 
5
+ abstract class LI_ConfigReaderInterface extends LI_ConfigFileReaderTrait
6
  {
7
  /**
8
  * @param string $lookupString
admin/inc/sources/Snowplow/RefererParser/Config/{JsonConfigReader.php → LI_JsonConfigReader.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class JsonConfigReader extends ConfigReaderInterface
4
  {
5
  /** @var string */
6
  private $fileName;
@@ -16,7 +16,7 @@ class JsonConfigReader extends ConfigReaderInterface
16
  private function init($fileName)
17
  {
18
  if (!file_exists($fileName)) {
19
- throw InvalidArgumentException::fileNotExists($fileName);
20
  }
21
 
22
  $this->fileName = $fileName;
1
  <?php
2
 
3
+ class LI_JsonConfigReader extends LI_ConfigReaderInterface
4
  {
5
  /** @var string */
6
  private $fileName;
16
  private function init($fileName)
17
  {
18
  if (!file_exists($fileName)) {
19
+ throw LI_InvalidArgumentException::fileNotExists($fileName);
20
  }
21
 
22
  $this->fileName = $fileName;
admin/inc/sources/Snowplow/RefererParser/Exception/{InvalidArgumentException.php → LI_InvalidArgumentException.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class InvalidArgumentException extends BaseInvalidArgumentException
4
  {
5
  public static function fileNotExists($fileName)
6
  {
1
  <?php
2
 
3
+ class LI_InvalidArgumentException extends BaseInvalidArgumentException
4
  {
5
  public static function fileNotExists($fileName)
6
  {
admin/inc/sources/Snowplow/RefererParser/{Medium.php → LI_Medium.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- final class Medium
4
  {
5
  const SEARCH = 'search';
6
 
1
  <?php
2
 
3
+ final class LI_Medium
4
  {
5
  const SEARCH = 'search';
6
 
admin/inc/sources/Snowplow/RefererParser/{Parser.php → LI_Parser.php} RENAMED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
- include_once('Config/ConfigReaderInterface.php');
4
- include_once('Config/JsonConfigReader.php');
5
 
6
- class Parser
7
  {
8
  /** @var ConfigReaderInterface */
9
  private $configReader;
@@ -13,7 +13,7 @@ class Parser
13
  */
14
  private $internalHosts = array();
15
 
16
- public function __construct(ConfigReaderInterface $configReader = null, array $internalHosts = array() )
17
  {
18
  $this->configReader = $configReader ? $configReader : self::createDefaultConfigReader();
19
  $this->internalHosts = $internalHosts;
@@ -30,7 +30,7 @@ class Parser
30
  {
31
  $refererParts = $this->parseUrl($refererUrl);
32
  if (!$refererParts) {
33
- return Referer::createInvalid();
34
  }
35
 
36
  $pageUrlParts = $this->parseUrl($pageUrl);
@@ -40,13 +40,13 @@ class Parser
40
  if ($pageUrlParts
41
  && $pageUrlParts['host'] === $refererParts['host']
42
  || in_array($refererParts['host'], $this->internalHosts)) {
43
- return Referer::createInternal();
44
  }
45
 
46
  $referer = $this->lookup($refererParts['host'], $refererParts['path']);
47
 
48
  if (!$referer) {
49
- return Referer::createUnknown();
50
  }
51
 
52
  $searchTerm = null;
@@ -59,7 +59,7 @@ class Parser
59
  //}
60
  }
61
 
62
- return Referer::createKnown($referer['medium'], $referer['source'], $searchTerm);
63
  }
64
 
65
  private static function parseUrl($url)
@@ -116,6 +116,6 @@ class Parser
116
 
117
  private static function createDefaultConfigReader()
118
  {
119
- return new JsonConfigReader(LEADIN_PLUGIN_DIR . '/admin/inc/sources/referers.json');
120
  }
121
  }
1
  <?php
2
 
3
+ include_once('Config/LI_ConfigReaderInterface.php');
4
+ include_once('Config/LI_JsonConfigReader.php');
5
 
6
+ class LI_Parser
7
  {
8
  /** @var ConfigReaderInterface */
9
  private $configReader;
13
  */
14
  private $internalHosts = array();
15
 
16
+ public function __construct(LI_ConfigReaderInterface $configReader = null, array $internalHosts = array() )
17
  {
18
  $this->configReader = $configReader ? $configReader : self::createDefaultConfigReader();
19
  $this->internalHosts = $internalHosts;
30
  {
31
  $refererParts = $this->parseUrl($refererUrl);
32
  if (!$refererParts) {
33
+ return LI_Referer::createInvalid();
34
  }
35
 
36
  $pageUrlParts = $this->parseUrl($pageUrl);
40
  if ($pageUrlParts
41
  && $pageUrlParts['host'] === $refererParts['host']
42
  || in_array($refererParts['host'], $this->internalHosts)) {
43
+ return LI_Referer::createInternal();
44
  }
45
 
46
  $referer = $this->lookup($refererParts['host'], $refererParts['path']);
47
 
48
  if (!$referer) {
49
+ return LI_Referer::createUnknown();
50
  }
51
 
52
  $searchTerm = null;
59
  //}
60
  }
61
 
62
+ return LI_Referer::createKnown($referer['medium'], $referer['source'], $searchTerm);
63
  }
64
 
65
  private static function parseUrl($url)
116
 
117
  private static function createDefaultConfigReader()
118
  {
119
+ return new LI_JsonConfigReader(LEADIN_PLUGIN_DIR . '/admin/inc/sources/referers.json');
120
  }
121
  }
admin/inc/sources/Snowplow/RefererParser/{Referer.php → LI_Referer.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class Referer
4
  {
5
  /** @var string */
6
  private $medium;
@@ -27,7 +27,7 @@ class Referer
27
  public static function createUnknown()
28
  {
29
  $referer = new self();
30
- $referer->medium = Medium::UNKNOWN;
31
 
32
  return $referer;
33
  }
@@ -35,7 +35,7 @@ class Referer
35
  public static function createInternal()
36
  {
37
  $referer = new self();
38
- $referer->medium = Medium::INTERNAL;
39
 
40
  return $referer;
41
  }
@@ -43,7 +43,7 @@ class Referer
43
  public static function createInvalid()
44
  {
45
  $referer = new self();
46
- $referer->medium = Medium::INVALID;
47
 
48
  return $referer;
49
  }
@@ -51,13 +51,13 @@ class Referer
51
  /** @return boolean */
52
  public function isValid()
53
  {
54
- return $this->medium !== Medium::INVALID;
55
  }
56
 
57
  /** @return boolean */
58
  public function isKnown()
59
  {
60
- return !in_array($this->medium, array(Medium::UNKNOWN, Medium::INTERNAL, Medium::INVALID), true);
61
  }
62
 
63
  /** @return string */
1
  <?php
2
 
3
+ class LI_Referer
4
  {
5
  /** @var string */
6
  private $medium;
27
  public static function createUnknown()
28
  {
29
  $referer = new self();
30
+ $referer->medium = LI_Medium::UNKNOWN;
31
 
32
  return $referer;
33
  }
35
  public static function createInternal()
36
  {
37
  $referer = new self();
38
+ $referer->medium = LI_Medium::INTERNAL;
39
 
40
  return $referer;
41
  }
43
  public static function createInvalid()
44
  {
45
  $referer = new self();
46
+ $referer->medium = LI_Medium::INVALID;
47
 
48
  return $referer;
49
  }
51
  /** @return boolean */
52
  public function isValid()
53
  {
54
+ return $this->medium !== LI_Medium::INVALID;
55
  }
56
 
57
  /** @return boolean */
58
  public function isKnown()
59
  {
60
+ return !in_array($this->medium, array(LI_Medium::UNKNOWN, LI_Medium::INTERNAL, LI_Medium::INVALID), true);
61
  }
62
 
63
  /** @return string */
admin/leadin-admin.php CHANGED
@@ -639,6 +639,14 @@ class WPLeadInAdmin {
639
  <a href="mailto:team@leadin.com" target="_blank" class="button button-primary button-large">Suggest an idea</a>
640
  </li>
641
 
 
 
 
 
 
 
 
 
642
  </ul>
643
 
644
  <?php
639
  <a href="mailto:team@leadin.com" target="_blank" class="button button-primary button-large">Suggest an idea</a>
640
  </li>
641
 
642
+ <li class="powerup">
643
+ <h2>LeadIn VIP Program</h2>
644
+ <img src="<?php echo LEADIN_PATH; ?>/images/powerup-icon-vip@2x.png" height="80px" width="80px">
645
+ <p>Get access to exclusive features and offers for consultants and agencies.</p>
646
+ <p><a href="http://leadin.com/vip/" target="_blank">Learn more</a></p>
647
+ <a href="http://leadin.com/vip" target="_blank" class="button button-primary button-large">Become a VIP</a>
648
+ </li>
649
+
650
  </ul>
651
 
652
  <?php
images/powerup-icon-vip.png ADDED
Binary file
images/powerup-icon-vip@2x.png ADDED
Binary file
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: 1.1.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', '1.1.0');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
- define('LEADIN_PLUGIN_VERSION', '1.1.1');
30
 
31
  if ( !defined('MIXPANEL_PROJECT_TOKEN') )
32
  define('MIXPANEL_PROJECT_TOKEN', 'a9615503ec58a6bce2c646a58390eac1');
@@ -288,7 +288,9 @@ class WPLeadIn {
288
  {
289
  wp_register_script('leadin-tracking', LEADIN_PATH . '/assets/js/build/leadin-tracking.min.js', array ('jquery'), FALSE, TRUE);
290
  wp_enqueue_script('leadin-tracking');
291
- wp_localize_script('leadin-tracking', 'li_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
 
 
292
  }
293
  }
294
 
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: 1.2.0
7
  Author: Andy Cook, Nelson Joyce
8
  Author URI: http://leadin.com
9
  License: GPL2
26
  define('LEADIN_DB_VERSION', '1.1.0');
27
 
28
  if ( !defined('LEADIN_PLUGIN_VERSION') )
29
+ define('LEADIN_PLUGIN_VERSION', '1.2.0');
30
 
31
  if ( !defined('MIXPANEL_PROJECT_TOKEN') )
32
  define('MIXPANEL_PROJECT_TOKEN', 'a9615503ec58a6bce2c646a58390eac1');
288
  {
289
  wp_register_script('leadin-tracking', LEADIN_PATH . '/assets/js/build/leadin-tracking.min.js', array ('jquery'), FALSE, TRUE);
290
  wp_enqueue_script('leadin-tracking');
291
+
292
+ // replace https with http for admin-ajax calls for SSLed backends
293
+ wp_localize_script('leadin-tracking', 'li_ajax', array('ajax_url' => str_replace('https:', 'http:', admin_url('admin-ajax.php'))));
294
  }
295
  }
296
 
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: 1.1.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
 
@@ -90,8 +90,17 @@ To ensure quality we've tested the most popular WordPress form builder plugins.
90
 
91
  == Changelog ==
92
 
93
- - Current version: 1.1.1
94
- - Current version release: 2014-06-20
 
 
 
 
 
 
 
 
 
95
 
96
  = 1.1.1 (2014.06.20) =
97
  - 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: 1.2.0
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
 
90
 
91
  == Changelog ==
92
 
93
+ - Current version: 1.2.0
94
+ - Current version release: 2014-06-25
95
+
96
+ = 1.2.0 (2014.06.25) =
97
+ - Bug fixes
98
+ - Contacts with default "contact status" were not showing up in the contact list
99
+ - WordPress admin backends secured with SSL can now be used with LeadIn
100
+ - Namespaced the referrer parsing library for the Sources widget
101
+
102
+ = Enhancements =
103
+ - LeadIn VIP program
104
 
105
  = 1.1.1 (2014.06.20) =
106
  - Bug fixes