HubSpot – Free Marketing Plugin for WordPress - Version 7.2.2

Version Description

(2019.04.09) - Fix for whitespace bug

Download this release

Release Info

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

Code changes from version 7.1.1 to 7.2.2

Files changed (5) hide show
  1. admin/leadin-admin.php +19 -15
  2. assets/leadin.css +4 -0
  3. assets/leadin.js +28 -0
  4. leadin.php +2 -2
  5. readme.txt +16 -3
admin/leadin-admin.php CHANGED
@@ -17,8 +17,11 @@ if ( ! defined( 'LEADIN_ADMIN_PATH' ) ) {
17
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
18
 
19
  function action_required_notice(){
 
 
20
  $leadin_icon = LEADIN_PATH . '/images/sprocket.svg';
21
  echo '<div class="notice notice-warning is-dismissible"><p><img src="' . $leadin_icon . '" height="16" style="margin-bottom: -3px" /> The HubSpot plugin isn’t connected right now. To use HubSpot tools on your WordPress site, <a href="admin.php?page=leadin">connect the plugin now</a>.</p></div>';
 
22
  }
23
 
24
  // =============================================
@@ -50,6 +53,7 @@ class WPLeadInAdmin {
50
  add_action( 'admin_menu', array( &$this, 'leadin_add_menu_items' ) );
51
  add_action( 'admin_print_scripts', array( &$this, 'add_leadin_admin_scripts' ) );
52
  add_filter( 'plugin_action_links_' . 'leadin/leadin.php', array( $this, 'leadin_plugin_settings_link' ) );
 
53
 
54
  if ($affiliate = $this->get_affiliate_code()) {
55
  add_option( 'hubspot_affiliate_code', $affiliate );
@@ -160,18 +164,16 @@ class WPLeadInAdmin {
160
  /**
161
  * Creates leadin app
162
  */
163
-
164
  function leadin_build_app() {
165
- global $wp_version;
166
-
167
- echo '<div id="leadin" class="wrap ' . ( $wp_version < 3.8 && ! is_plugin_active( 'mp6/mp6.php' ) ? 'pre-mp6' : '' ) . '"></div>';
168
-
169
  wp_enqueue_style( 'leadin-bridge-css' );
170
- wp_enqueue_script( 'leadin-bridge-app' );
171
-
172
  }
173
 
174
- function update_option_leadin_options_callback( $old_value, $new_value ) {
 
 
 
 
 
175
  }
176
 
177
  // =============================================
@@ -219,14 +221,16 @@ class WPLeadInAdmin {
219
  'wpUserEmail' => $wpUser->user_email,
220
  );
221
 
222
- if ( ( $pagenow == 'admin.php' && isset( $_GET['page'] ) && strstr( $_GET['page'], 'leadin' ) ) ) { // WPCS: CSRF ok.
223
- wp_register_script( 'leadin-head-js', leadin_get_resource_url( '/bundle/head/head.js' ), false, false, false );
224
- wp_localize_script( 'leadin-head-js', 'leadin_config', $leadin_config );
225
- wp_enqueue_script( 'leadin-head-js' );
226
 
227
- wp_register_script( 'leadin-bridge-app', leadin_get_resource_url( '/bundle/app.js' ), array( 'backbone' ), false, true );
228
- wp_register_style( 'leadin-bridge-css', leadin_get_resource_url( '/bundle/app.css' ) );
229
- }
 
 
 
230
  }
231
 
232
  // =============================================
17
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
18
 
19
  function action_required_notice(){
20
+ $current_screen = get_current_screen();
21
+ if ( $current_screen->parent_base !== 'leadin' ) {
22
  $leadin_icon = LEADIN_PATH . '/images/sprocket.svg';
23
  echo '<div class="notice notice-warning is-dismissible"><p><img src="' . $leadin_icon . '" height="16" style="margin-bottom: -3px" /> The HubSpot plugin isn’t connected right now. To use HubSpot tools on your WordPress site, <a href="admin.php?page=leadin">connect the plugin now</a>.</p></div>';
24
+ }
25
  }
26
 
27
  // =============================================
53
  add_action( 'admin_menu', array( &$this, 'leadin_add_menu_items' ) );
54
  add_action( 'admin_print_scripts', array( &$this, 'add_leadin_admin_scripts' ) );
55
  add_filter( 'plugin_action_links_' . 'leadin/leadin.php', array( $this, 'leadin_plugin_settings_link' ) );
56
+ add_action( 'admin_notices', array( &$this, 'leadin_add_iframe' ) );
57
 
58
  if ($affiliate = $this->get_affiliate_code()) {
59
  add_option( 'hubspot_affiliate_code', $affiliate );
164
  /**
165
  * Creates leadin app
166
  */
 
167
  function leadin_build_app() {
 
 
 
 
168
  wp_enqueue_style( 'leadin-bridge-css' );
 
 
169
  }
170
 
171
+ /**
172
+ * Add iframe
173
+ */
174
+ function leadin_add_iframe() {
175
+ global $wp_version;
176
+ echo '<div id="leadin" class="' . ( $wp_version < 3.8 && ! is_plugin_active( 'mp6/mp6.php' ) ? 'pre-mp6' : '' ) . '"></div>';
177
  }
178
 
179
  // =============================================
221
  'wpUserEmail' => $wpUser->user_email,
222
  );
223
 
224
+ wp_register_script( 'leadin-head-js', leadin_get_resource_url( '/bundle/head/head.js' ), false, false, false );
225
+ wp_localize_script( 'leadin-head-js', 'leadin_config', $leadin_config );
226
+ wp_enqueue_script( 'leadin-head-js' );
 
227
 
228
+ wp_register_script( 'leadin-bridge-app', leadin_get_resource_url( '/bundle/app.js' ), array( 'backbone' ), false, true );
229
+ wp_register_style( 'leadin-bridge-css', leadin_get_resource_url( '/bundle/app.css' ) );
230
+ wp_register_script( 'leadin-js', LEADIN_PATH.'/assets/leadin.js', false, false, true );
231
+
232
+ wp_enqueue_script( 'leadin-bridge-app' );
233
+ wp_enqueue_script( 'leadin-js' );
234
  }
235
 
236
  // =============================================
assets/leadin.css CHANGED
@@ -30,3 +30,7 @@
30
  .dashicons-sprocket:before {
31
  content: "\61";
32
  }
 
 
 
 
30
  .dashicons-sprocket:before {
31
  content: "\61";
32
  }
33
+
34
+ #leadin-bridge-container {
35
+ display: none !important;
36
+ }
assets/leadin.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ 'use strict';
3
+ // Elements
4
+ var leadinMenu = document.getElementById('toplevel_page_leadin');
5
+ var firstSubMenu = leadinMenu && leadinMenu.querySelector('.wp-first-item');
6
+
7
+ // HubSpot Env
8
+ var leadinConfig = window.leadin_config || {};
9
+ var hsEnv = leadinConfig.env || 'prod';
10
+ var hubspotBaseUrl =
11
+ 'https://app.hubspot' + (hsEnv === 'prod' ? '' : 'qa') + '.com';
12
+ var portalId = leadinConfig.portalId;
13
+
14
+ function addChatflowsToMenu() {
15
+ var chatflowsUrl = hubspotBaseUrl + '/chatflows/' + portalId;
16
+ var chatflowsHtml =
17
+ '<li><a href="' + chatflowsUrl + '" target="_blank">Chatflows</a></li>';
18
+ if (firstSubMenu) {
19
+ firstSubMenu.insertAdjacentHTML('afterend', chatflowsHtml);
20
+ }
21
+ }
22
+
23
+ function main() {
24
+ addChatflowsToMenu();
25
+ }
26
+
27
+ main();
28
+ })();
leadin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: HubSpot All-In-One Marketing - Forms, Popups, Live Chat
4
  Plugin URI: http://www.hubspot.com/integrations/wordpress
