Zendesk Chat - Version 1.2.7

Version Description

  • Plugin will now embed v2 Widget
  • Improved Login Response
  • Classic Theme Editor remove to use Dashboard Widget Customization Click on Appearance to make changes to your widget
  • Old Javascript API from v1 Widget may not work with v2 Widget Visit http://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html for more details
Download this release

Release Info

Developer bencxr
Plugin Icon 128x128 Zendesk Chat
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.6 to 1.2.7

Files changed (7) hide show
  1. accountconfig.php +11 -8
  2. readme.txt +25 -12
  3. screenshot-1.png +0 -0
  4. screenshot-2.png +0 -0
  5. screenshot-3.png +0 -0
  6. screenshot-4.png +0 -0
  7. zopim.php +26 -18
accountconfig.php CHANGED
@@ -9,7 +9,6 @@ function zopim_account_config() {
9
  <div class="wrap">
10
 
11
  <?php
12
-
13
  if (isset($_GET["action"]) && $_GET["action"]=="deactivate") {
14
  update_option('zopimSalt', "");
15
  update_option('zopimCode', "zopim");
@@ -25,11 +24,10 @@ function zopim_account_config() {
25
 
26
  update_option('zopimUseSSL', $_POST["zopimUseSSL"]);
27
 
28
- if ($_POST["zopimPassword"] != "password") {
29
 
30
- $logindata = array("email" => $_POST["zopimUsername"], "password" => $_POST["zopimPassword"]);
31
  $loginresult = json_to_array(zopim_post_request(ZOPIM_LOGIN_URL, $logindata));
32
-
33
  if (isset($loginresult->error)) {
34
  $error["login"] = "<b>Could not log in to Zopim. Please check your login details. If problem persists, try connecting without SSL enabled.</b>";
35
  $gotologin = 1;
@@ -38,6 +36,7 @@ function zopim_account_config() {
38
  update_option('zopimUsername', $_POST["zopimUsername"]);
39
  update_option('zopimSalt', $loginresult->salt);
40
  $account = getAccountDetails(get_option('zopimSalt'));
 
41
 
42
  if (isset($account)) {
43
  update_option('zopimCode', $account->account_key);
@@ -52,6 +51,11 @@ function zopim_account_config() {
52
  $error["login"] = "<b>Could not log in to Zopim. We were unable to contact Zopim servers. Please check with your server administrator to ensure that <a href='http://www.php.net/manual/en/book.curl.php'>PHP Curl</a> is installed and permissions are set correctly.</b>";
53
  }
54
  }
 
 
 
 
 
55
  } else if (isset($_POST["action"]) && $_POST["action"]=="signup") {
56
 
57
  if ($_POST["zopimUseSSL"] == "") {
@@ -81,7 +85,6 @@ function zopim_account_config() {
81
  }
82
  }
83
 
84
- $error = NULL;
85
  if (get_option('zopimCode') != "" && get_option('zopimCode') != "zopim") {
86
 
87
  $accountDetails = getAccountDetails(get_option('zopimSalt'));
@@ -108,6 +111,7 @@ function zopim_account_config() {
108
  } else {
109
  $accountDetails->package_id .= " Package";
110
  }
 
111
  ?>
112
  <div id="icon-options-general" class="icon32"><br/></div><h2>Set up your Zopim Account</h2>
113
  <br/>
@@ -143,8 +147,7 @@ Currently Activated Account &rarr; <b><?php echo get_option('zopimUsername'); ?>
143
  } else if ($message == "") { ?>
144
  Congratulations on successfully installing the Zopim WordPress plugin! Activate an account to start using Zopim Live Chat.<br>
145
  <br>
146
- <?php } else { echo $message; } ?>
147
-
148
  <div id="existingform">
149
  <div class="metabox-holder">
150
  <div class="postbox">
@@ -188,4 +191,4 @@ Congratulations on successfully installing the Zopim WordPress plugin! Activate
188
  </div>
189
 
190
 
191
- <?php } } ?>
9
  <div class="wrap">
10
 
11
  <?php
 
12
  if (isset($_GET["action"]) && $_GET["action"]=="deactivate") {
13
  update_option('zopimSalt', "");
14
  update_option('zopimCode', "zopim");
24
 
25
  update_option('zopimUseSSL', $_POST["zopimUseSSL"]);
26
 
27
+ if ($_POST["zopimUsername"] != "" && $_POST["zopimPassword"] != "") {
28
 
29
+ $logindata = array("email" => $_POST["zopimUsername"], "password" => $_POST["zopimPassword"]);
30
  $loginresult = json_to_array(zopim_post_request(ZOPIM_LOGIN_URL, $logindata));
 
31
  if (isset($loginresult->error)) {
32
  $error["login"] = "<b>Could not log in to Zopim. Please check your login details. If problem persists, try connecting without SSL enabled.</b>";
33
  $gotologin = 1;
36
  update_option('zopimUsername', $_POST["zopimUsername"]);
37
  update_option('zopimSalt', $loginresult->salt);
38
  $account = getAccountDetails(get_option('zopimSalt'));
39
+ $editor = setEditor(get_option('zopimSalt'));
40
 
41
  if (isset($account)) {
42
  update_option('zopimCode', $account->account_key);
51
  $error["login"] = "<b>Could not log in to Zopim. We were unable to contact Zopim servers. Please check with your server administrator to ensure that <a href='http://www.php.net/manual/en/book.curl.php'>PHP Curl</a> is installed and permissions are set correctly.</b>";
52
  }
53
  }
54
+ else {
55
+ update_option('zopimSalt', "wronglogin");
56
+ $gotologin = 1;
57
+ $error["login"] = "<b>Could not log in to Zopim. Please check your login details. If problem persists, try connecting without SSL enabled.</b>";
58
+ }
59
  } else if (isset($_POST["action"]) && $_POST["action"]=="signup") {
60
 
61
  if ($_POST["zopimUseSSL"] == "") {
85
  }
86
  }
87
 
 
88
  if (get_option('zopimCode') != "" && get_option('zopimCode') != "zopim") {
89
 
90
  $accountDetails = getAccountDetails(get_option('zopimSalt'));
111
  } else {
112
  $accountDetails->package_id .= " Package";
113
  }
114
+
115
  ?>
116
  <div id="icon-options-general" class="icon32"><br/></div><h2>Set up your Zopim Account</h2>
117
  <br/>
147
  } else if ($message == "") { ?>
148
  Congratulations on successfully installing the Zopim WordPress plugin! Activate an account to start using Zopim Live Chat.<br>
149
  <br>
150
+ <?php } else { echo $message;} ?>
 
151
  <div id="existingform">
152
  <div class="metabox-holder">
153
  <div class="postbox">
191
  </div>
192
 
193
 
194
+ <?php } } ?>
readme.txt CHANGED
@@ -1,11 +1,15 @@
1
- === Zopim Live Chat ===
2
  Contributors: bencxr
3
- Tags: widget, plugin, sidebar, page, admin, enhancement, livechat, chat, widget
 
 
 
 
4
  Requires at least: 3.1
5
  Tested up to: 3.4.2
6
- Stable tag: 1.2.6
7
 
8
- Zopim is an award winning chat solution that helps website owners to engage their visitors and convert customers into fans!
9
 
10
  == Description ==
11
 
@@ -21,14 +25,15 @@ Zopim Live Chat shows up as a chatbar docked at the bottom of your website. Visi
21
 
22
  * Know what your visitors are looking at. See which product page they are currently viewing.
23
  * Let customers reach you directly. You can also proactively click on them to start a chat.
24
- * Reply to chats online or offline via any browser, or your favorite IM client.
25
 
26
  **Why Zopim Live Chat but not anyone else?**
27
 
28
- * A real customer-centric live chat tool that is loved by 50,000 businesses around the world.
 
29
  * Simple to setup and use.
30
- * Nice interface with fully customizable chat widget.
31
- * 24/7 technical support.
32
  * Chat widget available in more than 40 languages*.
33
 
34
  Just to name a few!
@@ -51,6 +56,15 @@ What are you waiting for? Download Zopim Live Chat plugin now and <a href="https
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
 
 
 
54
  = 1.2.6 =
55
  * Addresses XSS vulnerabilities concerns by removing ZeroClipboard
56
 
@@ -163,10 +177,9 @@ to give roles the 'access_zopim' capability.
163
  == Screenshots ==
164
 
165
  1. Chat window on your website - active chat
166
- 2. Chat widget on your website - minimized
167
- 3. Account Configuration
168
- 4. Styling and customiation
169
- 5. Another nice screenshot on a 'virtual' monitor
170
 
171
  == Frequently Asked Questions ==
172
 
1
+ === Zopim Live Chat ===
2
  Contributors: bencxr
3
+ Tags: chat, chat online, contact plugin, contact us, customer support, free chat, chat software, IM chat,
4
+ live chat, live chat inc, live chat services, live chat software, live chatting, live help, live support,
5
+ live web chat, livechat, live help, live support, olark, online chat, online support, php live chat,
6
+ snapengage, support software, website chat, wordpress chat, wordpress live chat, wordpress live chat plugin,
7
+ Zopim, Zopim live chat, banckle, clickdesk, click desk
8
  Requires at least: 3.1
9
  Tested up to: 3.4.2
10
+ Stable tag: 1.2.7
11
 
12
+ Zopim is an award winning chat solution that helps website owners to engage their visitors and convert customers into fans! Try it Free!
13
 
14
  == Description ==
15
 
25
 
26
  * Know what your visitors are looking at. See which product page they are currently viewing.
27
  * Let customers reach you directly. You can also proactively click on them to start a chat.
28
+ * Chat with many visitors at the same time
29
 
30
  **Why Zopim Live Chat but not anyone else?**
31
 
32
+ * A real customer-centric live chat tool that is loved by 140,000 businesses around the world.
33
+ * Free version available.
34
  * Simple to setup and use.
35
+ * Fully customizable chat widget to match your website design.
36
+ * User-friendly dashboard/ control panel to manage chats.
37
  * Chat widget available in more than 40 languages*.
38
 
39
  Just to name a few!
56
 
57
  == Changelog ==
58
 
59
+ = 1.2.7 =
60
+ * Plugin will now embed v2 Widget
61
+ * Improved Login Response
62
+ * Classic Theme Editor remove to use Dashboard Widget Customization
63
+ Click on Appearance to make changes to your widget
64
+ * Old Javascript API from v1 Widget may not work with v2 Widget
65
+ Visit http://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html for more details
66
+
67
+
68
  = 1.2.6 =
69
  * Addresses XSS vulnerabilities concerns by removing ZeroClipboard
70
 
177
  == Screenshots ==
178
 
179
  1. Chat window on your website - active chat
180
+ 2. Account Configuration
181
+ 3. Styling and customiation
182
+ 4. Dashboard View
 
183
 
184
  == Frequently Asked Questions ==
185
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
zopim.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Zopim Widget
5
  Plugin URI: http://www.zopim.com/?iref=wp_plugin
6
  Description: Zopim is an award winning chat solution that helps website owners to engage their visitors and convert customers into fans!
7
  Author: Zopim
8
- Version: 1.2.6
9
  Author URI: http://www.zopim.com/?iref=wp_plugin
10
  */
11
 
@@ -14,14 +14,15 @@ define('ZOPIM_BASE_URL', "https://www.zopim.com/");
14
  define('ZOPIM_SIGNUP_REDIRECT_URL', ZOPIM_BASE_URL."?aref=MjUxMjY4:1TeORR:9SP1e-iPTuAVXROJA6UU5seC8x4&visit_id=6ffe00ec3cfc11e2b5ab22000a1db8fa&utm_source=account%2Bsetup%2Bpage&utm_medium=link&utm_campaign=wp%2Bsignup2#signup");
15
  define('ZOPIM_GETACCOUNTDETAILS_URL', ZOPIM_BASE_URL."plugins/getAccountDetails");
16
  define('ZOPIM_SETDISPLAYNAME_URL', ZOPIM_BASE_URL."plugins/setDisplayName");
 
17
  define('ZOPIM_IMINFO_URL', ZOPIM_BASE_URL."plugins/getImSetupInfo");
18
  define('ZOPIM_IMREMOVE_URL', ZOPIM_BASE_URL."plugins/removeImSetup");
19
  define('ZOPIM_LOGIN_URL', ZOPIM_BASE_URL."plugins/login");
20
  define('ZOPIM_SIGNUP_URL', ZOPIM_BASE_URL."plugins/createTrialAccount");
21
  define('ZOPIM_DASHBOARD_URL', "http://dashboard.zopim.com/?utm_source=wp&utm_medium=iframe&utm_campaign=wp%2Bdashboard");
22
  define('ZOPIM_DASHBOARD_LINK', "http://dashboard.zopim.com/?utm_source=wp&utm_medium=link&utm_campaign=wp%2Bdashboard");
23
- define('ZOPIM_THEMEEDITOR_URL', "http://dashboard.zopim.com/themeEditor/?utm_source=wp&utm_medium=iframe&utm_campaign=wp%2Bthemeditor");
24
- define('ZOPIM_THEMEEDITOR_LINK', "http://dashboard.zopim.com/themeEditor/?utm_source=wp&utm_medium=link&utm_campaign=wp%2Bthemeeditor");
25
  define('ZOPIM_SMALL_LOGO', "http://zopim.com/assets/branding/zopim.com/chatman/online.png");
26
  define('ZOPIM_IM_LOGOS', "http://www.zopim.com/static/images/im/");
27
 
@@ -41,7 +42,7 @@ function zopimme() {
41
  global $current_user, $zopimshown;
42
  get_currentuserinfo();
43
 
44
- $code = get_option('zopimCode');
45
 
46
  if (($code == "" || $code=="zopim") && (!ereg("zopim", $_GET["page"]))&& (!ereg("zopim", $_SERVER["SERVER_NAME"]))) { return; }
47
 
@@ -54,7 +55,7 @@ function zopimme() {
54
  window.\$zopim||(function(d,s){var z=\$zopim=function(c){z._.push(c)},$=z.s=
55
  d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
56
  _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
57
- $.src='//cdn.zopim.com/?".$code."';z.t=+new Date;$.
58
  type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
59
  </script>";
60
 
@@ -76,7 +77,11 @@ function zopim_get_widget_options() {
76
  $opts = get_option('zopimWidgetOptions');
77
  if ($opts) return stripslashes($opts);
78
 
79
- $opts = zopim_old_plugin_settings();
 
 
 
 
80
  update_option('zopimWidgetOptions', $opts);
81
 
82
  $list = array(
@@ -96,10 +101,11 @@ function zopim_get_widget_options() {
96
  delete_option($key);
97
  endforeach;
98
 
99
- if ($opts) return $opts;
100
  else return '';
101
  }
102
 
 
103
  function zopim_old_plugin_settings() {
104
  $theoptions = array();
105
 
@@ -145,7 +151,7 @@ function zopim_old_plugin_settings() {
145
  if (get_option('zopimHideOnOffline') == "zopimHideOnOffline")
146
  $zopim_embed_opts .= "\n\$zopim.livechat.button.setHideWhenOffline(true);";
147
 
148
- $zopim_embed_opts .= "\n})";
149
  return $zopim_embed_opts;
150
 
151
  }
@@ -193,13 +199,11 @@ function zopim_customize_widget() {
193
 
194
  $params = '';
195
  $code = get_option('zopimCode');
196
- if (!empty($code)) $params .= '&account_key=' . urlencode($code);
197
-
198
- $params .= '&url=' . urlencode(get_site_option('siteurl'));
199
-
200
- echo '<div id="dashboarddiv"><iframe id="themeEditor" src="'.ZOPIM_THEMEEDITOR_URL.$params.'" height=700 width=98% scrolling="no"></iframe></div>';
201
  echo 'You may also <a href="'.ZOPIM_THEMEEDITOR_LINK.$params.'" target="customize" onclick="javascript:document.getElementById(\'dashboarddiv\').innerHTML=\'\'; ">access the theme editor in a new window</a>.';
202
- zopim_resize_iframe('themeEditor');
203
  }
204
 
205
  function zopim_dashboard() {
@@ -234,11 +238,10 @@ function zopim_post_request($url, $_data, $optional_headers = null)
234
  {
235
  if (get_option('zopimUseSSL') != "zopimUseSSL")
236
  $url = str_replace("https", "http", $url);
237
-
238
  $args = array('body' => $_data);
239
- $response = wp_remote_post( $url, $args );
240
  return $response['body'];
241
-
242
  }
243
 
244
  function zopim_url_get($filename) {
@@ -263,4 +266,9 @@ function getAccountDetails($salt) {
263
  return json_to_array(zopim_post_request(ZOPIM_GETACCOUNTDETAILS_URL, $salty));
264
  }
265
 
266
- ?>
 
 
 
 
 
5
  Plugin URI: http://www.zopim.com/?iref=wp_plugin
6
  Description: Zopim is an award winning chat solution that helps website owners to engage their visitors and convert customers into fans!
7
  Author: Zopim
8
+ Version: 1.2.7
9
  Author URI: http://www.zopim.com/?iref=wp_plugin
10
  */
11
 
14
  define('ZOPIM_SIGNUP_REDIRECT_URL', ZOPIM_BASE_URL."?aref=MjUxMjY4:1TeORR:9SP1e-iPTuAVXROJA6UU5seC8x4&visit_id=6ffe00ec3cfc11e2b5ab22000a1db8fa&utm_source=account%2Bsetup%2Bpage&utm_medium=link&utm_campaign=wp%2Bsignup2#signup");
15
  define('ZOPIM_GETACCOUNTDETAILS_URL', ZOPIM_BASE_URL."plugins/getAccountDetails");
16
  define('ZOPIM_SETDISPLAYNAME_URL', ZOPIM_BASE_URL."plugins/setDisplayName");
17
+ define('ZOPIM_SETEDITOR_URL', ZOPIM_BASE_URL."plugins/setEditor");
18
  define('ZOPIM_IMINFO_URL', ZOPIM_BASE_URL."plugins/getImSetupInfo");
19
  define('ZOPIM_IMREMOVE_URL', ZOPIM_BASE_URL."plugins/removeImSetup");
20
  define('ZOPIM_LOGIN_URL', ZOPIM_BASE_URL."plugins/login");
21
  define('ZOPIM_SIGNUP_URL', ZOPIM_BASE_URL."plugins/createTrialAccount");
22
  define('ZOPIM_DASHBOARD_URL', "http://dashboard.zopim.com/?utm_source=wp&utm_medium=iframe&utm_campaign=wp%2Bdashboard");
23
  define('ZOPIM_DASHBOARD_LINK', "http://dashboard.zopim.com/?utm_source=wp&utm_medium=link&utm_campaign=wp%2Bdashboard");
24
+ define('ZOPIM_THEMEEDITOR_URL', "http://dashboard.zopim.com/#Widget/appearance");
25
+ define('ZOPIM_THEMEEDITOR_LINK', "http://dashboard.zopim.com/#Widget/appearance");
26
  define('ZOPIM_SMALL_LOGO', "http://zopim.com/assets/branding/zopim.com/chatman/online.png");
27
  define('ZOPIM_IM_LOGOS', "http://www.zopim.com/static/images/im/");
28
 
42
  global $current_user, $zopimshown;
43
  get_currentuserinfo();
44
 
45
+ $code = get_option('zopimCode');
46
 
47
  if (($code == "" || $code=="zopim") && (!ereg("zopim", $_GET["page"]))&& (!ereg("zopim", $_SERVER["SERVER_NAME"]))) { return; }
48
 
55
  window.\$zopim||(function(d,s){var z=\$zopim=function(c){z._.push(c)},$=z.s=
56
  d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
57
  _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
58
+ $.src='//v2.zopim.com/?".$code."';z.t=+new Date;$.
59
  type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
60
  </script>";
61
 
77
  $opts = get_option('zopimWidgetOptions');
78
  if ($opts) return stripslashes($opts);
79
 
80
+ //$opts = zopim_old_plugin_settings();
81
+ $zopim_embed_opts .= "\$zopim( function() {";
82
+ $zopim_embed_opts .= "\n})";
83
+ $opts = $zopim_embed_opts;
84
+
85
  update_option('zopimWidgetOptions', $opts);
86
 
87
  $list = array(
101
  delete_option($key);
102
  endforeach;
103
 
104
+ if ($opts) return $opts;
105
  else return '';
106
  }
107
 
108
+
109
  function zopim_old_plugin_settings() {
110
  $theoptions = array();
111
 
151
  if (get_option('zopimHideOnOffline') == "zopimHideOnOffline")
152
  $zopim_embed_opts .= "\n\$zopim.livechat.button.setHideWhenOffline(true);";
153
 
154
+ $zopim_embed_opts .= "\n})";
155
  return $zopim_embed_opts;
156
 
157
  }
199
 
200
  $params = '';
201
  $code = get_option('zopimCode');
202
+ //if (!empty($code)) $params .= '&account_key=' . urlencode($code);
203
+ //$params .= '&url=' . urlencode(get_site_option('siteurl'));
204
+ echo '<div id="dashboarddiv" style="overflow:hidden;"><iframe id="dashboard-widget" src="'.ZOPIM_THEMEEDITOR_URL.'" height=700 width=110% scrolling="no" style="margin-left:-180px;"></iframe></div>';
 
 
205
  echo 'You may also <a href="'.ZOPIM_THEMEEDITOR_LINK.$params.'" target="customize" onclick="javascript:document.getElementById(\'dashboarddiv\').innerHTML=\'\'; ">access the theme editor in a new window</a>.';
206
+ zopim_resize_iframe('dashboard-widget');
207
  }
208
 
209
  function zopim_dashboard() {
238
  {
239
  if (get_option('zopimUseSSL') != "zopimUseSSL")
240
  $url = str_replace("https", "http", $url);
241
+
242
  $args = array('body' => $_data);
243
+ $response = wp_remote_post( $url, $args );
244
  return $response['body'];
 
245
  }
246
 
247
  function zopim_url_get($filename) {
266
  return json_to_array(zopim_post_request(ZOPIM_GETACCOUNTDETAILS_URL, $salty));
267
  }
268
 
269
+ function setEditor($salt) {
270
+ $salty = array("salt" => get_option('zopimSalt'));
271
+ return json_to_array(zopim_post_request(ZOPIM_SETEDITOR_URL, $salty));
272
+ }
273
+
274
+ ?>