Sidekick - Version 1.5.5

Version Description

  • 4.0 Readiness
Download this release

Release Info

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

Code changes from version 1.5.3 to 1.5.5

css/sidekick_wordpress.css CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  @media screen and (max-width: 782px) {
2
  body div#sidekick,
3
  body div#sidekick.sidekick_player {
@@ -631,6 +635,7 @@ div#sidekick div#sk_taskbar div.sk_toggles button#toggle_hotspots:hover {
631
  /*transition: width 0.3s ease-out, max-height 0.3s ease-out, background-color 0.3s ease-out, transform 0.3s ease-out;*/
632
  }
633
  div#sidekick div#sk_taskbar div.sk_toggles button#toggle_feedback {
 
634
  background: #f1631d url('../images/sprides_v13.png?v=1.3.4') 17px -287px;
635
  /*border-right: solid 1px white;*/
636
  border-left: solid 1px white;
1
+ body div#sidekick div#sk_taskbar div.sk_toggles button#toggle_composer,
2
+ body div#sidekick.composer_button_on div#sk_taskbar div.sk_toggles button#toggle_composer {
3
+ display: none;
4
+ }
5
  @media screen and (max-width: 782px) {
6
  body div#sidekick,
7
  body div#sidekick.sidekick_player {
635
  /*transition: width 0.3s ease-out, max-height 0.3s ease-out, background-color 0.3s ease-out, transform 0.3s ease-out;*/
636
  }
637
  div#sidekick div#sk_taskbar div.sk_toggles button#toggle_feedback {
638
+ display: none;
639
  background: #f1631d url('../images/sprides_v13.png?v=1.3.4') 17px -287px;
640
  /*border-right: solid 1px white;*/
641
  border-left: solid 1px white;
images/icon-128x128.png ADDED
Binary file
libs/admin_page.php CHANGED
@@ -273,6 +273,7 @@
273
  </tbody>
274
  </table>
275
  <?php submit_button('Update'); ?>
 
276
  </form>
277
  <?php endif ?>
278
  </div>
273
  </tbody>
274
  </table>
275
  <?php submit_button('Update'); ?>
276
+ <?php wp_nonce_field( 'update_sk_settings' ); ?>
277
  </form>
278
  <?php endif ?>
279
  </div>
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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: 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,6 +130,14 @@ Absolutely. In fact, we rely on users like you to tell us about things that nee
130
 
131
  == Changelog ==
132
 
 
 
 
 
 
 
 
 
133
  = 1.5.3 =
134
  * Super Admin detection added
135
 
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.5.5
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.5 =
134
+ * 4.0 Readiness
135
+
136
+ = 1.5.4 =
137
+ * Fixed incompatibility with iThemes Builder and For Loop JS Loops
138
+ * Added security nonces
139
+ * Added banner to let users know of Sidekick's existence
140
+
141
  = 1.5.3 =
142
  * Super Admin detection added
143
 
sidekick.php CHANGED
@@ -4,9 +4,9 @@
4
  Plugin Name: Sidekick
