Advanced Access Manager - Version 5.8.1

Version Description

  • Fixed bug that causes fatal error with Policy editor on Linux servers
  • Profiled and improved several bottlenecks that may speed-up website load up to 300 milliseconds
Download this release

Release Info

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

Code changes from version 5.8 to 5.8.1

Application/Backend/Filter.php CHANGED
@@ -218,15 +218,19 @@ class AAM_Backend_Filter {
218
  * @return array
219
  */
220
  public function filterRoles($roles) {
 
 
221
  $userLevel = AAM::getUser()->getMaxLevel();
222
 
223
  //filter roles
224
  foreach($roles as $id => $role) {
225
  if (!empty($role['capabilities']) && is_array($role['capabilities'])) {
226
- $roleLevel = AAM_Core_API::maxLevel($role['capabilities']);
227
- if ($userLevel < $roleLevel) {
 
 
228
  unset($roles[$id]);
229
- } elseif ($userLevel === $roleLevel && $this->filterSameLevel()) {
230
  unset($roles[$id]);
231
  }
232
  }
218
  * @return array
219
  */
220
  public function filterRoles($roles) {
221
+ static $levels = array(); // to speed-up the execution
222
+
223
  $userLevel = AAM::getUser()->getMaxLevel();
224
 
225
  //filter roles
226
  foreach($roles as $id => $role) {
227
  if (!empty($role['capabilities']) && is_array($role['capabilities'])) {
228
+ if (!isset($levels[$id])) {
229
+ $levels[$id] = AAM_Core_API::maxLevel($role['capabilities']);
230
+ }
231
+ if ($userLevel < $levels[$id]) {
232
  unset($roles[$id]);
233
+ } elseif ($userLevel === $levels[$id] && $this->filterSameLevel()) {
234
  unset($roles[$id]);
235
  }
236
  }
Application/Core/API.php CHANGED
@@ -216,11 +216,13 @@ final class AAM_Core_API {
216
  * @access public
217
  */
218
  public static function getAllCapabilities() {
219
- $caps = array();
220
 
221
- foreach (self::getRoles()->role_objects as $role) {
222
- if (is_array($role->capabilities)) {
223
- $caps = array_merge($caps, $role->capabilities);
 
 
224
  }
225
  }
226
 
216
  * @access public
217
  */
218
  public static function getAllCapabilities() {
219
+ static $caps = array();
220
 
221
+ if (empty($caps)) {
222
+ foreach (self::getRoles()->role_objects as $role) {
223
+ if (is_array($role->capabilities)) {
224
+ $caps = array_merge($caps, $role->capabilities);
225
+ }
226
  }
227
  }
228
 
aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
- Version: 5.8
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
+ Version: 5.8.1
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vasyltech
3
  Tags: access control, membership, backend menu, user role, restricted content, security, jwt
4
  Requires at least: 4.0
5
  Tested up to: 5.0.3
6
- Stable tag: 5.8
7
 
8
  All you need to manage access to you WordPress websites on frontend, backend and API levels for any role, user or visitors.
9
 
@@ -46,6 +46,7 @@ https://www.youtube.com/watch?v=mj5Xa_Wc16Y
46
  * [limited] URI Access. Allow or deny access to any page of you website by the page URL as well as how to redirect user when access is denied;
47
  * [free] Manage access to RESTful or XML-RPC individual endpoints for any role, user or visitors.
48
  * [free] JWT authentication. Authenticate user with WordPress RESTful API and use received JWT token for further requests. Fid out more from [Hot to authenticate WordPress user with JWT token](https://aamplugin.com/help/how-to-authenticate-wordpress-user-with-jwt-token)
 
49
  * [free] Content Filter. Filter or replace parts of your content with AAM shortcodes. Find out more from [How to filter WordPress post content](https://aamplugin.com/help/how-to-filter-wordpress-post-content) article;
50
  * [free] Login/Logout Redirects. Define custom login and logout redirect for any user or role;
51
  * [free] 404 Redirect. Redefine where user should be redirected when page does not exist. Find out more from [How to redirect on WordPress 404 error](https://aamplugin.com/help/how-to-redirect-on-wordpress-404-error);
@@ -78,6 +79,10 @@ https://www.youtube.com/watch?v=mj5Xa_Wc16Y
78
 
79
  == Changelog ==
80
 
 
 
 
 
81
  = 5.8 =
82
  * Fixed the bug with Access Policy settings inheritance mechanism
83
  * Fixed numerous of bugs with JWT authentication and improved time expiration handling
3
  Tags: access control, membership, backend menu, user role, restricted content, security, jwt
4
  Requires at least: 4.0
5
  Tested up to: 5.0.3
6
+ Stable tag: 5.8.1
7
 
8
  All you need to manage access to you WordPress websites on frontend, backend and API levels for any role, user or visitors.
9
 
46
  * [limited] URI Access. Allow or deny access to any page of you website by the page URL as well as how to redirect user when access is denied;
47
  * [free] Manage access to RESTful or XML-RPC individual endpoints for any role, user or visitors.
48
  * [free] JWT authentication. Authenticate user with WordPress RESTful API and use received JWT token for further requests. Fid out more from [Hot to authenticate WordPress user with JWT token](https://aamplugin.com/help/how-to-authenticate-wordpress-user-with-jwt-token)
49
+ * [free] Login with URL. For more information check [WordPress: Temporary User Account, Login With URL & JWT Token](https://aamplugin.com/article/wordpress-temporary-user-account-login-with-url-jwt-token) article.
50
  * [free] Content Filter. Filter or replace parts of your content with AAM shortcodes. Find out more from [How to filter WordPress post content](https://aamplugin.com/help/how-to-filter-wordpress-post-content) article;
51
  * [free] Login/Logout Redirects. Define custom login and logout redirect for any user or role;
52
  * [free] 404 Redirect. Redefine where user should be redirected when page does not exist. Find out more from [How to redirect on WordPress 404 error](https://aamplugin.com/help/how-to-redirect-on-wordpress-404-error);
79
 
80
  == Changelog ==
81
 
82
+ = 5.8.1 =
83
+ * Fixed bug that causes fatal error with Policy editor on Linux servers
84
+ * Profiled and improved several bottlenecks that may speed-up website load up to 300 milliseconds
85
+
86
  = 5.8 =
87
  * Fixed the bug with Access Policy settings inheritance mechanism
88
  * Fixed numerous of bugs with JWT authentication and improved time expiration handling
vendor/autoload.php CHANGED
@@ -28,7 +28,7 @@ if (!class_exists('Composer\Semver')) {
28
  if (strpos($classname, 'Composer\Semver') === 0) {
29
  $normalized = str_replace(
30
  array('Composer\Semver', '\\'),
31
- array('Composer', '/'),
32
  $classname
33
  );
34
  $filename = __DIR__ . '/' . $normalized . '.php';
28
  if (strpos($classname, 'Composer\Semver') === 0) {
29
  $normalized = str_replace(
30
  array('Composer\Semver', '\\'),
31
+ array('composer', '/'),
32
  $classname
33
  );
34
  $filename = __DIR__ . '/' . $normalized . '.php';