Sidekick - Version 2.0.0

Version Description

  • Major Composer Release
Download this release

Release Info

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

Code changes from version 1.6.19 to 2.0.0

Files changed (3) hide show
  1. libs/admin_page.php +270 -65
  2. readme.txt +5 -5
  3. sidekick.php +93 -91
libs/admin_page.php CHANGED
@@ -1,5 +1,3 @@
1
- <?php global $SK_PAID_LIBRARY_FILE, $SK_FREE_LIBRARY_FILE ?>
2
-
3
  <style type="text/css">
4
 
5
  .wrapper_main{
@@ -22,12 +20,12 @@
22
  margin: 0;
23
  }
24
 
25
- .wrapper_main .box{
26
- -webkit-box-flex: 1; /* OLD - iOS 6-, Safari 3.1-6 */
27
- -moz-box-flex: 1; /* OLD - Firefox 19- */
28
- -webkit-flex: 1; /* Chrome */
29
- -ms-flex: 1; /* IE 10 */
30
- flex: 1; /* NEW, Spec - Opera 12.1, Firefox 20+ */
31
  max-width: 50%;
32
  }
33
 
@@ -38,7 +36,7 @@
38
  flex-direction: column;
39
  }
40
 
41
- .wrapper_left .box{
42
  max-width: 100%;
43
  }
44
 
@@ -49,7 +47,7 @@
49
  flex-direction: column;
50
  }
51
 
52
- .wrapper_right .box{
53
  max-width: 100%;
54
  }
55
 
@@ -69,17 +67,46 @@
69
  flex-wrap: wrap;
70
  }
71
 
72
- .wrapper_wts .box{
73
- -webkit-flex-grow: 1;
74
- -moz-flex-grow: 1;
75
- -ms-flex-grow: 1;
76
- flex-grow: 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  min-width: 50%;
 
 
 
 
 
 
 
78
  }
79
 
80
- .wrapper_wts .box span{
 
 
 
 
 
 
81
  padding: 3px;
82
- display: block;
83
  }
84
 
85
  .well{
@@ -93,6 +120,10 @@
93
  overflow: hidden;
94
  }
95
 
 
 
 
 
96
  .sidekick_admin a{
97
  color: #F2641E;
98
  }
@@ -101,6 +132,8 @@
101
  margin-left: 20px;
102
  }
103
 
 
 
