Advanced Access Manager - Version 5.0.4

Version Description

  • Fixed bug with caching. Significantly improved speed.
  • Fixed incompatibility issue with websites that have corrupted role list.
  • Fixed bug with role expiration timer when "Manage Backend Access" option is off.
  • Fixed incompatibility issue with plugins that use "the_title" filter.
  • Fixed bug with extension status
  • Removed registration step during plugin activation.
Download this release

Release Info

Developer vasyl_m
Plugin Icon 128x128 Advanced Access Manager
Version 5.0.4
Comparing to
See all releases

Code changes from version 5.0.3 to 5.0.4

Application/Backend/Filter.php CHANGED
@@ -67,9 +67,6 @@ class AAM_Backend_Filter {
67
 
68
  add_action('pre_post_update', array($this, 'prePostUpdate'), 10, 2);
69
 
70
- //user profile update action
71
- add_action('profile_update', array($this, 'profileUpdate'), 10, 2);
72
-
73
  //user/role filters
74
  if (!is_multisite() || !is_super_admin()) {
75
  add_filter('editable_roles', array($this, 'filterRoles'));
@@ -396,36 +393,6 @@ class AAM_Backend_Filter {
396
  }
397
  }
398
 
399
- /**
400
- * Profile updated hook
401
- *
402
- * Adjust expiration time and user cache if profile updated
403
- *
404
- * @param int $id
405
- * @param WP_User $old
406
- *
407
- * @return void
408
- *
409
- * @access public
410
- */
411
- public function profileUpdate($id, $old) {
412
- $user = get_user_by('ID', $id);
413
-
414
- //role changed?
415
- if (implode('', $user->roles) != implode('', $old->roles)) {
416
- AAM_Core_Cache::clear($id);
417
-
418
- //check if role has expiration data set
419
- $role = (is_array($user->roles) ? $user->roles[0] : '');
420
- $expire = AAM_Core_API::getOption("aam-role-{$role}-expiration", '');
421
-
422
- if ($expire) {
423
- update_user_option($id, "aam-original-roles", $old->roles);
424
- update_user_option($id, "aam-role-expires", strtotime($expire));
425
- }
426
- }
427
- }
428
-
429
  /**
430
  * Filter roles
431
  *
@@ -438,9 +405,11 @@ class AAM_Backend_Filter {
438
 
439
  //filter roles
440
  foreach($roles as $id => $role) {
441
- $roleLevel = AAM_Core_API::maxLevel($role['capabilities']);
442
- if ($userLevel < $roleLevel) {
443
- unset($roles[$id]);
 
 
444
  }
445
  }
446
 
67
 
68
  add_action('pre_post_update', array($this, 'prePostUpdate'), 10, 2);
69
 
 
 
 
70
  //user/role filters
71
  if (!is_multisite() || !is_super_admin()) {
72
  add_filter('editable_roles', array($this, 'filterRoles'));
393
  }
394
  }
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  /**
397
  * Filter roles
398
  *
405
 
406
  //filter roles
407
  foreach($roles as $id => $role) {
408
+ if (!empty($role['capabilities']) && is_array($role['capabilities'])) {
409
+ $roleLevel = AAM_Core_API::maxLevel($role['capabilities']);
410
+ if ($userLevel < $roleLevel) {
411
+ unset($roles[$id]);
412
+ }
413
  }
414
  }
415
 
Application/Backend/Manager.php CHANGED
@@ -45,8 +45,11 @@ class AAM_Backend_Manager {
45
  //map AAM UI specific capabilities
46
  add_filter('map_meta_cap', array($this, 'mapMetaCap'), 10, 4);
47
 
 
 
 
48
  //post title decorator
49
- add_filter('the_title', array($this, 'theTitle'), 10, 2);
50
 
51
  //screen options & contextual help hooks
52
  add_filter('screen_options_show_screen', array($this, 'screenOptions'));
@@ -129,10 +132,44 @@ class AAM_Backend_Manager {
129
  }
130
 
131
  /**
 
132
  *
133
- * @param type $title
134
- * @param type $id
135
- * @return type
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  */
137
  public function theTitle($title, $id = null) {
138
  if (empty($title)) {
45
  //map AAM UI specific capabilities
46
  add_filter('map_meta_cap', array($this, 'mapMetaCap'), 10, 4);
47
 
48
+ //user profile update action
49
+ add_action('profile_update', array($this, 'profileUpdate'), 10, 2);
50
+
51
  //post title decorator
52
+ add_filter('the_title', array($this, 'theTitle'), 999, 2);
53
 
54
  //screen options & contextual help hooks
55
  add_filter('screen_options_show_screen', array($this, 'screenOptions'));
132
  }
133
 
134
  /**
135
+ * Profile updated hook
136
  *
137
+ * Adjust expiration time and user cache if profile updated
138
+ *
139
+ * @param int $id
140
+ * @param WP_User $old
141
+ *
142
+ * @return void
143
+ *
144
+ * @access public
145
+ */
146
+ public function profileUpdate($id, $old) {
147
+ $user = get_user_by('ID', $id);
148
+
149
+ //role changed?
150
+ if (implode('', $user->roles) != implode('', $old->roles)) {
151
+ AAM_Core_Cache::clear($id);
152
+
153
+ //check if role has expiration data set
154
+ $role = (is_array($user->roles) ? $user->roles[0] : '');
155
+ $expire = AAM_Core_API::getOption("aam-role-{$role}-expiration", '');
156
+
157
+ if ($expire) {
158
+ update_user_option($id, "aam-original-roles", $old->roles);
159
+ update_user_option($id, "aam-role-expires", strtotime($expire));
160
+ }
161
+ }
162
+ }
163
+
164
+ /**
165
+ * Filter post title
166
+ *
167
+ * @param string $title
168
+ * @param int $id
169
+ *
170
+ * @return string
171
+ *
172
+ * @access public
173
  */
174
  public function theTitle($title, $id = null) {
175
  if (empty($title)) {
Application/Core/Cache.php CHANGED
@@ -103,7 +103,7 @@ class AAM_Core_Cache {
103
  $wpdb->query($wpdb->prepare($query, $user, self::CACHE_OPTION));
104
  }
105
 
106
- self::$cache = false;
107
 
108
  //clear updated flag
109
  self::$updated = false;
@@ -135,7 +135,7 @@ class AAM_Core_Cache {
135
  */
136
  public static function bootstrap() {
137
  if (!AAM::isAAM()) {
138
- $cache = get_user_meta(AAM::getUser(), self::CACHE_OPTION, true);
139
  self::$cache = (is_array($cache) ? $cache : array());
140
 
141
  add_action('shutdown', 'AAM_Core_Cache::save');
103
  $wpdb->query($wpdb->prepare($query, $user, self::CACHE_OPTION));
104
  }
105
 
106
+ self::$cache = array();
107
 
108
  //clear updated flag
109
  self::$updated = false;
135
  */
136
  public static function bootstrap() {
137
  if (!AAM::isAAM()) {
138
+ $cache = get_user_meta(AAM::getUser()->ID, self::CACHE_OPTION, true);
139
  self::$cache = (is_array($cache) ? $cache : array());
140
 
141
  add_action('shutdown', 'AAM_Core_Cache::save');
Application/Core/Server.php CHANGED
@@ -36,8 +36,7 @@ final class AAM_Core_Server {
36
  $params = array(
37
  'domain' => parse_url(site_url(), PHP_URL_HOST),
38
  'version' => AAM_Core_API::version(),
39
- 'uid' => AAM_Core_API::getOption('aam-uid', null, 'site'),
40
- 'email' => AAM_Core_API::getOption('admin_email')
41
  );
42
 
43
  self::send('/register', $params);
36
  $params = array(
37
  'domain' => parse_url(site_url(), PHP_URL_HOST),
38
  'version' => AAM_Core_API::version(),
39
+ 'uid' => AAM_Core_API::getOption('aam-uid', null, 'site')
 
40
  );
41
 
42
  self::send('/register', $params);
Application/Extension/Repository.php CHANGED
@@ -277,8 +277,12 @@ class AAM_Extension_Repository {
277
  );
278
  }
279
  }
280
- } elseif ($status == AAM_Extension_Repository::STATUS_INSTALLED && !defined($id)) {
281
- $status = AAM_Extension_Repository::STATUS_DOWNLOAD;
 
 
 
 
282
  }
283
 
284
  return $status;
277
  );
278
  }
279
  }
280
+ } elseif ($status == AAM_Extension_Repository::STATUS_INSTALLED) {
281
+ if (!defined($id)) {
282
+ $status = AAM_Extension_Repository::STATUS_DOWNLOAD;
283
+ } elseif ($this->isOutdatedVersion($item, $retrieved, constant($id))) {
284
+ $status = AAM_Extension_Repository::STATUS_UPDATE;
285
+ }
286
  }
287
 
288
  return $status;
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.0.3
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
@@ -174,9 +174,6 @@ class AAM {
174
  } elseif (version_compare($wp_version, '3.8') == -1) {
175
  exit(__('WP 3.8 or higher is required.', AAM_KEY));
176
  }
177
-
178
- //register plugin
179
- AAM_Core_Server::register();
180
  }
181
 
182
  /**
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
+ Version: 5.0.4
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
174
  } elseif (version_compare($wp_version, '3.8') == -1) {
175
  exit(__('WP 3.8 or higher is required.', AAM_KEY));
176
  }
 
 
 
177
  }
178
 
179
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vasyltech
3
  Tags: access, role, user, capability, page access, post access, comments, security, login redirect, brute force attack, double authentication, membership, backend lockdown, wp-admin, 404, activity tracking
4
  Requires at least: 3.8
5
  Tested up to: 4.9.1
6
- Stable tag: 5.0.3
7
 
8
  The most powerful access management plugin for WordPress websites.
9
 
@@ -60,6 +60,14 @@ https://www.youtube.com/watch?v=yiOhjaacNJc
60
 
61
  == Changelog ==
62
 
 
 
 
 
 
 
 
 
63
  = 5.0.3 =
64
  * Fixed bug with LIST option
65
  * Fixed bug with incompatible PHP 5.3 or lower
3
  Tags: access, role, user, capability, page access, post access, comments, security, login redirect, brute force attack, double authentication, membership, backend lockdown, wp-admin, 404, activity tracking
4
  Requires at least: 3.8
5
  Tested up to: 4.9.1
6
+ Stable tag: 5.0.4
7
 
8
  The most powerful access management plugin for WordPress websites.
9
 
60
 
61
  == Changelog ==
62
 
63
+ = 5.0.4 =
64
+ * Fixed bug with caching. Significantly improved speed.
65
+ * Fixed incompatibility issue with websites that have corrupted role list.
66
+ * Fixed bug with role expiration timer when "Manage Backend Access" option is off.
67
+ * Fixed incompatibility issue with plugins that use "the_title" filter.
68
+ * Fixed bug with extension status
69
+ * Removed registration step during plugin activation.
70
+
71
  = 5.0.3 =
72
  * Fixed bug with LIST option
73
  * Fixed bug with incompatible PHP 5.3 or lower