User Role Editor - Version 4.41

Version Description

Download this release

Release Info

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

Code changes from version 4.40.3 to 4.41

includes/classes/ajax-processor.php CHANGED
@@ -130,6 +130,32 @@ class URE_Ajax_Processor {
130
  // end of get_user_roles()
131
 
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  protected function _dispatch() {
134
  switch ($this->action) {
135
  case 'get_caps_to_remove':
@@ -144,7 +170,9 @@ class URE_Ajax_Processor {
144
  case 'get_user_roles':
145
  $answer = $this->get_user_roles();
146
  break;
147
-
 
 
148
  default:
149
  $answer = array('result' => 'error', 'message' => 'unknown action "' . $this->action . '"');
150
  }
130
  // end of get_user_roles()
131
 
132
 
133
+ protected function get_role_caps() {
134
+ $role = filter_input(INPUT_POST, 'role', FILTER_SANITIZE_STRING);
135
+ if (empty($role)) {
136
+ $answer = array('result'=>'error', 'message'=>'Provide new role');
137
+ return $answer;
138
+ }
139
+
140
+ $wp_roles = wp_roles();
141
+ if (!isset($wp_roles->roles[$role])) {
142
+ $answer = array('result'=>'error', 'message'=>'Requested role does not exist');
143
+ return $answer;
144
+ }
145
+
146
+ $answer = array(
147
+ 'result'=>'success',
148
+ 'message'=>'Role capabilities retrieved successfully',
149
+ 'role_id'=>$role,
150
+ 'role_name'=>$wp_roles->roles[$role]['name'],
151
+ 'caps'=>$wp_roles->roles[$role]['capabilities']
152
+ );
153
+
154
+ return $answer;
155
+ }
156
+ // end of get_role_caps()
157
+
158
+
159
  protected function _dispatch() {
160
  switch ($this->action) {
161
  case 'get_caps_to_remove':
170
  case 'get_user_roles':
171
  $answer = $this->get_user_roles();
172
  break;
173
+ case 'get_role_caps':
174
+ $answer = $this->get_role_caps();
175
+ break;
176
  default:
177
  $answer = array('result' => 'error', 'message' => 'unknown action "' . $this->action . '"');
178
  }
includes/classes/grant-roles.php CHANGED
@@ -295,10 +295,8 @@ class URE_Grant_Roles {
295
  ?>
296
  </div>
297
  </div>
298
- <div id="ure_task_status" style="display:none;position:absolute;top:10px;right:10px;padding:10px;background-color:#000000;color:#ffffff;">
299
- <img src="<?php echo URE_PLUGIN_URL .'/images/ajax-loader.gif';?>" width="16" height="16"/> <?php esc_html_e('Working...','user-role-editor');?>
300
- </div>
301
  <?php
 
302
  self::$counter++;
303
  }
304
 
295
  ?>
296
  </div>
297
  </div>
 
 
 
298
  <?php
299
+ URE_View::output_task_status_div();
300
  self::$counter++;
301
  }
302
 
includes/classes/role-view.php CHANGED
@@ -255,7 +255,7 @@ if ($multisite && !is_network_admin()) {
255
  </div>
256
 
257
  <?php
258
-
259
  }
260
  // end of output_role_edit_dialogs()
261
 
255
  </div>
256
 
257
  <?php
258
+ URE_View::output_task_status_div();
259
  }
260
  // end of output_role_edit_dialogs()
261
 
includes/classes/ure-lib.php CHANGED
@@ -306,6 +306,20 @@ class URE_Lib extends URE_Base_Lib {
306
 
307
  }
308
  // end of init_current_role_name()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
 
310
 
311
  /**
@@ -319,6 +333,8 @@ class URE_Lib extends URE_Base_Lib {
319
  $this->capabilities_to_save[$available_capability['inner']] = true;
320
  }
321
  }
 
 
322
  }
323
  // end of prepare_capabilities_to_save()
324
 
@@ -708,15 +724,27 @@ class URE_Lib extends URE_Base_Lib {
708
 
709
 
710
  /**
711
- * return the array of unused user capabilities
712
- *
713
- * @global WP_Roles $wp_roles
714
- * @return array
715
  */
716
- public function get_caps_to_remove() {
717
- global $wp_roles;
718
-
719
- // build full capabilities list from all roles except Administrator
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  $full_caps_list = array();
721
  foreach ($wp_roles->roles as $role) {
722
  // validate if capabilities is an array
@@ -728,29 +756,46 @@ class URE_Lib extends URE_Base_Lib {
728
  }
729
  }
730
  }
731
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
  $caps_to_exclude = $this->get_built_in_wp_caps();
733
  $ure_caps = URE_Own_Capabilities::get_caps();
734
- $caps_to_exclude = array_merge($caps_to_exclude, $ure_caps);
 
735
 
736
  $caps_to_remove = array();
737
  foreach ($full_caps_list as $capability => $value) {
738
- if (!isset($caps_to_exclude[$capability])) { // do not touch built-in WP caps
739
- // check roles
740
- $cap_in_use = false;
741
- foreach ($wp_roles->role_objects as $wp_role) {
742
- if ($wp_role->name != 'administrator') {
743
- if ($wp_role->has_cap($capability)) {
744
- $cap_in_use = true;
745
- break;
746
- }
 
 
747
  }
748
  }
749
- if (!$cap_in_use) {
750
- $caps_to_remove[$capability] = 1;
751
- }
752
  }
753
- }
 
 
 
754
 
755
  return $caps_to_remove;
756
  }
@@ -1178,7 +1223,7 @@ class URE_Lib extends URE_Base_Lib {
1178
  return false;
1179
  }
1180
 
1181
- $this->capabilities_to_save = $this->remove_caps_not_allowed_for_single_admin($this->capabilities_to_save);
1182
  $this->roles[$this->current_role]['name'] = $this->current_role_name;
1183
  $this->roles[$this->current_role]['capabilities'] = $this->capabilities_to_save;
1184
  $option_name = $wpdb->prefix . 'user_roles';
306
 
307
  }