104
  .sidekick_admin ul li{
105
  list-style-type: disc;
106
  list-style-position: outside;
@@ -151,59 +184,197 @@
151
  width: 100%;
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  </style>
155
 
156
 
157
  <script type="text/javascript">
158
 
159
  function sk_populate(data){
160
- var passed_walkthroughs = window.sidekick.compatibilityModel.get('passed_walkthroughs');
161
- var already_done = [];
162
-
163
- _.each(passed_walkthroughs,function(item,key){
164
- var checked = false;
165
- var selected = false;
166
-
167
- if (!already_done[item.id]) {
168
- already_done[item.id] = true;
169
- if (jQuery.inArray(item.id,sk_config.disable_wts) > -1) {
170
- checked = 'CHECKED'
171
- };
172
- if (sk_config.autostart_walkthrough_id !== 'undefined' && sk_config.autostart_walkthrough_id == item.id) {
173
- selected = 'SELECTED';
174
- };
175
-
176
- jQuery('.sk_walkthrough_list').append('<div class="box"><span><input type="checkbox" ' + checked + ' value="' + item.id + '" name="disable_wts[]">' + item.title + '<span></div>');
177
- jQuery('[name="sk_autostart_walkthrough_id"]').append('<option ' + selected + ' value="' + item.id + '">' + item.title + '</option>');
178
  };
179
- })
180
 
181
- }
 
 
 
 
 
 
 
 
 
182
 
183
- jQuery(document).ready(function($) {
184
- sk_populate();
185
- if (sk_config.library_paid_file) {
186
  jQuery.ajax({
187
- url:'<?php echo $SK_PAID_LIBRARY_FILE ?>',
188
- type:'HEAD',
189
- error: function(data){
190
- jQuery('.sk_license_status span').html('Invalid Key').css({color: 'red'});
191
- jQuery('.sk_upgrade').show();
192
- },
193
- success: function(data){
194
- if (typeof sk_paid_library !== 'undefined') {
195
- if (_.size(sk_paid_library.buckets) > 0) {
196
- jQuery('.sk_license_status').html('Valid').css({color: 'green'});
197
- } else {
198
- jQuery('.sk_license_status span').html('Expired').css({color: 'orange'});
199
- jQuery('.sk_upgrade').show();
200
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  };
202
  }
203
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  } else {
205
  jQuery('.sk_upgrade').show();
 
206
  }
 
 
 
 
 
 
 
207
  });
208
 
209
  </script>
@@ -233,9 +404,9 @@
233
 
234
  <div class="sidekick_admin wrapper_main">
235
 
236
- <div class="box left">
237
  <div class="wrapper_left">
238
- <div class="box license">
239
  <div class="well">
240
  <?php if (!$error): ?>
241
  <h3>My Sidekick Account</h3>
@@ -282,18 +453,18 @@
282
  </div>
283
  </div>
284
 
285
- <div class="box composer">
286
  <div class="well">
287
  <h3>Build Your Own Walkthroughs - Get Composer</h3>
288
- <a href='http://www.sidekick.pro/plans/?utm_source=plugin&utm_medium=settings&utm_campaign=composerbeta' target='_blank'><div class='composer_beta_button'>Join the<br/>Composer Beta</div></a>
289
  <ul>
290
- <li>Join the <a href='http://www.sidekick.pro/plans/' target='_blank'>Composer Beta</a> now!</li>
291
- <li><a href="http://www.sidekick.pro/plans/" target="_blank">Check out our Composer Plans</a></li>
292
  </ul>
293
  </div>
294
  </div>
295
 
296
- <div class="box you_should_know">
297
  <div class="well">
298
  <h3>Few Things you should know:</h3>
299
  <div class="">
@@ -307,12 +478,43 @@
307
  </div>
308
  </div>
309
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  </div>
311
  </div>
312
 
313
- <div class="box right">
314
  <div class="wrapper_right">
315
- <div class="box">
316
  <div class="well">
317
  <h3>Configure</h3>
318
 
@@ -329,14 +531,17 @@
329
  <h4>Turn Off Walkthroughs</h4>
330
 
331
  <p>Below you can turn off specific Walkthroughs for this website.</p>
332
- <div class='sk_walkthrough_list wrapper_wts'></div>
 
 
333
  <input class='button button-primary' type='submit' value='Save'/>
 
334
  <?php wp_nonce_field( 'update_sk_settings' ); ?>
335
  </form>
336
  </div>
337
  </div>
338
 
339
- <div class="box love">
340
  <div class="well">
341
  <h3>Love the Sidekick plugin?</h3>
342
  <ul>
 
 
1
  <style type="text/css">
2
 
3
  .wrapper_main{
20
  margin: 0;
21
  }
22
 
23
+ .wrapper_main .sk_box{
24
+ -webkit-box-flex: 1;
25
+ -moz-box-flex: 1;
26
+ -webkit-flex: 1;
27
+ -ms-flex: 1;
28
+ flex: 1;
29
  max-width: 50%;
30
  }
31
 
36
  flex-direction: column;
37
  }
38
 
39
+ .wrapper_left .sk_box{
40
  max-width: 100%;
41
  }
42
 
47
  flex-direction: column;
48
  }
49
 
50
+ .wrapper_right .sk_box{
51
  max-width: 100%;
52
  }
53
 
67
  flex-wrap: wrap;
68
  }
69
 
70
+ .sk_bucket ul{
71
+ display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
72
+ display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
73
+ display: -ms-flexbox; /* TWEENER - IE 10 */
74
+ display: -webkit-flex; /* NEW - Chrome */
75
+ display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
76
+ -webkit-flex-direction: row;
77
+ -moz-flex-direction: row;
78
+ -ms-flex-direction: row;
79
+ flex-direction: row;
80
+ -webkit-flex-wrap: wrap;
81
+ -moz-flex-wrap: wrap;
82
+ -ms-flex-wrap: wrap;
83
+ flex-wrap: wrap;
84
+ }
85
+
86
+ .sk_bucket ul div{
87
+ -webkit-flex-grow: 2;
88
+ -moz-flex-grow: 2;
89
+ -ms-flex-grow: 2;
90
+ flex-grow: 2;
91
  min-width: 50%;
92
+ max-width: 50%;
93
+ }
94
+
95
+
96
+
97
+ .wrapper_wts .sk_product{
98
+ min-width: 100%;
99
  }
100
 
101
+ .configure{
102
+ display: none;
103
+ }
104
+
105
+
106
+
107
+ .wrapper_wts .sk_box span{
108
  padding: 3px;
109
+ /*display: block;*/
110
  }
111
 
112
  .well{
120
  overflow: hidden;
121
  }
122
 
123
+ .advanced{
124
+ display: none;
125
+ }
126
+
127
  .sidekick_admin a{
128
  color: #F2641E;
129
  }
132
  margin-left: 20px;
133
  }
134
 
135
+
136
+
137
  .sidekick_admin ul li{
138
  list-style-type: disc;
139
  list-style-position: outside;
184
  width: 100%;
185
  }
186
 
187
+ span.select_all{
188
+ cursor: pointer;
189
+ color: #F2641E;
190
+ text-decoration: underline;
191
+ }
192
+
193
+ .sk_bucket{
194
+ margin-top: 5px;
195
+ background-color: #F1F1F1;
196
+ padding: 5px;
197
+ list-style-type: none;
198
+ }
199
+
200
+ .sidekick_admin ul li.sk_walkthrough{
201
+ list-style-type: none;
202
+ padding-left: 0px;
203
+ margin: 0px;
204
+ min-width: 47%;
205
+ max-width: 47%;
206
+ margin-bottom: 5px;
207
+ }
208
+
209
+ .sidekick_admin ul li.sk_walkthrough span{
210
+ margin-left: -20px;
211
+ }
212
+
213
+ .sidekick_admin ul li.sk_walkthrough span.title{
214
+ margin-left: 0px;
215
+ padding-right: 20px;
216
+ }
217
+
218
  </style>
