Sidekick - Version 2.4.1

Version Description

  • Added new compatibility checking for front page static vs blog listing
  • Readines for Sidekick intro walkthrough
Download this release

Release Info

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

Code changes from version 2.3.1 to 2.4.1

Files changed (6) hide show
  1. js/sidekick_admin.js +1 -3
  2. libs/admin_page.php +1 -1
  3. readme.txt +11 -1
  4. sidekick.php +118 -88
  5. sidekick_embed.php +119 -106
  6. sk_init.php +0 -17
js/sidekick_admin.js CHANGED
@@ -404,12 +404,10 @@ function sk_populate(data){
404
  jQuery('#toggle_composer').trigger('click');
405
  });
406
 
407
- load_sites_by_status('unactivated');
408
- // return;
409
-
410
  if (typeof sk_ms_admin !== 'undefined' && sk_ms_admin) {
411
 
412
  // Multisite
 
413
 
414
  var clicked_button;
415
 
404
  jQuery('#toggle_composer').trigger('click');
405
  });
406
 
 
 
 
407
  if (typeof sk_ms_admin !== 'undefined' && sk_ms_admin) {
408
 
409
  // Multisite
410
+ load_sites_by_status('unactivated');
411
 
412
  var clicked_button;
413
 
libs/admin_page.php CHANGED
@@ -79,7 +79,7 @@
79
  Enable Composer Mode
80
  </th>
81
  <td>
82
- <button class='open_composer'>Open Composer</button>
83
  </td>
84
  </tr>
85
  </tbody>
79
  Enable Composer Mode
80
  </th>
81
  <td>
82
+ <button type='button' class='open_composer'>Open Composer</button>
83
  </td>
84
  </tr>
85
  </tbody>
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.7
6
  Tested up to: 4.2
7
- Stable tag: 2.3.1
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -145,6 +145,16 @@ We read and respond to every piece of feedback we get.
145
 
146
  == Changelog ==
147
 
 
 
 
 
 
 
 
 
 
 
148
  = 2.3.1 =
149
  * Critical bug fix post status transition
150
 
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.2
7
+ Stable tag: 2.4.1
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
145
 
146
  == Changelog ==
147
 
148
+ = 2.4.1 =
149
+ * Added new compatibility checking for front page static vs blog listing
150
+ * Readines for Sidekick intro walkthrough
151
+
152
+ = 2.4.0 =
153
+ * WordPress Customizer support
154
+ * Platform fixes
155
+ * Caption display optimizations
156
+ * Walkthroughs started in modal windows or customizer will first
157
+
158
  = 2.3.1 =
159
  * Critical bug fix post status transition
160
 
sidekick.php CHANGED
@@ -6,7 +6,7 @@ Plugin URL: http://wordpress.org/plugins/sidekick/
6
  Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
7
  Requires at least: 4.0
8
  Tested up to: 4.1.1
9
- Version: 2.3.1
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
@@ -17,7 +17,7 @@ if ( ! defined( 'PLAYER_PATH' ) ) define( 'PLAYER_PATH', 'tag/latest' );
17
  if ( ! defined( 'PLAYER_FILE' ) ) define( 'PLAYER_FILE', 'sidekick.min.js' );
18
  if ( ! defined( 'COMPOSER_DOMAIN' ) ) define( 'COMPOSER_DOMAIN', 'composer.sidekick.pro' );
19
  if ( ! defined( 'COMPOSER_PATH' ) ) define( 'COMPOSER_PATH', 'tag/latest' );
20
- if ( ! defined( 'SK_EMBED_PARTNER' ) ) define( 'SK_EMBED_PARTNER', '' );
21
 
22
  if ( ! function_exists('mlog')) {
23
  function mlog(){}
@@ -37,22 +37,27 @@ if (!class_exists('Sidekick')){
37
  }
38
 
39
  function enqueue_required(){
40
- wp_enqueue_script('jquery' , null );
41
- wp_enqueue_script('underscore' , null, array('underscore'));
42
- wp_enqueue_script('backbone' , null, array('jquery','underscore'));
43
- wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
44
- wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
45
- wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
46
- wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
47
- wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
48
- wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
49
- wp_enqueue_script('sidekick-admin' , '//assets.sidekick.pro/plugin/tag/latest/js/sidekick_admin.js',array( 'jquery' ), null);
50
  }
51
 
52
  function enqueue(){
53
- wp_enqueue_script('sidekick' ,"//" . PLAYER_DOMAIN ."/" . PLAYER_PATH . "/" . PLAYER_FILE, array('backbone','jquery','underscore','jquery-effects-highlight'),null);
54
- wp_enqueue_style('wp-pointer');
55
- wp_enqueue_script('wp-pointer');
 
 
 
 
 
56
  }
57
 
58
  function setup_menu(){
@@ -268,36 +273,41 @@ if (!class_exists('Sidekick')){
268
  <?php if (is_network_admin()): ?>var is_network_admin = true; <?php endif ?>
269
 
270
  var sk_config = {
271
- // Compatibility
 
272
 
273
  compatibilities: {
274
- <?php echo $post_types ?>
275
- <?php echo $taxonomies ?>
276
- <?php echo $user_data ?>
277
- <?php echo $comments ?>
278
- <?php echo $post_statuses ?>
279
- <?php echo $frameworks ?>
280
- <?php echo $post_types_and_statuses ?>
281
- installed_plugins: <?php echo json_encode($installed_plugins) ?>,
282
- plugin_count: <?php echo ($plugin_count) ? $plugin_count : 0 ?>,
283
- is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
284
- number_of_themes: <?php echo $number_of_themes ?>,
285
- installed_theme: '<?php echo sanitize_title($theme->Name) ?>',
286
- theme_version: '<?php echo $theme->Version ?>',
287
- main_soft_version: '<?php echo get_bloginfo("version") ?>',
288
- // main_soft_version: '4.5.1',
289
- user_level: '<?php echo $user_role ?>',
290
- main_soft_name: 'WordPress',
291
- file_editor_enabled: <?php echo ($file_editor_enabled) ? $file_editor_enabled: 'null' ?>,
292
- role: '<?php echo $user_role ?>'
 
 
 
293
  },
294
 
295
- disable_wts: <?php echo $disabled_wts ?>,
296
- disable_network_wts: <?php echo $disabled_network_wts ?>,
297
- main_soft_name: 'WordPress',
298
- embeded: false,
299
 
300
- // User Settings
 
301
  activation_id: '<?php echo $activation_id ?>',
302
  auto_open_root_bucket_id: 79,
303
  auto_open_product: 'default',
@@ -306,46 +316,66 @@ if (!class_exists('Sidekick')){
306
  track_data: '<?php echo $sk_track_data ?>',
307
  user_email: '<?php echo $user_email ?>',
308
  custom_class: '<?php echo $custom_class ?>',
309
-
310
- // Toggles
311
- path_not_found_continue: true,
312
- show_powered_by: true,
313
- show_powered_by_link: true,
314
- sk_autostart_only_once: true,
315
- use_native_controls: false,
316
- basics_upgrade: true,
317
- composer_upgrade_off: <?php echo ($sk_hide_composer_upgrade_button ? "true" : "false") ?>,
318
- hide_taskbar_composer_button: <?php echo ($sk_hide_composer_taskbar_button ? "true" : "false") ?>,
319
- hide_taskbar_config_button: <?php echo ($sk_hide_config_taskbar_button ? "true" : "false") ?>,
320
-
321
- // Platform Info
322
- library_version: 2,
323
- platform_id: 1,
324
- embed_partner: '<?php echo SK_EMBED_PARTNER ?>',
325
-
326
- // Generic Info
327
- just_activated: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
328
- show_login: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
329
- platform_version: null,
330
- plugin_version: '2.3.1',
331
-
332
- // SIDEKICK URLS
333
- assets: '<?php echo SK_ASSETS ?>',
334
- api: '<?php echo SK_API ?>',
335
- tracking_api: '<?php echo SK_TRACKING_API ?>',
336
- sk_path: '<?php echo PLAYER_PATH ?>',
337
- audio: '<?php echo SK_AUDIO ?>',
338
- library: '<?php echo SK_LIBRARY ?>',
339
-
340
- // URLS
341
- site_url: '<?php echo $site_url ?>',
342
- domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
343
- domain_used: '//<?php echo PLAYER_DOMAIN ?>/',
344
- plugin_url: '<?php echo admin_url("admin.php?page=sidekick") ?>',
345
- base_url: '<?php echo site_url() ?>',
346
- current_url: '<?php echo $current_url ?>'
347
  }
348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  var skc_config = {
350
  audioPlaceholderUrl: '<?php echo SK_ASSETS ?>walkthrough-audio-placeholder.mp3',
351
  audioBaseUrl: '<?php echo SK_AUDIO ?>',
@@ -375,11 +405,11 @@ if (!class_exists('Sidekick')){
375
 
376
  switch ($data['type']) {
377
  case 'activate':
378
- $mp->track("Activate - Plugin", array("domain" => $domain));
379
  break;
380
 
381
  case 'deactivate':
382
- $mp->track("Deactivate - Plugin", array("domain" => $domain));
383
  break;
384
 
385
  default:
@@ -426,7 +456,7 @@ if (!class_exists('Sidekick')){
426
  function check_ver(){
427
 
428
  if (isset($_GET['sk_ver_check'])){
429
- $data = json_encode('2.3.1');
430
 
431
  if(array_key_exists('callback', $_GET)){
432
 
@@ -503,15 +533,15 @@ if (!class_exists('Sidekick')){
503
  add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
504
  add_action('admin_notices', array($sidekick,'admin_notice'));
505
 
506
- if (!defined('SK_PLUGIN_DEGBUG')){
507
- require_once('sk_init.php');
508
- }
509
-
510
- if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information') && !defined('IFRAME_REQUEST')) {
511
- add_action('admin_footer', array($sidekick,'footer'));
512
  add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
 
 
 
 
513
  }
514
-
515
  // Not working right now
516
  // add_action('transition_post_status',array($sidekick,'delete_sk_get_post_types_and_statuses'));
517
  // add_action('clean_post_cache',array($sidekick,'delete_sk_get_post_types_and_statuses'));
6
  Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
7
  Requires at least: 4.0
8
  Tested up to: 4.1.1
9
+ Version: 2.4.1
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
17
  if ( ! defined( 'PLAYER_FILE' ) ) define( 'PLAYER_FILE', 'sidekick.min.js' );
18
  if ( ! defined( 'COMPOSER_DOMAIN' ) ) define( 'COMPOSER_DOMAIN', 'composer.sidekick.pro' );
19
  if ( ! defined( 'COMPOSER_PATH' ) ) define( 'COMPOSER_PATH', 'tag/latest' );
20
+ if ( ! defined( 'SK_EMBEDDED_PARTNER' ) ) define( 'SK_EMBEDDED_PARTNER', '' );
21
 
22
  if ( ! function_exists('mlog')) {
23
  function mlog(){}
37
  }
38
 
39
  function enqueue_required(){
40
+ wp_enqueue_script('jquery' , null );
41
+ wp_enqueue_script('underscore' , null, array('underscore'));
42
+ wp_enqueue_script('backbone' , null, array('jquery','underscore'));
43
+ wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
44
+ wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
45
+ wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
46
+ wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
47
+ wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
48
+ wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
49
+ wp_enqueue_script('sidekick-admin' , '//assets.sidekick.pro/plugin/tag/latest/js/sidekick_admin.js',array( 'jquery' ), null);
50
  }
51
 
52
  function enqueue(){
53
+ $prod_build = apply_filters( 'sk_build', true );
54
+ if ($prod_build) {
55
+ wp_enqueue_script('sidekick' ,"//" . PLAYER_DOMAIN ."/" . PLAYER_PATH . "/" . PLAYER_FILE, array('backbone','jquery','underscore','jquery-effects-highlight'),null);
56
+ wp_enqueue_style('wp-pointer');
57
+ wp_enqueue_script('wp-pointer');
58
+ } else {
59
+ do_action( 'sk_enqueue' );
60
+ }
61
  }
62
 
63
  function setup_menu(){
273
  <?php if (is_network_admin()): ?>var is_network_admin = true; <?php endif ?>
274
 
275
  var sk_config = {
276
+
277
+ // Compatibilities
278
 
279
  compatibilities: {
280
+ <?php echo $post_types ?>
281
+ <?php echo $taxonomies ?>
282
+ <?php echo $user_data ?>
283
+ <?php echo $comments ?>
284
+ <?php echo $post_statuses ?>
285
+ <?php echo $frameworks ?>
286
+ <?php echo $post_types_and_statuses ?>
287
+ installed_theme: '<?php echo sanitize_title($theme->Name) ?>',
288
+ theme_version: '<?php echo $theme->Version ?>',
289
+ main_soft_version: '<?php echo get_bloginfo("version") ?>',
290
+ user_level: '<?php echo $user_role ?>',
291
+ role: '<?php echo $user_role ?>',
292
+ show_on_front: '<?php echo get_option('show_on_front') ?>',
293
+ page_on_front: '<?php echo get_option('page_on_front') ?>',
294
+ page_for_posts: '<?php echo get_option('page_for_posts') ?>',
295
+ installed_plugins: <?php echo json_encode($installed_plugins) ?>,
296
+ plugin_count: <?php echo ($plugin_count) ? $plugin_count : 0 ?>,
297
+ is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
298
+ number_of_themes: <?php echo $number_of_themes ?>,
299
+ file_editor_enabled: <?php echo ($file_editor_enabled) ? $file_editor_enabled: 'null' ?>,
300
+ disable_wts: <?php echo $disabled_wts ?>, // Copying these to compatibilities, have to update this over time
301
+ disable_network_wts: <?php echo $disabled_network_wts ?> // Copying these to compatibilities, have to update this over time
302
  },
303
 
304
+ disable_wts: <?php echo $disabled_wts ?>, // Copying these to compatibilities, have to update this over time
305
+ disable_network_wts: <?php echo $disabled_network_wts ?>, // Copying these to compatibilities, have to update this over time
306
+
307
+ // Platform
308
 
309
+ platform_id: 1,
310
+ base_url: '<?php echo site_url() ?>',
311
  activation_id: '<?php echo $activation_id ?>',
312
  auto_open_root_bucket_id: 79,
313
  auto_open_product: 'default',
316
  track_data: '<?php echo $sk_track_data ?>',
317
  user_email: '<?php echo $user_email ?>',
318
  custom_class: '<?php echo $custom_class ?>',
319
+ path_not_found_continue: true, // Turn on audio fallback if step is not found
320
+ show_powered_by: true, // Show powered by in the taskbar
321
+ show_powered_by_link: true, // Make powered by a link
322
+ sk_autostart_only_once: true, // Make autostarted walkthrough play only once, if false it will play everytime the user comes back.
323
+ hide_taskbar_composer_button: <?php echo ($sk_hide_composer_taskbar_button ? "true" : "false") ?>, // hide composer button on the taskbar
324
+ hide_taskbar_config_button: <?php echo ($sk_hide_config_taskbar_button ? "true" : "false") ?>, // hide settings button on taskbar
325
+ show_login: <?php echo ($sk_just_activated) ? "true" : "false" ?>, // open drawer automatically, same as just_activated
326
+ platform_version: null, // default value set at runtime by build process
327
+ assets: '<?php echo SK_ASSETS ?>',
328
+ api: '<?php echo SK_API ?>',
329
+ tracking_api: '<?php echo SK_TRACKING_API ?>',
330
+ sk_path: '<?php echo PLAYER_PATH ?>',
331
+ audio: '<?php echo SK_AUDIO ?>',
332
+ library: '<?php echo SK_LIBRARY ?>',
333
+ playIntro: true,
334
+
335
+
336
+ // WordPress
337
+
338
+ embedded: false,
339
+ showContentUpgrade: true, // if true show upgrade to WordPress basics if not on a paid library, should always be false for other platforms
340
+ embedded_partner: '<?php echo SK_EMBEDDED_PARTNER ?>', // for tracking purposes if sidekick has been embeded in another WordPress plugin or theme
341
+ plugin_version: '2.4.1', // WordPress plugin version
342
+ site_url: '<?php echo $site_url ?>',
343
+ domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
344
+ domain_used: '//<?php echo PLAYER_DOMAIN ?>/',
345
+ plugin_url: '<?php echo admin_url("admin.php?page=sidekick") ?>',
346
+ current_url: '<?php echo $current_url ?>', // need to move this to be set via the client
347
+ introMp3: '<?php echo SK_ASSETS ?>/sidekick-getting-started-short-v2.mp3'
348
+
 
 
 
 
 
 
 
 
349
  }
350
 
351
+ // sk_config.additionalLibrary = {
352
+ // products : {
353
+ // 5 : {
354
+ // buckets: {
355
+ // 7: {
356
+ // walkthroughs: [
357
+ // {id: 100000, title: 'Install WordPress on Bluehost Addon Domain', type: 'video', url: 'https://www.youtube.com/watch?v=UbEg8P89MiU', width: 560, height: 315},
358
+ // {id: 100001, title: 'Creating Pages', type: 'video', url: 'https://www.youtube.com/watch?v=9s8aYsSNtjk&index=3&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
359
+ // {id: 100002, title: 'Creating Blog Pages', type: 'video', url: 'https://www.youtube.com/watch?v=m0C55PU-8xE&index=4&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
360
+ // {id: 100003, title: 'Categories and Tags', type: 'video', url: 'https://www.youtube.com/watch?v=GYy9n-nmnM0&index=5&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
361
+ // {id: 100004, title: 'Using Plugins', type: 'video', url: 'https://www.youtube.com/watch?v=mmpoAC9HhRQ&index=6&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
362
+ // {id: 100005, title: 'Customizing Themes', type: 'video', url: 'https://www.youtube.com/watch?v=rlpSSSXRThk&index=7&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
363
+
364
+ // {id: 100006, title: 'Install a new Theme', type: 'website', url: 'https://my.bluehost.com/hosting/help/wp_themes', width: 560, height: 315},
365
+ // {id: 100007, title: 'How to Update WordPress Plugins', type: 'website', url: 'https://my.bluehost.com/hosting/help/update_wordpress_plugins', width: 560, height: 315},
366
+ // {id: 100008, title: 'How to Uninstall a Plugin', type: 'website', url: 'https://my.bluehost.com/hosting/help/2530', width: 560, height: 315},
367
+ // {id: 100009, title: 'Preventing Spam', type: 'website', url: 'https://my.bluehost.com/hosting/help/wp_spam', width: 560, height: 315}
368
+ // ]
369
+ // }
370
+ // }
371
+ // }
372
+ // }
373
+ // }
374
+
375
+ sk_config.onBeforePlay = [
376
+ {path: 'a.customize-controls-close,a.media-modal-close,.so-panels-dialog-edit-widget a.so-close,.close-full-overlay', event: 'click'}
377
+ ];
378
+
379
  var skc_config = {
380
  audioPlaceholderUrl: '<?php echo SK_ASSETS ?>walkthrough-audio-placeholder.mp3',
381
  audioBaseUrl: '<?php echo SK_AUDIO ?>',
405
 
406
  switch ($data['type']) {
407
  case 'activate':
408
+ $mp->track("Activate - Plugin", array("domain" => $domain));
409
  break;
410
 
411
  case 'deactivate':
412
+ $mp->track("Deactivate - Plugin", array("domain" => $domain));
413
  break;
414
 
415
  default:
456
  function check_ver(){
457
 
458
  if (isset($_GET['sk_ver_check'])){
459
+ $data = json_encode('2.4.1');
460
 
461
  if(array_key_exists('callback', $_GET)){
462
 
533
  add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
534
  add_action('admin_notices', array($sidekick,'admin_notice'));
535
 
536
+ if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information')) {
537
+ add_action('admin_footer', array($sidekick,'footer'));
 
 
 
 
538
  add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
539
+ add_action('admin_enqueue_scripts', array($sidekick,'enqueue'));
540
+ add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
541
+ add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue'),1000);
542
+ add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue_required'),1000);
543
  }
544
+
545
  // Not working right now
546
  // add_action('transition_post_status',array($sidekick,'delete_sk_get_post_types_and_statuses'));
547
  // add_action('clean_post_cache',array($sidekick,'delete_sk_get_post_types_and_statuses'));
sidekick_embed.php CHANGED
@@ -8,7 +8,7 @@ Description: Adds a real-time WordPress training walkthroughs right in your Dash
8
  We recommend not activating SIDEKICK automatically for people but via an Opt-In process when they configure your own theme or plugin.
9
  Requires at least: 4.0
10
  Tested up to: 4.1.1
11
- Version: 2.3.1
12
  Author: Sidekick.pro
13
  Author URI: http://www.sidekick.pro
14
  */
@@ -19,7 +19,7 @@ if ( ! defined( 'PLAYER_PATH' ) ) define( 'PLAYER_PATH', 'tag/latest' );
19
  if ( ! defined( 'PLAYER_FILE' ) ) define( 'PLAYER_FILE', 'sidekick.min.js' );
20
  if ( ! defined( 'COMPOSER_DOMAIN' ) ) define( 'COMPOSER_DOMAIN', 'composer.sidekick.pro' );
21
  if ( ! defined( 'COMPOSER_PATH' ) ) define( 'COMPOSER_PATH', 'tag/latest' );
22
- if ( ! defined( 'SK_EMBED_PARTNER' ) ) define( 'SK_EMBED_PARTNER', '' );
23
 
24
  if ( ! function_exists('mlog')) {
25
  function mlog(){}
@@ -42,22 +42,27 @@ if (!$sidekick_active && !class_exists('Sidekick')){
42
  }
43
 
44
  function enqueue_required(){
45
- wp_enqueue_script('jquery' , null );
46
- wp_enqueue_script('underscore' , null, array('underscore'));
47
- wp_enqueue_script('backbone' , null, array('jquery','underscore'));
48
- wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
49
- wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
50
- wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
51
- wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
52
- wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
53
- wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
54
- wp_enqueue_script('sidekick-admin' , '//assets.sidekick.pro/plugin/tag/latest/js/sidekick_admin.js',array( 'jquery' ), null);
55
  }
56
 
57
  function enqueue(){
58
- wp_enqueue_script('sidekick' ,"//" . PLAYER_DOMAIN ."/" . PLAYER_PATH . "/" . PLAYER_FILE, array('backbone','jquery','underscore','jquery-effects-highlight'),null);
59
- wp_enqueue_style('wp-pointer');
60
- wp_enqueue_script('wp-pointer');
 
 
 
 
 
61
  }
62
 
63
  function setup_menu(){
@@ -220,7 +225,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
220
  Enable Composer Mode
221
  </th>
222
  <td>
223
- <button class='open_composer'>Open Composer</button>
224
  </td>
225
  </tr>
226
  </tbody>
@@ -531,36 +536,41 @@ if (!$sidekick_active && !class_exists('Sidekick')){
531
  <?php if (is_network_admin()): ?>var is_network_admin = true; <?php endif ?>
532
 
533
  var sk_config = {
534
- // Compatibility
 
535
 
536
  compatibilities: {
537
- <?php echo $post_types ?>
538
- <?php echo $taxonomies ?>
539
- <?php echo $user_data ?>
540
- <?php echo $comments ?>
541
- <?php echo $post_statuses ?>
542
- <?php echo $frameworks ?>
543
- <?php echo $post_types_and_statuses ?>
544
- installed_plugins: <?php echo json_encode($installed_plugins) ?>,
545
- plugin_count: <?php echo ($plugin_count) ? $plugin_count : 0 ?>,
546
- is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
547
- number_of_themes: <?php echo $number_of_themes ?>,
548
- installed_theme: '<?php echo sanitize_title($theme->Name) ?>',
549
- theme_version: '<?php echo $theme->Version ?>',
550
- main_soft_version: '<?php echo get_bloginfo("version") ?>',
551
- // main_soft_version: '4.5.1',
552
- user_level: '<?php echo $user_role ?>',
553
- main_soft_name: 'WordPress',
554
- file_editor_enabled: <?php echo ($file_editor_enabled) ? $file_editor_enabled: 'null' ?>,
555
- role: '<?php echo $user_role ?>'
 
 
 
556
  },
557
 
558
- disable_wts: <?php echo $disabled_wts ?>,
559
- disable_network_wts: <?php echo $disabled_network_wts ?>,
560
- main_soft_name: 'WordPress',
561
- embeded: true,
562
 
563
- // User Settings
 
 
 
564
  activation_id: '<?php echo $activation_id ?>',
565
  auto_open_root_bucket_id: 79,
566
  auto_open_product: 'default',
@@ -569,46 +579,66 @@ if (!$sidekick_active && !class_exists('Sidekick')){
569
  track_data: '<?php echo $sk_track_data ?>',
570
  user_email: '<?php echo $user_email ?>',
571
  custom_class: '<?php echo $custom_class ?>',
572
-
573
- // Toggles
574
- path_not_found_continue: true,
575
- show_powered_by: true,
576
- show_powered_by_link: true,
577
- sk_autostart_only_once: true,
578
- use_native_controls: false,
579
- basics_upgrade: true,
580
- composer_upgrade_off: <?php echo ($sk_hide_composer_upgrade_button ? "true" : "false") ?>,
581
- hide_taskbar_composer_button: <?php echo ($sk_hide_composer_taskbar_button ? "true" : "false") ?>,
582
- hide_taskbar_config_button: <?php echo ($sk_hide_config_taskbar_button ? "true" : "false") ?>,
583
-
584
- // Platform Info
585
- library_version: 2,
586
- platform_id: 1,
587
- embed_partner: '<?php echo SK_EMBED_PARTNER ?>',
588
-
589
- // Generic Info
590
- just_activated: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
591
- show_login: <?php echo ($sk_just_activated) ? "true" : "false" ?>,
592
- platform_version: null,
593
- plugin_version: '2.3.1',
594
-
595
- // SIDEKICK URLS
596
- assets: '<?php echo SK_ASSETS ?>',
597
- api: '<?php echo SK_API ?>',
598
- tracking_api: '<?php echo SK_TRACKING_API ?>',
599
- sk_path: '<?php echo PLAYER_PATH ?>',
600
- audio: '<?php echo SK_AUDIO ?>',
601
- library: '<?php echo SK_LIBRARY ?>',
602
-
603
- // URLS
604
- site_url: '<?php echo $site_url ?>',
605
- domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
606
- domain_used: '//<?php echo PLAYER_DOMAIN ?>/',
607
- plugin_url: '<?php echo admin_url("admin.php?page=sidekick") ?>',
608
- base_url: '<?php echo site_url() ?>',
609
- current_url: '<?php echo $current_url ?>'
610
  }
611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  var skc_config = {
613
  audioPlaceholderUrl: '<?php echo SK_ASSETS ?>walkthrough-audio-placeholder.mp3',
614
  audioBaseUrl: '<?php echo SK_AUDIO ?>',
@@ -638,11 +668,11 @@ if (!$sidekick_active && !class_exists('Sidekick')){
638
 
639
  switch ($data['type']) {
640
  case 'activate':
641
- $mp->track("Activate - Plugin", array("domain" => $domain));
642
  break;
643
 
644
  case 'deactivate':
645
- $mp->track("Deactivate - Plugin", array("domain" => $domain));
646
  break;
647
 
648
  default:
@@ -689,7 +719,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
689
  function check_ver(){
690
 
691
  if (isset($_GET['sk_ver_check'])){
692
- $data = json_encode('2.3.1');
693
 
694
  if(array_key_exists('callback', $_GET)){
695
 
@@ -766,32 +796,15 @@ if (!$sidekick_active && !class_exists('Sidekick')){
766
  add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
767
  add_action('admin_notices', array($sidekick,'admin_notice'));
768
 
769
- {
770
-
771
-
772
- if (defined('SK_PLUGIN_DEGBUG')) {
773
- // mlog('PHP: Sidekick run debug class');
774
- $sidekick = new SidekickDev;
775
- }
776
-
777
- if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information') && !defined('IFRAME_REQUEST')) {
778
- add_action('admin_enqueue_scripts', array($sidekick,'enqueue'));
779
- add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
780
- add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue'));
781
-
782
- if (defined('SK_PLUGIN_DEGBUG')) {
783
- add_action('admin_footer', array($sidekick,'footer_dev'));
784
- add_action('customize_controls_print_footer_scripts', array($sidekick,'footer_dev'));
785
- }
786
- }
787
-
788
- }
789
-
790
- if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information') && !defined('IFRAME_REQUEST')) {
791
- add_action('admin_footer', array($sidekick,'footer'));
792
  add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
 
 
 
 
793
  }
794
-
795
  // Not working right now
796
  // add_action('transition_post_status',array($sidekick,'delete_sk_get_post_types_and_statuses'));
797
  // add_action('clean_post_cache',array($sidekick,'delete_sk_get_post_types_and_statuses'));
8
  We recommend not activating SIDEKICK automatically for people but via an Opt-In process when they configure your own theme or plugin.
9
  Requires at least: 4.0
10
  Tested up to: 4.1.1
11
+ Version: 2.4.1
12
  Author: Sidekick.pro
13
  Author URI: http://www.sidekick.pro
14
  */
19
  if ( ! defined( 'PLAYER_FILE' ) ) define( 'PLAYER_FILE', 'sidekick.min.js' );
20
  if ( ! defined( 'COMPOSER_DOMAIN' ) ) define( 'COMPOSER_DOMAIN', 'composer.sidekick.pro' );
21
  if ( ! defined( 'COMPOSER_PATH' ) ) define( 'COMPOSER_PATH', 'tag/latest' );
22
+ if ( ! defined( 'SK_EMBEDDED_PARTNER' ) ) define( 'SK_EMBEDDED_PARTNER', '' );
23
 
24
  if ( ! function_exists('mlog')) {
25
  function mlog(){}
42
  }
43
 
44
  function enqueue_required(){
45
+ wp_enqueue_script('jquery' , null );
46
+ wp_enqueue_script('underscore' , null, array('underscore'));
47
+ wp_enqueue_script('backbone' , null, array('jquery','underscore'));
48
+ wp_enqueue_script('jquery-ui-core' , null, array('jquery') );
49
+ wp_enqueue_script('jquery-ui-position' , null, array('jquery-ui-core') );
50
+ wp_enqueue_script('jquery-ui-draggable' , null, array('jquery-ui-core') );
51
+ wp_enqueue_script('jquery-ui-droppable' , null, array('jquery-ui-core') );
52
+ wp_enqueue_script('jquery-effects-scale' , null, array('jquery-ui-core') );
53
+ wp_enqueue_script('jquery-effects-highlight' , null, array('jquery-ui-core') );
54
+ wp_enqueue_script('sidekick-admin' , '//assets.sidekick.pro/plugin/tag/latest/js/sidekick_admin.js',array( 'jquery' ), null);
55
  }
56
 
57
  function enqueue(){
58
+ $prod_build = apply_filters( 'sk_build', true );
59
+ if ($prod_build) {
60
+ wp_enqueue_script('sidekick' ,"//" . PLAYER_DOMAIN ."/" . PLAYER_PATH . "/" . PLAYER_FILE, array('backbone','jquery','underscore','jquery-effects-highlight'),null);
61
+ wp_enqueue_style('wp-pointer');
62
+ wp_enqueue_script('wp-pointer');
63
+ } else {
64
+ do_action( 'sk_enqueue' );
65
+ }
66
  }
67
 
68
  function setup_menu(){
225
  Enable Composer Mode
226
  </th>
227
  <td>
228
+ <button type='button' class='open_composer'>Open Composer</button>
229
  </td>
230
  </tr>
231
  </tbody>
536
  <?php if (is_network_admin()): ?>var is_network_admin = true; <?php endif ?>
537
 
538
  var sk_config = {
539
+
540
+ // Compatibilities
541
 
542
  compatibilities: {
543
+ <?php echo $post_types ?>
544
+ <?php echo $taxonomies ?>
545
+ <?php echo $user_data ?>
546
+ <?php echo $comments ?>
547
+ <?php echo $post_statuses ?>
548
+ <?php echo $frameworks ?>
549
+ <?php echo $post_types_and_statuses ?>
550
+ installed_theme: '<?php echo sanitize_title($theme->Name) ?>',
551
+ theme_version: '<?php echo $theme->Version ?>',
552
+ main_soft_version: '<?php echo get_bloginfo("version") ?>',
553
+ user_level: '<?php echo $user_role ?>',
554
+ role: '<?php echo $user_role ?>',
555
+ show_on_front: '<?php echo get_option('show_on_front') ?>',
556
+ page_on_front: '<?php echo get_option('page_on_front') ?>',
557
+ page_for_posts: '<?php echo get_option('page_for_posts') ?>',
558
+ installed_plugins: <?php echo json_encode($installed_plugins) ?>,
559
+ plugin_count: <?php echo ($plugin_count) ? $plugin_count : 0 ?>,
560
+ is_multisite: <?php echo (is_multisite()) ? "true" : "false" ?>,
561
+ number_of_themes: <?php echo $number_of_themes ?>,
562
+ file_editor_enabled: <?php echo ($file_editor_enabled) ? $file_editor_enabled: 'null' ?>,
563
+ disable_wts: <?php echo $disabled_wts ?>, // Copying these to compatibilities, have to update this over time
564
+ disable_network_wts: <?php echo $disabled_network_wts ?> // Copying these to compatibilities, have to update this over time
565
  },
566
 
567
+ disable_wts: <?php echo $disabled_wts ?>, // Copying these to compatibilities, have to update this over time
568
+ disable_network_wts: <?php echo $disabled_network_wts ?>, // Copying these to compatibilities, have to update this over time
 
 
569
 
570
+ // Platform
571
+
572
+ platform_id: 1,
573
+ base_url: '<?php echo site_url() ?>',
574
  activation_id: '<?php echo $activation_id ?>',
575
  auto_open_root_bucket_id: 79,
576
  auto_open_product: 'default',
579
  track_data: '<?php echo $sk_track_data ?>',
580
  user_email: '<?php echo $user_email ?>',
581
  custom_class: '<?php echo $custom_class ?>',
582
+ path_not_found_continue: true, // Turn on audio fallback if step is not found
583
+ show_powered_by: true, // Show powered by in the taskbar
584
+ show_powered_by_link: true, // Make powered by a link
585
+ sk_autostart_only_once: true, // Make autostarted walkthrough play only once, if false it will play everytime the user comes back.
586
+ hide_taskbar_composer_button: <?php echo ($sk_hide_composer_taskbar_button ? "true" : "false") ?>, // hide composer button on the taskbar
587
+ hide_taskbar_config_button: <?php echo ($sk_hide_config_taskbar_button ? "true" : "false") ?>, // hide settings button on taskbar
588
+ show_login: <?php echo ($sk_just_activated) ? "true" : "false" ?>, // open drawer automatically, same as just_activated
589
+ platform_version: null, // default value set at runtime by build process
590
+ assets: '<?php echo SK_ASSETS ?>',
591
+ api: '<?php echo SK_API ?>',
592
+ tracking_api: '<?php echo SK_TRACKING_API ?>',
593
+ sk_path: '<?php echo PLAYER_PATH ?>',
594
+ audio: '<?php echo SK_AUDIO ?>',
595
+ library: '<?php echo SK_LIBRARY ?>',
596
+ playIntro: true,
597
+
598
+
599
+ // WordPress
600
+
601
+ embedded: false,
602
+ showContentUpgrade: true, // if true show upgrade to WordPress basics if not on a paid library, should always be false for other platforms
603
+ embedded_partner: '<?php echo SK_EMBEDDED_PARTNER ?>', // for tracking purposes if sidekick has been embeded in another WordPress plugin or theme
604
+ plugin_version: '2.4.1', // WordPress plugin version
605
+ site_url: '<?php echo $site_url ?>',
606
+ domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
607
+ domain_used: '//<?php echo PLAYER_DOMAIN ?>/',
608
+ plugin_url: '<?php echo admin_url("admin.php?page=sidekick") ?>',
609
+ current_url: '<?php echo $current_url ?>', // need to move this to be set via the client
610
+ introMp3: '<?php echo SK_ASSETS ?>/sidekick-getting-started-short-v2.mp3'
611
+
 
 
 
 
 
 
 
 
612
  }
613
 
614
+ // sk_config.additionalLibrary = {
615
+ // products : {
616
+ // 5 : {
617
+ // buckets: {
618
+ // 7: {
619
+ // walkthroughs: [
620
+ // {id: 100000, title: 'Install WordPress on Bluehost Addon Domain', type: 'video', url: 'https://www.youtube.com/watch?v=UbEg8P89MiU', width: 560, height: 315},
621
+ // {id: 100001, title: 'Creating Pages', type: 'video', url: 'https://www.youtube.com/watch?v=9s8aYsSNtjk&index=3&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
622
+ // {id: 100002, title: 'Creating Blog Pages', type: 'video', url: 'https://www.youtube.com/watch?v=m0C55PU-8xE&index=4&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
623
+ // {id: 100003, title: 'Categories and Tags', type: 'video', url: 'https://www.youtube.com/watch?v=GYy9n-nmnM0&index=5&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
624
+ // {id: 100004, title: 'Using Plugins', type: 'video', url: 'https://www.youtube.com/watch?v=mmpoAC9HhRQ&index=6&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
625
+ // {id: 100005, title: 'Customizing Themes', type: 'video', url: 'https://www.youtube.com/watch?v=rlpSSSXRThk&index=7&list=PL_9u00nsHteH2OBVX4YSU_HWWY_JSxFyj', width: 560, height: 315},
626
+
627
+ // {id: 100006, title: 'Install a new Theme', type: 'website', url: 'https://my.bluehost.com/hosting/help/wp_themes', width: 560, height: 315},
628
+ // {id: 100007, title: 'How to Update WordPress Plugins', type: 'website', url: 'https://my.bluehost.com/hosting/help/update_wordpress_plugins', width: 560, height: 315},
629
+ // {id: 100008, title: 'How to Uninstall a Plugin', type: 'website', url: 'https://my.bluehost.com/hosting/help/2530', width: 560, height: 315},
630
+ // {id: 100009, title: 'Preventing Spam', type: 'website', url: 'https://my.bluehost.com/hosting/help/wp_spam', width: 560, height: 315}
631
+ // ]
632
+ // }
633
+ // }
634
+ // }
635
+ // }
636
+ // }
637
+
638
+ sk_config.onBeforePlay = [
639
+ {path: 'a.customize-controls-close,a.media-modal-close,.so-panels-dialog-edit-widget a.so-close,.close-full-overlay', event: 'click'}
640
+ ];
641
+
642
  var skc_config = {
643
  audioPlaceholderUrl: '<?php echo SK_ASSETS ?>walkthrough-audio-placeholder.mp3',
644
  audioBaseUrl: '<?php echo SK_AUDIO ?>',
668
 
669
  switch ($data['type']) {
670
  case 'activate':
671
+ $mp->track("Activate - Plugin", array("domain" => $domain));
672
  break;
673
 
674
  case 'deactivate':
675
+ $mp->track("Deactivate - Plugin", array("domain" => $domain));
676
  break;
677
 
678
  default:
719
  function check_ver(){
720
 
721
  if (isset($_GET['sk_ver_check'])){
722
+ $data = json_encode('2.4.1');
723
 
724
  if(array_key_exists('callback', $_GET)){
725
 
796
  add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
797
  add_action('admin_notices', array($sidekick,'admin_notice'));
798
 
799
+ if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information')) {
800
+ add_action('admin_footer', array($sidekick,'footer'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
801
  add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
802
+ add_action('admin_enqueue_scripts', array($sidekick,'enqueue'));
803
+ add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
804
+ add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue'),1000);
805
+ add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue_required'),1000);
806
  }
807
+
808
  // Not working right now
809
  // add_action('transition_post_status',array($sidekick,'delete_sk_get_post_types_and_statuses'));
810
  // add_action('clean_post_cache',array($sidekick,'delete_sk_get_post_types_and_statuses'));
sk_init.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- if (defined('SK_PLUGIN_DEGBUG')) {
4
- // mlog('PHP: Sidekick run debug class');
5
- $sidekick = new SidekickDev;
6
- }
7
-
8
- if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information') && !defined('IFRAME_REQUEST')) {
9
- add_action('admin_enqueue_scripts', array($sidekick,'enqueue'));
10
- add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
11
- add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue'));
12
-
13
- if (defined('SK_PLUGIN_DEGBUG')) {
14
- add_action('admin_footer', array($sidekick,'footer_dev'));
15
- add_action('customize_controls_print_footer_scripts', array($sidekick,'footer_dev'));
16
- }
17
- }