User Switching - Version 1.3.1

Version Description

Download this release

Release Info

Developer johnbillion
Plugin Icon 128x128 User Switching
Version 1.3.1
Comparing to
See all releases

Code changes from version 1.3.0 to 1.3.1

Files changed (3) hide show
  1. composer.json +6 -3
  2. readme.txt +7 -1
  3. user-switching.php +23 -13
composer.json CHANGED
@@ -3,7 +3,7 @@
3
  "description": "WordPress plugin that provides instant switching between user accounts.",
4
  "homepage" : "https://github.com/johnbillion/user-switching",
5
  "type" : "wordpress-plugin",
6
- "license" : "GPL-2.0+",
7
  "authors" : [
8
  {
9
  "name" : "John Blackbourn",
@@ -15,6 +15,9 @@
15
  "forum": "https://wordpress.org/support/plugin/user-switching",
16
  "source": "https://github.com/johnbillion/user-switching"
17
  },
 
 
 
18
  "require": {
19
  "composer/installers": "^1"
20
  },
@@ -22,13 +25,13 @@
22
  "behat/behat": "^3",
23
  "behat/mink-extension": "^2",
24
  "behat/mink-goutte-driver": "^1.1",
 
25
  "johnbillion/wordpress-behat-extension": "^0.1.5",
26
  "johnpbloch/wordpress": ">=4.8.0@stable",
27
- "johnbillion/php-docs-standards": "^1.2",
28
  "phpunit/phpunit": "^5",
29
  "wimg/php-compatibility": "^8",
30
  "wp-coding-standards/wpcs": "^0.13"
31
- },
32
  "extra": {
33
  "wordpress-install-dir": "vendor/wordpress"
34
  }
3
  "description": "WordPress plugin that provides instant switching between user accounts.",
4
  "homepage" : "https://github.com/johnbillion/user-switching",
5
  "type" : "wordpress-plugin",