219
 
220
 
221
  <script type="text/javascript">
222
 
223
  function sk_populate(data){
224
+
225
+ jQuery('.sk_walkthrough_list').html('');
226
+
227
+ var sk_prod_counter = 1;
228
+
229
+
230
+ _.each(data.products,function(item,key){
231
+
232
+ var last = false;
233
+ sk_prod_counter++;
234
+
235
+ if (!item.cacheId) {
236
+ return false;
 
 
 
 
 
237
  };
 
238
 
239
+ console.log('data.products %o', data.products);
240
+
241
+ console.log('sk_prod_counter %o', sk_prod_counter);
242
+
243
+
244
+ if (_.size(data.products) == sk_prod_counter) {
245
+ last = true;
246
+ };
247
+
248
+ jQuery('.sk_walkthrough_list').append('<div class="sk_product" id="' + item.cacheId + '"><b>' + item.name + '</b> (<span class="select_all">Toggle All</span>)</div>');
249
 
 
 
 
250
  jQuery.ajax({
251
+ url:sk_config.library + 'products/cache?cacheId=' + item.cacheId,
252
+ cacheId: item.cacheId,
253
+ last: last,
254
+ success: function(data,cacheId){
255
+
256
+ if (data.payload.buckets) {
257
+
258
+ // Clear out disabled wts so that compatibility doesn't screen out wts from this screen. Put it back after we're done.
259
+ var currently_disabled_wts = sk_config.disable_wts;
260
+ sk_config.disable_wts = null;
261
+
262
+ console.groupCollapsed('Checking Compatibilities');
263
+
264
+ _.each(data.payload.buckets,function(bucket,key){
265
+
266
+ jQuery('#' + item.cacheId).append("<li class='sk_bucket' id='sk_bucket_" + bucket.id + "'>" + bucket.name + " (<span class=\"select_all\">Toggle All</span>)<ul></ul></li>");
267
+
268
+ _.each(bucket.walkthroughs,function(walkthrough,key){
269
+ if (sidekick.compatibilityModel.check_compatiblity_array(this.all_walkthroughs[key])){
270
+ var checked = false;
271
+ var selected = false;
272
+
273
+ if (jQuery.inArray(parseInt(key),currently_disabled_wts) > -1) {
274
+ checked = 'CHECKED'
275
+ };
276
+
277
+ if (sk_config.autostart_walkthrough_id !== 'undefined' && sk_config.autostart_walkthrough_id == parseInt(key)) {
278
+ selected = 'SELECTED';
279
+ };
280
+
281
+ jQuery('#sk_bucket_' + this.bucket_id).find('ul').append("<li class=\" sk_walkthrough\"><span><input type=\"checkbox\" " + checked + " value='" + key + "' name=\"disable_wts[]\"></span><span class='title'>" + this.all_walkthroughs[key].title + "</span></li>");
282
+ jQuery('[name="sk_autostart_walkthrough_id"]').append('<option ' + selected + ' value="' + key + '">' + this.all_walkthroughs[key].title + '</option>');
283
+
284
+ }
285
+ },{bucket_id: bucket.id,all_walkthroughs: data.payload.walkthroughs})
286
+ }); //
287
+
288
+ console.groupEnd();//
289
+
290
+ } else { //
291
+ jQuery('#' + this.cacheId).remove();
292
+ }
293
+
294
+ console.log('last %o', last);
295
+
296
+
297
+ if (last) {
298
+ jQuery('.sk_bucket').not(':has(li)').remove();
299
+
300
+ jQuery('.select_all').click(function(){
301
+ var checkBoxes = jQuery(this).parent().find('input[type="checkbox"]');
302
+ _.each(checkBoxes,function(item,key){
303
+ jQuery(item).attr("checked", !jQuery(item).attr("checked"));
304
+ });
305
+ });
306
+
307
+ jQuery('[name="disable_wts[]"]').click(function(e){
308
+
309
+ if (e.currentTarget.checked) {
310
+ jQuery('input[value="' + e.currentTarget.value + '"]').attr('checked',true);
311
+ } else {
312
+ jQuery('input[value="' + e.currentTarget.value + '"]').attr('checked',false);
313
+ }
314
+
315
+ });
316
+
317
+ jQuery('.configure').show();
318
+
319
+ // Set the disable_wts back to original state
320
+ sk_config.disable_wts = currently_disabled_wts;
321
+
322
  };
323
  }
324
  });
325
+ }); //
326
+ } //
327
+
328
+ function load_sk_library($key){
329
+
330
+ if ($key) {
331
+ var sk_url = sk_config.library + 'domains/cache?domainKey=' + sk_config.activation_id;
332
+ } else {
333
+ var sk_url = sk_config.library + 'platform/cache?platformId=1';
334
+ }
335
+
336
+ jQuery.ajax({
337
+ url: sk_url,
338
+ error: function(data){
339
+ jQuery('.sk_license_status span').html('Invalid Key').css({color: 'red'});
340
+ jQuery('.sk_upgrade').show();
341
+ },
342
+ success: function(data){
343
+
344
+ if (sk_config.library + 'domains/cache?domainKey=' + sk_config.activation_id == sk_url) {
345
+ if (!data.payload) {
346
+ jQuery('.sk_license_status').html('Invalid Key').css({color: 'red'});
347
+ } else {
348
+ jQuery('.sk_license_status').html('Valid').css({color: 'green'});
349
+ }
350
+ }
351
+
352
+ if (!data.payload) {
353
+ load_sk_library();
354
+ return false;
355
+ }
356
+
357
+ if (data.payload) {
358
+ sk_populate(data.payload);
359
+ }
360
+ }
361
+ })
362
+ }
363
+
364
+ jQuery(document).ready(function($) {
365
+ if (sk_config.activation_id) {
366
+ load_sk_library(sk_config.activation_id);
367
  } else {
368
  jQuery('.sk_upgrade').show();
369
+ jQuery('.configure').hide();
370
  }
371
+
372
+ jQuery('h3:contains(Configure)').click(function(e){
373
+ if (e.shiftKey) {
374
+ jQuery('.advanced').show();
375
+ };
376
+ })
377
+
378
  });
