User Role Editor - Version 4.58.2

Version Description

Download this release

Release Info

Developer shinephp
Plugin Icon 128x128 User Role Editor
Version 4.58.2
Comparing to
See all releases

Code changes from version 4.58.1 to 4.58.2

changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  CHANGES LOG (full version).
2
  ===========================
 
 
 
 
3
  = [4.58.1] 11.01.2021 =
4
  * Fix: User lost assigned role(s) after click "Update" at the user permissions page, opened via "Selected user->Capabilities" or "User Profile->Capabilities->Edit" link.
5
 
1
  CHANGES LOG (full version).
2
  ===========================
3
+ = [4.58.2] 15.01.2021 =
4
+ * Fix: Additional options turned ON for a role was not saved during role update.
5
+ * Update: All JavaScript files are loaded with URE plugin version number as a query string for cache busting purpose.
6
+
7
  = [4.58.1] 11.01.2021 =
8
  * Fix: User lost assigned role(s) after click "Update" at the user permissions page, opened via "Selected user->Capabilities" or "User Profile->Capabilities->Edit" link.
9
 
includes/classes/editor.php CHANGED
@@ -676,7 +676,8 @@ class URE_Editor {
676
  }
677
 
678
  // add other roles to user
679
- foreach ($_POST['values'] as $key => $value) {
 
680
  $result = preg_match( '/^wp_role_(.+)/', $key, $match );
681
  if ( $result !== 1 ) {
682
  continue;
@@ -1199,10 +1200,6 @@ class URE_Editor {
1199
  $this->notification = esc_html__( 'User Roles are restored to WordPress default values. ', 'user-role-editor' );
1200
  break;
1201
  }
1202
- case 'update': {
1203
- $this->update();
1204
- break;
1205
- }
1206
  default: {
1207
  do_action( 'ure_process_user_request' );
1208
  }
676
  }
677
 
678
  // add other roles to user
679
+ $post_values = isset( $_POST['values'] ) && is_array( $_POST['values'] ) ? $_POST['values'] : array();
680
+ foreach ( $post_values as $key => $value ) {
681
  $result = preg_match( '/^wp_role_(.+)/', $key, $match );
682
  if ( $result !== 1 ) {
683
  continue;
1200
  $this->notification = esc_html__( 'User Roles are restored to WordPress default values. ', 'user-role-editor' );
1201
  break;
1202
  }
 
 
 
 
1203
  default: {
1204
  do_action( 'ure_process_user_request' );
1205
  }
includes/classes/grant-roles.php CHANGED
@@ -480,7 +480,7 @@ class URE_Grant_Roles {
480
  $show_wp_change_role = apply_filters('ure_users_show_wp_change_role', true);
481
 
482
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core','jquery-ui-button', 'jquery') );
483
- wp_register_script('ure-users-grant-roles', plugins_url('/js/users-grant-roles.js', URE_PLUGIN_FULL_PATH));
484
  wp_enqueue_script('ure-users-grant-roles', '', array(), false, true);
485
  wp_localize_script('ure-users-grant-roles', 'ure_users_grant_roles_data', array(
486
  'wp_nonce' => wp_create_nonce('user-role-editor'),
480
  $show_wp_change_role = apply_filters('ure_users_show_wp_change_role', true);
481
 
482
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core','jquery-ui-button', 'jquery') );
483
+ wp_register_script('ure-users-grant-roles', plugins_url('/js/users-grant-roles.js', URE_PLUGIN_FULL_PATH ), array(), URE_VERSION );
484
  wp_enqueue_script('ure-users-grant-roles', '', array(), false, true);
485
  wp_localize_script('ure-users-grant-roles', 'ure_users_grant_roles_data', array(
486
  'wp_nonce' => wp_create_nonce('user-role-editor'),
includes/classes/role-additional-options.php CHANGED
@@ -93,13 +93,13 @@ class URE_Role_Additional_Options {
93
 
94
  // Save additonal options section for the current role
95
  $this->active_items[$current_role] = array();
96
- foreach($this->items as $item) {
97
- if (isset($_POST[$item->id])) {
98
  $this->active_items[$current_role][$item->id] = 1;
99
  }
100
  }
101
 
102
- update_option(self::STORAGE_ID, $this->active_items);
103
 
104
  }
105
  // end of save()
@@ -141,4 +141,4 @@ class URE_Role_Additional_Options {
141
  // end of show()
142
 
143
  }
144
- // end of URE_Role_Additional_Options class
93
 
94
  // Save additonal options section for the current role
95
  $this->active_items[$current_role] = array();
96
+ foreach( $this->items as $item ) {
97
+ if ( isset( $_POST['values'][$item->id] ) ) {
98
  $this->active_items[$current_role][$item->id] = 1;
99
  }
100
  }
101
 
102
+ update_option( self::STORAGE_ID, $this->active_items );
103
 
104
  }
105
  // end of save()
141
  // end of show()
142
 
143
  }
144
+ // end of URE_Role_Additional_Options class
includes/classes/user-other-roles.php CHANGED
@@ -87,9 +87,9 @@ class URE_User_Other_Roles {
87
  $select_primary_role = apply_filters('ure_users_select_primary_role', true);
88
 
89
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
90
- wp_register_script('ure-jquery-multiple-select', plugins_url('/js/'. $ms_file_name, URE_PLUGIN_FULL_PATH));
91
  wp_enqueue_script('ure-jquery-multiple-select');
92
- wp_register_script('ure-user-profile-other-roles', plugins_url('/js/user-profile-other-roles.js', URE_PLUGIN_FULL_PATH));
93
  wp_enqueue_script('ure-user-profile-other-roles');
94
  wp_localize_script('ure-user-profile-other-roles', 'ure_data_user_profile_other_roles', array(
95
  'wp_nonce' => wp_create_nonce('user-role-editor'),
87
  $select_primary_role = apply_filters('ure_users_select_primary_role', true);
88
 
89
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
90
+ wp_register_script('ure-jquery-multiple-select', plugins_url('/js/'. $ms_file_name, URE_PLUGIN_FULL_PATH ), array(), URE_VERSION );
91
  wp_enqueue_script('ure-jquery-multiple-select');
92
+ wp_register_script('ure-user-profile-other-roles', plugins_url('/js/user-profile-other-roles.js', URE_PLUGIN_FULL_PATH ), array(), URE_VERSION );
93
  wp_enqueue_script('ure-user-profile-other-roles');
94
  wp_localize_script('ure-user-profile-other-roles', 'ure_data_user_profile_other_roles', array(
95
  'wp_nonce' => wp_create_nonce('user-role-editor'),
includes/classes/user-role-editor.php CHANGED
@@ -280,7 +280,7 @@ class User_Role_Editor {
280
  public function add_js_to_users_page() {
281
 
282
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core','jquery-ui-button', 'jquery') );
283
- wp_register_script( 'ure-users', plugins_url( '/js/users.js', URE_PLUGIN_FULL_PATH ) );
284
  wp_enqueue_script ( 'ure-users' );
285
  wp_localize_script( 'ure-users', 'ure_users_data', array(
286
  'wp_nonce' => wp_create_nonce('user-role-editor'),
@@ -724,7 +724,7 @@ class User_Role_Editor {
724
 
725
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
726
  wp_enqueue_script('jquery-ui-selectable', '', array('jquery-ui-core', 'jquery'));
727
- wp_register_script('ure', plugins_url('/js/ure.js', URE_PLUGIN_FULL_PATH));
728
  wp_enqueue_script('ure');
729
  wp_localize_script('ure', 'ure_data', array(
730
  'wp_nonce' => wp_create_nonce('user-role-editor'),
@@ -772,10 +772,10 @@ class User_Role_Editor {
772
  wp_enqueue_script('jquery-ui-tabs', '', array('jquery-ui-core', 'jquery'));
773
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery'));
774
  wp_enqueue_script('jquery-ui-button', '', array('jquery-ui-core', 'jquery'));
775
- wp_register_script('ure-js', plugins_url('/js/settings.js', URE_PLUGIN_FULL_PATH));
776
- wp_enqueue_script('ure-js');
777
 
778
- wp_localize_script('ure-js', 'ure_data', array(
779
  'wp_nonce' => wp_create_nonce('user-role-editor'),
780
  'network_admin' => is_network_admin() ? 1 : 0,
781
  'page_url' => $page_url,
280
  public function add_js_to_users_page() {
281
 
282
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core','jquery-ui-button', 'jquery') );
283
+ wp_register_script( 'ure-users', plugins_url( '/js/users.js', URE_PLUGIN_FULL_PATH ), array(), URE_VERSION );
284
  wp_enqueue_script ( 'ure-users' );
285
  wp_localize_script( 'ure-users', 'ure_users_data', array(
286
  'wp_nonce' => wp_create_nonce('user-role-editor'),
724
 
725
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
726
  wp_enqueue_script('jquery-ui-selectable', '', array('jquery-ui-core', 'jquery'));
727
+ wp_register_script('ure', plugins_url('/js/ure.js', URE_PLUGIN_FULL_PATH ), array(), URE_VERSION );
728
  wp_enqueue_script('ure');
729
  wp_localize_script('ure', 'ure_data', array(
730
  'wp_nonce' => wp_create_nonce('user-role-editor'),
772
  wp_enqueue_script('jquery-ui-tabs', '', array('jquery-ui-core', 'jquery'));
773
  wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery'));
774
  wp_enqueue_script('jquery-ui-button', '', array('jquery-ui-core', 'jquery'));
775
+ wp_register_script('ure-settings', plugins_url('/js/settings.js', URE_PLUGIN_FULL_PATH ), array(), URE_VERSION );
776
+ wp_enqueue_script('ure-settings');
777
 
778
+ wp_localize_script('ure-settings', 'ure_data', array(
779
  'wp_nonce' => wp_create_nonce('user-role-editor'),
780
  'network_admin' => is_network_admin() ? 1 : 0,
781
  'page_url' => $page_url,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vladi
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 4.0
6
  Tested up to: 5.6
7
- Stable tag: 4.58.1
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -80,6 +80,10 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
80
 
81
 
82
  == Changelog =
 
 
 
 
83
  = [4.58.1] 11.01.2021 =
84
  * Fix: User lost assigned role(s) after click "Update" at the user permissions page, opened via "Selected user->Capabilities" or "User Profile->Capabilities->Edit" link.
85
 
@@ -102,21 +106,6 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
102
  * Update: jQuery UI CSS was updated to version 1.12.1
103
  * Fix: "Grant Roles" button produced JavaScript error, if single user without any role granted (None) was selected.
104
 
105
- = [4.56.1] 05.09.2020 =
106
- * New: WordPress multisite: Main site: Users->User Role Editor->Apply to All->Update: 'ure_after_network_roles_update' action hook was added. It is executed after all roles were replicated from the main site to the all other subsites of the network.
107
- * Fix: "Granted Only" filter did not work.
108
- * Fix: Warning was fixed: wp-content/plugins/user-role-editor/js/ure.js: jQuery.fn.attr('checked') might use property instead of attribute.
109
-
110
- = [4.56] 09.08.2020 =
111
- * New: User capabilities 'install_languages', 'resume_plugins', 'resume_themes', 'view_site_health_checks' were added to the list of supported WordPress built-in user capabilities.
112
- * Update: Single site WordPress installation: URE automatically grants all existing user capabilities to WordPress built-in 'administrator' role before opening its page "Users->User Role Editor".
113
- * Fix: Extra slash was removed between URE_PLUGIN_URL and the image resource when outputting URE_PLUGIN_URL .'/images/ajax-loader.gif' at 'Users->User Role Editor' page.
114
- * Info: Marked as compatible with WordPress 5.5.
115
-
116
- = [4.55.1] 06.06.2020 =
117
- * Security fix: User with 'edit_users' capability could assign to another user a role not included into the editable roles list. This fix is required to install ASAP for all sites which have user(s) with 'edit_users' capability granted not via 'administrator' role.
118
- * Update: URE_Uninstall class properties were made 'protected' to be accessible in URE_Uninstall_Pro class included into the Pro version.
119
-
120
  File changelog.txt contains the full list of changes.
121
 
122
  == Additional Documentation ==
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 4.0
6
  Tested up to: 5.6
7
+ Stable tag: 4.58.2
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
80
 
81
 
82
  == Changelog =
83
+ = [4.58.2] 15.01.2021 =
84
+ * Fix: Additional options turned ON for a role was not saved during role update.
85
+ * Update: All JavaScript files are loaded with URE plugin version number as a query string for cache busting purpose.
86
+
87
  = [4.58.1] 11.01.2021 =
88
  * Fix: User lost assigned role(s) after click "Update" at the user permissions page, opened via "Selected user->Capabilities" or "User Profile->Capabilities->Edit" link.
89
 
106
  * Update: jQuery UI CSS was updated to version 1.12.1
107
  * Fix: "Grant Roles" button produced JavaScript error, if single user without any role granted (None) was selected.
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  File changelog.txt contains the full list of changes.
110
 
111
  == Additional Documentation ==
user-role-editor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: User Role Editor
4
  Plugin URI: https://www.role-editor.com
5
  Description: Change/add/delete WordPress user roles and capabilities.
6
- Version: 4.58.1
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
@@ -23,7 +23,7 @@ if ( defined( 'URE_PLUGIN_URL' ) ) {
23
  wp_die( 'It seems that other version of User Role Editor is active. Please deactivate it before use this version' );
24
  }
25
 
26
- define( 'URE_VERSION', '4.58.1' );
27
  define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
28
  define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
29
  define( 'URE_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
3
  Plugin Name: User Role Editor
4
  Plugin URI: https://www.role-editor.com
5
  Description: Change/add/delete WordPress user roles and capabilities.
6
+ Version: 4.58.2
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
23
  wp_die( 'It seems that other version of User Role Editor is active. Please deactivate it before use this version' );
24
  }
25
 
26
+ define( 'URE_VERSION', '4.58.2' );
27
  define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
28
  define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
29
  define( 'URE_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );