Advanced Access Manager - Version 6.7.6

Version Description

  • Fixed Bug: Incorrectly handled "Add User" for with multisite setup by @terrance-orletsky-d7 https://github.com/aamplugin/advanced-access-manager/issues/179
  • Fixed Bug: WP Notice in logs for fread by @terrance-orletsky-d7 https://github.com/aamplugin/advanced-access-manager/issues/177
Download this release

Release Info

Developer vasyltech
Plugin Icon 128x128 Advanced Access Manager
Version 6.7.6
Comparing to
See all releases

Code changes from version 6.7.5 to 6.7.6

aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: Advanced Access Manager
5
  * Description: Collection of features to manage your WordPress website authentication, authorization and monitoring
6
- * Version: 6.7.5
7
  * Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  * Author URI: https://vasyltech.com
9
  * Text Domain: advanced-access-manager
@@ -264,7 +264,7 @@ if (defined('ABSPATH')) {
264
  //define few common constants
265
  define('AAM_MEDIA', plugins_url('/media', __FILE__));
266
  define('AAM_KEY', 'advanced-access-manager');
267
- define('AAM_VERSION', '6.7.5');
268
  define('AAM_BASEDIR', __DIR__);
269
 
270
  //load vendor
3
  /**
4
  * Plugin Name: Advanced Access Manager
5
  * Description: Collection of features to manage your WordPress website authentication, authorization and monitoring
6
+ * Version: 6.7.6
7
  * Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  * Author URI: https://vasyltech.com
9
  * Text Domain: advanced-access-manager
264
  //define few common constants
265
  define('AAM_MEDIA', plugins_url('/media', __FILE__));
266
  define('AAM_KEY', 'advanced-access-manager');
267
+ define('AAM_VERSION', '6.7.6');
268
  define('AAM_BASEDIR', __DIR__);
269
 
270
  //load vendor
application/Addon/Repository.php CHANGED
@@ -10,17 +10,18 @@
10
  /**
11
  * Addon repository
12
  *
 
13
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
14
- * @since 6.4.3 Fixed https://github.com/aamplugin/advanced-access-manager/issues/92
15
- * @since 6.4.2 Implemented https://github.com/aamplugin/advanced-access-manager/issues/88
16
- * @since 6.4.1 Fixed https://github.com/aamplugin/advanced-access-manager/issues/81
17
  * @since 6.2.0 Bug fixing that is related to unwanted PHP notices
18
  * @since 6.0.5 Refactored the license managements. Fixed couple bugs with license
19
  * information displaying
20
  * @since 6.0.0 Initial implementation of the class
21
  *
22
  * @package AAM
23
- * @version 6.7.5
24
  */
25
  class AAM_Addon_Repository
26
  {
@@ -95,6 +96,7 @@ class AAM_Addon_Repository
95
  *
96
  * @return array
97
  *
 
98
  * @since 6.4.2 Fixed https://github.com/aamplugin/advanced-access-manager/issues/81
99
  * @since 6.3.0 Fixed bug that causes PHP Notice about license index is missing.
100
  * Optimized for Multisite setup
@@ -102,7 +104,7 @@ class AAM_Addon_Repository
102
  * @since 6.0.0 Initial implementation of the method
103
  *
104
  * @access public
105
- * @version 6.4.2
106
  */
107
  public function getRegistry()
108
  {
@@ -117,7 +119,7 @@ class AAM_Addon_Repository
117
  // Iterate over the list of official add-ons and check if there is any
118
  // installed
119
  foreach(array_keys(self::OFFICIAL_ADDON_LIST) as $id) {
120
- $plugin = $this->getPluginData($id);
121
 
122
  if (!is_null($plugin)) { // Capturing the fact that add-on is installed
123
  $registry[$id] = null;
10
  /**
11
  * Addon repository
12
  *
13
+ * @since 6.7.6 https://github.com/aamplugin/advanced-access-manager/issues/177
14
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
15
+ * @since 6.4.3 https://github.com/aamplugin/advanced-access-manager/issues/92
16
+ * @since 6.4.2 https://github.com/aamplugin/advanced-access-manager/issues/88
17
+ * @since 6.4.1 https://github.com/aamplugin/advanced-access-manager/issues/81
18
  * @since 6.2.0 Bug fixing that is related to unwanted PHP notices
19
  * @since 6.0.5 Refactored the license managements. Fixed couple bugs with license
20
  * information displaying
21
  * @since 6.0.0 Initial implementation of the class
22
  *
23
  * @package AAM
24
+ * @version 6.7.6
25
  */
26
  class AAM_Addon_Repository
27
  {
96
  *
97
  * @return array
98
  *
99
+ * @since 6.7.6 https://github.com/aamplugin/advanced-access-manager/issues/177
100
  * @since 6.4.2 Fixed https://github.com/aamplugin/advanced-access-manager/issues/81
101
  * @since 6.3.0 Fixed bug that causes PHP Notice about license index is missing.
102
  * Optimized for Multisite setup
104
  * @since 6.0.0 Initial implementation of the method
105
  *
106
  * @access public
107
+ * @version 6.7.6
108
  */
109
  public function getRegistry()
110
  {
119
  // Iterate over the list of official add-ons and check if there is any
120
  // installed
121
  foreach(array_keys(self::OFFICIAL_ADDON_LIST) as $id) {
122
+ $plugin = $this->getPluginData("{$id}/bootstrap.php");
123
 
124
  if (!is_null($plugin)) { // Capturing the fact that add-on is installed
125
  $registry[$id] = null;
application/Backend/Manager.php CHANGED
@@ -10,6 +10,7 @@
10
  /**
11
  * Backend manager
12
  *
 
13
  * @since 6.6.2 https://github.com/aamplugin/advanced-access-manager/issues/138
14
  * @since 6.2.2 Added `manage_policies` and removed `blog_id` for the localized
15
  * array of properties
@@ -18,7 +19,7 @@
18
  * @since 6.0.0 Initial implementation of the class
19
  *
20
  * @package AAM
21
- * @version 6.6.2
22
  */
23
  class AAM_Backend_Manager
24
  {
@@ -30,11 +31,12 @@ class AAM_Backend_Manager
30
  *
31
  * @return void
32
  *
33
- * @since 6.4.2 Added https://github.com/aamplugin/advanced-access-manager/issues/88
 
34
  * @since 6.0.0 Initial implementation of the method
35
  *
36
  * @access protected
37
- * @version 6.4.2
38
  */
39
  protected function __construct()
40
  {
@@ -43,13 +45,14 @@ class AAM_Backend_Manager
43
 
44
  // Alter user edit screen with support for multiple roles
45
  if (AAM::api()->getConfig('core.settings.multiSubject', false)) {
46
- add_action('show_user_profile', array($this, 'addMultiRoleSupport'));
47
- add_action('edit_user_profile', array($this, 'addMultiRoleSupport'));
48
- add_action('user_new_form', array($this, 'addMultiRoleSupport'));
49
 
50
  // User profile update action
51
- add_action('profile_update', array($this, 'profileUpdate'), 10, 2);
52
- add_action('user_register', array($this, 'profileUpdate'), 10, 2);
 
 
53
  }
54
 
55
  // Manager Admin Menu
@@ -133,15 +136,13 @@ class AAM_Backend_Manager
133
  protected function checkAddonUpdates()
134
  {
135
  $list = AAM_Addon_Repository::getInstance()->getList();
136
- $url = 'https://forum.aamplugin.com/d/530-the-new-version-of-is-available-for-download';
137
 
138
  foreach($list as $addon) {
139
  if ($addon['hasUpdate'] === true) {
140
  AAM_Core_Console::add(
141
  sprintf(
142
- 'The new version of ["%s"] is available for download. %s',
143
- $addon['title'],
144
- '<a href="' . $url . '" target="_blank">' . __('Learn more', AAM_KEY) . '</a>;'
145
  ),
146
  'strong'
147
  );
@@ -201,19 +202,38 @@ class AAM_Backend_Manager
201
  }
202
  }
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  /**
205
  * Adjust user edit/add screen to support multiple roles
206
  *
207
- * @param WP_User|string $param
208
  *
209
  * @return void
210
  *
211
  * @access public
212
  * @version 6.0.0
213
  */
214
- public function addMultiRoleSupport($param)
215
  {
216
- require_once dirname(__FILE__) . '/tmpl/user/multiple-roles.php';
217
  }
218
 
219
  /**
@@ -250,7 +270,7 @@ class AAM_Backend_Manager
250
  $newRoles = array_intersect($roles, array_keys(get_editable_roles()));
251
 
252
  if (!empty($newRoles)) {
253
- //remove all current roles and then set new
254
  $user->set_role('');
255
 
256
  foreach ($newRoles as $role) {
10
  /**
11
  * Backend manager
12
  *
13
+ * @since 6.7.6 https://github.com/aamplugin/advanced-access-manager/issues/179
14
  * @since 6.6.2 https://github.com/aamplugin/advanced-access-manager/issues/138
15
  * @since 6.2.2 Added `manage_policies` and removed `blog_id` for the localized
16
  * array of properties
19
  * @since 6.0.0 Initial implementation of the class
20
  *
21
  * @package AAM
22
+ * @version 6.7.6
23
  */
24
  class AAM_Backend_Manager
25
  {
31
  *
32
  * @return void
33
  *
34
+ * @since 6.7.6 https://github.com/aamplugin/advanced-access-manager/issues/179
35
+ * @since 6.4.2 https://github.com/aamplugin/advanced-access-manager/issues/88
36
  * @since 6.0.0 Initial implementation of the method
37
  *
38
  * @access protected
39
+ * @version 6.7.6
40
  */
41
  protected function __construct()
42
  {
45
 
46
  // Alter user edit screen with support for multiple roles
47
  if (AAM::api()->getConfig('core.settings.multiSubject', false)) {
48
+ add_action('edit_user_profile', array($this, 'editUserProfilePage'));
49
+ add_action('user_new_form', array($this, 'addNewUserPage'));
 
50
 
51
  // User profile update action
52
+ add_action('profile_update', array($this, 'profileUpdate'));
53
+ add_action('user_register', array($this, 'profileUpdate'));
54
+ add_action('added_existing_user', array($this, 'profileUpdate'));
55
+ add_action('wpmu_activate_user', array($this, 'profileUpdate'));
56
  }
57
 
58
  // Manager Admin Menu
136
  protected function checkAddonUpdates()
137
  {
138
  $list = AAM_Addon_Repository::getInstance()->getList();
 
139
 
140
  foreach($list as $addon) {
141
  if ($addon['hasUpdate'] === true) {
142
  AAM_Core_Console::add(
143
  sprintf(
144
+ 'The new version of ["%s"] is available for download.',
145
+ $addon['title']
 
146
  ),
147
  'strong'
148
  );
202
  }
203
  }
204
 
205
+ /**
206
+ * Edit existing user page
207
+ *
208
+ * Adding support for the multi-role if this feature is enabled
209
+ *
210
+ * @param WP_User $user
211
+ *
212
+ * @return void
213
+ *
214
+ * @access public
215
+ * @version 6.7.6
216
+ */
217
+ public function editUserProfilePage($user)
218
+ {
219
+ if (current_user_can('promote_user', $user->ID)) {
220
+ require dirname(__FILE__) . '/tmpl/user/multiple-roles.php';
221
+ }
222
+ }
223
+
224
  /**
225
  * Adjust user edit/add screen to support multiple roles
226
  *
227
+ * @param string $param
228
  *
229
  * @return void
230
  *
231
  * @access public
232
  * @version 6.0.0
233
  */
234
+ public function addNewUserPage($param)
235
  {
236
+ require dirname(__FILE__) . '/tmpl/user/multiple-roles.php';
237
  }
238
 
239
  /**
270
  $newRoles = array_intersect($roles, array_keys(get_editable_roles()));
271
 
272
  if (!empty($newRoles)) {
273
+ // remove all current roles and then set new
274
  $user->set_role('');
275
 
276
  foreach ($newRoles as $role) {
application/Backend/tmpl/user/multiple-roles.php CHANGED
@@ -1,41 +1,55 @@
1
- <?php /** @version 6.0.0 */ ?>
 
 
 
 
 
 
 
 
2
 
3
  <?php if (defined('AAM_KEY')) { ?>
4
- <?php $user = ($param === 'add-new-user' ? null : $param); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- <?php if ((!defined('IS_PROFILE_PAGE') || !IS_PROFILE_PAGE) && !is_network_admin() && (empty($user) || current_user_can('promote_user', $user->ID))) { ?>
7
- <table class="form-table">
8
- <tr>
9
- <th><?php echo esc_html('User Roles', AAM_KEY); ?></th>
10
- <td>
11
- <div class="wp-tab-panel">
12
- <ul>
13
- <?php $roles = (!empty($user) ? $user->roles : array('subscriber')); ?>
14
- <?php foreach (get_editable_roles() as $id => $role) { ?>
15
- <li>
16
- <label>
17
- <input type="checkbox" name="aam_user_roles[]" value="<?php echo esc_attr($id); ?>" <?php checked(in_array($id, $roles)); ?> />
18
- <?php echo esc_html(translate_user_role($role['name'])); ?>
19
- </label>
20
- </li>
21
- <?php } ?>
22
- </ul>
23
- </div>
24
- </td>
25
- </tr>
26
- </table>
27
 
28
- <!-- Remove standard WordPress roles selector-->
29
- <script>
30
- (function($) {
31
- $(document).ready(function() {
32
- if ($('.user-role-wrap').length) {
33
- $('.user-role-wrap').remove();
34
- } else if ($('#role').length) {
35
- $('#role').parent().parent().remove();
36
- }
37
- });
38
- })(jQuery);
39
- </script>
40
- <?php } ?>
41
  <?php }
1
+ <?php
2
+ /**
3
+ *
4
+ * @since 6.7.6 https://github.com/aamplugin/advanced-access-manager/issues/179
5
+ * @since 6.0.0 Initial implementation of the template
6
+ *
7
+ * @version 6.7.6
8
+ */
9
+ ?>
10
 
11
  <?php if (defined('AAM_KEY')) { ?>
12
+ <table class="form-table">
13
+ <tr>
14
+ <th><?php echo esc_html('User Roles', AAM_KEY); ?></th>
15
+ <td>
16
+ <div class="wp-tab-panel">
17
+ <ul>
18
+ <?php $roles = (!empty($user) ? $user->roles : array(get_option('default_role'))); ?>
19
+ <?php foreach (get_editable_roles() as $id => $role) { ?>
20
+ <li>
21
+ <label>
22
+ <input type="checkbox" name="aam_user_roles[]" value="<?php echo esc_attr($id); ?>" <?php checked(in_array($id, $roles)); ?> />
23
+ <?php echo esc_html(translate_user_role($role['name'])); ?>
24
+ </label>
25
+ </li>
26
+ <?php } ?>
27
+ </ul>
28
+ </div>
29
+ <input type="hidden" name="role" value="<?php echo get_option('default_role'); ?>" />
30
+ </td>
31
+ </tr>
32
+ </table>
33
 
34
+ <!-- Remove standard WordPress roles selector-->
35
+ <script>
36
+ (function($) {
37
+ $(document).ready(function() {
38
+ // Remove default role drop-down from User Edit page
39
+ if ($('.user-role-wrap').length) {
40
+ $('.user-role-wrap').remove();
41
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
+ // Remove default role drop-down from Add New User page
44
+ if ($('#role').length) {
45
+ $('#role').parent().parent().remove();
46
+ }
47
+
48
+ // Remove default role drop-down from Add Existing User page
49
+ if ($('#adduser-role').length) {
50
+ $('#adduser-role').parent().parent().remove();
51
+ }
52
+ });
53
+ })(jQuery);
54
+ </script>
 
55
  <?php }
application/Core/Object/Post.php CHANGED
@@ -171,8 +171,8 @@ class AAM_Core_Object_Post extends AAM_Core_Object
171
  * @return boolean
172
  *
173
  * @access public
174
- * @link https://forum.aamplugin.com/d/353-comment-system-activated
175
  * @see AAM_Service_Content::initializeHooks
 
176
  * @version 6.0.1
177
  */
178
  public function isDefined($property)
171
  * @return boolean
172
  *
173
  * @access public
 
174
  * @see AAM_Service_Content::initializeHooks
175
+ *
176
  * @version 6.0.1
177
  */
178
  public function isDefined($property)
application/Core/Server.php CHANGED
@@ -14,11 +14,9 @@
14
  * 6.x.x. The problem is with the way AAM registers hooks to WP core `http_response`
15
  * hook
16
  *
17
- * @link https://forum.aamplugin.com/d/358-uncaught-error-class-aam-core-server-not-found
18
- *
19
  * @package AAM
20
  * @since 6.0.3
21
- * @todo Remove in July 2020
22
  */
23
  final class AAM_Core_Server
24
  {
14
  * 6.x.x. The problem is with the way AAM registers hooks to WP core `http_response`
15
  * hook
16
  *
 
 
17
  * @package AAM
18
  * @since 6.0.3
19
+ * @todo Remove in July 2021
20
  */
21
  final class AAM_Core_Server
22
  {
application/Migration/2019_11_20-base.php CHANGED
@@ -72,8 +72,6 @@ class Migration601 implements AAM_Core_Contract_MigrationInterface
72
  /**
73
  * Clear corrupted data from the previously incorrectly executed script
74
  *
75
- * @link https://forum.aamplugin.com/d/369-notice-undefined-offset-1-service-content-php-on-line-509
76
- *
77
  * @return void
78
  *
79
  * @access protected
72
  /**
73
  * Clear corrupted data from the previously incorrectly executed script
74
  *
 
 
75
  * @return void
76
  *
77
  * @access protected
application/Service/Content.php CHANGED
@@ -952,8 +952,6 @@ class AAM_Service_Content
952
  * aam|... post type capability
953
  * @since 6.0.0 Initial implementation of the method
954
  *
955
- * @link https://forum.aamplugin.com/d/378-aam-6-0-1-conflict-with-acf-advanced-custom-fields
956
- *
957
  * @access public
958
  * @version 6.1.0
959
  */
952
  * aam|... post type capability
953
  * @since 6.0.0 Initial implementation of the method
954
  *
 
 
955
  * @access public
956
  * @version 6.1.0
957
  */
application/Service/Metabox.php CHANGED
@@ -95,7 +95,6 @@ class AAM_Service_Metabox
95
  }, 999);
96
 
97
  // Manage Navigation Menu page to support
98
- // https://forum.aamplugin.com/d/61-restrict-role-from-updating-or-deleting-specific-navigation-menus
99
  add_filter('nav_menu_meta_box_object', function ($postType) {
100
  $postType->_default_query['suppress_filters'] = false;
101
 
95
  }, 999);
96
 
97
  // Manage Navigation Menu page to support
 
98
  add_filter('nav_menu_meta_box_object', function ($postType) {
99
  $postType->_default_query['suppress_filters'] = false;
100
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: vasyltech
3
  Tags: access control, membership, backend menu, user role, restricted content, security, jwt
4
  Requires at least: 4.7.0
5
  Requires PHP: 5.6.0
6
- Tested up to: 5.7.0
7
- Stable tag: 6.7.5
8
 
9
  All you need to manage access to WordPress websites on the frontend, backend and API levels for any role, user or visitors.
10
 
@@ -91,6 +91,9 @@ We take security and privacy very seriously, that is why there are several non-n
91
 
92
  == Changelog ==
93
 
 
 
 
94
  = 6.7.5 =
95
  * Fixed Bug: Access Policy breaks Broadcaster Plugin by @SEA-NET [https://github.com/aamplugin/advanced-access-manager/issues/170](https://github.com/aamplugin/advanced-access-manager/issues/170)
96
  * Changed: Enhanced the premium life-cycle management [https://github.com/aamplugin/advanced-access-manager/issues/173](https://github.com/aamplugin/advanced-access-manager/issues/173)
3
  Tags: access control, membership, backend menu, user role, restricted content, security, jwt
4
  Requires at least: 4.7.0
5
  Requires PHP: 5.6.0
6
+ Tested up to: 5.7.2
7
+ Stable tag: 6.7.6
8
 
9
  All you need to manage access to WordPress websites on the frontend, backend and API levels for any role, user or visitors.
10
 
91
 
92
  == Changelog ==
93
 
94
+ = 6.7.6 =
95
+ * Fixed Bug: Incorrectly handled "Add User" for with multisite setup by @terrance-orletsky-d7 [https://github.com/aamplugin/advanced-access-manager/issues/179](https://github.com/aamplugin/advanced-access-manager/issues/179)
96
+ * Fixed Bug: WP Notice in logs for fread by @terrance-orletsky-d7 [https://github.com/aamplugin/advanced-access-manager/issues/177](https://github.com/aamplugin/advanced-access-manager/issues/177)
97
  = 6.7.5 =
98
  * Fixed Bug: Access Policy breaks Broadcaster Plugin by @SEA-NET [https://github.com/aamplugin/advanced-access-manager/issues/170](https://github.com/aamplugin/advanced-access-manager/issues/170)
99
  * Changed: Enhanced the premium life-cycle management [https://github.com/aamplugin/advanced-access-manager/issues/173](https://github.com/aamplugin/advanced-access-manager/issues/173)