308
  // end of init_current_role_name()
309
+
310
+
311
+ // Add existing WPBakery Visial Composer () plugin capabilities from this role to the list of capabiliteis for save with this role update -
312
+ // Visual Composer capabilities are excluded from a role update as they may store not boolean values.
313
+ protected function restore_visual_composer_caps() {
314
+
315
+ foreach($this->roles[$this->current_role]['capabilities'] as $cap=>$value) {
316
+ if (strpos($cap, 'vc_access_rules_')!==false) {
317
+ $this->capabilities_to_save[$cap] = $value;
318
+ }
319
+ }
320
+
321
+ }
322
+ // end of restore_visual_composer_caps()
323
 
324
 
325
  /**
333
  $this->capabilities_to_save[$available_capability['inner']] = true;
334
  }
335
  }
336
+
337
+ $this->restore_visual_composer_caps();
338
  }
339
  // end of prepare_capabilities_to_save()
340
 
724
 
725
 
726
  /**
727
+ * Returns array of WPBakery Visual Composer plugin capabilities
728
+ * extracted by 'vc_access_rules_' prefix
 
 
729
  */
730
+ public function get_visual_composer_caps($full_caps_list) {
731
+ $caps = array();
732
+ foreach(array_keys($full_caps_list) as $cap) {
733
+ if (strpos($cap, 'vc_access_rules_')!==false) {
734
+ $caps[$cap] = 1;
735
+ }
736
+ }
737
+
738
+ return $caps;
739
+ }
740
+ // end of get_visual_composer_caps()
741
+
742
+ /**
743
+ * Build full capabilities list from all roles
744
+ */
745
+ private function get_full_caps_list_from_roles() {
746
+ $wp_roles = wp_roles();
747
+ // build full capabilities list from all roles
748
  $full_caps_list = array();
749
  foreach ($wp_roles->roles as $role) {
750
  // validate if capabilities is an array
756
  }
757
  }
758
  }
