LiveChat – WP live chat plugin for WordPress - Version 4.4.9

Version Description

  • support for Elementor plugin
  • hide chat widget in Elementor preview
Download this release

Release Info

Developer livechat
Plugin Icon 128x128 LiveChat – WP live chat plugin for WordPress
Version 4.4.9
Comparing to
See all releases

Code changes from version 4.4.8 to 4.4.9

changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  == Changelog ==
2
 
 
 
 
 
3
  = 4.4.8 =
4
  * CDN for connect-bridge script
5
 
1
  == Changelog ==
2
 
3
+ = 4.4.9 =
4
+ * support for Elementor plugin
5
+ * hide chat widget in Elementor preview
6
+
7
  = 4.4.8 =
8
  * CDN for connect-bridge script
9
 
composer.lock CHANGED
@@ -340,16 +340,16 @@
340
  },
341
  {
342
  "name": "mockery/mockery",
343
- "version": "1.3.4",
344
  "source": {
345
  "type": "git",
346
  "url": "https://github.com/mockery/mockery.git",
347
- "reference": "31467aeb3ca3188158613322d66df81cedd86626"
348
  },
349
  "dist": {
350
  "type": "zip",
351
- "url": "https://api.github.com/repos/mockery/mockery/zipball/31467aeb3ca3188158613322d66df81cedd86626",
352
- "reference": "31467aeb3ca3188158613322d66df81cedd86626",
353
  "shasum": ""
354
  },
355
  "require": {
@@ -401,7 +401,7 @@
401
  "test double",
402
  "testing"
403
  ],
404
- "time": "2021-02-24T09:51:00+00:00"
405
  },
406
  {
407
  "name": "myclabs/deep-copy",
@@ -1683,7 +1683,6 @@
1683
  ],
1684
  "description": "Provides a list of PHP built-in functions that operate on resources",
1685
  "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1686
- "abandoned": true,
1687
  "time": "2015-07-28T20:34:47+00:00"
1688
  },
1689
  {
340
  },
341
  {
342
  "name": "mockery/mockery",
343
+ "version": "1.3.5",
344
  "source": {
345
  "type": "git",
346
  "url": "https://github.com/mockery/mockery.git",
347
+ "reference": "472fa8ca4e55483d55ee1e73c963718c4393791d"
348
  },
349
  "dist": {
350
  "type": "zip",
351
+ "url": "https://api.github.com/repos/mockery/mockery/zipball/472fa8ca4e55483d55ee1e73c963718c4393791d",
352
+ "reference": "472fa8ca4e55483d55ee1e73c963718c4393791d",
353
  "shasum": ""
354
  },
355
  "require": {
401
  "test double",
402
  "testing"
403
  ],
404
+ "time": "2021-09-13T15:33:03+00:00"
405
  },
406
  {
407
  "name": "myclabs/deep-copy",
1683
  ],
1684
  "description": "Provides a list of PHP built-in functions that operate on resources",
1685
  "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
 
1686
  "time": "2015-07-28T20:34:47+00:00"
1687
  },