379
 
380
  </script>
404
 
405
  <div class="sidekick_admin wrapper_main">
406
 
407
+ <div class="sk_box left">
408
  <div class="wrapper_left">
409
+ <div class="sk_box license">
410
  <div class="well">
411
  <?php if (!$error): ?>
412
  <h3>My Sidekick Account</h3>
453
  </div>
454
  </div>
455
 
456
+ <div class="sk_box composer">
457
  <div class="well">
458
  <h3>Build Your Own Walkthroughs - Get Composer</h3>
459
+ <a href='http://www.sidekick.pro/plans/create_wp_walkthroughs/?utm_source=plugin&utm_medium=settings&utm_campaign=composer' target='_blank'><div class='composer_beta_button'>Get<br/>Composer</div></a>
460
  <ul>
461
+ <li>Get more info about <a href='http://www.sidekick.pro/composer' target='_blank'>Composer</a> now!</li>
462
+ <li><a href="http://www.sidekick.pro/plans/create_wp_walkthroughs/" target="_blank">Check out our Composer Plans</a></li>
463
  </ul>
464
  </div>
465
  </div>
466
 
467
+ <div class="sk_box you_should_know">
468
  <div class="well">
469
  <h3>Few Things you should know:</h3>
470
  <div class="">
478
  </div>
479
  </div>
480
  </div>
481
+
482
+ <div class="sk_box advanced">
483
+ <div class="well">
484
+ <h3>Advanced</h3>
485
+ <form method="post">
486
+ <table class="form-table">
487
+ <tbody>
488
+ <tr valign="top">
489
+ <th scope="row" valign="top">API</th>
490
+ <td>
491
+ <select name='sk_api'>
492
+ <?php if (get_option('sk_api') == 'production'): ?>
493
+ <option value='production' SELECTED>Production</option>
494
+ <option value='staging'>Staging</option>
495
+ <?php else: ?>
496
+ <option value='production' >Production</option>
497
+ <option value='staging' SELECTED>Staging</option>
498
+ <?php endif ?>
499
+ </select>
500
+ </td>
501
+ </tr>
502
+ </tbody>
503
+ </table>
504
+
505
+ <?php wp_nonce_field( 'update_sk_settings' ); ?>
506
+ <input class='button button-primary' type='submit' value='Save'/>
507
+ </form>
508
+
509
+ </div>
510
+ </div>
511
+
512
  </div>
513
  </div>
514
 
515
+ <div class="sk_box right">
516
  <div class="wrapper_right">
517
+ <div class="sk_box configure">
518
  <div class="well">
519
  <h3>Configure</h3>
520
 
531
  <h4>Turn Off Walkthroughs</h4>
532
 
533
  <p>Below you can turn off specific Walkthroughs for this website.</p>
534
+ <div class='sk_walkthrough_list wrapper_wts'>
535
+ Loading...
536
+ </div>
537
  <input class='button button-primary' type='submit' value='Save'/>
538
+ <input type='hidden' name='setting_disabled' value='true'/>
539
  <?php wp_nonce_field( 'update_sk_settings' ); ?>
540
  </form>
541
  </div>
542
  </div>
543
 
544
+ <div class="sk_box love">
545
  <div class="well">
546
  <h3>Love the Sidekick plugin?</h3>
547
  <ul>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Sidekick ===
2
- Contributors: raptor235,benfox,andymci
3
  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.7
6
  Tested up to: 4.0
7
- Stable tag: 1.6.19
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -52,7 +52,7 @@ With the user’s permission, Sidekick will collect anonymous data to track walk
52
 
53
  1. In /wp-admin/, go to Plugins > Add New.