5
  Description: HubSpot’s official WordPress plugin allows you to add forms, popups, and live chat to your website and integrate with the best WordPress CRM.
6
- Version: 7.1.1
7
  Author: HubSpot
8
  Author URI: http://www.hubspot.com
9
  License: GPL2
@@ -33,7 +33,7 @@ if ( ! defined( 'LEADIN_DB_VERSION' ) ) {
33
  }
34
 
35
  if ( ! defined( 'LEADIN_PLUGIN_VERSION' ) ) {
36
- define( 'LEADIN_PLUGIN_VERSION', '7.1.1' );
37
  }
38
 
39
  if ( ! defined( 'LEADIN_SOURCE' ) ) {
3
  Plugin Name: HubSpot All-In-One Marketing - Forms, Popups, Live Chat
4
  Plugin URI: http://www.hubspot.com/integrations/wordpress
5
  Description: HubSpot’s official WordPress plugin allows you to add forms, popups, and live chat to your website and integrate with the best WordPress CRM.
6
+ Version: 7.2.2
7
  Author: HubSpot
8
  Author URI: http://www.hubspot.com
9
  License: GPL2
33
  }
34
 
35
  if ( ! defined( 'LEADIN_PLUGIN_VERSION' ) ) {
36
+ define( 'LEADIN_PLUGIN_VERSION', '7.2.2' );
37
  }
38
 
39
  if ( ! defined( 'LEADIN_SOURCE' ) ) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: HubSpotDev, leadin
3
  Tags: forms, popup, live chat, contact form, crm, newsletter, marketing, lead generation, hubspot, mailchimp, constant contact
4
  Requires at least: 3.7
5
  Tested up to: 5.1
6
- Stable tag: 7.1.1
7
 
8
  HubSpot All-In-One Marketing, is a free all-in-one marketing plugin that allows you to easily use HubSpot forms, popups, and live chat on your WordPress site. If you’re already a HubSpot user, the plugin lets you connect your HubSpot account to your website without any code.
9
 
@@ -161,8 +161,21 @@ Please <a href="https://community.hubspot.com?utm_source=wordpress-plugin-listin
161
 
162
  == Changelog ==
163
 
164
- - Current version: 7.1.1
165
- - Current version release: 2019-04-01
 
 
 
 
 
 
 
 
 
 
 
 
 
166
 
167
  = 7.1.0 (2019.04.01) =
168
  - Remove slumber/oauth mode
3
  Tags: forms, popup, live chat, contact form, crm, newsletter, marketing, lead generation, hubspot, mailchimp, constant contact
4
  Requires at least: 3.7
5
  Tested up to: 5.1
6
+ Stable tag: 7.2.2
7
 
8
  HubSpot All-In-One Marketing, is a free all-in-one marketing plugin that allows you to easily use HubSpot forms, popups, and live chat on your WordPress site. If you’re already a HubSpot user, the plugin lets you connect your HubSpot account to your website without any code.
9
 
161
 
162
  == Changelog ==
163
 
164
+ - Current version: 7.2.2
165
+ - Current version release: 2019-04-08
166
+
167
+ = 7.2.2 (2019.04.09)
168
+ - Fix for whitespace bug
169
+
170
+ = 7.2.1 (2019.04.08)
171
+ - Added link to Chatflows
172
+
173
+ = 7.2.0 (2019.04.03) =
174
+ - Add background iframe
175
+
176
+ = 7.1.1 (2019.04.03) =
177
+ - Remove OAuth step from signup
178
+ - Fix assets in listing
179
 
180
  = 7.1.0 (2019.04.01) =
181
  - Remove slumber/oauth mode