Sidekick - Version 2.5.4

Version Description

  • Fixes to MultiSite saving setting (Thank You Gabe from justaddcontent.com)
Download this release

Release Info

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

Code changes from version 2.5.3 to 2.5.4

libs/admin_page.php CHANGED
@@ -158,7 +158,7 @@
158
  <li>Please help spread the word!</li>
159
  <li><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://sidekick.pro" data-text="I use @sidekickhelps for the fastest and easiest way to learn WordPress." data-via="sidekickhelps" data-size="large">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li>
160
  <li>Like SIDEKICK? Please leave us a 5 star rating on <a href='http://WordPress.org' target='_blank'>WordPress.org</a></li>
161
- <li><a href="http://www.sidekick.pro/plans/wordpress-basics/">Sign up for a full WordPress Basics package</a></li>
162
  <li><a href="http://support.sidekick.pro/collection/50-quick-start-guides" target="_blank"><strong>Visit the SIDEKICK Quick Start guides</strong></a>.</li>
163
  </ul>
164
  </div>
158
  <li>Please help spread the word!</li>
159
  <li><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://sidekick.pro" data-text="I use @sidekickhelps for the fastest and easiest way to learn WordPress." data-via="sidekickhelps" data-size="large">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li>
160
  <li>Like SIDEKICK? Please leave us a 5 star rating on <a href='http://WordPress.org' target='_blank'>WordPress.org</a></li>
161
+ <li><a href="http://www.sidekick.pro/plans/wordpress-basics/<?php echo ($affiliate_id) ? '&ref=' . $affiliate_id : '' ?>">Sign up for a full WordPress Basics package</a></li>
162
  <li><a href="http://support.sidekick.pro/collection/50-quick-start-guides" target="_blank"><strong>Visit the SIDEKICK Quick Start guides</strong></a>.</li>
163
  </ul>
164
  </div>
libs/licensing.php CHANGED
@@ -88,6 +88,17 @@ if (!class_exists('sidekickMassActivator')) {
88
 
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
91
  function setup_super_admin_key($domainKey) {
92
  // Use the super admin's site activation key if not set using last activation key
93
  if (!get_option('sk_activation_id')) {
88
 
89
  }
90
 
91
+ function getAffiliateId(){
92
+ if (defined('SK_AFFILIATE_ID')) {
93
+ $affiliate_id = intval(SK_AFFILIATE_ID);
94
+ } else if (get_option( "sk_affiliate_id")){
95
+ $affiliate_id = intval(get_option( "sk_affiliate_id"));
96
+ } else {
97
+ $affiliate_id = '';
98
+ }
99
+ return $affiliate_id;
100
+ }
101
+
102
  function setup_super_admin_key($domainKey) {
103
  // Use the super admin's site activation key if not set using last activation key
104
  if (!get_option('sk_activation_id')) {
libs/sk_config_data.php CHANGED
@@ -276,13 +276,16 @@ if (!class_exists('sk_config_data')) {
276
  return 'administrator';
277
  }
278
  }
279
- foreach($wp_roles->role_names as $role => $Role) {
280
- if (array_key_exists($role, $current_user->caps)){
281
- $user_role = $role;
282
- break;
 
 
283
  }
 
284
  }
285
- return $user_role;
286
  }
287
 
288
  }
276
  return 'administrator';
277
  }
278
  }
279
+ if (isset($wp_roles) && $wp_roles) {
280
+ foreach($wp_roles->role_names as $role => $Role) {
281
+ if (array_key_exists($role, $current_user->caps)){
282
+ $user_role = $role;
283
+ break;
284
+ }
285
  }
286
+ return $user_role;
287
  }
288
+ return 'n/a';
289
  }
290
 
291
  }
libs/walkthrough_config.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="sk_box configure">
2
  <div class="well">
3
- <h3>Configure - Auto Start</h3>
4
 
5
  <form method='post'>
6
 
@@ -19,7 +19,7 @@
19
 
20
  <div class="sk_box configure">
21
  <div class="well">
22
- <h3>Configure - Other</h3>
23
 
24
  <form method="post">
25
  <?php settings_fields('sk_license'); ?>
@@ -67,7 +67,7 @@
67
  <form method='post'>
68
 
69
  <input class='top-right button button-primary alignright' type='submit' value='Save'/>
70
- <h3>Configure - Turn Off Walkthroughs</h3>
71
 
72
  <p>Below you can turn off specific Walkthroughs for this website.</p>
73
  <p>Please note, incompatible multisite walkthroughs will be disabled automatically on individual sites already. Here you're being show the raw unfiltered list of all available walkthroughs.</p>
1
  <div class="sk_box configure">
2
  <div class="well">
3
+ <h3><?php echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Auto Start</h3>
4
 
5
  <form method='post'>
6
 
19
 
20
  <div class="sk_box configure">
21
  <div class="well">
22
+ <h3><?php echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Other</h3>
23
 
24
  <form method="post">
25
  <?php settings_fields('sk_license'); ?>