759
+
760
+ return $full_caps_list;
761
+ }
762
+ // end of get_full_caps_list_from_roles()
763
+
764
+
765
+ /**
766
+ * return the array of unused user capabilities
767
+ *
768
+ * @global WP_Roles $wp_roles
769
+ * @return array
770
+ */
771
+ public function get_caps_to_remove() {
772
+ $wp_roles = wp_roles();
773
+ $full_caps_list = $this->get_full_caps_list_from_roles();
774
  $caps_to_exclude = $this->get_built_in_wp_caps();
775
  $ure_caps = URE_Own_Capabilities::get_caps();
776
+ $visual_composer_caps = $this->get_visual_composer_caps($full_caps_list);
777
+ $caps_to_exclude = array_merge($caps_to_exclude, $ure_caps, $visual_composer_caps);
778
 
779
  $caps_to_remove = array();
780
  foreach ($full_caps_list as $capability => $value) {
781
+ if (isset($caps_to_exclude[$capability])) { // do not touch built-in WP caps, URE own caps and Visual Composer caps
782
+ continue;
783
+ }
784
+
785
+ // check roles
786
+ $cap_in_use = false;
787
+ foreach ($wp_roles->role_objects as $wp_role) {
788
+ if ($wp_role->name != 'administrator') {
789
+ if ($wp_role->has_cap($capability)) {
790
+ $cap_in_use = true;
791
+ break;
792
  }
793
  }
 
 
 
794
  }
795
+ if (!$cap_in_use) {
796
+ $caps_to_remove[$capability] = 1;
797
+ }
798
+ } // foreach(...)
799
 
800
  return $caps_to_remove;
801
  }
1223
  return false;
1224
  }
1225
 
1226
+ $this->capabilities_to_save = $this->remove_caps_not_allowed_for_single_admin($this->capabilities_to_save);
1227
  $this->roles[$this->current_role]['name'] = $this->current_role_name;
1228
  $this->roles[$this->current_role]['capabilities'] = $this->capabilities_to_save;
1229
  $option_name = $wpdb->prefix . 'user_roles';