54
  2. Search for "Sidekick".
55
- 3. Look for "Sidekick” (should be the only result).
56
  4. Click Install Now.
57
  5. After installation has completed, click Activate Plugin.
58
 
@@ -130,8 +130,8 @@ Absolutely. In fact, we rely on users like you to tell us about things that nee
130
 
131
  == Changelog ==
132
 
133
- = 1.6.19 =
134
- * Fixed PHP null vlaue capability
135
 
136
  = 1.6.17 =
137
  * Fixed PHP warning on plugin version
1
  === Sidekick ===
2
+ Contributors: raptor235,benfox,kyle_white,bitwit,riavalon,JeffLam
3
  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.7
6
  Tested up to: 4.0
7
+ Stable tag: 2.0.0
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
52
 
53
  1. In /wp-admin/, go to Plugins > Add New.
54
  2. Search for "Sidekick".
55
+ 3. Look for "Sidekick” (should be the only result) .
56
  4. Click Install Now.
57
  5. After installation has completed, click Activate Plugin.
58
 
130
 
131
  == Changelog ==
132
 
133
+ = 2.0.0 =
134
+ * Major Composer Release
135
 
136
  = 1.6.17 =
137
  * Fixed PHP warning on plugin version
sidekick.php CHANGED
@@ -6,16 +6,15 @@ 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.8
8
  Tested up to: 4.0
9
- Version: 1.6.19
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
13
 
14
  define('SK_LIBRARY_VERSION',6);
15
- define('DEFAULT_ACTIVATION_ID','xxxxxxxx-xxxx-xxxx-xxxx-xxxxfree');
16
- define('SK_PATH','sidekick/latest/wordpress');
17
- define('COMPOSER_PATH','cdn/composer');
18
- if (!defined('SK_USE_CDN')) define('SK_USE_CDN',true);
19
 
20
  if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
21
  if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -27,32 +26,15 @@ if ( ! function_exists('mlog')) {
27
  class Sidekick{
28
 
29
  function __construct(){
30
- global $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE, $SK_GLOBAL_VERSION;
31
 
32
- if ($this->is_https()) {
33
- if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','https://api.sidekick.pro/');
34
- if (!defined('SK_COMPOSER_API')) define('SK_COMPOSER_API','https://library.sidekick.pro/api');
35
- if (defined('SK_USE_CDN') && SK_USE_CDN) {
36
- if (!defined('SK_DOMAIN')) define('SK_DOMAIN','https://pullvod-flowpress.netdna-ssl.com/');
37
- } else {
38
- if (!defined('SK_DOMAIN')) define('SK_DOMAIN','https://library.sidekick.pro/');
39
- }
40
- } else {
41
- if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','http://api.sidekick.pro/');
42
- if (!defined('SK_COMPOSER_API')) define('SK_COMPOSER_API','http://library.sidekick.pro/api');
43
- if (defined('SK_USE_CDN') && SK_USE_CDN) {
44
- if (!defined('SK_DOMAIN')) define('SK_DOMAIN','http://pullvod.flowpress.netdna-cdn.com/');
45
- } else {
46
- if (!defined('SK_DOMAIN')) define('SK_DOMAIN','http://library.sidekick.pro/');
47
- }
48
- }
49
 
50
- $SK_GLOBAL_VERSION = (strpos($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], '.sidekick')) ? intval($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],36) . '&d=' . date('m-d-y-G'): date('m-d-y-G');
51
- $SK_FREE_LIBRARY_FILE = SK_DOMAIN . "library/v" . SK_LIBRARY_VERSION . "/releases/" . DEFAULT_ACTIVATION_ID . "/library.js";
52
-
53
- if ($activation_id = get_option("sk_activation_id")) {
54
- $SK_PAID_LIBRARY_FILE = SK_DOMAIN . "library/v" . SK_LIBRARY_VERSION . "/releases/{$activation_id}/library.js";
55
- }
56
  }
57
 
58
  function enqueue_required(){
@@ -76,18 +58,8 @@ class Sidekick{
76
  }
77
 
78
  function enqueue(){
79
- global $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE, $SK_GLOBAL_VERSION;
80
-
81
- $activation_id = get_option("sk_activation_id");
82
-
83
- if ($activation_id) {
84
- wp_enqueue_script("sk_paid_library" , $SK_PAID_LIBRARY_FILE,null,$SK_GLOBAL_VERSION);
85
- wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array('sk_paid_library'),$SK_GLOBAL_VERSION);
86
- } else {
87
- wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array(),$SK_GLOBAL_VERSION);
88
- }
89
-
90
- wp_enqueue_script('sidekick' ,SK_DOMAIN . "cdn/" . SK_PATH . "/sidekick.min.js", array('sk_free_library','backbone','jquery','underscore','jquery-effects-highlight'), $SK_GLOBAL_VERSION);
91
  wp_enqueue_style('wp-pointer');
92
  wp_enqueue_script('wp-pointer');
93
  }
