Sidekick - Version 1.3.2

Version Description

  • HTTPs Protocol Adjustments
Download this release

Release Info

Developer raptor235
Plugin Icon 128x128 Sidekick
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

Files changed (3) hide show
  1. js/sk.source.js +1 -1
  2. readme.txt +4 -1
  3. sidekick.php +143 -133
js/sk.source.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! sidekick - v1.3.1 - 2014-05-01 */(function(jQuery, window){
2
 
3
  jQuery.fn.center = function () {
4
  this.css("position","absolute");
1
+ /*! sidekick - v1.3.2 - 2014-05-02 */(function(jQuery, window){
2
 
3
  jQuery.fn.center = function () {
4
  this.css("position","absolute");
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.sidekick.pro
4
  Tags: help, tutorial, training, learn, learning, sidekick, guide, teach, video, manual, videos, wphelp, support, instructions, question, questions, answers, answer, clippy, q&a, wpuniversity, helper, walkthrough
5
  Requires at least: 3.5
6
  Tested up to: 3.9
7
- Stable tag: 1.3.1
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -130,6 +130,9 @@ Absolutely. In fact, we rely on users like you to tell us about things that nee
130
 
131
  == Changelog ==
132
 
 
 
 
133
  = 1.3.1 =
134
  * Library loading bug fixed
135
 
4
  Tags: help, tutorial, training, learn, learning, sidekick, guide, teach, video, manual, videos, wphelp, support, instructions, question, questions, answers, answer, clippy, q&a, wpuniversity, helper, walkthrough
5
  Requires at least: 3.5
6
  Tested up to: 3.9
7
+ Stable tag: 1.3.2
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
130
 
131
  == Changelog ==
132
 
133
+ = 1.3.2 =
134
+ * HTTPs Protocol Adjustments
135
+
136
  = 1.3.1 =
137
  * Library loading bug fixed
138
 
sidekick.php CHANGED
@@ -6,173 +6,182 @@ Plugin URL: http://wordpress.org/plugins/sidekick/
6
  Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
7
  Requires at least: 3.7
8
  Tested up to: 3.9
9
- Version: 1.3.1
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
13
 
14
- define('SK_PLUGIN_VERSION','1.3.1');
15
  define('SK_LIBRARY_VERSION',5);
16
  define('SK_PLATFORM_VERSION',6);
17
 
18
  if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
19
  if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
20
  if ( ! defined( 'SK_SL_PLUGIN_FILE' ) ) define( 'SK_SL_PLUGIN_FILE', __FILE__ );
21
- if ( ! function_exists('mlog')) {function mlog(){}}
22
-
23
- class Sidekick{
24
- function enqueue_required(){
25
- mlog('PHP: enqueue_required');
26
-
27
- wp_enqueue_script('jquery' , null );
28
- wp_enqueue_script('underscore' , null, array('underscore'));
29
- wp_enqueue_script('backbone' , null, array('jquery','underscore'));
30
- wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
31
- wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
32
- wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
33
- wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
34
- wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
35
- wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
 
 
 
 
 
 
 
36
  }
 
37
 
38
- function enqueue(){
39
- mlog('PHP: enqueue');
40
- $activation_id = get_option("sk_activation_id");
41
 
42
- define('SK_FREE_LIBRARY_FILE', "//library.sidekick.pro/library/v" . SK_LIBRARY_VERSION . "/releases/xxxxxxxx-xxxx-xxxx-xxxx-xxxxfree/library.js?" . date('m-d-y-G'));
43
- if ($activation_id) {
44
- define('SK_PAID_LIBRARY_FILE', "//library.sidekick.pro/library/v" . SK_LIBRARY_VERSION . "/releases/{$activation_id}/library.js?" . date('m-d-y-G'));
45
- wp_enqueue_script("sk_paid_library" , SK_PAID_LIBRARY_FILE , null ,null);
46
- wp_enqueue_script("sk_free_library" , SK_FREE_LIBRARY_FILE , array('sk_paid_library') ,null);
47
- } else {
48
- wp_enqueue_script("sk_free_library" , SK_FREE_LIBRARY_FILE , array() ,null);
49
- }
50
 
51
- wp_enqueue_script('sidekick' ,'//platform.sidekick.pro/v' . SK_PLATFORM_VERSION . '/sidekick.min.js', array('sk_free_library','backbone','jquery','underscore','jquery-effects-highlight'), SK_PLUGIN_VERSION);
52
- wp_enqueue_script('player' ,plugins_url( '/js/sk.source.js' , __FILE__ ), array('sidekick') ,SK_PLUGIN_VERSION);
 
 
 
 
 
 
53
 
54
- wp_enqueue_style('sk-style' ,plugins_url( '/css/sidekick_wordpress.css' , __FILE__ ), null ,SK_PLUGIN_VERSION);
 
55
 
56
- wp_enqueue_style('wp-pointer');
57
- wp_enqueue_script('wp-pointer');
58
- }
59
 
60
- function setup_menu(){
61
- add_submenu_page( 'options-general.php', 'Sidekick', 'Sidekick', 'activate_plugins','sidekick', array(&$this,'admin_page'));
62
- }
63
 
64
- function admin_page(){
65
- if (isset($_POST['option_page']) && $_POST['option_page'] == 'sk_license') {
 
66
 
67
- if (isset($_POST['first_name']) && $_POST['first_name'])
68
- update_option('sk_first_name',$_POST['first_name']);
69
 
70
- if (isset($_POST['email']) && $_POST['email'])
71
- update_option('sk_email',$_POST['email']);
72
 
73
- if (isset($_POST['activation_id']) && $_POST['activation_id']){
74
- $result = $this->activate(true);
75
- } else {
76
- delete_option('sk_activation_id');
77
- }
78
 
79
- if (isset($_POST['sk_track_data'])) {
80
- update_option( 'sk_track_data', true );
81
- } else {
82
- delete_option('sk_track_data');
83
- }
84
 
85
- update_option( 'sk_activated', true );
86
- die('<script>window.open("' . get_site_url() . '/wp-admin/options-general.php?page=sidekick&firstuse","_self")</script>');
 
 
87
  }
88
 
89
- $activation_id = get_option( 'sk_activation_id' );
90
- $email = get_option( 'sk_email' );
91
- $first_name = get_option( 'sk_first_name' );
92
- $sk_track_data = get_option( 'sk_track_data' );
93
- $error = null;
94
-
95
- if (defined('SK_PAID_LIBRARY_FILE') && $activation_id) {
96
- $_POST['activation_id'] = $activation_id;
97
- $check_activation = $this->activate(true);
98
- if ($check_activation) {
99
- $library = file_get_contents(SK_PAID_LIBRARY_FILE);
100
- if (strlen($library) > 30) {
101
- $site_url = $this->get_domain();
102
- if (strpos($library, $site_url) !== false) {
103
- $status = 'Active';
104
- } else {
105
- $status = 'Domain not authorized.';
106
- }
 
107
  } else {
108
- $status = 'Expired';
109
  }
110
  } else {
111
- $status = 'Invalid';
112
  }
113
  } else {
114
- $status = 'Free';
115
  }
 
 
 
116
 
117
- $current_user = wp_get_current_user();
118
- if (!$first_name)
119
- $first_name = $current_user->user_firstname;
120
-
121
- if (!$email)
122
- $email = $current_user->user_email;
123
 
124
- $sk_track_data = get_option( 'sk_track_data' );
 
125
 
126
- global $wp_version;
127
- if (version_compare($wp_version, '3.7', '<=')) {
128
- $error = "Sorry, Sidekick requires WordPress 3.7 or higher to function.";
129
- }
130
 
131
- if (!$activation_id) {
132
- $warn = "You're using the <b>Demo</b> version of Sidekick, to gain full access to the walkthrough library please fill out your name and email address below.";
133
- }
 
134
 
135
- if(preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT'])){
136
- $error = "Sorry, Sidekick requires Internet Explorer 9 or higher to function.";
137
- }
138
 
139
- ?>
 
 
140
 
141
- <?php if ($_SERVER['QUERY_STRING'] == 'page=sidekick&firstuse'): ?>
142
- <script type="text/javascript">
143
- jQuery(document).ready(function($) {
144
- jQuery('#sidekick #logo').trigger('click');
145
- });
146
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  <?php endif ?>
148
 
149
- <div class="wrap">
150
- <div class="icon32" id="icon-tools"><br></div><h2>Sidekick</h2>
151
-
152
- <?php if (isset($error_message)): ?>
153
- <div class="error" style="padding:15px; position:relative;" id="gf_dashboard_message">
154
- There was a problem activating your license. The following error occured <?php echo $error_message ?>
155
- </div>
156
- <?php elseif (isset($error)): ?>
157
- <div class="error" style="padding:15px; position:relative;" id="gf_dashboard_message">
158
- <?php echo $error ?>
159
- </div>
160
- <?php elseif (isset($warn)): ?>
161
- <div class="updated" style="padding:15px; position:relative;" id="gf_dashboard_message">
162
- <?php echo $warn ?>
163
- </div>
164
- <?php elseif (isset($success)): ?>
165
- <div class="updated" style="padding:15px; position:relative;" id="gf_dashboard_message">
166
- <?php echo $success ?>
167
- </div>
168
- <?php endif ?>
169
-
170
- <?php if (!$error): ?>
171
- <h3>Your Sidekick Account</h3>
172
- <form method="post">
173
- <?php settings_fields('sk_license'); ?>
174
- <table class="form-table">
175
- <tbody>
176
  <!-- <tr valign="top">
177
  <th scope="row" valign="top">First Name</th>
178
  <td>
@@ -296,8 +305,6 @@ if ( ! function_exists('mlog')) {function mlog(){}}
296
 
297
  ?>
298
 
299
-
300
-
301
  <?php if (!$not_supported_ie): ?>
302
 
303
  <script type="text/javascript">
@@ -370,7 +377,9 @@ if ( ! function_exists('mlog')) {function mlog(){}}
370
  }
371
 
372
  function track($data){
373
- $response = wp_remote_post( "http://www.wpuniversity.com/wp-admin/admin-ajax.php", array(
 
 
374
  'method' => 'POST',
375
  'timeout' => 45,
376
  'redirection' => 5,
@@ -384,14 +393,15 @@ if ( ! function_exists('mlog')) {function mlog(){}}
384
  }
385
 
386
  function activate($return = false){
387
- mlog("activate");
388
  if ($_POST['activation_id']) {
389
- $library_file = "http://library.sidekick.pro/library/v" . SK_LIBRARY_VERSION . "/releases/{$_POST['activation_id']}/library.js";
 
 
 
390
  $ch = curl_init($library_file);
391
  curl_setopt($ch, CURLOPT_NOBODY, true);
392
  curl_exec($ch);
393
  $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
394
- mlog('$retcode',$retcode);
395
  curl_close($ch);
396
  if ($retcode == 200) {
397
  update_option('sk_activation_id',$_POST['activation_id']);
6
  Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
7
  Requires at least: 3.7
8
  Tested up to: 3.9
9
+ Version: 1.3.2
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
13
 
14
+ define('SK_PLUGIN_VERSION','1.3.2');
15
  define('SK_LIBRARY_VERSION',5);
16
  define('SK_PLATFORM_VERSION',6);
17
 
18
  if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
19
  if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
20
  if ( ! defined( 'SK_SL_PLUGIN_FILE' ) ) define( 'SK_SL_PLUGIN_FILE', __FILE__ );
21
+ if ( ! function_exists('mlog')) {
22
+ function mlog(){}
23
+ }
24
+
25
+ class Sidekick{
26
+ function enqueue_required(){
27
+ wp_enqueue_script('jquery' , null );
28
+ wp_enqueue_script('underscore' , null, array('underscore'));
29
+ wp_enqueue_script('backbone' , null, array('jquery','underscore'));
30
+ wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
31
+ wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
32
+ wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
33
+ wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
34
+ wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
35
+ wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
36
+ }
37
+
38
+ function protocol() {
39
+ if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) {
40
+ return 'https://';
41
+ } else {
42
+ return 'http://';
43
  }
44
+ }
45
 
46
+ function enqueue(){
47
+ $activation_id = get_option("sk_activation_id");
 
48
 
49
+ $protocol = $this->protocol();
 
 
 
 
 
 
 
50
 
51
+ define('SK_FREE_LIBRARY_FILE', "{$protocol}library.sidekick.pro/library/v" . SK_LIBRARY_VERSION . "/releases/xxxxxxxx-xxxx-xxxx-xxxx-xxxxfree/library.js?" . date('m-d-y-G'));
52
+ if ($activation_id) {
53
+ define('SK_PAID_LIBRARY_FILE', "{$protocol}library.sidekick.pro/library/v" . SK_LIBRARY_VERSION . "/releases/{$activation_id}/library.js?" . date('m-d-y-G'));
54
+ wp_enqueue_script("sk_paid_library" , SK_PAID_LIBRARY_FILE , null ,null);
55
+ wp_enqueue_script("sk_free_library" , SK_FREE_LIBRARY_FILE , array('sk_paid_library') ,null);
56
+ } else {
57
+ wp_enqueue_script("sk_free_library" , SK_FREE_LIBRARY_FILE , array() ,null);
58
+ }
59
 
60
+ wp_enqueue_script('sidekick' ,"{$protocol}platform.sidekick.pro/v" . SK_PLATFORM_VERSION . '/sidekick.min.js', array('sk_free_library','backbone','jquery','underscore','jquery-effects-highlight'), SK_PLUGIN_VERSION);
61
+ wp_enqueue_script('player' ,plugins_url( '/js/sk.source.js' , __FILE__ ), array('sidekick') ,SK_PLUGIN_VERSION);
62
 
63
+ wp_enqueue_style('sk-style' ,plugins_url( '/css/sidekick_wordpress.css' , __FILE__ ), null ,SK_PLUGIN_VERSION);
 
 
64
 
65
+ wp_enqueue_style('wp-pointer');
66
+ wp_enqueue_script('wp-pointer');
67
+ }
68
 
69
+ function setup_menu(){
70
+ add_submenu_page( 'options-general.php', 'Sidekick', 'Sidekick', 'activate_plugins','sidekick', array(&$this,'admin_page'));
71
+ }
72
 
73
+ function admin_page(){
74
+ if (isset($_POST['option_page']) && $_POST['option_page'] == 'sk_license') {
75
 
76
+ if (isset($_POST['first_name']) && $_POST['first_name'])
77
+ update_option('sk_first_name',$_POST['first_name']);
78
 
79
+ if (isset($_POST['email']) && $_POST['email'])
80
+ update_option('sk_email',$_POST['email']);
 
 
 
81
 
82
+ if (isset($_POST['activation_id']) && $_POST['activation_id']){
83
+ $result = $this->activate(true);
84
+ } else {
85
+ delete_option('sk_activation_id');
86
+ }
87
 
88
+ if (isset($_POST['sk_track_data'])) {
89
+ update_option( 'sk_track_data', true );
90
+ } else {
91
+ delete_option('sk_track_data');
92
  }
93
 
94
+ update_option( 'sk_activated', true );
95
+ die('<script>window.open("' . get_site_url() . '/wp-admin/options-general.php?page=sidekick&firstuse","_self")</script>');
96
+ }
97
+
98
+ $activation_id = get_option( 'sk_activation_id' );
99
+ $email = get_option( 'sk_email' );
100
+ $first_name = get_option( 'sk_first_name' );
101
+ $sk_track_data = get_option( 'sk_track_data' );
102
+ $error = null;
103
+
104
+ if (defined('SK_PAID_LIBRARY_FILE') && $activation_id) {
105
+ $_POST['activation_id'] = $activation_id;
106
+ $check_activation = $this->activate(true);
107
+ if ($check_activation) {
108
+ $library = file_get_contents(SK_PAID_LIBRARY_FILE);
109
+ if (strlen($library) > 30) {
110
+ $site_url = $this->get_domain();
111
+ if (strpos($library, $site_url) !== false) {
112
+ $status = 'Active';
113
  } else {
114
+ $status = 'Domain not authorized.';
115
  }
116
  } else {
117
+ $status = 'Expired';
118
  }
119
  } else {
120
+ $status = 'Invalid';
121
  }
122
+ } else {
123
+ $status = 'Free';
124
+ }
125
 
126
+ $current_user = wp_get_current_user();
127
+ if (!$first_name)
128
+ $first_name = $current_user->user_firstname;
 
 
 
129
 
130
+ if (!$email)
131
+ $email = $current_user->user_email;
132
 
133
+ $sk_track_data = get_option( 'sk_track_data' );
 
 
 
134
 
135
+ global $wp_version;
136
+ if (version_compare($wp_version, '3.7', '<=')) {
137
+ $error = "Sorry, Sidekick requires WordPress 3.7 or higher to function.";
138
+ }
139
 
140
+ if (!$activation_id) {
141
+ $warn = "You're using the <b>Demo</b> version of Sidekick, to gain full access to the walkthrough library please fill out your name and email address below.";
142
+ }
143
 
144
+ if(preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT'])){
145
+ $error = "Sorry, Sidekick requires Internet Explorer 9 or higher to function.";
146
+ }
147
 
148
+ ?>
149
+
150
+ <?php if ($_SERVER['QUERY_STRING'] == 'page=sidekick&firstuse'): ?>
151
+ <script type="text/javascript">
152
+ jQuery(document).ready(function($) {
153
+ jQuery('#sidekick #logo').trigger('click');
154
+ });
155
+ </script>
156
+ <?php endif ?>
157
+
158
+ <div class="wrap">
159
+ <div class="icon32" id="icon-tools"><br></div><h2>Sidekick</h2>
160
+
161
+ <?php if (isset($error_message)): ?>
162
+ <div class="error" style="padding:15px; position:relative;" id="gf_dashboard_message">
163
+ There was a problem activating your license. The following error occured <?php echo $error_message ?>
164
+ </div>
165
+ <?php elseif (isset($error)): ?>
166
+ <div class="error" style="padding:15px; position:relative;" id="gf_dashboard_message">
167
+ <?php echo $error ?>
168
+ </div>
169
+ <?php elseif (isset($warn)): ?>
170
+ <div class="updated" style="padding:15px; position:relative;" id="gf_dashboard_message">
171
+ <?php echo $warn ?>
172
+ </div>
173
+ <?php elseif (isset($success)): ?>
174
+ <div class="updated" style="padding:15px; position:relative;" id="gf_dashboard_message">
175
+ <?php echo $success ?>
176
+ </div>
177
  <?php endif ?>
178
 
179
+ <?php if (!$error): ?>
180
+ <h3>Your Sidekick Account</h3>
181
+ <form method="post">
182
+ <?php settings_fields('sk_license'); ?>
183
+ <table class="form-table">
184
+ <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  <!-- <tr valign="top">
186
  <th scope="row" valign="top">First Name</th>
187
  <td>
305
 
306
  ?>
307
 
 
 
308
  <?php if (!$not_supported_ie): ?>
309
 
310
  <script type="text/javascript">
377
  }
378
 
379
  function track($data){
380
+ $protocol = $this->protocol();
381
+
382
+ $response = wp_remote_post( "{$protocol}library.sidekick.pro/wp-admin/admin-ajax.php", array(
383
  'method' => 'POST',
384
  'timeout' => 45,
385
  'redirection' => 5,
393
  }
394
 
395
  function activate($return = false){
 
396
  if ($_POST['activation_id']) {
397
+
398
+ $protocol = $this->protocol();
399
+
400
+ $library_file = "{$protocol}library.sidekick.pro/library/v" . SK_LIBRARY_VERSION . "/releases/{$_POST['activation_id']}/library.js";
401
  $ch = curl_init($library_file);
402
  curl_setopt($ch, CURLOPT_NOBODY, true);
403
  curl_exec($ch);
404
  $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
 
405
  curl_close($ch);
406
  if ($retcode == 200) {
407
  update_option('sk_activation_id',$_POST['activation_id']);