Tidio Live Chat - Version 3.5.0

Version Description

  • Change domain to tidio.com in URL
  • Change path in login URL
  • Added ability to integrate with Tidio affiliate program
Download this release

Release Info

Developer lucastidio
Plugin Icon 128x128 Tidio Live Chat
Version 3.5.0
Comparing to
See all releases

Code changes from version 3.4.0 to 3.5.0

Files changed (2) hide show
  1. readme.txt +10 -5
  2. tidio-elements.php +27 -7
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Tidio Live Chat ===
2
- Contributors: tytus-tytus, lucastidio
3
  Tags: free live chat, plugin, facebook, admin, live chat, chat, livechat, post, tidio, widget, post, posts, twitter, zendesk, mailchimp
4
  Requires at least: 3.0
5
- Tested up to: 5.0
6
  Stable tag: trunk
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -59,9 +59,9 @@ Right after you install, open the “Tidio Chat” tab, and you’re ready to go
59
  * Russian
60
  * Swedish
61
 
62
- If you're lacking support of your language, please contact us on contact[at]tidio.net or visit our website www.tidiochat.com
63
 
64
- Please note that Tidio Chat is free. After activating the plugin, your 7 day trial period will begin. When the trial period is finished, you can downgrade your account to Free or continue to use the PRO account. [More information here](http://www.tidiochat.com/en/pricing "Live Chat Pricing").
65
 
66
  == Installation ==
67
  1. Go to WordPress Control Panel
@@ -116,11 +116,16 @@ Yes, simply go to your chat panel and switch the “Display” option to off.
116
  == Screenshots ==
117
  1. Live Chat - instantly reply to people who visit your website
118
  2. Intuitive Chat Panel - manage and monitor all conversations and visitors in one place
119
- 3. Automations - set up automated messages triggered by predefined actions
120
  4. Dedicated app for mobile and desktop devices (iOS, Android, Chrome, Windows, OS X)
121
 
122
  == Changelog ==
123
 
 
 
 
 
 
124
  = 3.4.0 =
125
  * Add asynchronous loading of chat widget option
126
  * Code cleanup
1
  === Tidio Live Chat ===
2
+ Contributors: tytus-tytus, lucastidio, marcingwizdala
3
  Tags: free live chat, plugin, facebook, admin, live chat, chat, livechat, post, tidio, widget, post, posts, twitter, zendesk, mailchimp
4
  Requires at least: 3.0
5
+ Tested up to: 5.2
6
  Stable tag: trunk
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
59
  * Russian
60
  * Swedish
61
 
62
+ If you're lacking support of your language, please contact us on contact[at]tidio.net or visit our website www.tidio.com
63
 
64
+ Please note that Tidio Chat is free. After activating the plugin, your 7 day trial period will begin. When the trial period is finished, you can downgrade your account to Free or continue to use the PRO account. [More information here](http://www.tidio.com/en/pricing "Live Chat Pricing").
65
 
66
  == Installation ==
67
  1. Go to WordPress Control Panel
116
  == Screenshots ==
117
  1. Live Chat - instantly reply to people who visit your website
118
  2. Intuitive Chat Panel - manage and monitor all conversations and visitors in one place
119
+ 3. Chatbots - set up automated messages triggered by predefined actions
120
  4. Dedicated app for mobile and desktop devices (iOS, Android, Chrome, Windows, OS X)
121
 
122
  == Changelog ==
123
 
124
+ = 3.5.0 =
125
+ * Change domain to tidio.com in URL
126
+ * Change path in login URL
127
+ * Added ability to integrate with Tidio affiliate program
128
+
129
  = 3.4.0 =
130
  * Add asynchronous loading of chat widget option
131
  * Code cleanup
tidio-elements.php CHANGED
@@ -4,18 +4,19 @@
4
  * Plugin Name: Tidio Chat
5
  * Plugin URI: http://www.tidiochat.com
6
  * Description: Tidio Live Chat - Live chat for your website. No logging in, no signing up - integrates with your website in less than 20 seconds.
7
- * Version: 3.4.0
8
  * Author: Tidio Ltd.
9
  * Author URI: http://www.tidiochat.com
10
  * License: GPL2
11
  */
12
- define('TIDIOCHAT_VERSION', '3.4.0');
 
13
 
14
  class TidioLiveChat
15
  {
16
  const SCRIPT_URL = '//code.tidio.co/';
17
  const API_URL = 'https://api-v2.tidio.co';
18
- const CHAT_URL = 'https://www.tidiochat.com';
19
  const PUBLIC_KEY_OPTION = 'tidio-one-public-key';
20
  const PRIVATE_KEY_OPTION = 'tidio-one-private-key';
21
  const ASYNC_LOAD_OPTION = 'tidio-async-load';
@@ -135,7 +136,7 @@ class TidioLiveChat
135
  public static function getContent($url)
136
  {
137
 
138
- if (function_exists('curl_version')) { // load trought curl
139
  $ch = curl_init();
140
 
141
  curl_setopt($ch, CURLOPT_HEADER, 0);
@@ -146,19 +147,38 @@ class TidioLiveChat
146
  curl_close($ch);
147
 
148
  return $data;
149
- } else { // load trought file get contents
150
  return file_get_contents($url);
151
  }
152
  }
153
 
 
 
 
 
 
 
 
 
154
  public static function getAccessUrl()
155
  {
156
- return TidioLiveChat::API_URL . '/access/external/create?url=' . urlencode(site_url()) . '&platform=wordpress&email=' . urlencode(get_option('admin_email')) . '&_ip=' . $_SERVER['REMOTE_ADDR'];
 
 
 
 
 
 
 
 
 
 
 
157
  }
158
 
159
  public static function getRedirectUrl($privateKey)
160
  {
161
- return TidioLiveChat::CHAT_URL . '/access?' . http_build_query(
162
  array(
163
  'privateKey' => $privateKey,
164
  'utm_source' => 'platform',
4
  * Plugin Name: Tidio Chat
5
  * Plugin URI: http://www.tidiochat.com
6
  * Description: Tidio Live Chat - Live chat for your website. No logging in, no signing up - integrates with your website in less than 20 seconds.
7
+ * Version: 3.5.0
8
  * Author: Tidio Ltd.
9
  * Author URI: http://www.tidiochat.com
10
  * License: GPL2
11
  */
12
+ define('TIDIOCHAT_VERSION', '3.5.0');
13
+ define('AFFILIATE_CONFIG_FILE_PATH', get_template_directory().'/tidio_affiliate_ref_id.txt');
14
 
15
  class TidioLiveChat
16
  {
17
  const SCRIPT_URL = '//code.tidio.co/';
18
  const API_URL = 'https://api-v2.tidio.co';
19
+ const CHAT_URL = 'https://www.tidio.com';
20
  const PUBLIC_KEY_OPTION = 'tidio-one-public-key';
21
  const PRIVATE_KEY_OPTION = 'tidio-one-private-key';
22
  const ASYNC_LOAD_OPTION = 'tidio-async-load';
136
  public static function getContent($url)
137
  {
138
 
139
+ if (function_exists('curl_version')) { // load through curl
140
  $ch = curl_init();
141
 
142
  curl_setopt($ch, CURLOPT_HEADER, 0);
147
  curl_close($ch);
148
 
149
  return $data;
150
+ } else { // load through file get contents
151
  return file_get_contents($url);
152
  }
153
  }
154
 
155
+ public static function readRefIDFromFile() {
156
+ try {
157
+ $loadedRefIdFromFile = @file_get_contents(AFFILIATE_CONFIG_FILE_PATH);
158
+ return trim($loadedRefIdFromFile);
159
+ } catch (Exception $e){}
160
+ return null;
161
+ }
162
+
163
  public static function getAccessUrl()
164
  {
165
+ $parameters = array(
166
+ 'url' => site_url(),
167
+ 'platform' => 'wordpress',
168
+ 'email' => get_option('admin_email'),
169
+ '_ip' => $_SERVER['REMOTE_ADDR'],
170
+ );
171
+ $refIdFromFile = TidioLiveChat::readRefIDFromFile();
172
+ if (isset($refIdFromFile)) {
173
+ $parameters['ref_id'] = $refIdFromFile;
174
+ }
175
+ $accessUrlParameters = http_build_query($parameters);
176
+ return TidioLiveChat::API_URL . '/access/external/create?'.$accessUrlParameters;
177
  }
178
 
179
  public static function getRedirectUrl($privateKey)
180
  {
181
+ return TidioLiveChat::CHAT_URL . '/panel/external-access?' . http_build_query(
182
  array(
183
  'privateKey' => $privateKey,
184
  'utm_source' => 'platform',