Peter’s Login Redirect - Version 2.9.9

Version Description

  • Fixed bug in multisite activation support.
Download this release

Release Info

Developer Collizo4sky
Plugin Icon 128x128 Peter’s Login Redirect
Version 2.9.9
Comparing to
See all releases

Code changes from version 2.9.8 to 2.9.9

Files changed (2) hide show
  1. readme.txt +5 -2
  2. wplogin_redirect.php +5 -19
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://profilepress.net/pricing
4
  Tags: login, logout, redirect, admin, administration, dashboard, users, authentication
5
  Requires at least: 4.0
6
  Requires PHP: 5.4
7
- Tested up to: 5.7
8
- Stable tag: 2.9.8
9
  License: GPL-2.0+
10
 
11
  Redirect users to different locations after logging in and logging out.
@@ -160,6 +160,9 @@ Be sure to rawurlencode the returned variable if necessary.
160
 
161
  == Changelog ==
162
 
 
 
 
163
  = 2.9.8 =
164
  * Added multisite support.
165
 
4
  Tags: login, logout, redirect, admin, administration, dashboard, users, authentication
5
  Requires at least: 4.0
6
  Requires PHP: 5.4
7
+ Tested up to: 5.8
8
+ Stable tag: 2.9.9
9
  License: GPL-2.0+
10
 
11
  Redirect users to different locations after logging in and logging out.
160
 
161
  == Changelog ==
162
 
163
+ = 2.9.9 =
164
+ * Fixed bug in multisite activation support.
165
+
166
  = 2.9.8 =
167
  * Added multisite support.
168
 
wplogin_redirect.php CHANGED
@@ -4,8 +4,8 @@ Plugin Name: Peter's Login Redirect
4
  Plugin URI: http://www.theblog.ca/wplogin-redirect
5
  Description: Redirect users to different locations after logging in. Define a set of rules for specific users, user with specific roles, users with specific capabilities, and a blanket rule for all other users. This is all managed in Settings > Login/logout redirects.
6
  Author: Peter Keung
7
- Author URI: http://www.theblog.ca
8
- Version: 2.9.8
9
  Text Domain: peters-login-redirect
10
  Domain Path: /languages/
11
  */
@@ -23,7 +23,7 @@ global $rul_db_addresses;
23
  global $rul_version;
24
  // Name of the database table that will hold group information and moderator rules
25
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
26
- $rul_version = '2.9.8';
27
 
28
  // doing this so we can pass current user logging out since it is no longer active after logout
29
  if ( ! function_exists('wp_logout')) :
@@ -1324,26 +1324,13 @@ function rul_activate_plugin($networkwide)
1324
  switch_to_blog($blog);
1325
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
1326
  rul_install();
 
1327
  }
1328
- restore_current_blog();
1329
  } else {
1330
  rul_install();
1331
  }
1332
  }
1333
 
1334
- function rul_deactivate_plugin($networkwide)
1335
- {
1336
- global $wpdb;
1337
-
1338
- if (function_exists('is_multisite') && is_multisite() && $networkwide) {
1339
- $blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
1340
- foreach ($blogs as $blog) {
1341
- switch_to_blog($blog);
1342
- }
1343
- restore_current_blog();
1344
- }
1345
- }
1346
-
1347
  function rul_uninstall_plugin()
1348
  {
1349
  // Executes when plugin is deleted
@@ -1354,8 +1341,8 @@ function rul_uninstall_plugin()
1354
  switch_to_blog($blog);
1355
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
1356
  rul_uninstall();
 
1357
  }
1358
- restore_current_blog();
1359
  } else {
1360
  rul_uninstall();
1361
  }
@@ -1385,7 +1372,6 @@ function rul_drop_tables($tables)
1385
  }
1386
 
1387
  register_activation_hook(__FILE__, 'rul_activate_plugin');
1388
- register_deactivation_hook(__FILE__, 'rul_deactivate_plugin');
1389
  register_uninstall_hook(__FILE__, 'rul_uninstall_plugin');
1390
  add_filter('wpmu_drop_tables', 'rul_drop_tables');
1391
  add_action('activate_blog', 'rul_site_added');
4
  Plugin URI: http://www.theblog.ca/wplogin-redirect
5
  Description: Redirect users to different locations after logging in. Define a set of rules for specific users, user with specific roles, users with specific capabilities, and a blanket rule for all other users. This is all managed in Settings > Login/logout redirects.
6
  Author: Peter Keung
7
+ Author URI: https://www.theblog.ca
8
+ Version: 2.9.9
9
  Text Domain: peters-login-redirect
10
  Domain Path: /languages/
11
  */
23
  global $rul_version;
24
  // Name of the database table that will hold group information and moderator rules
25
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
26
+ $rul_version = '2.9.9';
27
 
28
  // doing this so we can pass current user logging out since it is no longer active after logout
29
  if ( ! function_exists('wp_logout')) :
1324
  switch_to_blog($blog);
1325
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
1326
  rul_install();
1327
+ restore_current_blog();
1328
  }
 
1329
  } else {
1330
  rul_install();
1331
  }
1332
  }
1333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1334
  function rul_uninstall_plugin()
1335
  {
1336
  // Executes when plugin is deleted
1341
  switch_to_blog($blog);
1342
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
1343
  rul_uninstall();
1344
+ restore_current_blog();
1345
  }
 
1346
  } else {
1347
  rul_uninstall();
1348
  }
1372
  }
1373
 
1374
  register_activation_hook(__FILE__, 'rul_activate_plugin');
 
1375
  register_uninstall_hook(__FILE__, 'rul_uninstall_plugin');
1376
  add_filter('wpmu_drop_tables', 'rul_drop_tables');
1377
  add_action('activate_blog', 'rul_site_added');