Zendesk Chat - Version 1.3.5

Version Description

  • Update supported version to 4.1.1
  • Include Plugin's version number to footer (if Account is linked up)
  • Always use SSL to link account
  • Improved UI on login page to reduce confusion with SSL option and Password field
  • Update Signup Link
Download this release

Release Info

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

Code changes from version 1.3.4 to 1.3.5

Files changed (4) hide show
  1. accountconfig.php +18 -22
  2. readme.txt +10 -4
  3. zopim.css +13 -0
  4. zopim.php +13 -19
accountconfig.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <?php
2
  // Settings page in the admin panel
3
  function zopim_account_config() {
@@ -17,18 +23,13 @@ function zopim_account_config() {
17
  $authenticated = "";
18
 
19
  if (isset($_POST["action"]) && $_POST["action"]=="login") {
20
- if (!isset($_POST["zopimUseSSL"]) || $_POST["zopimUseSSL"] == '') {
21
- $_POST["zopimUseSSL"] = "nossl";
22
- }
23
-
24
- update_option('zopimUseSSL', $_POST["zopimUseSSL"]);
25
 
26
  if ($_POST["zopimUsername"] != "" && $_POST["zopimPassword"] != "") {
27
-
28
  $logindata = array("email" => $_POST["zopimUsername"], "password" => $_POST["zopimPassword"]);
29
  $loginresult = json_to_array(zopim_post_request(ZOPIM_LOGIN_URL, $logindata));
 
30
  if (isset($loginresult->error)) {
31
- $error["login"] = "<b>Could not log in to Zopim. Please check your login details. If problem persists, try connecting without SSL enabled.</b>";
32
  $gotologin = 1;
33
  update_option('zopimSalt', "wronglogin");
34
  } else if (isset($loginresult->salt)) {
@@ -53,15 +54,9 @@ function zopim_account_config() {
53
  else {
54
  update_option('zopimSalt', "wronglogin");
55
  $gotologin = 1;
56
- $error["login"] = "<b>Could not log in to Zopim. Please check your login details. If problem persists, try connecting without SSL enabled.</b>";
57
  }
58
  } else if (isset($_POST["action"]) && $_POST["action"]=="signup") {
59
-
60
- if ($_POST["zopimUseSSL"] == "") {
61
- $_POST["zopimUseSSL"] = "nossl";
62
- }
63
- update_option('zopimUseSSL', $_POST["zopimUseSSL"]);
64
-
65
  $createdata = array(
66
  "email" => $_POST["zopimnewemail"],
67
  "first_name" => $_POST["zopimfirstname"],
@@ -85,8 +80,8 @@ function zopim_account_config() {
85
  }
86
 
87
  if (get_option('zopimCode') != "" && get_option('zopimCode') != "zopim") {
88
-
89
  $accountDetails = getAccountDetails(get_option('zopimSalt'));
 
90
  if (!isset($accountDetails) || isset($accountDetails->error)) {
91
  $gotologin = 1;
92
  $error["auth"] = '
@@ -105,6 +100,7 @@ function zopim_account_config() {
105
  }
106
 
107
  if ($authenticated == "ok") {
 
108
  if ($accountDetails->package_id=="trial") {
109
  $accountDetails->package_id = "Free Lite Package + 14 Days Full-features";
110
  } else {
@@ -136,7 +132,7 @@ Currently Activated Account &rarr; <b><?php echo get_option('zopimUsername'); ?>
136
  <br/>
137
  <textarea name="widget-options" style="width:680px; height: 200px;"><?php echo esc_textarea(zopim_get_widget_options()); ?></textarea>
138
  <br/>
139
- <input type="submit" value="Update widget options" />
140
  </p>
141
  </form>
142
 
@@ -154,7 +150,7 @@ Congratulations on successfully installing the Zopim WordPress plugin!<br>
154
  <div class="postbox">
155
  <h3 class="hndle"><span>Link up with your Zopim account</span></h3>
156
  <div style="padding:10px;">
157
- <?php if (isset($error) && isset($error["login"])) { echo $error["login"]; } ?>
158
  <form method="post" action="admin.php?page=zopim_account_config">
159
  <input type="hidden" name="action" value="login">
160
  <table class="form-table">
@@ -166,20 +162,20 @@ Congratulations on successfully installing the Zopim WordPress plugin!<br>
166
 
167
  <tr valign="top">
168
  <th scope="row">Zopim Password</th>
169
- <td><input type="password" name="zopimPassword" value="<?php if (get_option('zopimSalt') != "") { echo "password"; }; ?>" /></td>
170
  </tr>
171
 
172
- <tr valign="center">
173
  <th scope="row">Use SSL</th>
174
  <td><input type="checkbox" name="zopimUseSSL" value="zopimUseSSL" <?php if (get_option('zopimUseSSL') == "zopimUseSSL") { echo "checked='checked'"; } ?> /> uncheck this if you are unable to login</td>
175
- </tr>
176
  </table>
177
  <br/>
178
  The Zopim chat widget will display on your blog after your account is linked up.
179
  <br/>
180
  <p class="submit">
181
- <input type="submit" class="button-primary" value="<?php _e('Link Up') ?>" />
182
- &nbsp;Don't have a zopim account? <a href="<?php echo ZOPIM_SIGNUP_REDIRECT_URL; ?>" target="_blank" data-popup="true">Sign up now</a>.
183
  </p>
184
 
185
  </form>
1
+ <script type="text/javascript">
2
+ function animateButton() {
3
+ document.getElementById("linkup").className += " animate";
4
+ }
5
+ </script>
6
+
7
  <?php
8
  // Settings page in the admin panel
9
  function zopim_account_config() {
23
  $authenticated = "";
24
 
25
  if (isset($_POST["action"]) && $_POST["action"]=="login") {
 
 
 
 
 
26
 
27
  if ($_POST["zopimUsername"] != "" && $_POST["zopimPassword"] != "") {
 
28
  $logindata = array("email" => $_POST["zopimUsername"], "password" => $_POST["zopimPassword"]);
29
  $loginresult = json_to_array(zopim_post_request(ZOPIM_LOGIN_URL, $logindata));
30
+
31
  if (isset($loginresult->error)) {
32
+ $error["login"] = "<b>Could not log in to Zopim. Please check your login details.</b>";
33
  $gotologin = 1;
34
  update_option('zopimSalt', "wronglogin");
35
  } else if (isset($loginresult->salt)) {
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.</b>";
58
  }
59
  } else if (isset($_POST["action"]) && $_POST["action"]=="signup") {
 
 
 
 
 
 
60
  $createdata = array(
61
  "email" => $_POST["zopimnewemail"],
62
  "first_name" => $_POST["zopimfirstname"],
80
  }
81
 
82
  if (get_option('zopimCode') != "" && get_option('zopimCode') != "zopim") {
 
83
  $accountDetails = getAccountDetails(get_option('zopimSalt'));
84
+
85
  if (!isset($accountDetails) || isset($accountDetails->error)) {
86
  $gotologin = 1;
87
  $error["auth"] = '
100
  }
101
 
102
  if ($authenticated == "ok") {
103
+
104
  if ($accountDetails->package_id=="trial") {
105
  $accountDetails->package_id = "Free Lite Package + 14 Days Full-features";
106
  } else {
132
  <br/>
133
  <textarea name="widget-options" style="width:680px; height: 200px;"><?php echo esc_textarea(zopim_get_widget_options()); ?></textarea>
134
  <br/>
135
+ <input class="button-primary" type="submit" value="Update widget options" />
136
  </p>
137
  </form>
138
 
150
  <div class="postbox">
151
  <h3 class="hndle"><span>Link up with your Zopim account</span></h3>
152
  <div style="padding:10px;">
153
+ <?php if (isset($error) && isset($error["login"])) { echo '<span class="error">'.$error["login"].'</span>'; } ?>
154
  <form method="post" action="admin.php?page=zopim_account_config">
155
  <input type="hidden" name="action" value="login">
156
  <table class="form-table">
162
 
163
  <tr valign="top">
164
  <th scope="row">Zopim Password</th>
165
+ <td><input type="password" name="zopimPassword" value="" /></td>
166
  </tr>
167
 
168
+ <!--<tr valign="center">
169
  <th scope="row">Use SSL</th>
170
  <td><input type="checkbox" name="zopimUseSSL" value="zopimUseSSL" <?php if (get_option('zopimUseSSL') == "zopimUseSSL") { echo "checked='checked'"; } ?> /> uncheck this if you are unable to login</td>
171
+ </tr>-->
172
  </table>
173
  <br/>
174
  The Zopim chat widget will display on your blog after your account is linked up.
175
  <br/>
176
  <p class="submit">
177
+ <input id="linkup" type="submit" onclick="animateButton()" class="button-primary" value="<?php _e('Link Up') ?>" />
178
+ &nbsp;Don't have a Zopim account? <a href="<?php echo ZOPIM_SIGNUP_REDIRECT_URL; ?>" target="_blank" data-popup="true">Sign up now</a>.
179
  </p>
180
 
181
  </form>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: bencxr
3
  Tags: chat, chat online, contact plugin, contact us, customer support, free chat, chat software, IM chat, live chat, live chat inc, live chat services, live chat software, live chatting, live help, live support, live web chat, livechat, live help, live support, olark, online chat, online support, php live chat, snapengage, support software, website chat, wordpress chat, wordpress live chat, wordpress live chat plugin, Zopim, zendesk, Zopim live chat, banckle, clickdesk, click desk
4
  Requires at least: 3.1
5
- Tested up to: 4.0.0
6
- Stable tag: 1.3.4
7
 
8
  Zopim lets you monitor and chat with visitors surfing your store in real-time. Impress them personally and ease them into their purchase.
9
 
@@ -41,13 +41,20 @@ With Zopim Live Chat, visitors to your website will be able to chat directly wit
41
 
42
  Should you need any assistance, feel free to chat with our customer advocates on www.zopim.com or email us at support@zopim.com
43
 
44
- What are you waiting for? Download Zopim Live Chat plugin now and <a href="https://www.zopim.com/?aref=MjUxMjY4:1TeORR:9SP1e-iPTuAVXROJA6UU5seC8x4&visit_id=6ffe00ec3cfc11e2b5ab22000a1db8fa&utm_source=wpdirectory&utm_medium=link&utm_campaign=wp%2Bsignup#signup">sign up here</a> for a free account!
45
 
46
  **See languages available, lovingly translated by Zopim users (in alphabetical order)**
47
 
48
  * Arabic | Bulgarian | Chinese | Croatian | Czech | Danish | Dutch; Flemish | Estonian | Faroese | Finnish | French | Georgian | German | Greek | Hebrew | Hungarian | Icelandic | Indonesian | Italian | Japanese | Korean | Kurdish | Latvian | Lithuanian | Macedonian | Malay | Norwegian Bokmal | Persian | Polish | Portuguese | Romanian | Russian | Serbian | Slovak | Slovenian | Spanish; Castilian | Swedish | Thai | Turkish | Ukranian | Urdu | Vietnamese
49
 
50
  == Changelog ==
 
 
 
 
 
 
 
51
  = 1.3.4 =
52
  * Fix menu icon image
53
 
@@ -68,7 +75,6 @@ What are you waiting for? Download Zopim Live Chat plugin now and <a href="https
68
  * Added Launch Dashboard link to open new browser tab to access Dashboard
69
  * Minor Code Fixes
70
 
71
-
72
  = 1.2.9 =
73
  * Revert back to iframe Customize and Dashboard instead of opening new window
74
  * In PHP 5.3, ereg is deprecated, updated to use preg_match
2
  Contributors: bencxr
3
  Tags: chat, chat online, contact plugin, contact us, customer support, free chat, chat software, IM chat, live chat, live chat inc, live chat services, live chat software, live chatting, live help, live support, live web chat, livechat, live help, live support, olark, online chat, online support, php live chat, snapengage, support software, website chat, wordpress chat, wordpress live chat, wordpress live chat plugin, Zopim, zendesk, Zopim live chat, banckle, clickdesk, click desk
4
  Requires at least: 3.1
5
+ Tested up to: 4.1.1
6
+ Stable tag: 1.3.5
7
 
8
  Zopim lets you monitor and chat with visitors surfing your store in real-time. Impress them personally and ease them into their purchase.
9
 
41
 
42
  Should you need any assistance, feel free to chat with our customer advocates on www.zopim.com or email us at support@zopim.com
43
 
44
+ What are you waiting for? Download Zopim Live Chat plugin now and <a href="https://account.zopim.com/?aref=MjUxMjY4:1TeORR:9SP1e-iPTuAVXROJA6UU5seC8x4&visit_id=6ffe00ec3cfc11e2b5ab22000a1db8fa&utm_source=wpdirectory&utm_medium=link&utm_campaign=wp%2Bsignup#signup">sign up here</a> for a free account!
45
 
46
  **See languages available, lovingly translated by Zopim users (in alphabetical order)**
47
 
48
  * Arabic | Bulgarian | Chinese | Croatian | Czech | Danish | Dutch; Flemish | Estonian | Faroese | Finnish | French | Georgian | German | Greek | Hebrew | Hungarian | Icelandic | Indonesian | Italian | Japanese | Korean | Kurdish | Latvian | Lithuanian | Macedonian | Malay | Norwegian Bokmal | Persian | Polish | Portuguese | Romanian | Russian | Serbian | Slovak | Slovenian | Spanish; Castilian | Swedish | Thai | Turkish | Ukranian | Urdu | Vietnamese
49
 
50
  == Changelog ==
51
+ = 1.3.5 =
52
+ * Update supported version to 4.1.1
53
+ * Include Plugin's version number to footer (if Account is linked up)
54
+ * Always use SSL to link account
55
+ * Improved UI on login page to reduce confusion with SSL option and Password field
56
+ * Update Signup Link
57
+
58
  = 1.3.4 =
59
  * Fix menu icon image
60
 
75
  * Added Launch Dashboard link to open new browser tab to access Dashboard
76
  * Minor Code Fixes
77
 
 
78
  = 1.2.9 =
79
  * Revert back to iframe Customize and Dashboard instead of opening new window
80
  * In PHP 5.3, ereg is deprecated, updated to use preg_match
zopim.css CHANGED
@@ -14,4 +14,17 @@
14
  text-align: center;
15
  border: 1px solid #E37A13;
16
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
14
  text-align: center;
15
  border: 1px solid #E37A13;
16
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
17
+ }
18
+
19
+ .error {
20
+ color: red;
21
+ }
22
+
23
+ .animate{
24
+ background: url('https://dashboard.zopim.com/dashboard/images/spinner.gif') !important;
25
+ background-repeat: no-repeat !important;
26
+ background-color: #2ea2cc !important;
27
+ background-position: center center !important;
28
+ color: #2ea2cc !important;
29
+ opacity: 0.5;
30
  }
zopim.php CHANGED
@@ -5,16 +5,17 @@ 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.3.4
9
  Author URI: http://www.zopim.com/?iref=wp_plugin
10
  */
11
 
12
- define('ZOPIM_SCRIPT_DOMAIN', "zopim.com");
13
  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_SETEDITOR_URL', ZOPIM_BASE_URL."plugins/setEditor");
18
  define('ZOPIM_LOGIN_URL', ZOPIM_BASE_URL."plugins/login");
19
  define('ZOPIM_SIGNUP_URL', ZOPIM_BASE_URL."plugins/createTrialAccount");
20
  define('ZOPIM_DASHBOARD_LINK', "https://dashboard.zopim.com/?utm_source=wp&utm_medium=link&utm_campaign=wp%2Bdashboard");
@@ -34,7 +35,7 @@ function add_zopim_caps() {
34
  }
35
 
36
  add_action('admin_enqueue_scripts', 'load_zopim_style');
37
- add_action( 'admin_init', 'add_zopim_caps');
38
 
39
  // We need some CSS to position the paragraph
40
  function zopimme() {
@@ -43,12 +44,14 @@ function zopimme() {
43
 
44
  $code = get_option('zopimCode');
45
 
46
- if ( ( $code == "" || $code == "zopim" ) && ( !preg_match( "/zopim/", $_GET['page'] ) ) && ( !preg_match( "/zopim/", $_SERVER["SERVER_NAME"] ) ) ) { return; }
47
 
48
  // dont show this more than once
49
  if (isset($zopimshown) && $zopimshown == 1) { return; }
50
  $zopimshown = 1;
51
- echo "<!--Start of Zopim Live Chat Script-->
 
 
52
  <script type=\"text/javascript\">
53
  window.\$zopim||(function(d,s){var z=\$zopim=function(c){z._.push(c)},$=z.s=
54
  d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
@@ -158,11 +161,7 @@ function zopim_create_menu() {
158
  //create new top-level menu
159
  add_menu_page('Account Configuration', 'Zopim Chat', 'access_zopim', 'zopim_account_config', 'zopim_account_config', ZOPIM_SMALL_LOGO);
160
  //call register settings function
161
- add_action( 'admin_init', 'register_zopim_plugin_settings' );
162
- }
163
-
164
- function zopim_about() {
165
- echo "about";
166
  }
167
 
168
  // Register the option settings we will be using
@@ -172,7 +171,6 @@ function register_zopim_plugin_settings() {
172
  register_setting( 'zopim-settings-group', 'zopimCode' );
173
  register_setting( 'zopim-settings-group', 'zopimUsername' );
174
  register_setting( 'zopim-settings-group', 'zopimSalt' );
175
- register_setting( 'zopim-settings-group', 'zopimUseSSL' );
176
 
177
  }
178
 
@@ -180,13 +178,9 @@ add_action('get_footer', 'zopimme');
180
  // create custom plugin settings menu
181
  add_action('admin_menu', 'zopim_create_menu');
182
 
183
- function zopim_post_request($url, $_data, $optional_headers = null)
184
- {
185
- if (get_option('zopimUseSSL') != "zopimUseSSL")
186
- $url = str_replace("https", "http", $url);
187
-
188
  $args = array('body' => $_data);
189
- $response = wp_remote_post( $url, $args );
190
  return $response['body'];
191
  }
192
 
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.3.5
9
  Author URI: http://www.zopim.com/?iref=wp_plugin
10
  */
11
 
12
+ define('VERSION_NUMBER', "1.3.5");
13
  define('ZOPIM_BASE_URL', "https://www.zopim.com/");
14
+ define('ZOPIM_ACCOUNT_URL', "https://account.zopim.com/");
15
+ define('ZOPIM_SIGNUP_REDIRECT_URL', ZOPIM_ACCOUNT_URL."?aref=MjUxMjY4:1TeORR:9SP1e-iPTuAVXROJA6UU5seC8x4&visit_id=6ffe00ec3cfc11e2b5ab22000a1db8fa&utm_source=account%2Bsetup%2Bpage&utm_medium=link&utm_campaign=wp%2Bsignup2#signup");
16
  define('ZOPIM_GETACCOUNTDETAILS_URL', ZOPIM_BASE_URL."plugins/getAccountDetails");
17
  define('ZOPIM_SETDISPLAYNAME_URL', ZOPIM_BASE_URL."plugins/setDisplayName");
18
+ define('ZOPIM_SETEDITOR_URL', ZOPIM_BASE_URL."plugins/setEditor");
19
  define('ZOPIM_LOGIN_URL', ZOPIM_BASE_URL."plugins/login");
20
  define('ZOPIM_SIGNUP_URL', ZOPIM_BASE_URL."plugins/createTrialAccount");
21
  define('ZOPIM_DASHBOARD_LINK', "https://dashboard.zopim.com/?utm_source=wp&utm_medium=link&utm_campaign=wp%2Bdashboard");
35
  }
36
 
37
  add_action('admin_enqueue_scripts', 'load_zopim_style');
38
+ add_action('admin_init', 'add_zopim_caps');
39
 
40
  // We need some CSS to position the paragraph
41
  function zopimme() {
44
 
45
  $code = get_option('zopimCode');
46
 
47
+ if ( ( $code == "" || $code == "zopim" ) && ( !isset($_GET['page']) && !preg_match( "/zopim/", $_GET['page'] ) ) && ( !preg_match( "/zopim/", $_SERVER["SERVER_NAME"] ) ) ) { return; }
48
 
49
  // dont show this more than once
50
  if (isset($zopimshown) && $zopimshown == 1) { return; }
51
  $zopimshown = 1;
52
+
53
+ echo "<!--Embed from Zopim Live Chat Wordpress Plugin v".VERSION_NUMBER."-->
54
+ <!--Start of Zopim Live Chat Script-->
55
  <script type=\"text/javascript\">
56
  window.\$zopim||(function(d,s){var z=\$zopim=function(c){z._.push(c)},$=z.s=
57
  d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
161
  //create new top-level menu
162
  add_menu_page('Account Configuration', 'Zopim Chat', 'access_zopim', 'zopim_account_config', 'zopim_account_config', ZOPIM_SMALL_LOGO);
163
  //call register settings function
164
+ add_action('admin_init', 'register_zopim_plugin_settings' );
 
 
 
 
165
  }
166
 
167
  // Register the option settings we will be using
171
  register_setting( 'zopim-settings-group', 'zopimCode' );
172
  register_setting( 'zopim-settings-group', 'zopimUsername' );
173
  register_setting( 'zopim-settings-group', 'zopimSalt' );
 
174
 
175
  }
176
 
178
  // create custom plugin settings menu
179
  add_action('admin_menu', 'zopim_create_menu');
180
 
181
+ function zopim_post_request($url, $_data, $optional_headers = null) {
 
 
 
 
182
  $args = array('body' => $_data);
183
+ $response = wp_remote_post( $url, $args );
184
  return $response['body'];
185
  }
186