Sidekick - Version 1.5.3

Version Description

  • Super Admin detection added
Download this release

Release Info

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

Code changes from version 1.5.0 to 1.5.3

Files changed (3) hide show
  1. libs/sk_config_data.php +5 -0
  2. readme.txt +4 -1
  3. sidekick.php +32 -25
libs/sk_config_data.php CHANGED
@@ -143,6 +143,11 @@ class sk_config_data{
143
 
144
  function get_user_role(){
145
  global $current_user, $wp_roles;
 
 
 
 
 
146
  if(!isset($current_user->caps) || count($current_user->caps) < 1){
147
  // In MS in some specific pages current user is returning empty caps so this is a work around for that case.
148
  if (current_user_can('activate_plugins')){
143
 
144
  function get_user_role(){
145
  global $current_user, $wp_roles;
146
+
147
+ if (is_super_admin($current_user->ID)) {
148
+ return 'administrator';
149
+ }
150
+
151
  if(!isset($current_user->caps) || count($current_user->caps) < 1){
152
  // In MS in some specific pages current user is returning empty caps so this is a work around for that case.
153
  if (current_user_can('activate_plugins')){
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: 3.9
7
- Stable tag: 1.5.2
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -130,6 +130,9 @@ Absolutely. In fact, we rely on users like you to tell us about things that nee
130
 
131
  == Changelog ==
132
 
 
 
 
133
  = 1.5.2 =
134
  * Fixed Multisite issue with role detection on certain pages
135
 
4
  Tags: help, tutorial, training, learn, learning, sidekick, guide, teach, video, manual, videos, wphelp, support, instructions, question, questions, answers, answer, clippy, q&a, wpuniversity, helper, walkthrough
5
  Requires at least: 3.7
6
  Tested up to: 3.9
7
+ Stable tag: 1.5.3
8
  License: GNU Version 2 or Any Later Version
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
130
 
131
  == Changelog ==
132
 
133
+ = 1.5.3 =
134
+ * Super Admin detection added
135
+
136
  = 1.5.2 =
137
  * Fixed Multisite issue with role detection on certain pages
138
 
sidekick.php CHANGED
@@ -6,14 +6,19 @@ Plugin URL: http://wordpress.org/plugins/sidekick/
6
  Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
7
  Requires at least: 3.7
8
  Tested up to: 3.9.1
9
- Version: 1.5.2
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_LIBRARY_DOMAIN','pullvod.flowpress.netdna-cdn.com/library');
 
 
 
 
 
17
 
18
  if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
19
  if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -31,15 +36,9 @@ class Sidekick{
31
  $protocol = $this->protocol();
32
  $this->check_versions();
33
 
34
- if (strpos($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], '.sidekick')) {
35
- $version = time();
36
- } else {
37
- $version = date('m-d-y-G');
38
- }
39
-
40
- $SK_FREE_LIBRARY_FILE = $protocol . SK_LIBRARY_DOMAIN . "/v" . SK_LIBRARY_VERSION . "/releases/xxxxxxxx-xxxx-xxxx-xxxx-xxxxfree/library.js?{$version}";
41
  if ($activation_id) {
42
- $SK_PAID_LIBRARY_FILE = $protocol . SK_LIBRARY_DOMAIN . "/v" . SK_LIBRARY_VERSION . "/releases/{$activation_id}/library.js?{$version}";
43
  }
44
  }
45
 
@@ -56,9 +55,13 @@ class Sidekick{
56
  }
57
 
58
  function protocol() {
59
- if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) {
 
 
60
  return 'https://';
61
  } else {
 
 
62
  return 'http://';
63
  }
64
  }
@@ -68,19 +71,23 @@ class Sidekick{
68
 
69
  $activation_id = get_option("sk_activation_id");
70
 
71
- $protocol = $this->protocol();
 
 
 
 
72
 
73
  if ($activation_id) {
74
- wp_enqueue_script("sk_paid_library" , $SK_PAID_LIBRARY_FILE,null,null);
75
- wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array('sk_paid_library'),null);
76
  } else {
77
- wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array(),null);
78
  }
79
 
80
- wp_enqueue_script('sidekick' ,"{$protocol}platform.sidekick.pro/wordpress/sidekick.min.js", array('sk_free_library','backbone','jquery','underscore','jquery-effects-highlight'), get_transient( 'sk_platform_version' ));
81
- wp_enqueue_script('player' ,"{$protocol}player.sidekick.pro/wordpress/js/sk.min.js", array('sidekick') ,get_transient( 'sk_player_version' ));
82
 
83
- wp_enqueue_style('sk-style' ,"{$protocol}player.sidekick.pro/wordpress/css/sidekick_wordpress.css", null ,get_transient( 'sk_player_version' ));
84
 
85
  wp_enqueue_style('wp-pointer');
86
  wp_enqueue_script('wp-pointer');
@@ -200,7 +207,7 @@ class Sidekick{
200
  $autostart_walkthrough_id = (get_option('sk_autostart_walkthrough_id') ? get_option('sk_autostart_walkthrough_id') : 'null' );
201
  $theme = wp_get_theme();
202
  $not_supported_ie = false;
203
- // $sk_composer_button = true; // BETA
204
 
205
  $user_role = $sk_config_data->get_user_role();
206
  $site_url = $sk_config_data->get_domain();
@@ -270,8 +277,8 @@ class Sidekick{
270
  }
271
 
272
  var skc_config = {
273
- url: '//p.vod-flowpress.flowpress.netdna-cdn.com/vod/vod-flowpress.flowpress/public_html/composer/',
274
- apiUrl: '//library.sidekick.pro/api',
275
  baseSiteUrl: sk_config.base_url
276
  }
277
 
@@ -285,7 +292,7 @@ class Sidekick{
285
  function track($data){
286
  $protocol = $this->protocol();
287
 
288
- $response = wp_remote_post( "{$protocol}library.sidekick.pro/wp-admin/admin-ajax.php", array(
289
  'method' => 'POST',
290
  'timeout' => 45,
291
  'redirection' => 5,
@@ -304,7 +311,7 @@ class Sidekick{
304
 
305
  $protocol = $this->protocol();
306
 
307
- $library_file = $protocol . SK_LIBRARY_DOMAIN . "/v" . SK_LIBRARY_VERSION . "/releases/{$_POST['activation_id']}/library.js";
308
  $ch = curl_init($library_file);
309
  curl_setopt($ch, CURLOPT_NOBODY, true);
310
  curl_exec($ch);
@@ -340,12 +347,12 @@ class Sidekick{
340
  $protocol = $this->protocol();
341
 
342
  if ( false === ( $player_version = get_transient( 'sk_player_version' ) ) ) {
343
- $player_version = file_get_contents("{$protocol}player.sidekick.pro/wordpress/version?v=x");
344
  set_transient( 'sk_player_version', $player_version, 2 * HOUR_IN_SECONDS );
345
  }
346
 
347
  if ( false === ( $platform_version = get_transient( 'sk_platform_version' ) ) ) {
348
- $platform_version = file_get_contents("{$protocol}platform.sidekick.pro/wordpress/version?v=x");
349
  set_transient( 'sk_platform_version', $platform_version, 2 * HOUR_IN_SECONDS );
350
  }
351
  }
6
  Description: Adds a real-time WordPress training walkthroughs right in your Dashboard
7
  Requires at least: 3.7
8
  Tested up to: 3.9.1
9
+ Version: 1.5.3
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
+
17
+ define('SK_DOMAIN','http://pullvod.flowpress.netdna-cdn.com/');
18
+ define('SK_DOMAIN_SSL','https://pullvod-flowpress.netdna-ssl.com/');
19
+
20
+ define('SK_LIBRARY_DOMAIN','http://library.sidekick.pro/');
21
+ define('SK_LIBRARY_DOMAIN_SSL','https://library.sidekick.pro/');
22
 
23
  if ( ! defined( 'SK_SL_PLUGIN_DIR' ) ) define( 'SK_SL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
24
  if ( ! defined( 'SK_SL_PLUGIN_URL' ) ) define( 'SK_SL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
36
  $protocol = $this->protocol();
37
  $this->check_versions();
38
 
39
+ $SK_FREE_LIBRARY_FILE = SK_DOMAIN_USED . "library/v" . SK_LIBRARY_VERSION . "/releases/xxxxxxxx-xxxx-xxxx-xxxx-xxxxfree/library.js";
 
 
 
 
 
 
40
  if ($activation_id) {
41
+ $SK_PAID_LIBRARY_FILE = SK_DOMAIN_USED . "library/v" . SK_LIBRARY_VERSION . "/releases/{$activation_id}/library.js";
42
  }
43
  }
44
 
55
  }
56
 
57
  function protocol() {
58
+ if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443 || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
59
+ define('SK_DOMAIN_USED',SK_DOMAIN_SSL);
60
+ define('SK_LIBRARY_DOMAIN_USED',SK_LIBRARY_DOMAIN_SSL);
61
  return 'https://';
62
  } else {
63
+ define('SK_DOMAIN_USED',SK_DOMAIN);
64
+ define('SK_LIBRARY_DOMAIN_USED',SK_LIBRARY_DOMAIN);
65
  return 'http://';
66
  }
67
  }
71
 
72
  $activation_id = get_option("sk_activation_id");
73
 
74
+ if (strpos($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], '.sidekick')) {
75
+ $version = time();
76
+ } else {
77
+ $version = date('m-d-y-G');
78
+ }
79
 
80
  if ($activation_id) {
81
+ wp_enqueue_script("sk_paid_library" , $SK_PAID_LIBRARY_FILE,null,$version);
82
+ wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array('sk_paid_library'),$version);
83
  } else {
84
+ wp_enqueue_script("sk_free_library" , $SK_FREE_LIBRARY_FILE,array(),$version);
85
  }
86
 
87
+ wp_enqueue_script('sidekick' ,SK_DOMAIN_USED . "cdn/platform/wordpress/sidekick.min.js", array('sk_free_library','backbone','jquery','underscore','jquery-effects-highlight'), get_transient( 'sk_platform_version' ));
88
+ wp_enqueue_script('player' ,SK_DOMAIN_USED . "cdn/player/wordpress/js/sk.min.js", array('sidekick') ,get_transient( 'sk_player_version' ));
89
 
90
+ wp_enqueue_style('sk-style' ,SK_DOMAIN_USED . "cdn/player/wordpress/css/sidekick_wordpress.css", null ,get_transient( 'sk_player_version' ));
91
 
92
  wp_enqueue_style('wp-pointer');
93
  wp_enqueue_script('wp-pointer');
207
  $autostart_walkthrough_id = (get_option('sk_autostart_walkthrough_id') ? get_option('sk_autostart_walkthrough_id') : 'null' );
208
  $theme = wp_get_theme();
209
  $not_supported_ie = false;
210
+ $sk_composer_button = true; // BETA
211
 
212
  $user_role = $sk_config_data->get_user_role();
213
  $site_url = $sk_config_data->get_domain();
277
  }
278
 
279
  var skc_config = {
280
+ url: '<?php echo SK_DOMAIN_USED ?>cdn/composer/',
281
+ apiUrl: '<?php echo SK_LIBRARY_DOMAIN_USED ?>api',
282
  baseSiteUrl: sk_config.base_url
283
  }
284
 
292
  function track($data){
293
  $protocol = $this->protocol();
294
 
295
+ $response = wp_remote_post( SK_LIBRARY_DOMAIN_USED . "wp-admin/admin-ajax.php", array(
296
  'method' => 'POST',
297
  'timeout' => 45,
298
  'redirection' => 5,
311
 
312
  $protocol = $this->protocol();
313
 
314
+ $library_file = SK_DOMAIN_USED . "library/v" . SK_LIBRARY_VERSION . "/releases/{$_POST['activation_id']}/library.js";
315
  $ch = curl_init($library_file);
316
  curl_setopt($ch, CURLOPT_NOBODY, true);
317
  curl_exec($ch);
347
  $protocol = $this->protocol();
348
 
349
  if ( false === ( $player_version = get_transient( 'sk_player_version' ) ) ) {
350
+ $player_version = file_get_contents(SK_DOMAIN_USED . "cdn/player/wordpress/version?v=x");
351
  set_transient( 'sk_player_version', $player_version, 2 * HOUR_IN_SECONDS );
352
  }
353
 
354
  if ( false === ( $platform_version = get_transient( 'sk_platform_version' ) ) ) {
355
+ $platform_version = file_get_contents(SK_DOMAIN_USED . "cdn/platform/wordpress/version?v=x");
356
  set_transient( 'sk_platform_version', $platform_version, 2 * HOUR_IN_SECONDS );
357
  }
358
  }