includes/classes/user-role-editor.php CHANGED
@@ -105,7 +105,7 @@ class User_Role_Editor {
105
  if ($multisite) {
106
  // new blog may be registered not at admin back-end only but automatically after new user registration, e.g.
107
  // Gravity Forms User Registration Addon does
108
- add_action( 'wpmu_new_blog', array($this, 'duplicate_roles_for_new_blog'), 10, 2);
109
  }
110
 
111
  // setup additional options hooks for the roles
@@ -394,7 +394,7 @@ class User_Role_Editor {
394
 
395
 
396
  /**
397
- * every time when new blog created - duplicate to it roles from the main blog (1)
398
  * @global wpdb $wpdb
399
  * @global WP_Roles $wp_roles
400
  * @param int $blog_id
@@ -413,6 +413,8 @@ class User_Role_Editor {
413
  switch_to_blog($main_blog_id);
414
  $main_roles = new WP_Roles(); // get roles from primary blog
415
  $default_role = get_option('default_role'); // get default role from primary blog
 
 
416
  switch_to_blog($blog_id); // switch to the new created blog
417
  $main_roles->use_db = false; // do not touch DB
418
  $main_roles->add_cap('administrator', 'dummy_123456'); // just to save current roles into new blog
@@ -420,6 +422,8 @@ class User_Role_Editor {
420
  $main_roles->use_db = true; // save roles into new blog DB
421
  $main_roles->remove_cap('administrator', 'dummy_123456'); // remove unneeded dummy capability
422
  update_option('default_role', $default_role); // set default role for new blog as it set for primary one
 
 
423
  switch_to_blog($current_blog); // return to blog where we were at the begin
424
  }
425
  // end of duplicate_roles_for_new_blog()
105
  if ($multisite) {
106
  // new blog may be registered not at admin back-end only but automatically after new user registration, e.g.
107
  // Gravity Forms User Registration Addon does
108
+ add_action( 'wpmu_new_blog', array($this, 'duplicate_roles_for_new_blog'), 10, 2);
109
  }
110
 
111
  // setup additional options hooks for the roles
394
 
395
 
396
  /**
397
+ * Every time when new blog is created - duplicate for it the roles from the main blog
398
  * @global wpdb $wpdb
399
  * @global WP_Roles $wp_roles
400
  * @param int $blog_id
413
  switch_to_blog($main_blog_id);
414
  $main_roles = new WP_Roles(); // get roles from primary blog
415
  $default_role = get_option('default_role'); // get default role from primary blog
416
+ $addons_data = apply_filters('ure_get_addons_data_for_new_blog', array()); // load addons data - for internal use in a Pro version
417
+
418
  switch_to_blog($blog_id); // switch to the new created blog
419
  $main_roles->use_db = false; // do not touch DB
420
  $main_roles->add_cap('administrator', 'dummy_123456'); // just to save current roles into new blog
422
  $main_roles->use_db = true; // save roles into new blog DB
423
  $main_roles->remove_cap('administrator', 'dummy_123456'); // remove unneeded dummy capability
424
  update_option('default_role', $default_role); // set default role for new blog as it set for primary one
425
+ do_action('ure_set_addons_data_for_new_blog', $blog_id, $addons_data); // save addons data for new blog - for internal use in a Pro version
426
+
427
  switch_to_blog($current_blog); // return to blog where we were at the begin
428
  }
429
  // end of duplicate_roles_for_new_blog()
includes/classes/view.php CHANGED
@@ -108,6 +108,21 @@ class URE_View {
108
  // end of blocked_for_single_admin_style()
109
 
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * output HTML-code for capabilities list
113
  * @param boolean $for_role - if true, it is role capabilities list, else - user specific capabilities list
@@ -125,7 +140,7 @@ class URE_View {
125
  }
126
  $user_to_edit = $this->lib->get('user_to_edit');
127
  $roles = $this->lib->get('roles');
128
- $full_capabilities = $this->lib->get('full_capabilities');
129
  $built_in_wp_caps = $this->lib->get_built_in_wp_caps();
130
  $caps_readable = $this->lib->get('caps_readable');
131
  $caps_groups_manager = URE_Capabilities_Groups_Manager::get_instance();
@@ -252,6 +267,16 @@ class URE_View {
252
  // end of output_confirmation_dialog()
253
 
254
 
 
 
 
 
 
 
 
 
 
 
255
  private function show_select_all() {
256
  $multisite = $this->lib->get('multisite');
257
  $current_role = $this->lib->get('current_role');
108
  // end of blocked_for_single_admin_style()
109
 
110
 
111
+ // Get full capabilities list and exclude Visual Composer capabilities from it
112
+ // Do not take VC capabilities into account as VC stores not boolean values with them
113
+ protected function get_full_capabilities() {
114
+ $full_caps = $this->lib->get('full_capabilities');
115
+ foreach($full_caps as $key=>$capability) {
116
+ if (strpos($key, 'vc_access_rules_')!==false) {
117
+ unset($full_caps[$key]);
118
+ }
119
+ }
120
+
121
+ return $full_caps;
122
+ }
123
+ // end of get_full_capabilities()
124
+
125
+
126
  /**
127
  * output HTML-code for capabilities list
128
  * @param boolean $for_role - if true, it is role capabilities list, else - user specific capabilities list
140
  }
141
  $user_to_edit = $this->lib->get('user_to_edit');
142
  $roles = $this->lib->get('roles');
143
+ $full_capabilities = $this->get_full_capabilities();
144
  $built_in_wp_caps = $this->lib->get_built_in_wp_caps();
145
  $caps_readable = $this->lib->get('caps_readable');
146
  $caps_groups_manager = URE_Capabilities_Groups_Manager::get_instance();
267
  // end of output_confirmation_dialog()
268
 
269
 
270
+ public static function output_task_status_div() {
271
+ ?>
272
+ <div id="ure_task_status" style="display:none;position:absolute;top:10px;right:10px;padding:10px;background-color:#000000;color:#ffffff;">
273
+ <img src="<?php echo URE_PLUGIN_URL .'/images/ajax-loader.gif';?>" width="16" height="16"/> <?php esc_html_e('Working...','user-role-editor');?>
274
+ </div>
275
+ <?php
276
+ }
277
+ // end of output task_status_div()
278
+
279
+
280
  private function show_select_all() {
281
  $multisite = $this->lib->get('multisite');
282
  $current_role = $this->lib->get('current_role');
js/ure.js CHANGED
@@ -518,9 +518,43 @@ function ure_turn_deprecated_caps(user_id) {
518
  // ure_turn_deprecated_caps()
519
 
520
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  function ure_role_change(role_name) {
522
 
523
- jQuery.ure_postGo(ure_data.page_url, {action: 'role-change', object: 'role', user_role: role_name, ure_nonce: ure_data.wp_nonce});
 
 
 
 
 
 
 
524
 
525
  }
526
  // end of ure_role_change()
@@ -667,7 +701,12 @@ function ure_count_caps_in_groups() {
667
 
668
  for (i=0; i<ure_main.caps_counter.length; i++) {
669
  var el = jQuery('#ure_caps_group_'+ ure_main.caps_counter[i].id);
670
- var value = el.text() +' ('+ ure_main.caps_counter[i].total +'/'+ ure_main.caps_counter[i].granted +')';
 
 
 
 
 
671
 
672
  el.text(value);
673
  }
518
  // ure_turn_deprecated_caps()
519
 
520
 
521
+ function ure_refresh_role_view(response) {
522
+ jQuery('#ure_task_status').hide();
523
+ if (response!==null && response.result=='error') {
524
+ alert(response.message);
525
+ return;
526
+ }
527
+
528
+ ure_current_role = response.role_id;
529
+ ure_current_role_name = response.role_name;
530
+ // Select capabilities included to a newly selected role and exclude others
531
+ jQuery('.ure-cap-cb').each(function () { // go through all checkboxes
532
+ jQuery(this).prop('checked', response.caps.hasOwnProperty(this.id));
533
+ });
534
+
535
+ // Recalculate granted capabilities for capabilities groups
536
+ ure_count_caps_in_groups();
537
+ ure_select_selectable_element(jQuery('#ure_caps_groups_list'), jQuery('#ure_caps_group_all'));
538
+ var granted_only = jQuery('#granted_only').prop('checked');
539
+ if (granted_only) {
540
+ jQuery('#granted_only').prop('checked', false);
541
+ ure_show_granted_caps_only();
542
+ }
543
+
544
+ }
545
+ // end of refresh_role_view()
546
+
547
+
548
  function ure_role_change(role_name) {
549
 
550
+ //jQuery.ure_postGo(ure_data.page_url, {action: 'role-change', object: 'role', user_role: role_name, ure_nonce: ure_data.wp_nonce});
551
+ jQuery('#ure_task_status').show();
552
+ var data = {
553
+ 'action': 'ure_ajax',
554
+ 'sub_action':'get_role_caps',
555
+ 'role': role_name,
556
+ 'wp_nonce': ure_data.wp_nonce};
557
+ jQuery.post(ajaxurl, data, ure_refresh_role_view, 'json');
558
 
559
  }
560
  // end of ure_role_change()
701
 
702
  for (i=0; i<ure_main.caps_counter.length; i++) {
703
  var el = jQuery('#ure_caps_group_'+ ure_main.caps_counter[i].id);
704
+ var old_text = el.text();
705
+ var key_pos = old_text.indexOf('('); // exclude (0/0) text if it is in string already
706
+ if (key_pos>0) {
707
+ old_text = old_text.substr(0, key_pos - 1);
708
+ }
709
+ var value = old_text +' ('+ ure_main.caps_counter[i].total +'/'+ ure_main.caps_counter[i].granted +')';
710
 
711
  el.text(value);
712
  }
js/users-grant-roles.js CHANGED
@@ -30,7 +30,6 @@ function ure_get_selected_checkboxes(item_name) {
30
  function ure_show_grant_roles_dialog_pre_selected(response) {
31
  jQuery('#ure_task_status').hide();
32
  if (response!==null && response.result=='error') {
33
- jQuery('#ure_task_status').hide();
34
  alert(response.message);
35
  return;
36
  }
30
  function ure_show_grant_roles_dialog_pre_selected(response) {
31
  jQuery('#ure_task_status').hide();
32
  if (response!==null && response.result=='error') {
 
33
  alert(response.message);
34
  return;
35
  }
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: 4.9.5
7
- Stable tag: 4.40.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -79,8 +79,12 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
79
 
80
 
81
  == Changelog =
82
- = [4.40.3] 06.04.2018 =
83
- * Update: bbPress detection and code for integration with it was updated to support multisite installations when URE is network activated but bbPress is activated on some sites of the network only. (Free version does not support bbPress roles. It excludes them from processing as bbPress creates them dynamically.)
 
 
 
 
84
 
85
  = [4.40.2] 04.04.2018 =
86
  * Update: Load required .php files from the active bbPress plugin directly, as in some cases URE code may be executed earlier than they are loaded by bbPress.
@@ -93,17 +97,6 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
93
  * Update: use wp_roles() function from WordPress API instead of initializing $wp_roles global variable directly.
94
  * Fix: Bug was introduced by version 4.37 with users recalculation for "All" tab after excluding users with "administrator" role. Code worked incorrectly for Japanese locale.
95
 
96
- = [4.39] 19.12.2017 =
97
- * Update: Plugin settings management code moved to the separate URE_Settings class.
98
- * Update: 'create_posts', 'create_pages' user capabilities are not added by default to WordPress built-in capabilities groups as they are supported by the Pro version only.
99
- * Update: Type checking enhanced for values received from a user input and for variable arguments inside database queries.
100
- * Update: Own code to build usermeta db table name was excluded. A value from $wpdb->usermeta is used instead.
101
-
102
- = [4.38] 27.11.2017 =
103
- * Security: XSS vulnerability was fixed at URE's options page. Bug was discovered and fixed at tab index value numeric type checking. Tab index value is additionally escaped before output also.
104
- * Security: Deprecated code for debug output to the .log file in case of database query error was removed.
105
- * Security: Multiple select jQuery plugin (https://github.com/wenzhixin/multiple-select/) was updated to the latest available version 1.2.1, which fixed XSS vulnerability, existed in earlier versions.
106
-
107
 
108
  For full list of changes applied to User Role Editor plugin look changelog.txt file.
109
 
@@ -115,6 +108,8 @@ You can find more information about "User Role Editor" plugin at [this page](htt
115
  I am ready to answer on your questions about plugin usage. Use [plugin page comments](http://www.shinephp.com/user-role-editor-wordpress-plugin/) for that.
116
 
117
  == Upgrade Notice ==
118
- = [4.40.1] 09.03.2018 =
119
- * Update: wp_roles() function (introduced with WP 4.3) was included conditionally to URE code for backward compatibility with WordPress 4.0+
120
- * Fix: WordPress multisite: bbPress plugin detection code was changed from checking bbPress API function existence to checking WordPress active plugins list. bbPress plugin activated for the site was not available yet for the network activated User Role Editor at the point of URE instance creation. URE did not work with bbPress roles as it should by design for that reason. URE (free version) should ignore bbPress roles and capabilities as the special efforts are required for this.
 
 
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 4.0
6
  Tested up to: 4.9.5
7
+ Stable tag: 4.41
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
79
 
80
 
81
  == Changelog =
82
+ = [4.41] 07.05.2018 =
83
+ * New: URE changes currently selected role via AJAX request, without full "Users->User Role Editor" page refresh.
84
+ * Update: All [WPBakery Visual Composer](http://vc.wpbakery.com) plugin custom user capabilities (started from 'vc_access_rules_') were excluded from processing by User Role Editor. Visual Composer loses settings made via its own "Role Manager" after the role update by User Role Editor in other case. The reason - Visual Composer stores not boolean values with user capabilities granted to the roles via own "Role Manager". User Role Editor converted them to related boolean values during role(s) update.
85
+
86
+ = [4.40.3] 05.04.2018 =
87
+ * Update: bbPress detection and code for integration with it was updated to support multisite installations when URE is network activated but bbPress is activated on some sites of the network only. Free version does not support bbPress roles. It excludes them from processing as bbPress creates them dynamically.
88
 
89
  = [4.40.2] 04.04.2018 =
90
  * Update: Load required .php files from the active bbPress plugin directly, as in some cases URE code may be executed earlier than they are loaded by bbPress.
97
  * Update: use wp_roles() function from WordPress API instead of initializing $wp_roles global variable directly.
98
  * Fix: Bug was introduced by version 4.37 with users recalculation for "All" tab after excluding users with "administrator" role. Code worked incorrectly for Japanese locale.
99
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  For full list of changes applied to User Role Editor plugin look changelog.txt file.
102
 
108
  I am ready to answer on your questions about plugin usage. Use [plugin page comments](http://www.shinephp.com/user-role-editor-wordpress-plugin/) for that.
109
 
110
  == Upgrade Notice ==
111
+ = [4.41] 07.05.2018 =
112
+ * New: URE changes currently selected role via AJAX request, without full "Users->User Role Editor" page refresh.
113
+ * Update: All [WPBakery Visual Composer](http://vc.wpbakery.com) plugin custom user capabilities (started from 'vc_access_rules_') were excluded from processing by User Role Editor. Visual Composer loses settings made via its own "Role Manager" after the role update by User Role Editor in other case. The reason - Visual Composer stores not boolean values with user capabilities granted to the roles via own "Role Manager". User Role Editor converted them to related boolean values during role(s) update.
114
+
115
+
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.40.3
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
@@ -11,7 +11,7 @@ Domain Path: /lang/
11
  */
12
 
13
  /*
14
- Copyright 2010-2017 Vladimir Garagulya (email: support@role-editor.com)
15
  */
16
 
17
  if (!function_exists('get_option')) {
@@ -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.40.3');
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.41
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
11
  */
12
 
13
  /*
14
+ Copyright 2010-2018 Vladimir Garagulya (email: support@role-editor.com)
15
  */
16
 
17
  if (!function_exists('get_option')) {
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.41');
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__));