5
  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.3
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
@@ -108,38 +108,41 @@ class Sidekick{
108
  function admin_page(){
109
  global $SK_PAID_LIBRARY_FILE, $SK_FREE_LIBRARY_FILE ;
110
 
111
- if (isset($_POST['option_page']) && $_POST['option_page'] == 'sk_license') {
112
 
113
- if (isset($_POST['first_name']) && $_POST['first_name'])
114
- update_option('sk_first_name',$_POST['first_name']);
115
 
116
- if (isset($_POST['email']) && $_POST['email'])
117
- update_option('sk_email',$_POST['email']);
118
 
119
- if (isset($_POST['activation_id']) && $_POST['activation_id']){
120
- $result = $this->activate(true);
121
- } else {
122
- delete_option('sk_activation_id');
123
- }
124
 
125
- if (isset($_POST['sk_composer_button'])) {
126
- update_option( 'sk_composer_button', true );
127
- } else {
128
- delete_option('sk_composer_button');
129
- }
130
 
131
- if (isset($_POST['sk_track_data'])) {
132
- update_option( 'sk_track_data', true );
133
- } else {
134
- delete_option('sk_track_data');
135
- }
136
 
137
- update_option( 'sk_activated', true );
138
- die('<script>window.open("' . get_site_url() . '/wp-admin/options-general.php?page=sidekick","_self")</script>');
139
- }
 
 
 
 
 
 
140
 
141
- if (isset($_POST['sk_autostart_walkthrough_id']) && $_POST['sk_autostart_walkthrough_id']){
142
- update_option('sk_autostart_walkthrough_id',$_POST['sk_autostart_walkthrough_id']);
 
143
  }
144
 
145
  $activation_id = get_option( 'sk_activation_id' );
@@ -198,6 +201,7 @@ class Sidekick{
198
 
199
  require_once('libs/sk_config_data.php');
200
 
 
201
  $sk_config_data = new sk_config_data;
202
  $current_user = wp_get_current_user();
203
  $sk_just_activated = get_option( 'sk_just_activated' );
@@ -207,7 +211,10 @@ class Sidekick{
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();
@@ -222,11 +229,9 @@ class Sidekick{
222
  $post_types_and_statuses = $sk_config_data->get_post_types_and_statuses();
223
  $number_of_themes = $sk_config_data->get_themes();
224
 
225
-
226
- $plugin_data = get_plugin_data(plugin_dir_path( dirname( __FILE__ ) ) . 'sidekick/sidekick.php');
227
 
228
  delete_option( 'sk_just_activated' );
229
-
230
  if(preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT'])) $not_supported_ie = true;
231
 
232
  ?>
@@ -240,6 +245,7 @@ class Sidekick{
240
  show_powered_by_link: true,
241
  use_native_controls: false,
242
  main_soft_name: 'WordPress',
 
243
  domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
244
  base_url: '<?php echo site_url() ?>',
245
  site_url: '<?php echo $site_url ?>',
@@ -256,7 +262,7 @@ class Sidekick{
256
  platform_version: '<?php echo get_transient("sk_platform_version") ?>',
257
  track_data: '<?php echo $sk_track_data ?>',
258
  user_level: '<?php echo $user_role ?>',
259
- user_email: '<?php echo $current_user->user_email ?>',
260
  activation_id: '<?php echo $activation_id ?>',
261
  autostart_walkthrough_id: <?php echo $autostart_walkthrough_id ?>,
262
  sk_composer_button: <?php echo ($sk_composer_button ? "true" : "false") ?>,
@@ -345,18 +351,42 @@ class Sidekick{
345
 
346
  function check_versions(){
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
  }
359
 
 
 
 
 
 
 
 
 
 
 
 
360
  function redirect(){
361
  if (get_option('sk_do_activation_redirect', false)) {
362
  delete_option('sk_do_activation_redirect');
@@ -366,6 +396,21 @@ class Sidekick{
366
  }
367
  }
368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  function deactivate_plugin(){
370
  $sk_track_data = get_option( 'sk_track_data' );
371
  if ($sk_track_data) {
@@ -405,6 +450,8 @@ add_action('admin_menu', array($sidekick,'setup_menu'));
405
  add_action('admin_init', array($sidekick,'redirect'));
406
  add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
407
  add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
 
 
408
 
409
  if (isset($_POST['disable_wts'])) {
410
  $sidekick->set_disabled_wts();
4
  Plugin Name: Sidekick
5
  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.5.5
10
  Author: Sidekick.pro
11
  Author URI: http://www.sidekick.pro
12
  */
108
  function admin_page(){
109
  global $SK_PAID_LIBRARY_FILE, $SK_FREE_LIBRARY_FILE ;
110
 
111
+ if ( empty( $_POST ) || check_admin_referer( 'update_sk_settings' ) ) {
112
 
113
+ if (isset($_POST['option_page']) && $_POST['option_page'] == 'sk_license') {
 
114
 
115
+ if (isset($_POST['first_name']) && $_POST['first_name'])
116
+ update_option('sk_first_name',$_POST['first_name']);
117
 
118
+ if (isset($_POST['email']) && $_POST['email'])
119
+ update_option('sk_email',$_POST['email']);
 
 
 
120
 
121
+ if (isset($_POST['activation_id']) && $_POST['activation_id']){
122
+ $result = $this->activate(true);
123
+ } else {
124
+ delete_option('sk_activation_id');
125
+ }
126
 
127
+ if (isset($_POST['sk_composer_button'])) {
128
+ update_option( 'sk_composer_button', true );
129
+ } else {
130
+ delete_option('sk_composer_button');
131
+ }
132
 
133
+ if (isset($_POST['sk_track_data'])) {
134
+ update_option( 'sk_track_data', true );
135
+ } else {
136
+ delete_option('sk_track_data');
137
+ }
138
+
139
+ update_option( 'sk_activated', true );
140
+ die('<script>window.open("' . get_site_url() . '/wp-admin/options-general.php?page=sidekick","_self")</script>');
141
+ }
142
 
143
+ if (isset($_POST['sk_autostart_walkthrough_id']) && $_POST['sk_autostart_walkthrough_id']){
144
+ update_option('sk_autostart_walkthrough_id',$_POST['sk_autostart_walkthrough_id']);
145
+ }
146
  }
147
 
148
  $activation_id = get_option( 'sk_activation_id' );
201
 
202
  require_once('libs/sk_config_data.php');
203
 
204
+ $plugin_data = get_plugin_data(plugin_dir_path( dirname( __FILE__ ) ) . 'sidekick/sidekick.php');
205
  $sk_config_data = new sk_config_data;
206
  $current_user = wp_get_current_user();
207
  $sk_just_activated = get_option( 'sk_just_activated' );
211
  $autostart_walkthrough_id = (get_option('sk_autostart_walkthrough_id') ? get_option('sk_autostart_walkthrough_id') : 'null' );
212
  $theme = wp_get_theme();
213
  $not_supported_ie = false;
214
+ $user_email = '';
215
+ if ($sk_track_data) {
216
+ $user_email = $current_user->user_email;
217
+ }
218
 
219
  $user_role = $sk_config_data->get_user_role();
220
  $site_url = $sk_config_data->get_domain();
229
  $post_types_and_statuses = $sk_config_data->get_post_types_and_statuses();
230
  $number_of_themes = $sk_config_data->get_themes();
231
 
232
+ // $sk_composer_button = true; // BETA
 
233
 
234
  delete_option( 'sk_just_activated' );
 
235
  if(preg_match('/(?i)msie [6-8]/',$_SERVER['HTTP_USER_AGENT'])) $not_supported_ie = true;
236
 
237
  ?>
245
  show_powered_by_link: true,
246
  use_native_controls: false,
247
  main_soft_name: 'WordPress',
248
+ domain_used: '<?php echo SK_DOMAIN_USED ?>',
249
  domain: '<?php echo str_replace("http://","",$_SERVER["SERVER_NAME"]) ?>',
250
  base_url: '<?php echo site_url() ?>',
251
  site_url: '<?php echo $site_url ?>',
262
  platform_version: '<?php echo get_transient("sk_platform_version") ?>',
263
  track_data: '<?php echo $sk_track_data ?>',
264
  user_level: '<?php echo $user_role ?>',
265
+ user_email: '<?php echo $user_email ?>',
266
  activation_id: '<?php echo $activation_id ?>',
267
  autostart_walkthrough_id: <?php echo $autostart_walkthrough_id ?>,
268
  sk_composer_button: <?php echo ($sk_composer_button ? "true" : "false") ?>,
351
 
352
  function check_versions(){
353
  $protocol = $this->protocol();
354
+ $url = SK_DOMAIN_USED . "cdn/player/wordpress/version";
355
 
356
  if ( false === ( $player_version = get_transient( 'sk_player_version' ) ) ) {
357
+ if (ini_get('allow_url_fopen')) {
358
+ $player_version = file_get_contents($url);
359
+ set_transient( 'sk_player_version', $player_version, 2 * HOUR_IN_SECONDS );
360
+ } elseif (function_exists('curl_version')){
361
+ $player_version = $this->curl_get_data($url);
362
+ set_transient( 'sk_player_version', $player_version, 2 * HOUR_IN_SECONDS );
363
+ }
364
  }
365
 
366
+ $url = SK_DOMAIN_USED . "cdn/platform/wordpress/version";
367
+
368
  if ( false === ( $platform_version = get_transient( 'sk_platform_version' ) ) ) {
369
+ if (ini_get('allow_url_fopen')) {
370
+ $platform_version = file_get_contents($url);
371
+ set_transient( 'sk_platform_version', $platform_version, 2 * HOUR_IN_SECONDS );
372
+ } elseif (function_exists('curl_version')){
373
+ $platform_version = $this->curl_get_data($url);
374
+ set_transient( 'sk_platform_version', $platform_version, 2 * HOUR_IN_SECONDS );
375
+ }
376
  }
377
  }
378
 
379
+ function curl_get_data($url){
380
+ $ch = curl_init();
381
+ $timeout = 5;
382
+ curl_setopt($ch, CURLOPT_URL, $url);
383
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
384
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
385
+ $data = curl_exec($ch);
386
+ curl_close($ch);
387
+ return $data;
388
+ }
389
+
390
  function redirect(){
391
  if (get_option('sk_do_activation_redirect', false)) {
392
  delete_option('sk_do_activation_redirect');
396
  }
397
  }
398
 
399
+ function admin_notice() {
400
+ global $current_user ;
401
+
402
+ if ( ! get_user_meta($current_user->ID, 'sk_ignore_notice') ) {
403
+ printf ('<div class="updated"><p>Need help with WordPress? Click HELP ME in the bottom left corner to get started! <a href="%1$s">Hide</a></p></div>','?sk_ignore_notice=1');
404
+ }
405
+ }
406
+
407
+ function admin_notice_ignore() {
408
+ global $current_user;
409
+ if ( isset($_GET['sk_ignore_notice'])) {
410
+ add_user_meta($current_user->ID, 'sk_ignore_notice', true);
411
+ }
412
+ }
413
+
414
  function deactivate_plugin(){
415
  $sk_track_data = get_option( 'sk_track_data' );
416
  if ($sk_track_data) {
450
  add_action('admin_init', array($sidekick,'redirect'));
451
  add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
452
  add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
453
+ add_action('admin_notices', array($sidekick,'admin_notice'));
454
+ add_action('admin_init', array($sidekick,'admin_notice_ignore'));
455
 
456
  if (isset($_POST['disable_wts'])) {
457
  $sidekick->set_disabled_wts();