Version Description
Download this release
Release Info
Developer | shinephp |
Plugin | User Role Editor |
Version | 4.43 |
Comparing to | |
See all releases |
Code changes from version 4.42 to 4.43
- changelog.txt +20 -0
- includes/classes/ajax-processor.php +11 -3
- includes/classes/role-additional-options.php +13 -17
- js/ure.js +6 -1
- readme.txt +10 -4
- user-role-editor.php +2 -2
changelog.txt
CHANGED
@@ -1,5 +1,25 @@
|
|
1 |
CHANGES LOG (full version).
|
2 |
===========================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
= [4.40] 31.01.2018 =
|
5 |
* Update: use wp_roles() function from WordPress API instead of initializing $wp_roles global variable directly.
|
1 |
CHANGES LOG (full version).
|
2 |
===========================
|
3 |
+
= [4.43] 05.06.2018 =
|
4 |
+
* Update: references to non-existed roles are removed from the URE role additional options data storage after any role update.
|
5 |
+
* Fix: Additional options section view for the current role was not refreshed properly after other current role selection.
|
6 |
+
|
7 |
+
= [4.42] 16.05.2018 =
|
8 |
+
* Fix: Type checking was added (URE_Lib::restore_visual_composer_caps()) to fix "Warning: Invalid argument supplied for foreach() in .../user-role-editor-pro/includes/classes/ure-lib.php on line 315".
|
9 |
+
|
10 |
+
= [4.41] 07.05.2018 =
|
11 |
+
* New: URE changes currently selected role via AJAX request, without full "Users->User Role Editor" page refresh.
|
12 |
+
* 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.
|
13 |
+
|
14 |
+
= [4.40.3] 05.04.2018 =
|
15 |
+
* 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.
|
16 |
+
|
17 |
+
= [4.40.2] 04.04.2018 =
|
18 |
+
* 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.
|
19 |
+
|
20 |
+
= [4.40.1] 09.03.2018 =
|
21 |
+
* Update: wp_roles() function (introduced with WP 4.3) was included conditionally to URE code for backward compatibility with WordPress 4.0+
|
22 |
+
* 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.
|
23 |
|
24 |
= [4.40] 31.01.2018 =
|
25 |
* Update: use wp_roles() function from WordPress API instead of initializing $wp_roles global variable directly.
|
includes/classes/ajax-processor.php
CHANGED
@@ -133,7 +133,7 @@ class URE_Ajax_Processor {
|
|
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
|
137 |
return $answer;
|
138 |
}
|
139 |
|
@@ -143,13 +143,21 @@ class URE_Ajax_Processor {
|
|
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 |
}
|
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 role ID');
|
137 |
return $answer;
|
138 |
}
|
139 |
|
143 |
return $answer;
|
144 |
}
|
145 |
|
146 |
+
$active_items = URE_Role_Additional_Options::get_active_items();
|
147 |
+
if (isset($active_items[$role])) {
|
148 |
+
$role_options = $active_items[$role];
|
149 |
+
} else {
|
150 |
+
$role_options = array();
|
151 |
+
}
|
152 |
+
|
153 |
$answer = array(
|
154 |
'result'=>'success',
|
155 |
'message'=>'Role capabilities retrieved successfully',
|
156 |
'role_id'=>$role,
|
157 |
'role_name'=>$wp_roles->roles[$role]['name'],
|
158 |
+
'caps'=>$wp_roles->roles[$role]['capabilities'],
|
159 |
+
'options'=>$role_options
|
160 |
+
);
|
161 |
|
162 |
return $answer;
|
163 |
}
|
includes/classes/role-additional-options.php
CHANGED
@@ -43,22 +43,6 @@ class URE_Role_Additional_Options {
|
|
43 |
|
44 |
$data = get_option(self::STORAGE_ID, array());
|
45 |
|
46 |
-
/*
|
47 |
-
// It's enough to update the role via URE to achieve this, that why this code is commented:
|
48 |
-
// remove deactivated options
|
49 |
-
$modified = false;
|
50 |
-
foreach($data as $role=>$items) {
|
51 |
-
foreach($items as $item_id) {
|
52 |
-
if (!isset($this->items[$item_id])) {
|
53 |
-
$modified = true;
|
54 |
-
unset($data[$role][$item_id]);
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
58 |
-
if ($modified) {
|
59 |
-
put_option(self::STORAGE_ID, $data);
|
60 |
-
}
|
61 |
-
*/
|
62 |
return $data;
|
63 |
}
|
64 |
|
@@ -100,13 +84,25 @@ class URE_Role_Additional_Options {
|
|
100 |
|
101 |
|
102 |
public function save($current_role) {
|
|
|
|
|
103 |
$this->active_items = self::get_active_items();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
$this->active_items[$current_role] = array();
|
105 |
foreach($this->items as $item) {
|
106 |
if (isset($_POST[$item->id])) {
|
107 |
$this->active_items[$current_role][$item->id] = 1;
|
108 |
}
|
109 |
}
|
|
|
110 |
update_option(self::STORAGE_ID, $this->active_items);
|
111 |
|
112 |
}
|
@@ -119,7 +115,7 @@ class URE_Role_Additional_Options {
|
|
119 |
|
120 |
<hr />
|
121 |
<?php echo esc_html__('Additional Options', 'user-role-editor');?>:
|
122 |
-
<table class="form-table" style="clear:none;" cellpadding="0" cellspacing="0">
|
123 |
<tr>
|
124 |
<td>
|
125 |
|
43 |
|
44 |
$data = get_option(self::STORAGE_ID, array());
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
return $data;
|
47 |
}
|
48 |
|
84 |
|
85 |
|
86 |
public function save($current_role) {
|
87 |
+
|
88 |
+
$wp_roles = wp_roles();
|
89 |
$this->active_items = self::get_active_items();
|
90 |
+
|
91 |
+
// remove non-existing roles
|
92 |
+
foreach(array_keys($this->active_items) as $role_id) {
|
93 |
+
if (!isset($wp_roles->roles[$role_id])) {
|
94 |
+
unset($this->active_items[$role_id]);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
// Save additonal options section for the current role
|
99 |
$this->active_items[$current_role] = array();
|
100 |
foreach($this->items as $item) {
|
101 |
if (isset($_POST[$item->id])) {
|
102 |
$this->active_items[$current_role][$item->id] = 1;
|
103 |
}
|
104 |
}
|
105 |
+
|
106 |
update_option(self::STORAGE_ID, $this->active_items);
|
107 |
|
108 |
}
|
115 |
|
116 |
<hr />
|
117 |
<?php echo esc_html__('Additional Options', 'user-role-editor');?>:
|
118 |
+
<table id="additional_options" class="form-table" style="clear:none;" cellpadding="0" cellspacing="0">
|
119 |
<tr>
|
120 |
<td>
|
121 |
|
js/ure.js
CHANGED
@@ -528,7 +528,7 @@ function ure_refresh_role_view(response) {
|
|
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 |
|
@@ -541,6 +541,11 @@ function ure_refresh_role_view(response) {
|
|
541 |
ure_show_granted_caps_only();
|
542 |
}
|
543 |
|
|
|
|
|
|
|
|
|
|
|
544 |
}
|
545 |
// end of refresh_role_view()
|
546 |
|
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 capabilities checkboxes
|
532 |
jQuery(this).prop('checked', response.caps.hasOwnProperty(this.id));
|
533 |
});
|
534 |
|
541 |
ure_show_granted_caps_only();
|
542 |
}
|
543 |
|
544 |
+
// additional options section
|
545 |
+
jQuery('#additional_options').find(':checkbox').each(function() { // go through all additional options checkboxes
|
546 |
+
jQuery(this).prop('checked', response.options.hasOwnProperty(this.id));
|
547 |
+
});
|
548 |
+
|
549 |
}
|
550 |
// end of refresh_role_view()
|
551 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: shinephp
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vladimir%40shinephp%2ecom&lc=RU&item_name=ShinePHP%2ecom&item_number=User%20Role%20Editor%20WordPress%20plugin¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
4 |
Tags: user, role, editor, security, access, permission, capability
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.9.
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -79,6 +79,10 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
|
|
79 |
|
80 |
|
81 |
== Changelog =
|
|
|
|
|
|
|
|
|
82 |
= [4.42] 16.05.2018 =
|
83 |
* Fix: Type checking was added (URE_Lib::restore_visual_composer_caps()) to fix "Warning: Invalid argument supplied for foreach() in .../user-role-editor-pro/includes/classes/ure-lib.php on line 315".
|
84 |
|
@@ -111,8 +115,10 @@ You can find more information about "User Role Editor" plugin at [this page](htt
|
|
111 |
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.
|
112 |
|
113 |
== Upgrade Notice ==
|
114 |
-
= [4.
|
115 |
-
*
|
|
|
|
|
116 |
|
117 |
|
118 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vladimir%40shinephp%2ecom&lc=RU&item_name=ShinePHP%2ecom&item_number=User%20Role%20Editor%20WordPress%20plugin¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
4 |
Tags: user, role, editor, security, access, permission, capability
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.9.6
|
7 |
+
Stable tag: 4.43
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
79 |
|
80 |
|
81 |
== Changelog =
|
82 |
+
= [4.43] 05.06.2018 =
|
83 |
+
* Update: references to non-existed roles are removed from the URE role additional options data storage after any role update.
|
84 |
+
* Fix: Additional options section view for the current role was not refreshed properly after other current role selection.
|
85 |
+
|
86 |
= [4.42] 16.05.2018 =
|
87 |
* Fix: Type checking was added (URE_Lib::restore_visual_composer_caps()) to fix "Warning: Invalid argument supplied for foreach() in .../user-role-editor-pro/includes/classes/ure-lib.php on line 315".
|
88 |
|
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.43] 05.06.2018 =
|
119 |
+
* Update: references to non-existed roles are removed from the URE role additional options data storage after any role update.
|
120 |
+
* Fix: Additional options section view for the current role was not refreshed properly after other current role selection.
|
121 |
+
|
122 |
|
123 |
|
124 |
|
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.
|
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.
|
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.43
|
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.43');
|
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__));
|