6
+ "license" : "GPL-2.0-or-later",
7
  "authors" : [
8
  {
9
  "name" : "John Blackbourn",
15
  "forum": "https://wordpress.org/support/plugin/user-switching",
16
  "source": "https://github.com/johnbillion/user-switching"
17
  },
18
+ "config": {
19
+ "sort-packages": true
20
+ },
21
  "require": {
22
  "composer/installers": "^1"
23
  },
25
  "behat/behat": "^3",
26
  "behat/mink-extension": "^2",
27
  "behat/mink-goutte-driver": "^1.1",
28
+ "johnbillion/php-docs-standards": "^1.2",
29
  "johnbillion/wordpress-behat-extension": "^0.1.5",
30
  "johnpbloch/wordpress": ">=4.8.0@stable",
 
31
  "phpunit/phpunit": "^5",
32
  "wimg/php-compatibility": "^8",
33
  "wp-coding-standards/wpcs": "^0.13"
34
+ },
35
  "extra": {
36
  "wordpress-install-dir": "vendor/wordpress"
37
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: johnbillion
4
  Tags: users, profiles, user switching, fast user switching, multisite, buddypress, bbpress, become, user management, developer
5
  Requires at least: 3.7
6
  Tested up to: 4.9
7
- Stable tag: 1.3.0
8
  License: GPL v2 or later
9
 
10
  Instant switching between user accounts in WordPress.
@@ -37,6 +37,12 @@ This plugin allows you to quickly swap between user accounts in WordPress at the
37
 
38
  See the [FAQ](https://wordpress.org/plugins/user-switching/faq/) for information about the *Switch Off* feature.
39
 
 
 
 
 
 
 
40
  == Screenshots ==
41
 
42
  1. The *Switch To* link on the Users screen
4
  Tags: users, profiles, user switching, fast user switching, multisite, buddypress, bbpress, become, user management, developer
5
  Requires at least: 3.7
6
  Tested up to: 4.9
7
+ Stable tag: 1.3.1
8
  License: GPL v2 or later
9
 
10
  Instant switching between user accounts in WordPress.
37
 
38
  See the [FAQ](https://wordpress.org/plugins/user-switching/faq/) for information about the *Switch Off* feature.
39
 
40
+ = Privacy Statement =
41
+
42
+ User Switching makes use of browser cookies in order to allow users to switch to another account. Its cookies operate using the same mechanism as the authentication cookies in WordPress core, therefore they contain the user's `user_login` field in plain text which should be treated as potentially personally identifiable information. The name of the cookies are `wordpress_user_sw_{hash}`, `wordpress_user_sw_secure_{hash}`, and `wordpress_user_sw_olduser_{hash}`, where `{hash}` is an identifier unique to the installation of WordPress.
43
+
44
+ User Switching does not send data to any third party, nor does it include any third party resources, nor will it ever do so.
45
+
46
  == Screenshots ==
47
 
48
  1. The *Switch To* link on the Users screen
user-switching.php CHANGED
@@ -5,15 +5,15 @@
5
  * @package user-switching
6
  * @link https://github.com/johnbillion/user-switching
7
  * @author John Blackbourn <john@johnblackbourn.com>
8
- * @copyright 2009-2017 John Blackbourn
9
  * @license GPL v2 or later
10
  *
11
  * Plugin Name: User Switching
12
  * Description: Instant switching between user accounts in WordPress
13
- * Version: 1.3.0
14
  * Plugin URI: https://johnblackbourn.com/wordpress-plugin-user-switching/
15
- * Author: John Blackbourn
16
- * Author URI: https://johnblackbourn.com/
17
  * Text Domain: user-switching
18
  * Domain Path: /languages/
19
  * Network: true
@@ -34,6 +34,13 @@
34
  */
35
  class user_switching {
36
 
 
 
 
 
 
 
 
37
  /**
38
  * Class constructor. Sets up some filters and actions.
39
  */
@@ -175,12 +182,13 @@ class user_switching {
175
  $args = array(
176
  'user_switched' => 'true',
177
  );
 
178
  if ( $redirect_to ) {
179
- wp_safe_redirect( add_query_arg( $args, $redirect_to ) );
180
  } elseif ( ! current_user_can( 'read' ) ) {
181
- wp_safe_redirect( add_query_arg( $args, home_url() ) );
182
  } else {
183
- wp_safe_redirect( add_query_arg( $args, admin_url() ) );
184
  }
185
  exit;
186
 
@@ -219,10 +227,11 @@ class user_switching {
219
  'user_switched' => 'true',
220
  'switched_back' => 'true',
221
  );
 
222
  if ( $redirect_to ) {
223
- wp_safe_redirect( add_query_arg( $args, $redirect_to ) );
224
  } else {
225
- wp_safe_redirect( add_query_arg( $args, admin_url( 'users.php' ) ) );
226
  }
227
  exit;
228
  } else {
@@ -247,10 +256,11 @@ class user_switching {
247
  $args = array(
248
  'switched_off' => 'true',
249
  );
 
250
  if ( $redirect_to ) {
251
- wp_safe_redirect( add_query_arg( $args, $redirect_to ) );
252
  } else {
253
- wp_safe_redirect( add_query_arg( $args, home_url() ) );
254
  }
255
  exit;
256
  } else {
@@ -322,7 +332,7 @@ class user_switching {
322
  if ( $old_user ) {
323
 
324
  ?>
325
- <div id="user_switching" class="updated">
326
  <p><span class="dashicons dashicons-admin-users" style="color:#56c234"></span>
327
  <?php
328
  $message = '';
@@ -370,7 +380,7 @@ class user_switching {
370
  } elseif ( isset( $_GET['user_switched'] ) ) {
371
 
372
  ?>
373
- <div id="user_switching" class="updated">
374
  <p>
375
  <?php
376
  if ( isset( $_GET['switched_back'] ) ) {
5
  * @package user-switching
6
  * @link https://github.com/johnbillion/user-switching
7
  * @author John Blackbourn <john@johnblackbourn.com>
8
+ * @copyright 2009-2018 John Blackbourn
9
  * @license GPL v2 or later
10
  *
11
  * Plugin Name: User Switching
12
  * Description: Instant switching between user accounts in WordPress
13
+ * Version: 1.3.1
14
  * Plugin URI: https://johnblackbourn.com/wordpress-plugin-user-switching/
15
+ * Author: John Blackbourn & contributors
16
+ * Author URI: https://github.com/johnbillion/user-switching/graphs/contributors
17
  * Text Domain: user-switching
18
  * Domain Path: /languages/
19
  * Network: true
34
  */
35
  class user_switching {
36
 
37
+ /**
38
+ * The name used to identify the application for debugging purposes.
39
+ *
40
+ * @var string
41
+ */
42
+ public static $application = 'WordPress/User Switching';
43
+
44
  /**
45
  * Class constructor. Sets up some filters and actions.
46
  */
182
  $args = array(
183
  'user_switched' => 'true',
184
  );
185
+
186
  if ( $redirect_to ) {
187
+ wp_safe_redirect( add_query_arg( $args, $redirect_to ), 302, self::$application );
188
  } elseif ( ! current_user_can( 'read' ) ) {
189
+ wp_safe_redirect( add_query_arg( $args, home_url() ), 302, self::$application );
190
  } else {
191
+ wp_safe_redirect( add_query_arg( $args, admin_url() ), 302, self::$application );
192
  }
193
  exit;
194
 
227
  'user_switched' => 'true',
228
  'switched_back' => 'true',
229
  );
230
+
231
  if ( $redirect_to ) {
232
+ wp_safe_redirect( add_query_arg( $args, $redirect_to ), 302, self::$application );
233
  } else {
234
+ wp_safe_redirect( add_query_arg( $args, admin_url( 'users.php' ) ), 302, self::$application );
235
  }
236
  exit;
237
  } else {
256
  $args = array(
257
  'switched_off' => 'true',
258
  );
259
+
260
  if ( $redirect_to ) {
261
+ wp_safe_redirect( add_query_arg( $args, $redirect_to ), 302, self::$application );
262
  } else {
263
+ wp_safe_redirect( add_query_arg( $args, home_url() ), 302, self::$application );
264
  }
265
  exit;
266
  } else {
332
  if ( $old_user ) {
333
 
334
  ?>
335
+ <div id="user_switching" class="updated notice is-dismissible">
336
  <p><span class="dashicons dashicons-admin-users" style="color:#56c234"></span>
337
  <?php
338
  $message = '';
380
  } elseif ( isset( $_GET['user_switched'] ) ) {
381
 
382
  ?>
383
+ <div id="user_switching" class="updated notice is-dismissible">
384
  <p>
385
  <?php
386
  if ( isset( $_GET['switched_back'] ) ) {