67
  <form method='post'>
68
 
69
  <input class='top-right button button-primary alignright' type='submit' value='Save'/>
70
+ <h3><?php echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Turn Off Walkthroughs</h3>
71
 
72
  <p>Below you can turn off specific Walkthroughs for this website.</p>
73
  <p>Please note, incompatible multisite walkthroughs will be disabled automatically on individual sites already. Here you're being show the raw unfiltered list of all available walkthroughs.</p>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.sidekick.pro
4
  Tags: help, tutorial, tutorials,screencast, self-help, 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.5.3
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -145,7 +145,10 @@ We read and respond to every piece of feedback we get.
145
 
146
  == Changelog ==
147
 
148
- = 2.5.3 =
 
 
 
149
  * Add network activated plugins to compatibilities list
150
  * MU Plugins now have versions available for compatibility filtering
151
  * Optimize the multisite admin loading screen
4
  Tags: help, tutorial, tutorials,screencast, self-help, 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.5.4
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.5.4 =
149
+ * Fixes to MultiSite saving setting (Thank You Gabe from justaddcontent.com)
150
+
151
+ = 2.5.3 =
152
  * Add network activated plugins to compatibilities list
153
  * MU Plugins now have versions available for compatibility filtering
154
  * Optimize the multisite admin loading screen
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.5.3
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
@@ -25,7 +25,7 @@ if (!class_exists('Sidekick')){
25
  function __construct(){
26
  if (!defined('SK_API')) define('SK_API','//apiv2.sidekick.pro/');
27
  if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','//tracking.sidekick.pro/');
28
- if (!defined('SK_CACHE_PREFIX')) define('SK_CACHE_PREFIX',str_replace('.', '_', '2.5.3'));
29
  }
30
 
31
  function enqueue_required(){
@@ -148,12 +148,12 @@ if (!class_exists('Sidekick')){
148
 
149
  if (isset($_POST['disable_wts']) && $_POST['disable_wts']) {
150
  update_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
151
- if (is_network_admin()) {
152
  update_site_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
153
  }
154
  } else {
155
  delete_option('sk_disabled_wts');
156
- if (is_network_admin()) {
157
  delete_site_option('sk_disabled_wts');
158
  }
159
  }
@@ -171,13 +171,13 @@ if (!class_exists('Sidekick')){
171
  }
172
 
173
  if (isset($_POST['sk_autostart_walkthrough_id']) && intval($_POST['sk_autostart_walkthrough_id']) > 0){
174
- if (is_network_admin()) {
175
  update_site_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
176
  }
177
  update_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
178
  } else {
179
  delete_option('sk_autostart_walkthrough_id');
180
- if (is_network_admin()) {
181
  delete_site_option('sk_autostart_walkthrough_id');
182
  }
183
  }
@@ -198,13 +198,13 @@ if (!class_exists('Sidekick')){
198
 
199
  foreach ($checkboxes as $key => $checkbox) {
200
  if (isset($_POST[$checkbox])){
201
- if (is_network_admin()) {
202
  update_site_option($checkbox,wp_filter_kses($_POST[$checkbox]));
203
  }
204
  update_option($checkbox,wp_filter_kses($_POST[$checkbox]));
205
  } else {
206
  delete_option($checkbox);
207
- if (is_network_admin()) {
208
  delete_site_option($checkbox);
209
  }
210
  }
@@ -239,6 +239,20 @@ if (!class_exists('Sidekick')){
239
  $file_editor_enabled = $sk_config_data->get_file_editor_enabled();
240
  $affiliate_id = $this->getAffiliateId();
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  $sk_config = array(
243
  "compatibilities" => array(
244
  "comment_count" => $sk_config_data->get_comments(),
@@ -266,18 +280,18 @@ if (!class_exists('Sidekick')){
266
  "affiliate_id" => $affiliate_id,
267
  "user_email" => ($current_user) ? $current_user->user_email : '',
268
  "autostart_walkthrough_id" => ($autostart_walkthrough_id) ? $autostart_walkthrough_id : '',
269
- "disable_wts" => (!is_network_admin()) ? $sk_config_data->get_disabled_wts() : array(), // Copying these to compatibilities, have to update this over time
270
  "disable_network_wts" => $sk_config_data->get_disabled_network_wts(), // Copying these to compatibilities, have to update this over time
271
 
272
  // Toggles
273
- "hide_taskbar_composer_button" => (get_option( 'sk_hide_composer_taskbar_button' ) ? true : false), // hide composer button on the taskbar
274
- "hide_taskbar_config_button" => (get_option( 'sk_hide_config_taskbar_button' ) ? true : false), // hide settings button on taskbar
275
  "show_login" => (get_option( 'sk_just_activated' )) ? true : false, // open drawer automatically, same as just_activated
276
 
277
  // WordPress
278
  "embedded" => false,
279
  "embedPartner" => SK_EMBEDDED_PARTNER, // for tracking purposes if sidekick has been embeded in another WordPress plugin or theme
280
- "plugin_version" => '2.5.3', // WordPress plugin version
281
  "site_url" => $sk_config_data->get_domain(),
282
  "domain" => str_replace("http://","",$_SERVER["SERVER_NAME"]),
283
  "plugin_url" => admin_url("admin.php?page=sidekick"),
@@ -383,7 +397,7 @@ if (!class_exists('Sidekick')){
383
  function check_ver(){
384
 
385
  if (isset($_GET['sk_ver_check'])){
386
- $data = json_encode('2.5.3');
387
 
388
  if(array_key_exists('callback', $_GET)){
389
 
@@ -448,31 +462,26 @@ if (!class_exists('Sidekick')){
448
  $sidekick = new Sidekick;
449
  register_activation_hook( __FILE__, array($sidekick,'activate_plugin') );
450
 
451
- add_action('admin_init', array($sidekick,'set_disabled_wts'));
452
- add_action('admin_init', array($sidekick,'set_autostart_wt'));
453
- add_action('admin_init', array($sidekick,'set_configure_other'));
454
- add_action('admin_init', array($sidekick,'check_ver'));
455
- add_action('admin_init', array($sidekick,'redirect'));
456
- add_action('admin_init', array($sidekick,'admin_notice_ignore'));
457
- add_action('admin_menu', array($sidekick,'setup_menu'));
458
- add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
459
- add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
460
- add_action('admin_notices', array($sidekick,'admin_notice'));
461
-
462
- if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information')) {
463
- add_action('admin_footer', array($sidekick,'footer'));
464
- add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
465
- add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
466
- add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue_required'),1000);
467
- }
468
 
469
  // Reset Transient Cache
470
 
471
  add_action('wp_update_comment_count',array($sidekick,'delete_sk_get_comments'));
472
-
473
  add_action('set_user_role',array($sidekick,'delete_sk_get_user_data'));
474
  add_action('edit_user_profile',array($sidekick,'delete_sk_get_user_data'));
475
-
476
  add_action('activated_plugin',array($sidekick,'delete_sk_get_plugins'));
477
  add_action('deactivated_plugin',array($sidekick,'delete_sk_get_plugins'));
478
 
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.5.4
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
25
  function __construct(){
26
  if (!defined('SK_API')) define('SK_API','//apiv2.sidekick.pro/');
27
  if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','//tracking.sidekick.pro/');
28
+ if (!defined('SK_CACHE_PREFIX')) define('SK_CACHE_PREFIX',str_replace('.', '_', '2.5.4'));
29
  }
30
 
31
  function enqueue_required(){
148
 
149
  if (isset($_POST['disable_wts']) && $_POST['disable_wts']) {
150
  update_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
151
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
152
  update_site_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
153
  }
154
  } else {
155
  delete_option('sk_disabled_wts');
156
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
157
  delete_site_option('sk_disabled_wts');
158
  }
159
  }
171
  }
172
 
173
  if (isset($_POST['sk_autostart_walkthrough_id']) && intval($_POST['sk_autostart_walkthrough_id']) > 0){
174
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
175
  update_site_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
176
  }
177
  update_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
178
  } else {
179
  delete_option('sk_autostart_walkthrough_id');
180
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
181
  delete_site_option('sk_autostart_walkthrough_id');
182
  }
183
  }
198
 
199
  foreach ($checkboxes as $key => $checkbox) {
200
  if (isset($_POST[$checkbox])){
201
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
202
  update_site_option($checkbox,wp_filter_kses($_POST[$checkbox]));
203
  }
204
  update_option($checkbox,wp_filter_kses($_POST[$checkbox]));
205
  } else {
206
  delete_option($checkbox);
207
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
208
  delete_site_option($checkbox);
209
  }
210
  }
239
  $file_editor_enabled = $sk_config_data->get_file_editor_enabled();
240
  $affiliate_id = $this->getAffiliateId();
241
 
242
+ $sk_hide_composer_taskbar_button = false;
243
+
244
+ if (get_option( 'sk_hide_composer_taskbar_button' ) || get_site_option( 'sk_hide_composer_taskbar_button' )) {
245
+ $sk_hide_composer_taskbar_button = true;
246
+ }
247
+
248
+ $sk_hide_config_taskbar_button = false;
249
+
250
+ if (get_option( 'sk_hide_config_taskbar_button' ) || get_site_option( 'sk_hide_config_taskbar_button' )) {
251
+ $sk_hide_config_taskbar_button = true;
252
+ }
253
+
254
+
255
+
256
  $sk_config = array(
257
  "compatibilities" => array(
258
  "comment_count" => $sk_config_data->get_comments(),
280
  "affiliate_id" => $affiliate_id,
281
  "user_email" => ($current_user) ? $current_user->user_email : '',
282
  "autostart_walkthrough_id" => ($autostart_walkthrough_id) ? $autostart_walkthrough_id : '',
283
+ "disable_wts" => ((!isset($_POST['is_ms_admin']) || !$_POST['is_ms_admin'])) ? $sk_config_data->get_disabled_wts() : array(), // Copying these to compatibilities, have to update this over time
284
  "disable_network_wts" => $sk_config_data->get_disabled_network_wts(), // Copying these to compatibilities, have to update this over time
285
 
286
  // Toggles
287
+ "hide_taskbar_composer_button" => $sk_hide_composer_taskbar_button, // hide composer button on the taskbar
288
+ "hide_taskbar_config_button" => $sk_hide_config_taskbar_button, // hide settings button on taskbar
289
  "show_login" => (get_option( 'sk_just_activated' )) ? true : false, // open drawer automatically, same as just_activated
290
 
291
  // WordPress
292
  "embedded" => false,
293
  "embedPartner" => SK_EMBEDDED_PARTNER, // for tracking purposes if sidekick has been embeded in another WordPress plugin or theme
294
+ "plugin_version" => '2.5.4', // WordPress plugin version
295
  "site_url" => $sk_config_data->get_domain(),
296
  "domain" => str_replace("http://","",$_SERVER["SERVER_NAME"]),
297
  "plugin_url" => admin_url("admin.php?page=sidekick"),
397
  function check_ver(){
398
 
399
  if (isset($_GET['sk_ver_check'])){
400
+ $data = json_encode('2.5.4');
401
 
402
  if(array_key_exists('callback', $_GET)){
403
 
462
  $sidekick = new Sidekick;
463
  register_activation_hook( __FILE__, array($sidekick,'activate_plugin') );
464
 
465
+ add_action('admin_init', array($sidekick,'set_disabled_wts'));
466
+ add_action('admin_init', array($sidekick,'set_autostart_wt'));
467
+ add_action('admin_init', array($sidekick,'set_configure_other'));
468
+ add_action('admin_init', array($sidekick,'check_ver'));
469
+ add_action('admin_init', array($sidekick,'redirect'));
470
+ add_action('admin_init', array($sidekick,'admin_notice_ignore'));
471
+ add_action('admin_menu', array($sidekick,'setup_menu'));
472
+ add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
473
+ add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
474
+ add_action('admin_notices', array($sidekick,'admin_notice'));
475
+ add_action('admin_footer', array($sidekick,'footer'));
476
+ add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
477
+ add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
478
+ add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue_required'),1000);
 
 
 
479
 
480
  // Reset Transient Cache
481
 
482
  add_action('wp_update_comment_count',array($sidekick,'delete_sk_get_comments'));
 
483
  add_action('set_user_role',array($sidekick,'delete_sk_get_user_data'));
484
  add_action('edit_user_profile',array($sidekick,'delete_sk_get_user_data'));
 
485
  add_action('activated_plugin',array($sidekick,'delete_sk_get_plugins'));
486
  add_action('deactivated_plugin',array($sidekick,'delete_sk_get_plugins'));
487
 
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.5.3
12
  Author: Sidekick.pro
13
  Author URI: http://www.sidekick.pro
14
  */
@@ -30,7 +30,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
30
  function __construct(){
31
  if (!defined('SK_API')) define('SK_API','//apiv2.sidekick.pro/');
32
  if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','//tracking.sidekick.pro/');
33
- if (!defined('SK_CACHE_PREFIX')) define('SK_CACHE_PREFIX',str_replace('.', '_', '2.5.3'));
34
  }
35
 
36
  function enqueue_required(){
@@ -289,7 +289,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
289
 
290
  <div class="sk_box configure">
291
  <div class="well">
292
- <h3>Configure - Auto Start</h3>
293
 
294
  <form method='post'>
295
 
@@ -298,7 +298,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
298
  <option value='0'>No Auto Start</option>
299
  </select>
300
  <input class='button button-primary' type='submit' value='Save'/>
301
- <input type='hidden' name='is_ms_admin' value=' echo (isset($is_ms_admin)) ? $is_ms_admin : false ?>'/>
302
  <input type='hidden' name='sk_setting_autostart' value='true'/>
303
 
304
  <?php wp_nonce_field( 'update_sk_settings' ); ?>
@@ -308,7 +308,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
308
 
309
  <div class="sk_box configure">
310
  <div class="well">
311
- <h3>Configure - Other</h3>
312
 
313
  <form method="post">
314
  <?php settings_fields('sk_license'); ?>
@@ -356,7 +356,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
356
  <form method='post'>
357
 
358
  <input class='top-right button button-primary alignright' type='submit' value='Save'/>
359
- <h3>Configure - Turn Off Walkthroughs</h3>
360
 
361
  <p>Below you can turn off specific Walkthroughs for this website.</p>
362
  <p>Please note, incompatible multisite walkthroughs will be disabled automatically on individual sites already. Here you're being show the raw unfiltered list of all available walkthroughs.</p>
@@ -378,7 +378,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
378
  <li>Please help spread the word!</li>
379
  <li><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://sidekick.pro" data-text="I use @sidekickhelps for the fastest and easiest way to learn WordPress." data-via="sidekickhelps" data-size="large">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li>
380
  <li>Like SIDEKICK? Please leave us a 5 star rating on <a href='http://WordPress.org' target='_blank'>WordPress.org</a></li>
381
- <li><a href="http://www.sidekick.pro/plans/wordpress-basics/">Sign up for a full WordPress Basics package</a></li>
382
  <li><a href="http://support.sidekick.pro/collection/50-quick-start-guides" target="_blank"><strong>Visit the SIDEKICK Quick Start guides</strong></a>.</li>
383
  </ul>
384
  </div>
@@ -407,12 +407,12 @@ if (!$sidekick_active && !class_exists('Sidekick')){
407
 
408
  if (isset($_POST['disable_wts']) && $_POST['disable_wts']) {
409
  update_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
410
- if (is_network_admin()) {
411
  update_site_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
412
  }
413
  } else {
414
  delete_option('sk_disabled_wts');
415
- if (is_network_admin()) {
416
  delete_site_option('sk_disabled_wts');
417
  }
418
  }
@@ -430,13 +430,13 @@ if (!$sidekick_active && !class_exists('Sidekick')){
430
  }
431
 
432
  if (isset($_POST['sk_autostart_walkthrough_id']) && intval($_POST['sk_autostart_walkthrough_id']) > 0){
433
- if (is_network_admin()) {
434
  update_site_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
435
  }
436
  update_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
437
  } else {
438
  delete_option('sk_autostart_walkthrough_id');
439
- if (is_network_admin()) {
440
  delete_site_option('sk_autostart_walkthrough_id');
441
  }
442
  }
@@ -457,13 +457,13 @@ if (!$sidekick_active && !class_exists('Sidekick')){
457
 
458
  foreach ($checkboxes as $key => $checkbox) {
459
  if (isset($_POST[$checkbox])){
460
- if (is_network_admin()) {
461
  update_site_option($checkbox,wp_filter_kses($_POST[$checkbox]));
462
  }
463
  update_option($checkbox,wp_filter_kses($_POST[$checkbox]));
464
  } else {
465
  delete_option($checkbox);
466
- if (is_network_admin()) {
467
  delete_site_option($checkbox);
468
  }
469
  }
@@ -498,6 +498,20 @@ if (!$sidekick_active && !class_exists('Sidekick')){
498
  $file_editor_enabled = $sk_config_data->get_file_editor_enabled();
499
  $affiliate_id = $this->getAffiliateId();
500
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  $sk_config = array(
502
  "compatibilities" => array(
503
  "comment_count" => $sk_config_data->get_comments(),
@@ -525,18 +539,18 @@ if (!$sidekick_active && !class_exists('Sidekick')){
525
  "affiliate_id" => $affiliate_id,
526
  "user_email" => ($current_user) ? $current_user->user_email : '',
527
  "autostart_walkthrough_id" => ($autostart_walkthrough_id) ? $autostart_walkthrough_id : '',
528
- "disable_wts" => (!is_network_admin()) ? $sk_config_data->get_disabled_wts() : array(), // Copying these to compatibilities, have to update this over time
529
  "disable_network_wts" => $sk_config_data->get_disabled_network_wts(), // Copying these to compatibilities, have to update this over time
530
 
531
  // Toggles
532
- "hide_taskbar_composer_button" => (get_option( 'sk_hide_composer_taskbar_button' ) ? true : false), // hide composer button on the taskbar
533
- "hide_taskbar_config_button" => (get_option( 'sk_hide_config_taskbar_button' ) ? true : false), // hide settings button on taskbar
534
  "show_login" => (get_option( 'sk_just_activated' )) ? true : false, // open drawer automatically, same as just_activated
535
 
536
  // WordPress
537
  "embedded" => false,
538
  "embedPartner" => SK_EMBEDDED_PARTNER, // for tracking purposes if sidekick has been embeded in another WordPress plugin or theme
539
- "plugin_version" => '2.5.3', // WordPress plugin version
540
  "site_url" => $sk_config_data->get_domain(),
541
  "domain" => str_replace("http://","",$_SERVER["SERVER_NAME"]),
542
  "plugin_url" => admin_url("admin.php?page=sidekick"),
@@ -642,7 +656,7 @@ if (!$sidekick_active && !class_exists('Sidekick')){
642
  function check_ver(){
643
 
644
  if (isset($_GET['sk_ver_check'])){
645
- $data = json_encode('2.5.3');
646
 
647
  if(array_key_exists('callback', $_GET)){
648
 
@@ -707,31 +721,26 @@ if (!$sidekick_active && !class_exists('Sidekick')){
707
  $sidekick = new Sidekick;
708
  register_activation_hook( __FILE__, array($sidekick,'activate_plugin') );
709
 
710
- add_action('admin_init', array($sidekick,'set_disabled_wts'));
711
- add_action('admin_init', array($sidekick,'set_autostart_wt'));
712
- add_action('admin_init', array($sidekick,'set_configure_other'));
713
- add_action('admin_init', array($sidekick,'check_ver'));
714
- add_action('admin_init', array($sidekick,'redirect'));
715
- add_action('admin_init', array($sidekick,'admin_notice_ignore'));
716
- add_action('admin_menu', array($sidekick,'setup_menu'));
717
- add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
718
- add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
719
- add_action('admin_notices', array($sidekick,'admin_notice'));
720
-
721
- if (!(isset($_GET['tab']) && $_GET['tab'] == 'plugin-information')) {
722
- add_action('admin_footer', array($sidekick,'footer'));
723
- add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
724
- add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
725
- add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue_required'),1000);
726
- }
727
 
728
  // Reset Transient Cache
729
 
730
  add_action('wp_update_comment_count',array($sidekick,'delete_sk_get_comments'));
731
-
732
  add_action('set_user_role',array($sidekick,'delete_sk_get_user_data'));
733
  add_action('edit_user_profile',array($sidekick,'delete_sk_get_user_data'));
734
-
735
  add_action('activated_plugin',array($sidekick,'delete_sk_get_plugins'));
736
  add_action('deactivated_plugin',array($sidekick,'delete_sk_get_plugins'));
737
 
@@ -828,6 +837,17 @@ if (!$sidekick_active && !class_exists('sidekickMassActivator')) {
828
 
829
  }
830
 
 
 
 
 
 
 
 
 
 
 
 
831
  function setup_super_admin_key($domainKey) {
832
  // Use the super admin's site activation key if not set using last activation key
833
  if (!get_option('sk_activation_id')) {
@@ -1416,7 +1436,7 @@ if (!$sidekick_active && !class_exists('sidekickMassActivator')) {
1416
  <div class="wrapper_left">
1417
  <div class="sk_box configure">
1418
  <div class="well">
1419
- <h3>Configure - Auto Start</h3>
1420
 
1421
  <form method='post'>
1422
 
@@ -1425,7 +1445,7 @@ if (!$sidekick_active && !class_exists('sidekickMassActivator')) {
1425
  <option value='0'>No Auto Start</option>
1426
  </select>
1427
  <input class='button button-primary' type='submit' value='Save'/>
1428
- <input type='hidden' name='is_ms_admin' value=' echo (isset($is_ms_admin)) ? $is_ms_admin : false ?>'/>
1429
  <input type='hidden' name='sk_setting_autostart' value='true'/>
1430
 
1431
  <?php wp_nonce_field( 'update_sk_settings' ); ?>
@@ -1435,7 +1455,7 @@ if (!$sidekick_active && !class_exists('sidekickMassActivator')) {
1435
 
1436
  <div class="sk_box configure">
1437
  <div class="well">
1438
- <h3>Configure - Other</h3>
1439
 
1440
  <form method="post">
1441
  <?php settings_fields('sk_license'); ?>
@@ -1483,7 +1503,7 @@ if (!$sidekick_active && !class_exists('sidekickMassActivator')) {
1483
  <form method='post'>
1484
 
1485
  <input class='top-right button button-primary alignright' type='submit' value='Save'/>
1486
- <h3>Configure - Turn Off Walkthroughs</h3>
1487
 
1488
  <p>Below you can turn off specific Walkthroughs for this website.</p>
1489
  <p>Please note, incompatible multisite walkthroughs will be disabled automatically on individual sites already. Here you're being show the raw unfiltered list of all available walkthroughs.</p>
@@ -1806,13 +1826,16 @@ if (!$sidekick_active && !class_exists('sk_config_data')) {
1806
  return 'administrator';
1807
  }
1808
  }
1809
- foreach($wp_roles->role_names as $role => $Role) {
1810
- if (array_key_exists($role, $current_user->caps)){
1811
- $user_role = $role;
1812
- break;
 
 
1813
  }
 
1814
  }
1815
- return $user_role;
1816
  }
1817
 
1818
  }
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.5.4
12
  Author: Sidekick.pro
13
  Author URI: http://www.sidekick.pro
14
  */
30
  function __construct(){
31
  if (!defined('SK_API')) define('SK_API','//apiv2.sidekick.pro/');
32
  if (!defined('SK_TRACKING_API')) define('SK_TRACKING_API','//tracking.sidekick.pro/');
33
+ if (!defined('SK_CACHE_PREFIX')) define('SK_CACHE_PREFIX',str_replace('.', '_', '2.5.4'));
34
  }
35
 
36
  function enqueue_required(){
289
 
290
  <div class="sk_box configure">
291
  <div class="well">
292
+ <h3> echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Auto Start</h3>
293
 
294
  <form method='post'>
295
 
298
  <option value='0'>No Auto Start</option>
299
  </select>
300
  <input class='button button-primary' type='submit' value='Save'/>
301
+ <input type='hidden' name='is_ms_admin' value='<?php echo (isset($is_ms_admin)) ? $is_ms_admin : false ?>'/>
302
  <input type='hidden' name='sk_setting_autostart' value='true'/>
303
 
304
  <?php wp_nonce_field( 'update_sk_settings' ); ?>
308
 
309
  <div class="sk_box configure">
310
  <div class="well">
311
+ <h3><?php echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Other</h3>
312
 
313
  <form method="post">
314
  <?php settings_fields('sk_license'); ?>
356
  <form method='post'>
357
 
358
  <input class='top-right button button-primary alignright' type='submit' value='Save'/>
359
+ <h3><?php echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Turn Off Walkthroughs</h3>
360
 
361
  <p>Below you can turn off specific Walkthroughs for this website.</p>
362
  <p>Please note, incompatible multisite walkthroughs will be disabled automatically on individual sites already. Here you're being show the raw unfiltered list of all available walkthroughs.</p>
378
  <li>Please help spread the word!</li>
379
  <li><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://sidekick.pro" data-text="I use @sidekickhelps for the fastest and easiest way to learn WordPress." data-via="sidekickhelps" data-size="large">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li>
380
  <li>Like SIDEKICK? Please leave us a 5 star rating on <a href='http://WordPress.org' target='_blank'>WordPress.org</a></li>
381
+ <li><a href="http://www.sidekick.pro/plans/wordpress-basics/<?php echo ($affiliate_id) ? '&ref=' . $affiliate_id : '' ?>">Sign up for a full WordPress Basics package</a></li>
382
  <li><a href="http://support.sidekick.pro/collection/50-quick-start-guides" target="_blank"><strong>Visit the SIDEKICK Quick Start guides</strong></a>.</li>
383
  </ul>
384
  </div>
407
 
408
  if (isset($_POST['disable_wts']) && $_POST['disable_wts']) {
409
  update_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
410
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
411
  update_site_option('sk_disabled_wts',json_encode($_POST['disable_wts']));
412
  }
413
  } else {
414
  delete_option('sk_disabled_wts');
415
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
416
  delete_site_option('sk_disabled_wts');
417
  }
418
  }
430
  }
431
 
432
  if (isset($_POST['sk_autostart_walkthrough_id']) && intval($_POST['sk_autostart_walkthrough_id']) > 0){
433
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
434
  update_site_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
435
  }
436
  update_option('sk_autostart_walkthrough_id',wp_filter_kses($_POST['sk_autostart_walkthrough_id']));
437
  } else {
438
  delete_option('sk_autostart_walkthrough_id');
439
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
440
  delete_site_option('sk_autostart_walkthrough_id');
441
  }
442
  }
457
 
458
  foreach ($checkboxes as $key => $checkbox) {
459
  if (isset($_POST[$checkbox])){
460
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
461
  update_site_option($checkbox,wp_filter_kses($_POST[$checkbox]));
462
  }
463
  update_option($checkbox,wp_filter_kses($_POST[$checkbox]));
464
  } else {
465
  delete_option($checkbox);
466
+ if (isset($_POST['is_ms_admin']) && $_POST['is_ms_admin']) {
467
  delete_site_option($checkbox);
468
  }
469
  }
498
  $file_editor_enabled = $sk_config_data->get_file_editor_enabled();
499
  $affiliate_id = $this->getAffiliateId();
500
 
501
+ $sk_hide_composer_taskbar_button = false;
502
+
503
+ if (get_option( 'sk_hide_composer_taskbar_button' ) || get_site_option( 'sk_hide_composer_taskbar_button' )) {
504
+ $sk_hide_composer_taskbar_button = true;
505
+ }
506
+
507
+ $sk_hide_config_taskbar_button = false;
508
+
509
+ if (get_option( 'sk_hide_config_taskbar_button' ) || get_site_option( 'sk_hide_config_taskbar_button' )) {
510
+ $sk_hide_config_taskbar_button = true;
511
+ }
512
+
513
+
514
+
515
  $sk_config = array(
516
  "compatibilities" => array(
517
  "comment_count" => $sk_config_data->get_comments(),
539
  "affiliate_id" => $affiliate_id,
540
  "user_email" => ($current_user) ? $current_user->user_email : '',
541
  "autostart_walkthrough_id" => ($autostart_walkthrough_id) ? $autostart_walkthrough_id : '',
542
+ "disable_wts" => ((!isset($_POST['is_ms_admin']) || !$_POST['is_ms_admin'])) ? $sk_config_data->get_disabled_wts() : array(), // Copying these to compatibilities, have to update this over time
543
  "disable_network_wts" => $sk_config_data->get_disabled_network_wts(), // Copying these to compatibilities, have to update this over time
544
 
545
  // Toggles
546
+ "hide_taskbar_composer_button" => $sk_hide_composer_taskbar_button, // hide composer button on the taskbar
547
+ "hide_taskbar_config_button" => $sk_hide_config_taskbar_button, // hide settings button on taskbar
548
  "show_login" => (get_option( 'sk_just_activated' )) ? true : false, // open drawer automatically, same as just_activated
549
 
550
  // WordPress
551
  "embedded" => false,
552
  "embedPartner" => SK_EMBEDDED_PARTNER, // for tracking purposes if sidekick has been embeded in another WordPress plugin or theme
553
+ "plugin_version" => '2.5.4', // WordPress plugin version
554
  "site_url" => $sk_config_data->get_domain(),
555
  "domain" => str_replace("http://","",$_SERVER["SERVER_NAME"]),
556
  "plugin_url" => admin_url("admin.php?page=sidekick"),
656
  function check_ver(){
657
 
658
  if (isset($_GET['sk_ver_check'])){
659
+ $data = json_encode('2.5.4');
660
 
661
  if(array_key_exists('callback', $_GET)){
662
 
721
  $sidekick = new Sidekick;
722
  register_activation_hook( __FILE__, array($sidekick,'activate_plugin') );
723
 
724
+ add_action('admin_init', array($sidekick,'set_disabled_wts'));
725
+ add_action('admin_init', array($sidekick,'set_autostart_wt'));
726
+ add_action('admin_init', array($sidekick,'set_configure_other'));
727
+ add_action('admin_init', array($sidekick,'check_ver'));
728
+ add_action('admin_init', array($sidekick,'redirect'));
729
+ add_action('admin_init', array($sidekick,'admin_notice_ignore'));
730
+ add_action('admin_menu', array($sidekick,'setup_menu'));
731
+ add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
732
+ add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
733
+ add_action('admin_notices', array($sidekick,'admin_notice'));
734
+ add_action('admin_footer', array($sidekick,'footer'));
735
+ add_action('customize_controls_print_footer_scripts', array($sidekick,'footer'));
736
+ add_action('admin_enqueue_scripts', array($sidekick,'enqueue_required'));
737
+ add_action('customize_controls_enqueue_scripts', array($sidekick,'enqueue_required'),1000);
 
 
 
738
 
739
  // Reset Transient Cache
740
 
741
  add_action('wp_update_comment_count',array($sidekick,'delete_sk_get_comments'));
 
742
  add_action('set_user_role',array($sidekick,'delete_sk_get_user_data'));
743
  add_action('edit_user_profile',array($sidekick,'delete_sk_get_user_data'));
 
744
  add_action('activated_plugin',array($sidekick,'delete_sk_get_plugins'));
745
  add_action('deactivated_plugin',array($sidekick,'delete_sk_get_plugins'));
746
 
837
 
838
  }
839
 
840
+ function getAffiliateId(){
841
+ if (defined('SK_AFFILIATE_ID')) {
842
+ $affiliate_id = intval(SK_AFFILIATE_ID);
843
+ } else if (get_option( "sk_affiliate_id")){
844
+ $affiliate_id = intval(get_option( "sk_affiliate_id"));
845
+ } else {
846
+ $affiliate_id = '';
847
+ }
848
+ return $affiliate_id;
849
+ }
850
+
851
  function setup_super_admin_key($domainKey) {
852
  // Use the super admin's site activation key if not set using last activation key
853
  if (!get_option('sk_activation_id')) {
1436
  <div class="wrapper_left">
1437
  <div class="sk_box configure">
1438
  <div class="well">
1439
+ <h3> echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Auto Start</h3>
1440
 
1441
  <form method='post'>
1442
 
1445
  <option value='0'>No Auto Start</option>
1446
  </select>
1447
  <input class='button button-primary' type='submit' value='Save'/>
1448
+ <input type='hidden' name='is_ms_admin' value='<?php echo (isset($is_ms_admin)) ? $is_ms_admin : false ?>'/>
1449
  <input type='hidden' name='sk_setting_autostart' value='true'/>
1450
 
1451
  <?php wp_nonce_field( 'update_sk_settings' ); ?>
1455
 
1456
  <div class="sk_box configure">
1457
  <div class="well">
1458
+ <h3><?php echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Other</h3>
1459
 
1460
  <form method="post">
1461
  <?php settings_fields('sk_license'); ?>
1503
  <form method='post'>
1504
 
1505
  <input class='top-right button button-primary alignright' type='submit' value='Save'/>
1506
+ <h3><?php echo (isset($is_ms_admin)) ? 'Network ' : '' ?>Configure - Turn Off Walkthroughs</h3>
1507
 
1508
  <p>Below you can turn off specific Walkthroughs for this website.</p>
1509
  <p>Please note, incompatible multisite walkthroughs will be disabled automatically on individual sites already. Here you're being show the raw unfiltered list of all available walkthroughs.</p>
1826
  return 'administrator';
1827
  }
1828
  }
1829
+ if (isset($wp_roles) && $wp_roles) {
1830
+ foreach($wp_roles->role_names as $role => $Role) {
1831
+ if (array_key_exists($role, $current_user->caps)){
1832
+ $user_role = $role;
1833
+ break;
1834
+ }
1835
  }
1836
+ return $user_role;
1837
  }
1838
+ return 'n/a';
1839
  }
1840
 
1841
  }