Sidekick - Version 1.5.4

Version Description

  • Fixed incompatibility with iThemes Builder and For Loop JS Loops
  • Added security nonces
  • Added banner to let users know of Sidekick's existence
Download this release

Release Info

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

Code changes from version 1.5.3 to 1.5.4

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
@@ -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.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,11 @@ 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
 
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.4
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.4 =
134
+ * Fixed incompatibility with iThemes Builder and For Loop JS Loops
135
+ * Added security nonces
136
+ * Added banner to let users know of Sidekick's existence
137
+
138
  = 1.5.3 =
139
  * Super Admin detection added
140
 
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: 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
  ?>
@@ -256,7 +261,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 +350,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 +395,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 +449,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();
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.4
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
  ?>
261
  platform_version: '<?php echo get_transient("sk_platform_version") ?>',
262
  track_data: '<?php echo $sk_track_data ?>',
263
  user_level: '<?php echo $user_role ?>',
264
+ user_email: '<?php echo $user_email ?>',
265
  activation_id: '<?php echo $activation_id ?>',
266
  autostart_walkthrough_id: <?php echo $autostart_walkthrough_id ?>,
267
  sk_composer_button: <?php echo ($sk_composer_button ? "true" : "false") ?>,
350
 
351
  function check_versions(){
352
  $protocol = $this->protocol();
353
+ $url = SK_DOMAIN_USED . "cdn/player/wordpress/version";
354
 
355
  if ( false === ( $player_version = get_transient( 'sk_player_version' ) ) ) {
356
+ if (ini_get('allow_url_fopen')) {
357
+ $player_version = file_get_contents($url);
358
+ set_transient( 'sk_player_version', $player_version, 2 * HOUR_IN_SECONDS );
359
+ } elseif (function_exists('curl_version')){
360
+ $player_version = $this->curl_get_data($url);
361
+ set_transient( 'sk_player_version', $player_version, 2 * HOUR_IN_SECONDS );
362
+ }
363
  }
364
 
365
+ $url = SK_DOMAIN_USED . "cdn/platform/wordpress/version";
366
+
367
  if ( false === ( $platform_version = get_transient( 'sk_platform_version' ) ) ) {
368
+ if (ini_get('allow_url_fopen')) {
369
+ $platform_version = file_get_contents($url);
370
+ set_transient( 'sk_platform_version', $platform_version, 2 * HOUR_IN_SECONDS );
371
+ } elseif (function_exists('curl_version')){
372
+ $platform_version = $this->curl_get_data($url);
373
+ set_transient( 'sk_platform_version', $platform_version, 2 * HOUR_IN_SECONDS );
374
+ }
375
  }
376
  }
377
 
378
+ function curl_get_data($url){
379
+ $ch = curl_init();
380
+ $timeout = 5;
381
+ curl_setopt($ch, CURLOPT_URL, $url);
382
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
383
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
384
+ $data = curl_exec($ch);
385
+ curl_close($ch);
386
+ return $data;
387
+ }
388
+
389
  function redirect(){
390
  if (get_option('sk_do_activation_redirect', false)) {
391
  delete_option('sk_do_activation_redirect');
395
  }
396
  }
397
 
398
+ function admin_notice() {
399
+ global $current_user ;
400
+
401
+ if ( ! get_user_meta($current_user->ID, 'sk_ignore_notice') ) {
402
+ 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');
403
+ }
404
+ }
405
+
406
+ function admin_notice_ignore() {
407
+ global $current_user;
408
+ if ( isset($_GET['sk_ignore_notice'])) {
409
+ add_user_meta($current_user->ID, 'sk_ignore_notice', true);
410
+ }
411
+ }
412
+
413
  function deactivate_plugin(){
414
  $sk_track_data = get_option( 'sk_track_data' );
415
  if ($sk_track_data) {
449
  add_action('admin_init', array($sidekick,'redirect'));
450
  add_action('wp_ajax_sk_activate', array($sidekick,'activate'));
451
  add_action('wp_ajax_sk_save', array($sidekick,'ajax_save'));
452
+ add_action('admin_notices', array($sidekick,'admin_notice'));
453
+ add_action('admin_init', array($sidekick,'admin_notice_ignore'));
454
 
455
  if (isset($_POST['disable_wts'])) {
456
  $sidekick->set_disabled_wts();