@@ -133,12 +105,18 @@ class Sidekick{
133
  die('<script>window.open("' . get_site_url() . '/wp-admin/options-general.php?page=sidekick","_self")</script>');
134
  }
135
 
 
 
 
 
 
 
136
  if (isset($_POST['sk_autostart_walkthrough_id'])){
137
  update_option('sk_autostart_walkthrough_id',$_POST['sk_autostart_walkthrough_id']);
138
  }
139
  }
140
 
141
- $activation_id = get_option( 'sk_activation_id' );
142
  $sk_track_data = get_option( 'sk_track_data' );
143
  $current_user = wp_get_current_user();
144
  $status = 'Free';
@@ -185,7 +163,7 @@ class Sidekick{
185
  }
186
 
187
  function footer(){
188
- global $current_user, $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE, $SK_GLOBAL_VERSION;
189
 
190
  require_once('libs/sk_config_data.php');
191
 
@@ -233,75 +211,116 @@ class Sidekick{
233
 
234
  var sk_config = {
235
  // Compatibility
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  <?php echo $post_types ?>
237
  <?php echo $taxonomies ?>
238
  <?php echo $user_data ?>
239
  <?php echo $comments ?>
240
  <?php echo $post_statuses ?>
241
  <?php echo $post_types_and_statuses ?>
242
- plugin_count: <?php echo $plugin_count ?>,
243
- disable_wts: <?php echo $disabled_wts ?>,
244
  installed_plugins: <?php echo $installed_plugins ?>,
245
  is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
246
  number_of_themes: <?php echo $number_of_themes ?>,
247
  installed_theme: '<?php echo $theme->Name ?>',
248
- main_soft_name: 'WordPress',
249
  main_soft_version: '<?php echo get_bloginfo("version") ?>',
250
  theme_version: '<?php echo $theme->Version ?>',
251
  user_level: '<?php echo $user_role ?>',
 
 
 
 
252
 
253
  // User Settings
254
- activation_id: '<?php echo $activation_id ?>',
255
- auto_open_root_bucket_id: 79,
 
 
 
256
  autostart_walkthrough_id: <?php echo $autostart_walkthrough_id ?>,
257
  sk_composer_button: <?php echo ($sk_composer_button ? "true" : "false") ?>,
258
  track_data: '<?php echo $sk_track_data ?>',
259
  user_email: '<?php echo $user_email ?>',
260
 
261
  // Toggles
262
- path_not_found_continue: true,
263
- show_powered_by: true,
264
- show_powered_by_link: true,
265
- sk_autostart_only_once: true,
266
- use_native_controls: false,
 
 
267
 
268
  // Platform Info
269
- library_version: '<?php echo (defined("SK_LIBRARY_VERSION") ? SK_LIBRARY_VERSION : '') ?>',
270
 
271
  // Generic Info
272
  just_activated: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
273
  platform_version: null,
274
- plugin_version: '1.6.19',
275
  show_login: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
276
 
 
 
 
 
 
 
 
 
277
  // URLS
278
- site_url: '<?php echo $site_url ?>',
279
- domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
280
- domain_used: '<?php echo SK_DOMAIN ?>',
281
- plugin_url: '<?php echo admin_url("admin.php?page=sidekick") ?>',
282
- base_url: '<?php echo site_url() ?>',
283
- current_url: '<?php echo $current_url ?>',
284
- tracking_api: '<?php echo SK_TRACKING_API ?>',
285
- sk_path: '<?php echo SK_PATH ?>',
286
- library_free_file: '<?php echo (isset($SK_FREE_LIBRARY_FILE) ? $SK_FREE_LIBRARY_FILE : '') ?>',
287
- library_paid_file: '<?php echo (isset($SK_PAID_LIBRARY_FILE) ? $SK_PAID_LIBRARY_FILE : '') ?>',
288
- rand_file_version: '<?php echo $SK_GLOBAL_VERSION ?>'
289
  }
290
 
291
  var skc_config = {
292
- js: '<?php echo SK_DOMAIN . COMPOSER_PATH ?>/composer.source.js?<?php echo $SK_GLOBAL_VERSION ?>',
293
- css: '<?php echo SK_DOMAIN . COMPOSER_PATH ?>/style.css?<?php echo $SK_GLOBAL_VERSION ?>',
294
- apiUrl: '<?php echo SK_COMPOSER_API ?>',
295
- baseSiteUrl: sk_config.base_url
 
 
 
 
 
296
  }
297
 
298
  </script>
299
  <?php endif ?>
 
 
 
300
  <?php
301
  }
302
 
303
  function track($data){
304
- $response = wp_remote_post( SK_TRACKING_API . "v3/events/", array(
305
  'method' => 'POST',
306
  'timeout' => 45,
307
  'redirection' => 5,
@@ -315,26 +334,8 @@ class Sidekick{
315
  }
316
 
317
  function activate($return = false){
318
- if ($_POST['activation_id']) {
319
-
320
- $library_file = SK_DOMAIN . "library/v" . SK_LIBRARY_VERSION . "/releases/{$_POST['activation_id']}/library.js";
321
- $ch = curl_init($library_file);
322
- curl_setopt($ch, CURLOPT_NOBODY, true);
323
- curl_exec($ch);
324
- $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
325
- curl_close($ch);
326
  update_option('sk_activation_id',$_POST['activation_id']);
327
- if ($retcode == 200) {
328
- if ($return)
329
- return 1;
330
- die(json_encode(array('success' => 1)));
331
- } else {
332
- if ($return)
333
- return $retcode;
334
- die(json_encode(array('error' => $retcode)));
335
- }
336
- } else {
337
- die(json_encode(array('error' => 'No Activation ID')));
338
  }
339
  }
340
 
@@ -420,7 +421,7 @@ add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
420
  add_action('admin_notices', array($sidekick,'admin_notice'));
421
  add_action('admin_init', array($sidekick,'admin_notice_ignore'));
422
 
423
- if (isset($_POST['disable_wts'])) {
424
  $sidekick->set_disabled_wts();
425
  }
426
 
@@ -431,3 +432,4 @@ if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information') && !defined('
431
  add_action('admin_footer', array($sidekick,'footer'));
432
  add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
433
  }
 
6
  Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
7
  Requires at least: 3.8
8
  Tested up to: 4.0
9
+ Version: 2.0.0
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
13
 
14
  define('SK_LIBRARY_VERSION',6);
15
+ define('PLAYER_PATH','tag/latest');
16
+ define('COMPOSER_PATH','tag/latest');
17
+ define('DEFAULT_ACTIVATION_ID','');
 
18
 
19
  if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
20
  if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
26
  class Sidekick{
27
 
28
  function __construct(){
29
+ global $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE;
30
 
31
+ if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','//tracking.sidekick.pro/');
32
+ if (!defined('SK_COMPOSER_API')) define('SK_COMPOSER_API','//apiv2.sidekick.pro');
33
+ if (!defined('SK_API')) define('SK_API','//apiv2.sidekick.pro/');
34
+ if (!defined('SK_LIBRARY')) define('SK_LIBRARY','//librarycache.sidekick.pro/');
35
+ if (!defined('SK_ASSETS')) define('SK_ASSETS','//assets.sidekick.pro/');
36
+ if (!defined('SK_AUDIO')) define('SK_AUDIO','//audio.sidekick.pro/');
 
 
 
 
 
 
 
 
 
 
 
37
 
 
 
 
 
 
 
38
  }
39
 
40
  function enqueue_required(){
58
  }
59
 
60
  function enqueue(){
61
+ global $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE;
62
+ wp_enqueue_script('sidekick' ,"//player.sidekick.pro/" . PLAYER_PATH . "/sidekick.min.js", array('backbone','jquery','underscore','jquery-effects-highlight'),null);
 
 
 
 
 
 
 
 
 
 
63
  wp_enqueue_style('wp-pointer');
64
  wp_enqueue_script('wp-pointer');
65
  }
105
  die('<script>window.open("' . get_site_url() . '/wp-admin/options-general.php?page=sidekick","_self")</script>');
106
  }
107
 
108
+ if (isset($_POST['sk_api'])) {
109
+ update_option( 'sk_api', $_POST['sk_api'] );
110
+ } else {
111
+ delete_option('sk_api');
112
+ }
113
+
114
  if (isset($_POST['sk_autostart_walkthrough_id'])){
115
  update_option('sk_autostart_walkthrough_id',$_POST['sk_autostart_walkthrough_id']);
116
  }
117
  }
118
 
119
+ $activation_id = (get_option( "sk_activation_id" ) ? get_option( "sk_activation_id" ) : '');
120
  $sk_track_data = get_option( 'sk_track_data' );
121
  $current_user = wp_get_current_user();
122
  $status = 'Free';
163
  }
164
 
165
  function footer(){
166
+ global $current_user, $SK_FREE_LIBRARY_FILE, $SK_PAID_LIBRARY_FILE;
167
 
168
  require_once('libs/sk_config_data.php');
169
 
211
 
212
  var sk_config = {
213
  // Compatibility
214
+
215
+ compatibilities: {
216
+ <?php echo $post_types ?>
217
+ <?php echo $taxonomies ?>
218
+ <?php echo $user_data ?>
219
+ <?php echo $comments ?>
220
+ <?php echo $post_statuses ?>
221
+ <?php echo $post_types_and_statuses ?>
222
+ installed_plugins: <?php echo $installed_plugins ?>,
223
+ plugin_count: <?php echo $plugin_count ?>,
224
+ is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
225
+ number_of_themes: <?php echo $number_of_themes ?>,
226
+ installed_theme: '<?php echo $theme->Name ?>',
227
+ main_soft_version: '<?php echo get_bloginfo("version") ?>',
228
+ theme_version: '<?php echo $theme->Version ?>',
229
+ user_level: '<?php echo $user_role ?>',
230
+ main_soft_name: 'WordPress',
231
+ role: '<?php echo $user_role ?>'
232
+ },
233
+
234
  <?php echo $post_types ?>
235
  <?php echo $taxonomies ?>
236
  <?php echo $user_data ?>
237
  <?php echo $comments ?>
238
  <?php echo $post_statuses ?>
239
  <?php echo $post_types_and_statuses ?>
 
 
240
  installed_plugins: <?php echo $installed_plugins ?>,
241
  is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
242
  number_of_themes: <?php echo $number_of_themes ?>,
243
  installed_theme: '<?php echo $theme->Name ?>',
 
244
  main_soft_version: '<?php echo get_bloginfo("version") ?>',
245
  theme_version: '<?php echo $theme->Version ?>',
246
  user_level: '<?php echo $user_role ?>',
247
+ role: '<?php echo $user_role ?>',
248
+
249
+ disable_wts: <?php echo $disabled_wts ?>,
250
+ main_soft_name: 'WordPress',
251
 
252
  // User Settings
253
+ activation_id: '<?php echo $activation_id ?>',
254
+ auto_open_root_bucket_id: 79,
255
+ auto_open_product: 'default',
256
+ disable_wts_in_root_bucket_ids: [5],
257
+
258
  autostart_walkthrough_id: <?php echo $autostart_walkthrough_id ?>,
259
  sk_composer_button: <?php echo ($sk_composer_button ? "true" : "false") ?>,
260
  track_data: '<?php echo $sk_track_data ?>',
261
  user_email: '<?php echo $user_email ?>',
262
 
263
  // Toggles
264
+ path_not_found_continue: true,
265
+ show_powered_by: true,
266
+ show_powered_by_link: true,
267
+ sk_autostart_only_once: true,
268
+ use_native_controls: false,
269
+ composer_upgrade_off: false,
270
+ basics_upgrade: true,
271
 
272
  // Platform Info
273
+ library_version: 2,
274
 
275
  // Generic Info
276
  just_activated: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
277
  platform_version: null,
278
+ plugin_version: '2.0.0',
279
  show_login: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
280
 
281
+ // SIDEKICK URLS
282
+ assets: '<?php echo SK_ASSETS ?>',
283
+ api: '<?php echo SK_API ?>',
284
+ tracking_api: '<?php echo SK_TRACKING_API ?>',
285
+ sk_path: '<?php echo PLAYER_PATH ?>',
286
+ audio: '<?php echo SK_AUDIO ?>',
287
+ library: '<?php echo SK_LIBRARY ?>',
288
+
289
  // URLS
290
+ site_url: '<?php echo $site_url ?>',
291
+ domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
292
+ domain_used: '//player.sidekick.pro/',
293
+ plugin_url: '<?php echo admin_url("admin.php?page=sidekick") ?>',
294
+ base_url: '<?php echo site_url() ?>',
295
+ current_url: '<?php echo $current_url ?>',
296
+ // library_free_file: '<?php echo (isset($SK_FREE_LIBRARY_FILE) ? $SK_FREE_LIBRARY_FILE : '') ?>',
297
+ // library_paid_file: '<?php echo (isset($SK_PAID_LIBRARY_FILE) ? $SK_PAID_LIBRARY_FILE : '') ?>',
298
+ //,
299
+ // fallback_notfication_mp3: '//assets.sidekick.pro/fallback.mp3'
 
300
  }
301
 
302
  var skc_config = {
303
+ js: '//composer.sidekick.pro/<?php echo COMPOSER_PATH ?>/sidekick-composer.js',
304
+ css: '//composer.sidekick.pro/<?php echo COMPOSER_PATH ?>/sidekick-composer.css',
305
+ apiUrl: '<?php echo SK_COMPOSER_API ?>',
306
+ baseSiteUrl: sk_config.base_url,
307
+ compatibilities: sk_config.compatibilities,
308
+ audioBaseUrl: '<?php echo SK_AUDIO ?>',
309
+ audioPlaceholderUrl: '//assets.sidekick.pro/walkthrough-audio-placeholder.mp3',
310
+ siteAjaxUrl: window.ajaxurl || '',
311
+ trackingUrl: '//tracking.sidekick.pro/'
312
  }
313
 
314
  </script>
315
  <?php endif ?>
316
+
317
+
318
+
319
  <?php
320
  }
321
 
322
  function track($data){
323
+ $response = wp_remote_post( SK_TRACKING_API . 'event', array(
324
  'method' => 'POST',
325
  'timeout' => 45,
326
  'redirection' => 5,
334
  }
335
 
336
  function activate($return = false){
337
+ if (isset($_POST['activation_id'])) {
 
 
 
 
 
 
 
338
  update_option('sk_activation_id',$_POST['activation_id']);
 
 
 
 
 
 
 
 
 
 
 
339
  }
340
  }
341
 
421
  add_action('admin_notices', array($sidekick,'admin_notice'));
422
  add_action('admin_init', array($sidekick,'admin_notice_ignore'));
423
 
424
+ if (isset($_POST['setting_disabled'])) {
425
  $sidekick->set_disabled_wts();
426
  }
427
 
432
  add_action('admin_footer', array($sidekick,'footer'));
433
  add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
434
  }
435
+