1688
  {
languages/livechat-elementor.pot ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
+ "Project-Id-Version: LiveChat\n"
6
+ "POT-Creation-Date: 2021-09-26 20:55+0200\n"
7
+ "PO-Revision-Date: 2020-07-21 11:47+0200\n"
8
+ "Last-Translator: LiveChat, Inc <apps@livechatinc.com>\n"
9
+ "Language-Team: LiveChat, Inc <apps@livechatinc.com>\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 3.0\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-Flags-xgettext: --add-comments=translators:\n"
16
+ "X-Poedit-WPHeader: elementor-livechat.php\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
20
+ "_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
+ "X-Poedit-SearchPath-0: .\n"
22
+ "X-Poedit-SearchPathExcluded-0: *.min.js\n"
23
+ "X-Poedit-SearchPathExcluded-1: vendor\n"
24
+
25
+ #: plugin_files/Services/MenuProvider.class.php:155
26
+ #: plugin_files/Services/MenuProvider.class.php:156
27
+ #: plugin_files/Services/MenuProvider.class.php:222
28
+ msgid "Settings"
29
+ msgstr ""
30
+
31
+ #: plugin_files/Services/MenuProvider.class.php:164
32
+ #: plugin_files/Services/MenuProvider.class.php:165
33
+ msgid "Resources"
34
+ msgstr ""
35
+
36
+ #: plugin_files/Services/MenuProvider.class.php:182
37
+ #: plugin_files/Services/MenuProvider.class.php:183
38
+ msgid "Go to LiveChat"
39
+ msgstr ""
40
+
41
+ #: plugin_files/Services/Templates/ConfirmIdentityNoticeTemplate.class.php:20
42
+ msgid "Action required - confirm your identity"
43
+ msgstr ""
44
+
45
+ #: plugin_files/Services/Templates/ConfirmIdentityNoticeTemplate.class.php:22
46
+ msgid ""
47
+ "Thank you for updating LiveChat to the latest version. Please click Connect "
48
+ "to confirm your identity and finish the installation."
49
+ msgstr ""
50
+
51
+ #: plugin_files/Services/Templates/ConfirmIdentityNoticeTemplate.class.php:25
52
+ #: plugin_files/Services/Templates/ConnectNoticeTemplate.class.php:31
53
+ msgid "Connect"
54
+ msgstr ""
55
+
56
+ #: plugin_files/Services/Templates/ConnectNoticeTemplate.class.php:27
57
+ msgid "Action required - connect LiveChat"
58
+ msgstr ""
59
+
60
+ #: plugin_files/Services/Templates/ConnectNoticeTemplate.class.php:28
61
+ msgid "Please"
62
+ msgstr ""
63
+
64
+ #: plugin_files/Services/Templates/ConnectNoticeTemplate.class.php:29
65
+ msgid "connect your LiveChat account"
66
+ msgstr ""
67
+
68
+ #: plugin_files/Services/Templates/ConnectNoticeTemplate.class.php:30
69
+ msgid "to start chatting with your customers."
70
+ msgstr ""
71
+
72
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:25
73
+ msgid "Cancel"
74
+ msgstr ""
75
+
76
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:32
77
+ msgid "Quick Feedback"
78
+ msgstr ""
79
+
80
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:33
81
+ msgid ""
82
+ "If you have a moment, please let us know why you are deactivating LiveChat:"
83
+ msgstr ""
84
+
85
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:34
86
+ msgid "I no longer need the plugin."
87
+ msgstr ""
88
+
89
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:35
90
+ msgid "I couldn't get the plugin to work."
91
+ msgstr ""
92
+
93
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:36
94
+ msgid "I found a better plugin."
95
+ msgstr ""
96
+
97
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:37
98
+ msgid "It's a temporary deactivation."
99
+ msgstr ""
100
+
101
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:38
102
+ msgid "Other"
103
+ msgstr ""
104
+
105
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:39
106
+ msgid "Tell us more..."
107
+ msgstr ""
108
+
109
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:40
110
+ msgid "Please choose one of available options."
111
+ msgstr ""
112
+
113
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:41
114
+ msgid "Please provide additional feedback."
115
+ msgstr ""
116
+
117
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:45
118
+ msgid "Skip & continue"
119
+ msgstr ""
120
+
121
+ #: plugin_files/Services/Templates/DeactivationModalTemplate.class.php:46
122
+ msgid "Send feedback"
123
+ msgstr ""
124
+
125
+ #. Plugin Name of the plugin/theme
126
+ #. Author of the plugin/theme
127
+ msgid "LiveChat"
128
+ msgstr ""
129
+
130
+ #. Plugin URI of the plugin/theme
131
+ msgid "https://www.livechat.com/marketplace/apps/elementor/"
132
+ msgstr ""
133
+
134
+ #. Description of the plugin/theme
135
+ msgid ""
136
+ "Live chat software for live help, online sales and customer support. This "
137
+ "plugin allows to quickly install LiveChat on any WordPress website."
138
+ msgstr ""
139
+
140
+ #. Author URI of the plugin/theme
141
+ msgid "https://www.livechat.com"
142
+ msgstr ""
livechat.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LiveChat
4
  * Plugin URI: https://www.livechat.com/marketplace/apps/wordpress/
5
  * Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install LiveChat on any WordPress website.
6
- * Version: 4.4.8
7
  * Author: LiveChat
8
  * Author URI: https://www.livechat.com
9
  * Text Domain: wp-live-chat-software-for-wordpress
@@ -21,45 +21,78 @@ if ( class_exists( 'LiveChat\LiveChat' ) ) {
21
  require_once dirname( __FILE__ ) . '/vendor/autoload.php';
22
  require_once dirname( __FILE__ ) . '/config.php';
23
 
24
- /**
25
- * Checks if WooCommerce plugin is active.
26
- *
27
- * @return bool
28
- */
29
- function is_woo_plugin_active() {
30
- return in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins', array() ), true );
 
 
 
31
  }
32
 
33
- /**
34
- * Detects platform based on active plugins.
35
- *
36
- * @return string
37
- * @throws Exception
38
- */
39
- function get_detected_platform() {
40
- require_once dirname( __FILE__ ) . '/plugin_files/Services/PlatformProvider.class.php';
41
- return \LiveChat\Services\PlatformProvider::create()->get();
 
42
  }
43
 
44
- define( 'PLATFORM', get_detected_platform() );
45
 
46
- /**
47
- * Returns current platform.
48
- *
49
- * @return bool
50
- */
51
- function get_platform() {
52
- // phpcs:ignore WordPress.WP.CapitalPDangit.Misspelled
53
- return defined( 'PLATFORM' ) ? PLATFORM : 'wordpress';
 
 
 
54
  }
55
 
56
- /**
57
- * Checks if WooCommerce is current platform.
58
- *
59
- * @return bool
60
- */
61
- function is_woo() {
62
- return 'woocommerce' === get_platform();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
 
65
  if ( is_admin() ) {
3
  * Plugin Name: LiveChat
4
  * Plugin URI: https://www.livechat.com/marketplace/apps/wordpress/
5
  * Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install LiveChat on any WordPress website.
6
+ * Version: 4.4.9
7
  * Author: LiveChat
8
  * Author URI: https://www.livechat.com
9
  * Text Domain: wp-live-chat-software-for-wordpress
21
  require_once dirname( __FILE__ ) . '/vendor/autoload.php';
22
  require_once dirname( __FILE__ ) . '/config.php';
23
 
24
+
25
+ if ( ! function_exists( 'livechat_is_woo_plugin_active' ) ) {
26
+ /**
27
+ * Checks if WooCommerce plugin is active.
28
+ *
29
+ * @return bool
30
+ */
31
+ function livechat_is_woo_plugin_active() {
32
+ return in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins', array() ), true );
33
+ }
34
  }
35
 
36
+ if ( ! function_exists( 'livechat_is_elementor_plugin_active' ) ) {
37
+ /**
38
+ * Checks if Elementor plugin is active.
39
+ *
40
+ * @return bool
41
+ */
42
+ function livechat_is_elementor_plugin_active()
43
+ {
44
+ return in_array('elementor/elementor.php', get_option('active_plugins', array()), true);
45
+ }
46
  }
47
 
 
48
 
49
+ if ( ! function_exists( 'livechat_get_detected_platform' ) ) {
50
+ /**
51
+ * Detects platform based on active plugins.
52
+ *
53
+ * @return string
54
+ * @throws Exception
55
+ */
56
+ function livechat_get_detected_platform() {
57
+ require_once dirname( __FILE__ ) . '/plugin_files/Services/PlatformProvider.class.php';
58
+ return \LiveChat\Services\PlatformProvider::create()->get();
59
+ }
60
  }
61
 
62
+ define( 'PLATFORM', livechat_get_detected_platform() );
63
+
64
+ if ( ! function_exists( 'livechat_get_platform' ) ) {
65
+ /**
66
+ * Returns current platform.
67
+ *
68
+ * @return bool
69
+ */
70
+ function livechat_get_platform() {
71
+ // phpcs:ignore WordPress.WP.CapitalPDangit.Misspelled
72
+ return defined( 'PLATFORM' ) ? PLATFORM : 'wordpress';
73
+ }
74
+ }
75
+
76
+ if ( ! function_exists( 'livechat_is_woo' ) ) {
77
+ /**
78
+ * Checks if WooCommerce is current platform.
79
+ *
80
+ * @return bool
81
+ */
82
+ function livechat_is_woo() {
83
+ return 'woocommerce' === livechat_get_platform();
84
+ }
85
+ }
86
+
87
+ if ( ! function_exists( 'livechat_is_elementor' ) ) {
88
+ /**
89
+ * Checks if Elementor is current platform.
90
+ *
91
+ * @return bool
92
+ */
93
+ function livechat_is_elementor() {
94
+ return 'elementor' === livechat_get_platform();
95
+ }
96
  }
97
 
98
  if ( is_admin() ) {
plugin_files/LiveChat.class.php CHANGED
@@ -45,7 +45,7 @@ class LiveChat {
45
  add_action(
46
  'plugins_loaded',
47
  function () {
48
- if ( is_woo() ) {
49
  $customer_tracking = CustomerTrackingProvider::create();
50
  add_action( 'wp_ajax_lc-refresh-cart', array( $customer_tracking, 'ajax_get_customer_tracking' ) );
51
  add_action( 'wp_ajax_nopriv_lc-refresh-cart', array( $customer_tracking, 'ajax_get_customer_tracking' ) );
45
  add_action(
46
  'plugins_loaded',
47
  function () {
48
+ if ( livechat_is_woo() ) {
49
  $customer_tracking = CustomerTrackingProvider::create();
50
  add_action( 'wp_ajax_lc-refresh-cart', array( $customer_tracking, 'ajax_get_customer_tracking' ) );
51
  add_action( 'wp_ajax_nopriv_lc-refresh-cart', array( $customer_tracking, 'ajax_get_customer_tracking' ) );
plugin_files/Services/ApiClient.class.php CHANGED
@@ -69,7 +69,7 @@ class ApiClient {
69
  private function headers( $platform = null ) {
70
  return array(
71
  'Accept' => 'application/json',
72
- 'Platform' => $platform ? $platform : get_platform(),
73
  'Authorization' => sprintf( 'Bearer %s', $this->connect_token->get_token() ),
74
  );
75
  }
@@ -101,7 +101,7 @@ class ApiClient {
101
  $options = array(
102
  'headers' => array(
103
  'Accept' => 'application/x-pem-file',
104
- 'Platform' => get_platform(),
105
  ),
106
  );
107
 
69
  private function headers( $platform = null ) {
70
  return array(
71
  'Accept' => 'application/json',
72
+ 'Platform' => $platform ? $platform : livechat_get_platform(),
73
  'Authorization' => sprintf( 'Bearer %s', $this->connect_token->get_token() ),
74
  );
75
  }
101
  $options = array(
102
  'headers' => array(
103
  'Accept' => 'application/x-pem-file',
104
+ 'Platform' => livechat_get_platform(),
105
  ),
106
  );
107
 
plugin_files/Services/ModuleConfiguration.class.php CHANGED
@@ -72,11 +72,15 @@ class ModuleConfiguration {
72
  * @return string
73
  */
74
  public function get_extension_version() {
75
- if ( ! is_woo() ) {
76
- return '';
77
  }
78
 
79
- return defined( 'WOOCOMMERCE_VERSION' ) ? WOOCOMMERCE_VERSION : 'unknown';
 
 
 
 
80
  }
81
 
82
  /**
72
  * @return string
73
  */
74
  public function get_extension_version() {
75
+ if ( livechat_is_woo() ) {
76
+ return defined( 'WOOCOMMERCE_VERSION' ) ? WOOCOMMERCE_VERSION : 'unknown';
77
  }
78
 
79
+ if ( livechat_is_elementor() ) {
80
+ return defined( 'ELEMENTOR_VERSION' ) ? ELEMENTOR_VERSION : 'unknown';
81
+ }
82
+
83
+ return '';
84
  }
85
 
86
  /**
plugin_files/Services/Options/Deprecated/DeprecatedOption.class.php CHANGED
@@ -27,9 +27,9 @@ class DeprecatedOption extends ReadableOption {
27
  }
28
 
29
  parent::__construct(
30
- is_woo() ? $woo_key : $wp_key,
31
  null,
32
- DEPRECATED_OPTION_PREFIXES[ is_woo() ? 'woo-legacy' : 'wp-legacy' ]
33
  );
34
  }
35
  }
27
  }
28
 
29
  parent::__construct(
30
+ livechat_is_woo() ? $woo_key : $wp_key,
31
  null,
32
+ DEPRECATED_OPTION_PREFIXES[ livechat_is_woo() ? 'woo-legacy' : 'wp-legacy' ]
33
  );
34
  }
35
  }
plugin_files/Services/Options/Deprecated/Widget/DeprecatedWidgetSettings.class.php CHANGED
@@ -46,7 +46,7 @@ class DeprecatedWidgetSettings extends OptionsSet {
46
  * @return DeprecatedWidgetWooCommerceSettings|DeprecatedWidgetWordPressSettings
47
  */
48
  private function option() {
49
- if ( is_woo() ) {
50
  return $this->woo;
51
  }
52
 
46
  * @return DeprecatedWidgetWooCommerceSettings|DeprecatedWidgetWordPressSettings
47
  */
48
  private function option() {
49
+ if ( livechat_is_woo() ) {
50
  return $this->woo;
51
  }
52
 
plugin_files/Services/PlatformProvider.class.php CHANGED
@@ -34,6 +34,13 @@ class PlatformProvider {
34
  */
35
  public static $woocommerce_platform = 'woocommerce';
36
 
 
 
 
 
 
 
 
37
  /**
38
  * Instance of ApiClientFactory.
39
  *
@@ -89,7 +96,13 @@ class PlatformProvider {
89
  */
90
  private function get_default_platform() {
91
  // phpcs:ignore WordPress.WP.CapitalPDangit.Misspelled
92
- return is_woo_plugin_active() ? self::$woocommerce_platform : self::$wordpress_platform;
 
 
 
 
 
 
93
  }
94
 
95
  /**
@@ -98,9 +111,15 @@ class PlatformProvider {
98
  * @return string
99
  */
100
  private function get_platform_from_slug() {
101
- return 'wp-live-chat-software-for-wordpress' === PLUGIN_SLUG ?
102
- self::$wordpress_platform :
103
- self::$woocommerce_platform;
 
 
 
 
 
 
104
  }
105
 
106
  /**
@@ -111,7 +130,7 @@ class PlatformProvider {
111
  private function get_backend_platform() {
112
  try {
113
  $api_client = $this->api_client_factory->create();
114
- $platforms = array( self::$wordpress_platform, self::$woocommerce_platform );
115
 
116
  foreach ( $platforms as $platform ) {
117
  $response = $api_client->store_info( $platform );
34
  */
35
  public static $woocommerce_platform = 'woocommerce';
36
 
37
+ /**
38
+ * String of Elementor platform.
39
+ *
40
+ * @var string
41
+ */
42
+ public static $elementor_platform = 'elementor';
43
+
44
  /**
45
  * Instance of ApiClientFactory.
46
  *
96
  */
97
  private function get_default_platform() {
98
  // phpcs:ignore WordPress.WP.CapitalPDangit.Misspelled
99
+ if ( livechat_is_woo_plugin_active() ) {
100
+ return self::$woocommerce_platform;
101
+ } elseif ( livechat_is_elementor_plugin_active() ) {
102
+ return self::$elementor_platform;
103
+ } else {
104
+ return self::$wordpress_platform;
105
+ }
106
  }
107
 
108
  /**
111
  * @return string
112
  */
113
  private function get_platform_from_slug() {
114
+ switch ( PLUGIN_SLUG ) {
115
+ case 'livechat-woocommerce':
116
+ return self::$woocommerce_platform;
117
+ case 'livechat-elementor':
118
+ return self::$elementor_platform;
119
+ case 'wp-live-chat-software-for-wordpress':
120
+ default:
121
+ return self::$wordpress_platform;
122
+ }
123
  }
124
 
125
  /**
130
  private function get_backend_platform() {
131
  try {
132
  $api_client = $this->api_client_factory->create();
133
+ $platforms = array( self::$wordpress_platform, self::$woocommerce_platform, self::$elementor_platform );
134
 
135
  foreach ( $platforms as $platform ) {
136
  $response = $api_client->store_info( $platform );
plugin_files/Services/SetupProvider.class.php CHANGED
@@ -92,7 +92,7 @@ class SetupProvider {
92
  $this->load_design_system_styles();
93
  wp_enqueue_script( 'livechat', $this->plugin_url . 'js/livechat.js', 'jquery', $this->plugin_version, true );
94
  wp_enqueue_style( 'livechat', $this->plugin_url . 'css/livechat-general.css', false, $this->plugin_version );
95
- wp_enqueue_script( 'bridge', CONNECT_BRIDGE_SCRIPT_URL . '?lcv=' . $this->plugin_slug . '-' . $this->plugin_version, 'jquery');
96
 
97
  $config = array(
98
  'slug' => $this->plugin_slug,
92
  $this->load_design_system_styles();
93
  wp_enqueue_script( 'livechat', $this->plugin_url . 'js/livechat.js', 'jquery', $this->plugin_version, true );
94
  wp_enqueue_style( 'livechat', $this->plugin_url . 'css/livechat-general.css', false, $this->plugin_version );
95
+ wp_enqueue_script( 'bridge', CONNECT_BRIDGE_SCRIPT_URL . '?lcv=' . $this->plugin_slug . '-' . $this->plugin_version, 'jquery', $this->plugin_version, false );
96
 
97
  $config = array(
98
  'slug' => $this->plugin_slug,
plugin_files/Services/Templates/ChatWidgetScriptTemplate.class.php CHANGED
@@ -135,7 +135,7 @@ class ChatWidgetScriptTemplate extends Template {
135
  }
136
 
137
  $context = array(
138
- 'customerTrackingScript' => is_woo() ? $this->customer_tracking_template->render() : '',
139
  'widgetUrl' => $widget_url,
140
  );
141
 
135
  }
136
 
137
  $context = array(
138
+ 'customerTrackingScript' => livechat_is_woo() ? $this->customer_tracking_template->render() : '',
139
  'widgetUrl' => $widget_url,
140
  );
141
 
plugin_files/Services/Templates/SettingsTemplate.class.php CHANGED
@@ -129,21 +129,22 @@ class SettingsTemplate extends Template {
129
  * Renders iframe with Connect service.
130
  */
131
  public function render() {
132
- $context = array();
133
- $context['appUrl'] = esc_html( $this->url_provider->get_app_url() );
134
- $context['siteUrl'] = esc_html( $this->module->get_site_url() );
135
- $context['userEmail'] = esc_html( $this->user->get_user_data()['email'] );
136
- $context['userName'] = esc_html( $this->user->get_user_data()['name'] );
137
- $context['wpVer'] = esc_html( $this->module->get_wp_version() );
138
- $context['extensionVer'] = esc_html( $this->module->get_extension_version() );
139
- $context['moduleVer'] = esc_html( $this->module->get_plugin_version() );
140
- $context['lcToken'] = esc_html( $this->user->get_current_user_token() );
141
- $context['storeToken'] = esc_html( $this->store->get_store_token() );
142
- $context['partnerId'] = esc_html( LC_PARTNER_ID );
143
- $context['utmCampaign'] = esc_html( LC_UTM_CAMPAIGN );
144
- $context['license'] = esc_html( $this->license_provider->get_license_number() );
145
- $context['legacyOptions'] = wp_json_encode( $this->get_legacy_options() );
146
- $context['platform'] = esc_js( get_platform() );
 
147
 
148
  $this->template_parser->parse_template( 'connect.html.twig', $context );
149
  }
129
  * Renders iframe with Connect service.
130
  */
131
  public function render() {
132
+ $context = array();
133
+ $context['appUrl'] = esc_html( $this->url_provider->get_app_url() );
134
+ $context['siteUrl'] = esc_html( $this->module->get_site_url() );
135
+ $context['userEmail'] = esc_html( $this->user->get_user_data()['email'] );
136
+ $context['userName'] = esc_html( $this->user->get_user_data()['name'] );
137
+ $context['wpVer'] = esc_html( $this->module->get_wp_version() );
138
+ $context['extensionVer'] = esc_html( $this->module->get_extension_version() );
139
+ $context['moduleVer'] = esc_html( $this->module->get_plugin_version() );
140
+ $context['lcToken'] = esc_html( $this->user->get_current_user_token() );
141
+ $context['storeToken'] = esc_html( $this->store->get_store_token() );
142
+ $context['partnerId'] = esc_html( LC_PARTNER_ID );
143
+ $context['utmCampaign'] = esc_html( LC_UTM_CAMPAIGN );
144
+ $context['license'] = esc_html( $this->license_provider->get_license_number() );
145
+ $context['legacyOptions'] = wp_json_encode( $this->get_legacy_options() );
146
+ $context['platform'] = esc_js( livechat_get_platform() );
147
+ $context['platformLanguageVer'] = esc_html( phpversion() );
148
 
149
  $this->template_parser->parse_template( 'connect.html.twig', $context );
150
  }
plugin_files/Services/UrlProvider.class.php CHANGED
@@ -61,7 +61,7 @@ class UrlProvider {
61
  return sprintf(
62
  $this->app_url_format,
63
  is_null( $this->connect_token ) ? 'us' : $this->connect_token->get_api_region(),
64
- get_platform(),
65
  $path
66
  );
67
  }
61
  return sprintf(
62
  $this->app_url_format,
63
  is_null( $this->connect_token ) ? 'us' : $this->connect_token->get_api_region(),
64
+ livechat_get_platform(),
65
  $path
66
  );
67
  }
plugin_files/Services/WidgetProvider.class.php CHANGED
@@ -53,6 +53,14 @@ class WidgetProvider {
53
  * Sets widget script.
54
  */
55
  public function set_widget() {
 
 
 
 
 
 
 
 
56
  try {
57
  $this->chat_widget_script_template->render();
58
  } catch ( Exception $ex ) {
53
  * Sets widget script.
54
  */
55
  public function set_widget() {
56
+ if (
57
+ livechat_is_elementor() &&
58
+ class_exists( '\Elementor\Plugin' ) &&
59
+ \Elementor\Plugin::$instance->preview->is_preview_mode()
60
+ ) {
61
+ return;
62
+ }
63
+
64
  try {
65
  $this->chat_widget_script_template->render();
66
  } catch ( Exception $ex ) {
plugin_files/templates/connect.html.twig CHANGED
@@ -15,6 +15,7 @@
15
  var LICENSE = '{{ license }}';
16
  var LEGACY_OPTIONS = '{{ legacyOptions }}';
17
  var PLATFORM = '{{ platform }}';
 
18
 
19
  var PLATFORM_VERSION = [WP_VER, EXTENSION_VER].filter(Boolean).join('#');
20
 
@@ -100,6 +101,7 @@
100
  platformVer: PLATFORM_VERSION,
101
  moduleVer: MODULE_VER,
102
  options: parseOptions(LEGACY_OPTIONS),
 
103
  }));
104
  }
105
 
@@ -110,7 +112,8 @@
110
  userName: USER_NAME,
111
  platform: bridge.platform,
112
  platformVer: PLATFORM_VERSION,
113
- moduleVer: MODULE_VER
 
114
  }));
115
  }
116
 
@@ -121,6 +124,7 @@
121
  platform: bridge.platform,
122
  platformVer: PLATFORM_VERSION,
123
  moduleVer: MODULE_VER,
 
124
  partnerId: PARTNER_ID,
125
  utmCampaign: UTM_CAMPAIGN,
126
  license: LICENSE,
15
  var LICENSE = '{{ license }}';
16
  var LEGACY_OPTIONS = '{{ legacyOptions }}';
17
  var PLATFORM = '{{ platform }}';
18
+ var PLATFORM_LANGUAGE_VER = '{{ platformLanguageVer }}';
19
 
20
  var PLATFORM_VERSION = [WP_VER, EXTENSION_VER].filter(Boolean).join('#');
21
 
101
  platformVer: PLATFORM_VERSION,
102
  moduleVer: MODULE_VER,
103
  options: parseOptions(LEGACY_OPTIONS),
104
+ platformLanguageVer: PLATFORM_LANGUAGE_VER
105
  }));
106
  }
107
 
112
  userName: USER_NAME,
113
  platform: bridge.platform,
114
  platformVer: PLATFORM_VERSION,
115
+ moduleVer: MODULE_VER,
116
+ platformLanguageVer: PLATFORM_LANGUAGE_VER
117
  }));
118
  }
119
 
124
  platform: bridge.platform,
125
  platformVer: PLATFORM_VERSION,
126
  moduleVer: MODULE_VER,
127
+ platformLanguageVer: PLATFORM_LANGUAGE_VER,
128
  partnerId: PARTNER_ID,
129
  utmCampaign: UTM_CAMPAIGN,
130
  license: LICENSE,
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === LiveChat - WP live chat plugin for WordPress ===
2
  Contributors: LiveChat
3
  Tags: live chat, chat plugin, live chat plugin, wordpress live chat, wordpress chat,
4
- Stable tag: 4.4.8
5
  Requires PHP: 5.6
6
  Tested up to: 5.8
7
  Requires at least: 4.4
@@ -352,6 +352,10 @@ For more detailed instructions, go to the [live chat plugin page](https://www.li
352
 
353
  == Changelog ==
354
 
 
 
 
 
355
  = 4.4.8 =
356
  * CDN for connect-bridge script
357
 
1
  === LiveChat - WP live chat plugin for WordPress ===
2
  Contributors: LiveChat
3
  Tags: live chat, chat plugin, live chat plugin, wordpress live chat, wordpress chat,
4
+ Stable tag: 4.4.9
5
  Requires PHP: 5.6
6
  Tested up to: 5.8
7
  Requires at least: 4.4
352
 
353
  == Changelog ==
354
 
355
+ = 4.4.9 =
356
+ * support for Elementor plugin
357
+ * hide chat widget in Elementor preview
358
+
359
  = 4.4.8 =
360
  * CDN for connect-bridge script
361
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit3c354eeb2267a0113fc9c3ce9c7a7dfa::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitc9e00ab76f34e1502e32ce443cc37a87::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -6,6 +6,8 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
 
9
  'LiveChat\\Drivers\\HttpClient' => $baseDir . '/plugin_files/Drivers/HttpClient.class.php',
10
  'LiveChat\\Drivers\\HttpClientTest' => $baseDir . '/plugin_files/tests/drivers/HttpClientTest.class.php',
11
  'LiveChat\\Drivers\\WP_Error' => $baseDir . '/plugin_files/tests/drivers/HttpClientTest.class.php',
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Elementor\\Plugin' => $baseDir . '/plugin_files/tests/services/WidgetProviderTest.class.php',
10
+ 'Elementor\\Preview' => $baseDir . '/plugin_files/tests/services/WidgetProviderTest.class.php',
11
  'LiveChat\\Drivers\\HttpClient' => $baseDir . '/plugin_files/Drivers/HttpClient.class.php',
12
  'LiveChat\\Drivers\\HttpClientTest' => $baseDir . '/plugin_files/tests/drivers/HttpClientTest.class.php',
13
  'LiveChat\\Drivers\\WP_Error' => $baseDir . '/plugin_files/tests/drivers/HttpClientTest.class.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit3c354eeb2267a0113fc9c3ce9c7a7dfa
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit3c354eeb2267a0113fc9c3ce9c7a7dfa
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit3c354eeb2267a0113fc9c3ce9c7a7dfa', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit3c354eeb2267a0113fc9c3ce9c7a7dfa', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit3c354eeb2267a0113fc9c3ce9c7a7dfa::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitc9e00ab76f34e1502e32ce443cc37a87
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitc9e00ab76f34e1502e32ce443cc37a87', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitc9e00ab76f34e1502e32ce443cc37a87', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInitc9e00ab76f34e1502e32ce443cc37a87::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit3c354eeb2267a0113fc9c3ce9c7a7dfa
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'L' =>
@@ -29,6 +29,8 @@ class ComposerStaticInit3c354eeb2267a0113fc9c3ce9c7a7dfa
29
  );
30
 
31
  public static $classMap = array (
 
 
32
  'LiveChat\\Drivers\\HttpClient' => __DIR__ . '/../..' . '/plugin_files/Drivers/HttpClient.class.php',
33
  'LiveChat\\Drivers\\HttpClientTest' => __DIR__ . '/../..' . '/plugin_files/tests/drivers/HttpClientTest.class.php',
34
  'LiveChat\\Drivers\\WP_Error' => __DIR__ . '/../..' . '/plugin_files/tests/drivers/HttpClientTest.class.php',
@@ -156,9 +158,9 @@ class ComposerStaticInit3c354eeb2267a0113fc9c3ce9c7a7dfa
156
  public static function getInitializer(ClassLoader $loader)
157
  {
158
  return \Closure::bind(function () use ($loader) {
159
- $loader->prefixLengthsPsr4 = ComposerStaticInit3c354eeb2267a0113fc9c3ce9c7a7dfa::$prefixLengthsPsr4;
160
- $loader->prefixDirsPsr4 = ComposerStaticInit3c354eeb2267a0113fc9c3ce9c7a7dfa::$prefixDirsPsr4;
161
- $loader->classMap = ComposerStaticInit3c354eeb2267a0113fc9c3ce9c7a7dfa::$classMap;
162
 
163
  }, null, ClassLoader::class);
164
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitc9e00ab76f34e1502e32ce443cc37a87
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'L' =>
29
  );
30
 
31
  public static $classMap = array (
32
+ 'Elementor\\Plugin' => __DIR__ . '/../..' . '/plugin_files/tests/services/WidgetProviderTest.class.php',
33
+ 'Elementor\\Preview' => __DIR__ . '/../..' . '/plugin_files/tests/services/WidgetProviderTest.class.php',
34
  'LiveChat\\Drivers\\HttpClient' => __DIR__ . '/../..' . '/plugin_files/Drivers/HttpClient.class.php',
35
  'LiveChat\\Drivers\\HttpClientTest' => __DIR__ . '/../..' . '/plugin_files/tests/drivers/HttpClientTest.class.php',
36
  'LiveChat\\Drivers\\WP_Error' => __DIR__ . '/../..' . '/plugin_files/tests/drivers/HttpClientTest.class.php',
158
  public static function getInitializer(ClassLoader $loader)
159
  {
160
  return \Closure::bind(function () use ($loader) {
161
+ $loader->prefixLengthsPsr4 = ComposerStaticInitc9e00ab76f34e1502e32ce443cc37a87::$prefixLengthsPsr4;
162
+ $loader->prefixDirsPsr4 = ComposerStaticInitc9e00ab76f34e1502e32ce443cc37a87::$prefixDirsPsr4;
163
+ $loader->classMap = ComposerStaticInitc9e00ab76f34e1502e32ce443cc37a87::$classMap;
164
 
165
  }, null, ClassLoader::class);
166
  }