Advanced Access Manager - Version 6.9.3

Version Description

  • Fixed: Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable... https://github.com/aamplugin/advanced-access-manager/issues/236
  • Fixed: Warning: Undefined variable $value in... https://github.com/aamplugin/advanced-access-manager/issues/235
  • Changed: Deprecating offering of some AAM premium add-ons https://github.com/aamplugin/advanced-access-manager/issues/237
Download this release

Release Info

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

Code changes from version 6.9.2 to 6.9.3

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.9.2
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.9.2');
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.9.3
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.9.3');
268
  define('AAM_BASEDIR', __DIR__);
269
 
270
  // Load vendor
application/Addon/Repository.php CHANGED
@@ -10,6 +10,7 @@
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
@@ -21,7 +22,7 @@
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
  {
@@ -35,42 +36,38 @@ class AAM_Addon_Repository
35
  */
36
  const DB_OPTION = 'aam_addons';
37
 
38
- /**
39
- * Collection of license violations
40
- *
41
- * @version 6.7.5
42
- */
43
- const DB_VIOLATION_OPTION = 'aam_violations';
44
-
45
  /**
46
  * Official list of available addons
47
  *
48
- * @version 6.7.5
 
 
 
49
  */
50
  const OFFICIAL_ADDON_LIST = array(
51
  'aam-plus-package' => array(
52
  'title' => 'Plus Package',
53
  'slug' => 'plus-package',
54
  'description' => 'Manage access to your WordPress website posts, pages, media, custom post types, categories, tags and custom taxonomies for any role, individual user, visitors or even define default access for everybody; and do this separately for frontend, backend or API levels.',
55
- 'version' => '5.4.2'
56
  ),
57
  'aam-ip-check' => array(
58
  'title' => 'IP Check',
59
  'slug' => 'ip-check',
60
  'description' => 'Manage access to your WordPress website by users IP address or referred host and completely lock down the entire website if necessary. Define the unlimited number of whitelisted or blacklisted IPs or hosts.',
61
- 'version' => '4.1.4'
62
  ),
63
  'aam-role-hierarchy' => array(
64
  'title' => 'Role Hierarchy',
65
  'slug' => 'role-hierarchy',
66
  'description' => 'Define and manage complex WordPress role hierarchy where all the access settings are propagated down the tree with the ability to override any settings for any specific role.',
67
- 'version' => '3.0.1'
68
  ),
69
  'aam-complete-package' => array(
70
  'title' => 'Complete Package',
71
  'slug' => 'complete-package',
72
- 'description' => 'Get the complete list of all premium AAM addons in one package and all future premium addons will be included for now additional cost.',
73
- 'version' => '5.2.8'
74
  ),
75
  );
76
 
@@ -90,85 +87,64 @@ class AAM_Addon_Repository
90
  }
91
 
92
  /**
93
- * Get license registry
94
- *
95
- * @param boolean $license_only
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
103
- * @since 6.0.5 Added the $license_only argument
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
  {
111
- static $registry = null;
112
-
113
- if (is_null($registry)) {
114
- $registry = array();
115
- $option = AAM_Core_API::getOption(
116
- self::DB_OPTION, array(), AAM_Core_API::getMainSiteId()
117
- );
118
-
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;
126
- }
127
 
128
- // Finally merge official addons with respective licenses
129
- if (!empty($option[$id])) {
130
- $registry[$id] = $option[$id];
131
- }
132
  }
133
  }
134
 
135
- return $registry;
136
  }
137
 
138
  /**
139
- * Get key/value pair of add-ons
 
 
140
  *
141
  * @return array
142
  *
 
 
 
 
 
 
 
 
143
  * @access public
144
- * @version 6.7.5
145
  */
146
- public function getAddonLicenseMap()
147
  {
148
  $response = array();
 
 
 
149
 
150
- foreach($this->getRegistry() as $id => $data) {
151
- $response[$id] = !empty($data['license']) ? $data['license'] : null;
 
 
 
 
152
  }
153
 
154
  return $response;
155
  }
156
 
157
- /**
158
- * Get list of violations
159
- *
160
- * @return array
161
- *
162
- * @access public
163
- * @version 6.7.5
164
- */
165
- public function getViolations()
166
- {
167
- return AAM_Core_API::getOption(
168
- self::DB_VIOLATION_OPTION, array(), AAM_Core_API::getMainSiteId()
169
- );
170
- }
171
-
172
  /**
173
  * Check if there is at least one license registered
174
  *
@@ -183,16 +159,18 @@ class AAM_Addon_Repository
183
  }
184
 
185
  /**
186
- * Check if there are any violations registered
187
  *
188
  * @return boolean
189
  *
190
  * @access public
191
- * @since 6.7.5
192
  */
193
- public function hasViolations()
194
  {
195
- return count($this->getViolations()) > 0;
 
 
196
  }
197
 
198
  /**
@@ -203,19 +181,21 @@ class AAM_Addon_Repository
203
  *
204
  * @return boolean
205
  *
 
206
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
207
- * @since 6.4.2 Fixed https://github.com/aamplugin/advanced-access-manager/issues/81
208
  * @since 6.0.5 Initial implementation of the method
209
  *
210
  * @access public
211
- * @version 6.7.5
 
212
  */
213
  public function registerLicense($package, $license)
214
  {
215
  $list = $this->getRegistry();
216
 
217
  $list[$package['slug']] = array(
218
- 'license' => $license, 'expire' => $package['expire']
219
  );
220
 
221
  // Update the registry
@@ -223,73 +203,21 @@ class AAM_Addon_Repository
223
  self::DB_OPTION, $list, AAM_Core_API::getMainSiteId()
224
  );
225
 
226
- // If there are any violations, clear them
227
- $this->removeViolation($package['slug']);
228
-
229
  return $result;
230
  }
231
 
232
- /**
233
- * Remove registered violation for a given addon
234
- *
235
- * @param string $addon
236
- *
237
- * @return void
238
- *
239
- * @access public
240
- * @version 6.7.5
241
- */
242
- public function removeViolation($addon)
243
- {
244
- $violations = $this->getViolations();
245
-
246
- if (isset($violations[$addon])) {
247
- unset($violations[$addon]);
248
-
249
- AAM_Core_API::updateOption(
250
- self::DB_VIOLATION_OPTION, $violations, AAM_Core_API::getMainSiteId()
251
- );
252
- }
253
- }
254
-
255
- /**
256
- * Register new license violation and process the action if defined
257
- *
258
- * @param string $addon
259
- * @param string $message
260
- * @param string $action
261
- *
262
- * @return void
263
- *
264
- * @access public
265
- * @version 6.7.5
266
- */
267
- public function processViolation($addon, $message, $action = null)
268
- {
269
- $violations = $this->getViolations();
270
- $violations[$addon] = $message;
271
-
272
- // Store the violation for the further displaying
273
- AAM_Core_API::updateOption(
274
- self::DB_VIOLATION_OPTION, $violations, AAM_Core_API::getMainSiteId()
275
- );
276
-
277
- if ($action === 'deactivate') {
278
- deactivate_plugins("{$addon}/bootstrap.php", true, is_network_admin());
279
- }
280
- }
281
-
282
  /**
283
  * Get list of all addons with detailed information about each
284
  *
285
  * @return array
286
  *
 
287
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
288
- * @since 6.4.2 Added https://github.com/aamplugin/advanced-access-manager/issues/88
289
  * @since 6.0.0 Initial implementation of the method
290
  *
291
  * @access public
292
- * @version 6.7.5
293
  */
294
  public function getList()
295
  {
@@ -299,8 +227,7 @@ class AAM_Addon_Repository
299
  $response[$id] = $this->buildAddonObject(
300
  $details['title'],
301
  $details['slug'],
302
- __($details['description'], AAM_KEY),
303
- $details['version']
304
  );
305
  }
306
 
@@ -313,34 +240,27 @@ class AAM_Addon_Repository
313
  * @param string $title
314
  * @param string $slug
315
  * @param string $description
316
- * @param string $version
317
  *
318
  * @return array
319
  *
320
- * @since 6.4.3 Fixed https://github.com/aamplugin/advanced-access-manager/issues/92
321
- * @since 6.4.2 Added https://github.com/aamplugin/advanced-access-manager/issues/88
 
322
  * @since 6.0.5 Added new `hasUpdate` flag
323
  * @since 6.0.0 Initial implementation of the method
324
  *
325
  * @access protected
326
- * @version 6.4.3
327
  */
328
- protected function buildAddonObject($title, $slug, $description, $version = null)
329
  {
330
  // Determining if there is newer version
331
- $current = $this->getPluginVersion("aam-{$slug}/bootstrap.php");
332
-
333
- if (!empty($current) && version_compare($current, $version) === -1) {
334
- $hasUpdate = true;
335
- } else {
336
- $hasUpdate = $this->hasPluginUpdate("aam-{$slug}/bootstrap.php");
337
- }
338
 
339
  return array(
340
  'title' => $title,
341
  'version' => $current,
342
- 'isActive' => $this->isPluginActive("aam-{$slug}/bootstrap.php"),
343
- 'expires' => $this->getExpirationDate("aam-{$slug}"),
344
  'hasUpdate' => $hasUpdate,
345
  'license' => $this->getPluginLicense("aam-{$slug}"),
346
  'type' => 'commercial',
@@ -412,51 +332,6 @@ class AAM_Addon_Repository
412
  return $data;
413
  }
414
 
415
- /**
416
- * Check if plugin is active
417
- *
418
- * @param string $plugin
419
- *
420
- * @return boolean
421
- *
422
- * @access protected
423
- * @version 6.0.0
424
- */
425
- protected function isPluginActive($plugin)
426
- {
427
- $data = $this->getPluginData($plugin);
428
-
429
- if (!empty($data)) {
430
- $active = is_plugin_active($plugin);
431
- } else {
432
- $active = false;
433
- }
434
-
435
- return $active;
436
- }
437
-
438
- /**
439
- * Get license expiration date
440
- *
441
- * @param string $plugin
442
- *
443
- * @return string|null
444
- *
445
- * @since 6.2.0 Fixed bug with PHP notice when `expire` is not defined
446
- * @since 6.0.0 Initial implementation of the method
447
- * @since 6.0.5 Fixed typo in the property name
448
- * @since 6.0.0 Initial implementation of the method
449
- *
450
- * @access protected
451
- * @version 6.2.0
452
- */
453
- protected function getExpirationDate($plugin)
454
- {
455
- $r = $this->getRegistry();
456
-
457
- return (isset($r[$plugin]['expire']) ? $r[$plugin]['expire'] : null);
458
- }
459
-
460
  /**
461
  * Get plugin license key
462
  *
10
  /**
11
  * Addon repository
12
  *
13
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/237
14
  * @since 6.7.6 https://github.com/aamplugin/advanced-access-manager/issues/177
15
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
16
  * @since 6.4.3 https://github.com/aamplugin/advanced-access-manager/issues/92
22
  * @since 6.0.0 Initial implementation of the class
23
  *
24
  * @package AAM
25
+ * @version 6.9.3
26
  */
27
  class AAM_Addon_Repository
28
  {
36
  */
37
  const DB_OPTION = 'aam_addons';
38
 
 
 
 
 
 
 
 
39
  /**
40
  * Official list of available addons
41
  *
42
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/237
43
+ * @since 6.7.5 Initial implementation of the constant
44
+ *
45
+ * @version 6.9.3
46
  */
47
  const OFFICIAL_ADDON_LIST = array(
48
  'aam-plus-package' => array(
49
  'title' => 'Plus Package',
50
  'slug' => 'plus-package',
51
  'description' => 'Manage access to your WordPress website posts, pages, media, custom post types, categories, tags and custom taxonomies for any role, individual user, visitors or even define default access for everybody; and do this separately for frontend, backend or API levels.',
52
+ 'version' => '5.4.7'
53
  ),
54
  'aam-ip-check' => array(
55
  'title' => 'IP Check',
56
  'slug' => 'ip-check',
57
  'description' => 'Manage access to your WordPress website by users IP address or referred host and completely lock down the entire website if necessary. Define the unlimited number of whitelisted or blacklisted IPs or hosts.',
58
+ 'version' => '4.1.8'
59
  ),
60
  'aam-role-hierarchy' => array(
61
  'title' => 'Role Hierarchy',
62
  'slug' => 'role-hierarchy',
63
  'description' => 'Define and manage complex WordPress role hierarchy where all the access settings are propagated down the tree with the ability to override any settings for any specific role.',
64
+ 'version' => '3.0.2'
65
  ),
66
  'aam-complete-package' => array(
67
  'title' => 'Complete Package',
68
  'slug' => 'complete-package',
69
+ 'description' => 'The complete list of all premium AAM features in one package. All the future features will be available for download for no additional cost as long as the subscription stays active.',
70
+ 'version' => '5.2.16'
71
  ),
72
  );
73
 
87
  }
88
 
89
  /**
90
+ * Get list of all registered licenses
 
 
91
  *
92
  * @return array
93
  *
 
 
 
 
 
 
 
94
  * @access public
95
+ *
96
+ * @version 6.9.3
97
  */
98
+ public function getRegisteredLicenseList()
99
  {
100
+ $response = array();
101
+ $registry = $this->getRegistry();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
+ foreach($registry as $v) {
104
+ if (isset($v['license'])) {
105
+ array_push($response, $v['license']);
 
106
  }
107
  }
108
 
109
+ return $response;
110
  }
111
 
112
  /**
113
+ * Get license registry
114
+ *
115
+ * @param boolean $license_only
116
  *
117
  * @return array
118
  *
119
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/237
120
+ * @since 6.7.6 https://github.com/aamplugin/advanced-access-manager/issues/177
121
+ * @since 6.4.2 https://github.com/aamplugin/advanced-access-manager/issues/81
122
+ * @since 6.3.0 Fixed bug that causes PHP Notice about license index is missing.
123
+ * Optimized for Multisite setup
124
+ * @since 6.0.5 Added the $license_only argument
125
+ * @since 6.0.0 Initial implementation of the method
126
+ *
127
  * @access public
128
+ * @version 6.9.3
129
  */
130
+ public function getRegistry()
131
  {
132
  $response = array();
133
+ $registry = AAM_Core_API::getOption(
134
+ self::DB_OPTION, array(), AAM_Core_API::getMainSiteId()
135
+ );
136
 
137
+ if (is_array($registry)) {
138
+ foreach($registry as $id => $data) {
139
+ if (!empty($data['license'])) {
140
+ $response[$id] = $data;
141
+ }
142
+ }
143
  }
144
 
145
  return $response;
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  /**
149
  * Check if there is at least one license registered
150
  *
159
  }
160
 
161
  /**
162
+ * Reset registry
163
  *
164
  * @return boolean
165
  *
166
  * @access public
167
+ * @version 6.9.3
168
  */
169
+ public function resetRegistry()
170
  {
171
+ return AAM_Core_API::deleteOption(
172
+ self::DB_OPTION, AAM_Core_API::getMainSiteId()
173
+ );
174
  }
175
 
176
  /**
181
  *
182
  * @return boolean
183
  *
184
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/237
185
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
186
+ * @since 6.4.2 https://github.com/aamplugin/advanced-access-manager/issues/81
187
  * @since 6.0.5 Initial implementation of the method
188
  *
189
  * @access public
190
+ *
191
+ * @version 6.9.3
192
  */
193
  public function registerLicense($package, $license)
194
  {
195
  $list = $this->getRegistry();
196
 
197
  $list[$package['slug']] = array(
198
+ 'license' => $license
199
  );
200
 
201
  // Update the registry
203
  self::DB_OPTION, $list, AAM_Core_API::getMainSiteId()
204
  );
205
 
 
 
 
206
  return $result;
207
  }
208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  /**
210
  * Get list of all addons with detailed information about each
211
  *
212
  * @return array
213
  *
214
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/237
215
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
216
+ * @since 6.4.2 https://github.com/aamplugin/advanced-access-manager/issues/88
217
  * @since 6.0.0 Initial implementation of the method
218
  *
219
  * @access public
220
+ * @version 6.9.3
221
  */
222
  public function getList()
223
  {
227
  $response[$id] = $this->buildAddonObject(
228
  $details['title'],
229
  $details['slug'],
230
+ __($details['description'], AAM_KEY)
 
231
  );
232
  }
233
 
240
  * @param string $title
241
  * @param string $slug
242
  * @param string $description
 
243
  *
244
  * @return array
245
  *
246
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/237
247
+ * @since 6.4.3 https://github.com/aamplugin/advanced-access-manager/issues/92
248
+ * @since 6.4.2 https://github.com/aamplugin/advanced-access-manager/issues/88
249
  * @since 6.0.5 Added new `hasUpdate` flag
250
  * @since 6.0.0 Initial implementation of the method
251
  *
252
  * @access protected
253
+ * @version 6.9.3
254
  */
255
+ protected function buildAddonObject($title, $slug, $description)
256
  {
257
  // Determining if there is newer version
258
+ $current = $this->getPluginVersion("aam-{$slug}/bootstrap.php");
259
+ $hasUpdate = $this->hasPluginUpdate("aam-{$slug}/bootstrap.php");
 
 
 
 
 
260
 
261
  return array(
262
  'title' => $title,
263
  'version' => $current,
 
 
264
  'hasUpdate' => $hasUpdate,
265
  'license' => $this->getPluginLicense("aam-{$slug}"),
266
  'type' => 'commercial',
332
  return $data;
333
  }
334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  /**
336
  * Get plugin license key
337
  *
application/Backend/Feature/Addons/Manager.php CHANGED
@@ -10,11 +10,12 @@
10
  /**
11
  * Add-on manager
12
  *
 
13
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
14
  * @since 6.0.5 Initial implementation of the class
15
  *
16
  * @package AAM
17
- * @version 6.7.5
18
  */
19
  class AAM_Backend_Feature_Addons_Manager extends AAM_Backend_Feature_Abstract
20
  {
@@ -49,6 +50,21 @@ class AAM_Backend_Feature_Addons_Manager extends AAM_Backend_Feature_Abstract
49
  return wp_json_encode(array('status' => ($result ? 'success' : 'failure')));
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * Get internal registry of add-ons
54
  *
@@ -65,7 +81,7 @@ class AAM_Backend_Feature_Addons_Manager extends AAM_Backend_Feature_Abstract
65
  public function getRegistry()
66
  {
67
  return wp_json_encode(
68
- AAM_Addon_Repository::getInstance()->getAddonLicenseMap()
69
  );
70
  }
71
 
@@ -74,11 +90,12 @@ class AAM_Backend_Feature_Addons_Manager extends AAM_Backend_Feature_Abstract
74
  *
75
  * @return string
76
  *
 
77
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
78
  * @since 6.0.5 Initial implementation of the method
79
  *
80
  * @access public
81
- * @version 6.7.5
82
  */
83
  public function checkForPluginUpdates()
84
  {
@@ -94,14 +111,6 @@ class AAM_Backend_Feature_Addons_Manager extends AAM_Backend_Feature_Abstract
94
  $current->response[$data->plugin] = $data;
95
  unset($current->no_update[$data->plugin]);
96
  }
97
-
98
- if (!empty($data->violation)) {
99
- AAM_Addon_Repository::getInstance()->processViolation(
100
- $data->slug,
101
- $data->violation,
102
- (isset($data->action) ? $data->action : null)
103
- );
104
- }
105
  }
106
  }
107
 
10
  /**
11
  * Add-on manager
12
  *
13
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/236
14
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
15
  * @since 6.0.5 Initial implementation of the class
16
  *
17
  * @package AAM
18
+ * @version 6.9.3
19
  */
20
  class AAM_Backend_Feature_Addons_Manager extends AAM_Backend_Feature_Abstract
21
  {
50
  return wp_json_encode(array('status' => ($result ? 'success' : 'failure')));
51
  }
52
 
53
+ /**
54
+ * Reset registry
55
+ *
56
+ * @return string
57
+ *
58
+ * @access public
59
+ * @version 6.9.3
60
+ */
61
+ public function clearLicenses()
62
+ {
63
+ $result = AAM_Addon_Repository::getInstance()->resetRegistry();
64
+
65
+ return wp_json_encode(array('status' => ($result ? 'success' : 'failure')));
66
+ }
67
+
68
  /**
69
  * Get internal registry of add-ons
70
  *
81
  public function getRegistry()
82
  {
83
  return wp_json_encode(
84
+ AAM_Addon_Repository::getInstance()->getRegisteredLicenseList()
85
  );
86
  }
87
 
90
  *
91
  * @return string
92
  *
93
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/236
94
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
95
  * @since 6.0.5 Initial implementation of the method
96
  *
97
  * @access public
98
+ * @version 6.9.3
99
  */
100
  public function checkForPluginUpdates()
101
  {
111
  $current->response[$data->plugin] = $data;
112
  unset($current->no_update[$data->plugin]);
113
  }
 
 
 
 
 
 
 
 
114
  }
115
  }
116
 
application/Backend/Manager.php CHANGED
@@ -83,7 +83,6 @@ class AAM_Backend_Manager
83
  // Check for pending migration scripts
84
  if (current_user_can('update_plugins')) {
85
  $this->checkMigrationStatus();
86
- $this->checkAddonUpdates();
87
  }
88
 
89
  add_action( 'admin_enqueue_scripts', function() {
@@ -150,31 +149,6 @@ class AAM_Backend_Manager
150
  }
151
  }
152
 
153
- /**
154
- * Display notification if new version is available
155
- *
156
- * @return void
157
- *
158
- * @access protected
159
- * @version 6.4.2
160
- */
161
- protected function checkAddonUpdates()
162
- {
163
- $list = AAM_Addon_Repository::getInstance()->getList();
164
-
165
- foreach($list as $addon) {
166
- if ($addon['hasUpdate'] === true) {
167
- AAM_Core_Console::add(
168
- sprintf(
169
- 'The new version of ["%s"] is available for download.',
170
- $addon['title']
171
- ),
172
- 'strong'
173
- );
174
- }
175
- }
176
- }
177
-
178
  /**
179
  * Print all the necessary JS assets for the AAM UI
180
  *
83
  // Check for pending migration scripts
84
  if (current_user_can('update_plugins')) {
85
  $this->checkMigrationStatus();
 
86
  }
87
 
88
  add_action( 'admin_enqueue_scripts', function() {
149
  }
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  /**
153
  * Print all the necessary JS assets for the AAM UI
154
  *
application/Backend/tmpl/metabox/main-iframe.php CHANGED
@@ -163,16 +163,64 @@
163
  </div>
164
  <?php } ?>
165
 
166
- <div class="metabox-holder extensions-metabox" style="display:none;">
167
- <div class="postbox">
168
- <div class="inside">
169
- <div class="aam-postbox-inside text-center">
170
- <p class="alert alert-info text-larger highlighted-italic"><?php echo AAM_Backend_View_Helper::preparePhrase('With the [Enterprise Package] get dedicated support channel and all the premium add-ons for a [bulk number of live websites]', 'i', 'b'); ?></p>
171
- <a href="https://aamplugin.com/pricing/enterprise-package" target="_blank" class="btn btn-sm btn-primary btn-block"><i class="icon-link"></i> <?php echo __('Read More', AAM_KEY); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  </div>
173
  </div>
174
  </div>
175
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
 
177
  <?php echo static::loadTemplate(dirname(__DIR__) . '/page/subject-panel.php'); ?>
178
  <?php echo static::loadTemplate(dirname(__DIR__) . '/page/subject-panel-advanced.php'); ?>
163
  </div>
164
  <?php } ?>
165
 
166
+ <?php $licenses = AAM_Addon_Repository::getInstance()->getRegisteredLicenseList(); ?>
167
+
168
+ <?php if (count($licenses) > 0) { ?>
169
+ <div class="metabox-holder extensions-metabox" style="display:none;">
170
+ <div class="postbox">
171
+ <div class="inside">
172
+ <div class="aam-postbox-inside text-center">
173
+ <table class="table table-striped table-bordered dataTable no-footer">
174
+ <thead>
175
+ <tr>
176
+ <th><?php echo __('Registered Licenses', AAM_KEY); ?></th>
177
+ </tr>
178
+ </thead>
179
+ <tbody>
180
+ <?php foreach (AAM_Addon_Repository::getInstance()->getRegisteredLicenseList() as $i => $licenseId) { ?>
181
+ <tr class="<?php echo ($i % 2 === 0 ? 'odd' : 'even'); ?>">
182
+ <td>
183
+ <a href="https://aamplugin.com/license/<?php echo esc_attr($licenseId); ?>" target="_blank" class="aam-license-key"><?php echo esc_js($licenseId); ?></a>
184
+ </td>
185
+ </tr>
186
+ <?php } ?>
187
+ </tbody>
188
+ <tfoot>
189
+ <tr>
190
+ <td>
191
+ <p class="alert alert-info text-left">
192
+ <strong>NOTE!</strong> <?php echo __('Any listed license above only indicates that you used them on this website to download premium AAM add-ons. It does not mean that AAM add-ons are installed and/or active on your website. You can confirm that the premium add-on is active on the Plugins page. ', AAM_KEY); ?>
193
+ </p>
194
+ </td>
195
+ </tr>
196
+ </tfoot>
197
+ </table>
198
+ <a href="#clear-licenses-modal" data-toggle="modal" class="btn btn-danger btn-block"><?php echo __('Clear All Licenses', AAM_KEY); ?></a>
199
+ </div>
200
  </div>
201
  </div>
202
  </div>
203
+
204
+ <div class="modal fade" id="clear-licenses-modal" tabindex="-1" role="dialog">
205
+ <div class="modal-dialog" role="document">
206
+ <div class="modal-content">
207
+ <div class="modal-header">
208
+ <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">&times;</span></button>
209
+ <h4 class="modal-title"><?php echo __('Clear all licenses', AAM_KEY); ?></h4>
210
+ </div>
211
+ <div class="modal-body">
212
+ <p class="text-left alert alert-danger text-larger">
213
+ <?php echo __('You are about to clear all registered licenses on this WordPress instance. Please confirm this operation.', AAM_KEY); ?>
214
+ </p>
215
+ </div>
216
+ <div class="modal-footer">
217
+ <button type="button" class="btn btn-danger" id="clear-licenses"><?php echo __('Clear', AAM_KEY); ?></button>
218
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Cancel', AAM_KEY); ?></button>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ <?php } ?>
224
 
225
  <?php echo static::loadTemplate(dirname(__DIR__) . '/page/subject-panel.php'); ?>
226
  <?php echo static::loadTemplate(dirname(__DIR__) . '/page/subject-panel-advanced.php'); ?>
application/Backend/tmpl/page/addon-panel.php CHANGED
@@ -15,14 +15,6 @@
15
 
16
  <?php if (defined('AAM_KEY')) { ?>
17
  <div id="extension-content" class="extension-container">
18
- <div class="row">
19
- <div class="col-xs-12">
20
- <p class="aam-info">
21
- <?php echo AAM_Backend_View_Helper::preparePhrase('By purchasing any of the premium addon(s) below, you obtain the license that allows you to install and use AAM software for one physical WordPress installation only. Exceptions are websites where URL is either [localhost] or starts with [dev.], [staging.], [test.] or [demo.] They are considered as development websites and you can use the purchased license unlimited number of times before it is activated on a production website. [Money back guaranteed] within 30 day from the time of purchase.', 'i', 'i', 'i', 'i', 'i', 'i', 'b'); ?><br />
22
- </p>
23
- </div>
24
- </div>
25
-
26
  <label for="extension-key"><?php echo __('License Key', AAM_KEY); ?> <a href="#license-key-info-modal" data-toggle="modal"><i class="icon-help-circled"></i></a></label>
27
  <div class="row">
28
  <div class="col-xs-6">
@@ -33,17 +25,6 @@
33
  <div class="col-xs-3">
34
  <button class="btn btn-primary btn-block" id="download-extension"><i class="icon-download-cloud"></i> <?php echo __('Download Addon', AAM_KEY); ?></button>
35
  </div>
36
- <div class="col-xs-3">
37
- <div class="btn-group">
38
- <button type="button" class="btn btn-success btn-block dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
39
- <?php echo __('Register Website As', AAM_KEY); ?> <span class="caret"></span>
40
- </button>
41
- <ul class="dropdown-menu">
42
- <li><a href="#" class="register-license" data-type="dev"><?php echo __('Development Site', AAM_KEY); ?></a></li>
43
- <li><a href="#" class="register-license" data-type="prod"><?php echo __('Live Site', AAM_KEY); ?></a></li>
44
- </ul>
45
- </div>
46
- </div>
47
  </div>
48
 
49
  <?php $commercial = AAM_Addon_Repository::getInstance()->getList(); ?>
@@ -63,25 +44,12 @@
63
  <tr>
64
  <td width="80%">
65
  <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['tag']) ? '<sup><span class="badge sup">' . $product['tag'] . '</span></sup>' : ''), (!empty($product['version']) ? ' <small class="text-muted">' . $product['version'] . '</small>' : ''); ?></span>
66
- <?php if (!empty($product['license'])) { ?>
67
- <small class="aam-license-key"><b><?php echo __('License', AAM_KEY); ?>:</b> <a href="https://aamplugin.com/license/<?php echo $product['license']; ?>" target="_blank"><?php echo $product['license']; ?></a></small>
68
- <?php } elseif (!empty($product['version'])) { ?>
69
- <small class="aam-license-key"><b><?php echo __('License', AAM_KEY); ?>:</b> <span class="text-danger"><?php echo __('unregistered version', AAM_KEY); ?></span></small>
70
- <?php } ?>
71
  <p class="aam-extension-description">
72
  <?php echo $product['description']; ?>
73
  </p>
74
  </td>
75
  <td class="text-center">
76
- <?php if (!empty($product['hasUpdate'])) { ?>
77
- <a href="#" class="btn btn-sm btn-warning btn-block disabled"><i class="icon-attention-circled"></i> <?php echo __('Update Available', AAM_KEY); ?></a>
78
- <?php } elseif (!empty($product['isActive'])) { ?>
79
- <a href="#" class="btn btn-sm btn-success btn-block disabled"><i class="icon-check"></i> <?php echo __('Active', AAM_KEY); ?></a>
80
- <?php } elseif (!empty($product['version'])) { ?>
81
- <a href="#" class="btn btn-sm btn-info btn-block disabled"><i class="icon-info-circled"></i> <?php echo __('Inactive', AAM_KEY); ?></a>
82
- <?php } else { ?>
83
- <a href="<?php echo $product['url']; ?>" target="_blank" class="btn btn-sm btn-primary btn-block"><i class="icon-link"></i> <?php echo __('Read More', AAM_KEY); ?></a>
84
- <?php } ?>
85
  </td>
86
  </tr>
87
  <?php } ?>
@@ -146,8 +114,8 @@
146
  <h4 class="modal-title"><?php echo __('Plugin Installation', AAM_KEY); ?></h4>
147
  </div>
148
  <div class="modal-body">
149
- <p class="alert alert-success text-center">
150
- <?php echo __('The plugin has been successfully downloaded from our server.', AAM_KEY); ?>
151
  </p>
152
 
153
  <p class="aam-info aam-outer-top-xs">
15
 
16
  <?php if (defined('AAM_KEY')) { ?>
17
  <div id="extension-content" class="extension-container">
 
 
 
 
 
 
 
 
18
  <label for="extension-key"><?php echo __('License Key', AAM_KEY); ?> <a href="#license-key-info-modal" data-toggle="modal"><i class="icon-help-circled"></i></a></label>
19
  <div class="row">
20
  <div class="col-xs-6">
25
  <div class="col-xs-3">
26
  <button class="btn btn-primary btn-block" id="download-extension"><i class="icon-download-cloud"></i> <?php echo __('Download Addon', AAM_KEY); ?></button>
27
  </div>
 
 
 
 
 
 
 
 
 
 
 
28
  </div>
29
 
30
  <?php $commercial = AAM_Addon_Repository::getInstance()->getList(); ?>
44
  <tr>
45
  <td width="80%">
46
  <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['tag']) ? '<sup><span class="badge sup">' . $product['tag'] . '</span></sup>' : ''), (!empty($product['version']) ? ' <small class="text-muted">' . $product['version'] . '</small>' : ''); ?></span>
 
 
 
 
 
47
  <p class="aam-extension-description">
48
  <?php echo $product['description']; ?>
49
  </p>
50
  </td>
51
  <td class="text-center">
52
+ <a href="<?php echo $product['url']; ?>" target="_blank" class="btn btn-sm btn-primary btn-block"><i class="icon-link"></i> <?php echo __('Read More', AAM_KEY); ?></a>
 
 
 
 
 
 
 
 
53
  </td>
54
  </tr>
55
  <?php } ?>
114
  <h4 class="modal-title"><?php echo __('Plugin Installation', AAM_KEY); ?></h4>
115
  </div>
116
  <div class="modal-body">
117
+ <p class="alert alert-warning text-center">
118
+ <?php echo AAM_Backend_View_Helper::preparePhrase('[NOTE!] There are still a couple steps that you need to do to install the plugin.', 'strong'); ?>
119
  </p>
120
 
121
  <p class="aam-info aam-outer-top-xs">
application/Backend/tmpl/partial/license-violation-notice.php DELETED
@@ -1,15 +0,0 @@
1
- <?php /** @version 6.7.5 */ ?>
2
-
3
- <?php if (defined('AAM_KEY')) { ?>
4
- <?php $violations = AAM_Addon_Repository::getInstance()->getViolations(); ?>
5
- <div class="notice notice-warning is-dismissible">
6
- <p>
7
- <?php if (count($violations) === 1) { ?>
8
- <?php echo __('There is an issue with one Advanced Access Manager premium license.', AAM_KEY); ?>
9
- <?php } else { ?>
10
- <?php echo __('There are multiple issues with Advanced Access Manager premium licenses.', AAM_KEY); ?>
11
- <?php } ?>
12
- <?php echo sprintf(__('For more information, please follow %sthe link%s.', AAM_KEY), '<a href="' . admin_url('admin.php?page=aam') . '">', '</a>'); ?>
13
- </p>
14
- </div>
15
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
application/Backend/tmpl/partial/posts-terms-help-tips.php CHANGED
@@ -4,7 +4,7 @@
4
  <div class="row">
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
- <?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('You are allowed to manage access to unlimited number of posts, pages or custom post types but only for any role, user or visitor. Consider to get %s[Plus Package]%s add-on to have the ability to manage access to categories and custom taxonomies or to define the default access to all posts, pages or custom post types. For more information about this functionality check %sHow to manage access to the WordPress content%s.', 'b'), '<a href="https://aamplugin.com/pricing/plus-package" target="_blank">', '</a>', '<a href="https://aamplugin.com/article/manage-access-to-the-wordpress-posts-and-terms" target="_blank">', '</a>'); ?>
8
  </p>
9
  </div>
10
  </div>
4
  <div class="row">
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
+ <?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('You are allowed to manage access to unlimited number of posts, pages or custom post types but only for any role, user or visitor. Consider to get %s[Complete Package]%s add-on to have the ability to manage access to categories and custom taxonomies or to define the default access to all posts, pages or custom post types. For more information about this functionality check %sHow to manage access to the WordPress content%s.', 'b'), '<a href="https://aamplugin.com/pricing/plus-package" target="_blank">', '</a>', '<a href="https://aamplugin.com/article/manage-access-to-the-wordpress-posts-and-terms" target="_blank">', '</a>'); ?>
8
  </p>
9
  </div>
10
  </div>
application/Backend/tmpl/partial/taxonomy-access-form.php CHANGED
@@ -5,7 +5,7 @@
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
  <?php echo sprintf(
8
- AAM_Backend_View_Helper::preparePhrase('Managing access to the taxonomy "%s" is available with the premium %s[Plus Package]%s add-on only. It also allows to define the default access to all terms that are associated with this taxonomy. Consider to purchase Plus Package add-on.', 'b'),
9
  $params->taxonomy->labels->name,
10
  '<a href="https://aamplugin.com/pricing/plus-package">',
11
  '</a>'
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
  <?php echo sprintf(
8
+ AAM_Backend_View_Helper::preparePhrase('Managing access to the taxonomy "%s" is available with the premium %s[Complete Package]%s add-on only. It also allows to define the default access to all terms that are associated with this taxonomy. Consider to purchase Complete Package add-on.', 'b'),
9
  $params->taxonomy->labels->name,
10
  '<a href="https://aamplugin.com/pricing/plus-package">',
11
  '</a>'
application/Backend/tmpl/partial/term-access-form.php CHANGED
@@ -5,7 +5,7 @@
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
  <?php echo sprintf(
8
- AAM_Backend_View_Helper::preparePhrase('Managing access to the %s "%s" is available with the premium %s[Plus Package]%s add-on only. It also allows to define default access to all child posts that are related to the %s "%s". Consider to purchase Plus Package add-on.', 'b'),
9
  is_taxonomy_hierarchical($params->term->taxonomy) ? __('category', AAM_KEY) : __('tag', AAM_KEY),
10
  $params->term->name,
11
  '<a href="https://aamplugin.com/pricing/plus-package">',
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
  <?php echo sprintf(
8
+ AAM_Backend_View_Helper::preparePhrase('Managing access to the %s "%s" is available with the premium %s[Complete Package]%s add-on only. It also allows to define default access to all child posts that are related to the %s "%s". Consider to purchase Complete Package add-on.', 'b'),
9
  is_taxonomy_hierarchical($params->term->taxonomy) ? __('category', AAM_KEY) : __('tag', AAM_KEY),
10
  $params->term->name,
11
  '<a href="https://aamplugin.com/pricing/plus-package">',
application/Backend/tmpl/partial/type-access-form.php CHANGED
@@ -5,7 +5,7 @@
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
  <?php echo sprintf(
8
- AAM_Backend_View_Helper::preparePhrase('Manage default access to all posts that belong to the post type %s. This feature is available only with the premium %s[Plus Package]%s add-on.', 'b', 'b'),
9
  $params->postType->label,
10
  '<a href="https://aamplugin.com/pricing/plus-package">',
11
  '</a>'
5
  <div class="col-xs-12">
6
  <p class="aam-notification">
7
  <?php echo sprintf(
8
+ AAM_Backend_View_Helper::preparePhrase('Manage default access to all posts that belong to the post type %s. This feature is available only with the premium %s[Complete Package]%s add-on.', 'b', 'b'),
9
  $params->postType->label,
10
  '<a href="https://aamplugin.com/pricing/plus-package">',
11
  '</a>'
application/Backend/tmpl/service/uri.php CHANGED
@@ -28,7 +28,7 @@
28
  </div>
29
  <div class="modal-body">
30
  <div class="form-group">
31
- <label><?php echo AAM_Backend_View_Helper::preparePhrase('Enter URL [(wildcard * is available with Plus Package extension)]', 'small'); ?></label>
32
  <input type="text" class="form-control form-clearable" id="uri-rule" placeholder="Enter valid URL" />
33
  </div>
34
 
28
  </div>
29
  <div class="modal-body">
30
  <div class="form-group">
31
+ <label><?php echo AAM_Backend_View_Helper::preparePhrase('Enter URL [(wildcard * is available with Complete Package add-on)]', 'small'); ?></label>
32
  <input type="text" class="form-control form-clearable" id="uri-rule" placeholder="Enter valid URL" />
33
  </div>
34
 
application/Core/Object/Visibility.php CHANGED
@@ -83,7 +83,7 @@ class AAM_Core_Object_Visibility extends AAM_Core_Object
83
  }
84
 
85
  // Initialize post visibility option. This hooks is used by Access Policy
86
- // service as well as Plus Package to populate visibility list
87
  do_action('aam_visibility_object_init_action', $this);
88
  }
89
 
83
  }
84
 
85
  // Initialize post visibility option. This hooks is used by Access Policy
86
+ // service as well as Complete Package to populate visibility list
87
  do_action('aam_visibility_object_init_action', $this);
88
  }
89
 
application/Core/Policy/Token.php CHANGED
@@ -10,6 +10,7 @@
10
  /**
11
  * AAM core policy token evaluator
12
  *
 
13
  * @since 6.8.3 https://github.com/aamplugin/advanced-access-manager/issues/205
14
  * @since 6.3.0 Fixed bug that was causing fatal error policies that have conditions
15
  * defined for Capability & Role resources
@@ -20,7 +21,7 @@
20
  * @since 6.0.0 Initial implementation of the class
21
  *
22
  * @package AAM
23
- * @version 6.8.3
24
  */
25
  class AAM_Core_Policy_Token
26
  {
@@ -256,16 +257,18 @@ class AAM_Core_Policy_Token
256
  *
257
  * @return mixed
258
  *
 
259
  * @since 6.3.0 Fixed bug that caused "Fatal error: Allowed memory size of XXX
260
  * bytes exhausted"
261
  * @since 6.0.0 Initial implementation of the method
262
  *
263
  * @access protected
264
- * @version 6.3.0
265
  */
266
  protected static function getUserValue($prop)
267
  {
268
- $user = wp_get_current_user();
 
269
 
270
  switch (strtolower($prop)) {
271
  case 'ip':
10
  /**
11
  * AAM core policy token evaluator
12
  *
13
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/235
14
  * @since 6.8.3 https://github.com/aamplugin/advanced-access-manager/issues/205
15
  * @since 6.3.0 Fixed bug that was causing fatal error policies that have conditions
16
  * defined for Capability & Role resources
21
  * @since 6.0.0 Initial implementation of the class
22
  *
23
  * @package AAM
24
+ * @version 6.9.3
25
  */
26
  class AAM_Core_Policy_Token
27
  {
257
  *
258
  * @return mixed
259
  *
260
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/235
261
  * @since 6.3.0 Fixed bug that caused "Fatal error: Allowed memory size of XXX
262
  * bytes exhausted"
263
  * @since 6.0.0 Initial implementation of the method
264
  *
265
  * @access protected
266
+ * @version 6.9.3
267
  */
268
  protected static function getUserValue($prop)
269
  {
270
+ $value = null;
271
+ $user = wp_get_current_user();
272
 
273
  switch (strtolower($prop)) {
274
  case 'ip':
application/Migration/2019_06_30-base.php CHANGED
@@ -81,11 +81,10 @@ class Migration600 implements AAM_Core_Contract_MigrationInterface
81
  'loginredirect' => array($this, '_convertAsIs'),
82
  'logoutredirect' => array($this, '_convertAsIs'),
83
  'policy' => array($this, '_convertAsIs'),
84
- // Plus Package related object
85
  'term' => array($this, '_convertTermOptions'),
86
  'type' => array($this, '_convertTypeOptions'),
87
  'taxonomy' => array($this, '_convertTaxonomyOptions'),
88
- // IP Check related object
89
  'ipCheck' => array($this, '_convertIPCheckOptions')
90
  );
91
  }
81
  'loginredirect' => array($this, '_convertAsIs'),
82
  'logoutredirect' => array($this, '_convertAsIs'),
83
  'policy' => array($this, '_convertAsIs'),
84
+ // Complete Package related object
85
  'term' => array($this, '_convertTermOptions'),
86
  'type' => array($this, '_convertTypeOptions'),
87
  'taxonomy' => array($this, '_convertTaxonomyOptions'),
 
88
  'ipCheck' => array($this, '_convertIPCheckOptions')
89
  );
90
  }
application/Migration/2121_10_15-base.php CHANGED
@@ -17,10 +17,11 @@ use AAM_Core_Migration,
17
  *
18
  * @package AAM
19
  *
 
20
  * @since 6.8.1 https://github.com/aamplugin/advanced-access-manager/issues/198
21
  * @since 6.8.0 Initial implementation of the class
22
  *
23
- * @version 6.8.1
24
  */
25
  class Migration680 implements AAM_Core_Contract_MigrationInterface
26
  {
@@ -28,17 +29,14 @@ class Migration680 implements AAM_Core_Contract_MigrationInterface
28
  /**
29
  * @inheritdoc
30
  *
 
31
  * @since 6.8.1 https://github.com/aamplugin/advanced-access-manager/issues/198
32
  * @since 6.8.0 Initial implementation of the method
33
  *
34
- * @version 6.8.1
35
  */
36
  public function run()
37
  {
38
- if (defined('\AAM_Addon_Repository::DB_VIOLATION_OPTION')) {
39
- \AAM_Core_API::deleteOption(\AAM_Addon_Repository::DB_VIOLATION_OPTION);
40
- }
41
-
42
  // Finally store this script as completed
43
  AAM_Core_Migration::storeCompletedScript(basename(__FILE__));
44
 
17
  *
18
  * @package AAM
19
  *
20
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/236
21
  * @since 6.8.1 https://github.com/aamplugin/advanced-access-manager/issues/198
22
  * @since 6.8.0 Initial implementation of the class
23
  *
24
+ * @version 6.9.3
25
  */
26
  class Migration680 implements AAM_Core_Contract_MigrationInterface
27
  {
29
  /**
30
  * @inheritdoc
31
  *
32
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/236
33
  * @since 6.8.1 https://github.com/aamplugin/advanced-access-manager/issues/198
34
  * @since 6.8.0 Initial implementation of the method
35
  *
36
+ * @version 6.9.3
37
  */
38
  public function run()
39
  {
 
 
 
 
40
  // Finally store this script as completed
41
  AAM_Core_Migration::storeCompletedScript(basename(__FILE__));
42
 
application/Service/AccessPolicy.php CHANGED
@@ -522,7 +522,7 @@ class AAM_Service_AccessPolicy
522
  $effect = (strtolower($stm['Effect']) === 'allow' ? false : true);
523
 
524
  // Allow other plugins to determine what access options should be
525
- // considered during visibility check. For example Plus Package uses
526
  // HIDDEN TO OTHERS options
527
  $map = apply_filters('aam_policy_post_visibility_map_filter', array(
528
  'list' => 'hidden'
522
  $effect = (strtolower($stm['Effect']) === 'allow' ? false : true);
523
 
524
  // Allow other plugins to determine what access options should be
525
+ // considered during visibility check. For example Complete Package uses
526
  // HIDDEN TO OTHERS options
527
  $map = apply_filters('aam_policy_post_visibility_map_filter', array(
528
  'list' => 'hidden'
application/Service/Core.php CHANGED
@@ -10,6 +10,7 @@
10
  /**
11
  * AAM core service
12
  *
 
13
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
14
  * @since 6.5.3 https://github.com/aamplugin/advanced-access-manager/issues/126
15
  * @since 6.4.2 Fixed https://github.com/aamplugin/advanced-access-manager/issues/82
@@ -19,7 +20,7 @@
19
  * @since 6.0.0 Initial implementation of the class
20
  *
21
  * @package AAM
22
- * @version 6.7.5
23
  */
24
  class AAM_Service_Core
25
  {
@@ -38,7 +39,8 @@ class AAM_Service_Core
38
  *
39
  * @access protected
40
  *
41
- * @since 6.4.2 Fixed https://github.com/aamplugin/advanced-access-manager/issues/82
 
42
  * @since 6.4.0 Added "Manage Access" toolbar item
43
  * @since 6.0.5 Fixed bug when Access Manager metabox is rendered for users that
44
  * have ability to manage other users
@@ -47,7 +49,7 @@ class AAM_Service_Core
47
  * @since 6.0.0 Initial implementation of the method
48
  *
49
  * @return void
50
- * @version 6.4.2
51
  */
52
  protected function __construct()
53
  {
@@ -135,23 +137,6 @@ class AAM_Service_Core
135
  add_action('aam_set_user_expiration_action', function($settings) {
136
  AAM::getUser()->setUserExpiration($settings);
137
  });
138
-
139
- // If there are any license violations. Display the notification for users
140
- // that have enough permissions to manage AAM
141
- if (is_admin() && current_user_can('aam_manager')) {
142
- if (AAM_Addon_Repository::getInstance()->hasViolations()) {
143
- if (!AAM::isAAM()) {
144
- add_action('admin_notices', function() {
145
- require __DIR__ . '/../Backend/tmpl/partial/license-violation-notice.php';
146
- });
147
- }
148
-
149
- // Also add all the identified violations to the AAM console
150
- foreach(AAM_Addon_Repository::getInstance()->getViolations() as $v) {
151
- AAM_Core_Console::add($v);
152
- }
153
- }
154
- }
155
  }
156
 
157
  /**
@@ -183,7 +168,7 @@ class AAM_Service_Core
183
  'Accept' => 'application/json',
184
  'Content-Type' => 'application/json'
185
  ),
186
- 'body' => wp_json_encode($repository->getAddonLicenseMap())
187
  )
188
  );
189
 
@@ -207,14 +192,6 @@ class AAM_Service_Core
207
  if (!empty($v) && (version_compare($v, $new_v) === -1)) {
208
  $original['plugins'][$item['plugin']] = $item;
209
  }
210
-
211
- if (!empty($item['violation'])) {
212
- $repository->processViolation(
213
- $item['slug'],
214
- $item['violation'],
215
- (isset($item['action']) ? $item['action'] : null)
216
- );
217
- }
218
  }
219
  }
220
 
10
  /**
11
  * AAM core service
12
  *
13
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/236
14
  * @since 6.7.5 https://github.com/aamplugin/advanced-access-manager/issues/173
15
  * @since 6.5.3 https://github.com/aamplugin/advanced-access-manager/issues/126
16
  * @since 6.4.2 Fixed https://github.com/aamplugin/advanced-access-manager/issues/82
20
  * @since 6.0.0 Initial implementation of the class
21
  *
22
  * @package AAM
23
+ * @version 6.9.3
24
  */
25
  class AAM_Service_Core
26
  {
39
  *
40
  * @access protected
41
  *
42
+ * @since 6.9.3 https://github.com/aamplugin/advanced-access-manager/issues/236
43
+ * @since 6.4.2 https://github.com/aamplugin/advanced-access-manager/issues/82
44
  * @since 6.4.0 Added "Manage Access" toolbar item
45
  * @since 6.0.5 Fixed bug when Access Manager metabox is rendered for users that
46
  * have ability to manage other users
49
  * @since 6.0.0 Initial implementation of the method
50
  *
51
  * @return void
52
+ * @version 6.9.3
53
  */
54
  protected function __construct()
55
  {
137
  add_action('aam_set_user_expiration_action', function($settings) {
138
  AAM::getUser()->setUserExpiration($settings);
139
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
  /**
168
  'Accept' => 'application/json',
169
  'Content-Type' => 'application/json'
170
  ),
171
+ 'body' => wp_json_encode($repository->getRegisteredLicenseList())
172
  )
173
  );
174
 
192
  if (!empty($v) && (version_compare($v, $new_v) === -1)) {
193
  $original['plugins'][$item['plugin']] = $item;
194
  }
 
 
 
 
 
 
 
 
195
  }
196
  }
197
 
application/Service/Uri.php CHANGED
@@ -55,7 +55,7 @@ class AAM_Service_Uri
55
  add_filter('aam_service_list_filter', function ($services) {
56
  $services[] = array(
57
  'title' => __('URI Access', AAM_KEY),
58
- 'description' => __('Manage direct access to the website URIs for any role or individual user. Define either explicit URI or wildcard (with Plus Package addon) as well as how to manage user request (allow, deny, redirect, etc.).', AAM_KEY),
59
  'setting' => self::FEATURE_FLAG
60
  );
61
 
55
  add_filter('aam_service_list_filter', function ($services) {
56
  $services[] = array(
57
  'title' => __('URI Access', AAM_KEY),
58
+ 'description' => __('Manage direct access to the website URIs for any role or individual user. Define either explicit URI or wildcard (with Complete Package addon) as well as how to manage user request (allow, deny, redirect, etc.).', AAM_KEY),
59
  'setting' => self::FEATURE_FLAG
60
  );
61
 
lang/advanced-access-manager-en_US.po CHANGED
@@ -1682,7 +1682,7 @@ msgstr ""
1682
  msgid ""
1683
  "You are allowed to manage access to unlimited number of posts, pages or "
1684
  "custom post types but only for any role, user or visitor. Consider to get "
1685
- "%s[Plus Package]%s add-on to have the ability to manage access to categories "
1686
  "and custom taxonomies or to define the default access to all posts, pages or "
1687
  "custom post types. For more information about this functionality check %sHow "
1688
  "to manage access to the WordPress content%s."
@@ -1711,7 +1711,7 @@ msgstr ""
1711
  msgid ""
1712
  "Managing access to the %s \"%s\" is available with the premium %s[Plus "
1713
  "Package]%s add-on only. It also allows to define default access to all child "
1714
- "posts that are related to the %s \"%s\". Consider to purchase Plus Package "
1715
  "add-on."
1716
  msgstr ""
1717
 
@@ -1729,7 +1729,7 @@ msgstr ""
1729
  #, php-format
1730
  msgid ""
1731
  "Manage default access to all posts that belong to the post type %s. This "
1732
- "feature is available only with the premium %s[Plus Package]%s add-on."
1733
  msgstr ""
1734
 
1735
  #: application/Backend/tmpl/partial/visitor-principal-subject-tab.php:13
@@ -2252,7 +2252,7 @@ msgid "URI Access Rule"
2252
  msgstr ""
2253
 
2254
  #: application/Backend/tmpl/service/uri.php:31
2255
- msgid "Enter URL [(wildcard * is available with Plus Package extension)]"
2256
  msgstr ""
2257
 
2258
  #: application/Backend/tmpl/service/uri.php:35
@@ -2680,7 +2680,7 @@ msgstr ""
2680
  #: application/Service/Uri.php:58
2681
  msgid ""
2682
  "Manage direct access to the website URIs for any role or individual user. "
2683
- "Define either explicit URI or wildcard (with Plus Package addon) as well as "
2684
  "how to manage user request (allow, deny, redirect, etc.)."
2685
  msgstr ""
2686
 
1682
  msgid ""
1683
  "You are allowed to manage access to unlimited number of posts, pages or "
1684
  "custom post types but only for any role, user or visitor. Consider to get "
1685
+ "%s[Complete Package]%s add-on to have the ability to manage access to categories "
1686
  "and custom taxonomies or to define the default access to all posts, pages or "
1687
  "custom post types. For more information about this functionality check %sHow "
1688
  "to manage access to the WordPress content%s."
1711
  msgid ""
1712
  "Managing access to the %s \"%s\" is available with the premium %s[Plus "
1713
  "Package]%s add-on only. It also allows to define default access to all child "
1714
+ "posts that are related to the %s \"%s\". Consider to purchase Complete Package "
1715
  "add-on."
1716
  msgstr ""
1717
 
1729
  #, php-format
1730
  msgid ""
1731
  "Manage default access to all posts that belong to the post type %s. This "
1732
+ "feature is available only with the premium %s[Complete Package]%s add-on."
1733
  msgstr ""
1734
 
1735
  #: application/Backend/tmpl/partial/visitor-principal-subject-tab.php:13
2252
  msgstr ""
2253
 
2254
  #: application/Backend/tmpl/service/uri.php:31
2255
+ msgid "Enter URL [(wildcard * is available with Complete Package extension)]"
2256
  msgstr ""
2257
 
2258
  #: application/Backend/tmpl/service/uri.php:35
2680
  #: application/Service/Uri.php:58
2681
  msgid ""
2682
  "Manage direct access to the website URIs for any role or individual user. "
2683
+ "Define either explicit URI or wildcard (with Complete Package addon) as well as "
2684
  "how to manage user request (allow, deny, redirect, etc.)."
2685
  msgstr ""
2686
 
media/css/aam.css CHANGED
@@ -567,6 +567,7 @@ div.dataTables_wrapper div.dataTables_filter input {
567
 
568
  table.table-bordered.dataTable tbody th, table.table-bordered.dataTable tbody td {
569
  vertical-align: middle;
 
570
  }
571
 
572
  .progress {
@@ -976,7 +977,15 @@ input[type=radio]:checked + label:before {
976
 
977
  .aam-license-key {
978
  display: block;
979
- margin-bottom: 5px;
 
 
 
 
 
 
 
 
980
  }
981
 
982
  .aam-setting-description, .aam-extension-description {
567
 
568
  table.table-bordered.dataTable tbody th, table.table-bordered.dataTable tbody td {
569
  vertical-align: middle;
570
+ word-break: break-all;
571
  }
572
 
573
  .progress {
977
 
978
  .aam-license-key {
979
  display: block;
980
+ width: 100%;
981
+ text-align: left;
982
+ font-size: 1.1em;
983
+ color: #a94442;
984
+ }
985
+
986
+ .aam-license-key:active, .aam-license-key:hover {
987
+ text-decoration: none;
988
+ color: #F04748;
989
  }
990
 
991
  .aam-setting-description, .aam-extension-description {
media/js/aam.js CHANGED
@@ -4489,6 +4489,41 @@
4489
  getAAM().fetchContent('extensions');
4490
  });
4491
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4492
  }
4493
  }
4494
 
4489
  getAAM().fetchContent('extensions');
4490
  });
4491
  });
4492
+
4493
+ $('#clear-licenses').bind('click', function () {
4494
+ $.ajax(getLocal().ajaxurl, {
4495
+ type: 'POST',
4496
+ dataType: 'json',
4497
+ data: {
4498
+ action: 'aam',
4499
+ sub_action: 'Addons_Manager.clearLicenses',
4500
+ _ajax_nonce: getLocal().nonce,
4501
+ },
4502
+ beforeSend: function () {
4503
+ $('#clear-licenses').prop('disabled', true);
4504
+ $('#clear-licenses').text(getAAM().__('Processing...'));
4505
+ },
4506
+ success: function (response) {
4507
+ if (response.status === 'success') {
4508
+ getAAM().notification(
4509
+ 'success',
4510
+ getAAM().__('All licenses has been cleared successfully')
4511
+ );
4512
+ location.reload();
4513
+ } else {
4514
+ getAAM().notification('danger', response.reason);
4515
+ }
4516
+ },
4517
+ error: function () {
4518
+ getAAM().notification('danger');
4519
+ },
4520
+ complete: function () {
4521
+ $('#clear-licenses').prop('disabled', false);
4522
+ $('#clear-licenses').text(getAAM().__('Clear'));
4523
+ $('#clear-licenses-modal').modal('hide');
4524
+ }
4525
+ });
4526
+ });
4527
  }
4528
  }
4529
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: access control, membership, backend menu, user role, restricted content, s
4
  Requires at least: 4.7.0
5
  Requires PHP: 5.6.0
6
  Tested up to: 6.0.3
7
- Stable tag: 6.9.2
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,11 @@ We take security and privacy very seriously, that is why there are several non-n
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
94
  = 6.9.2 =
95
  * Fixed: Compliance with WordPress.org code quality [https://github.com/aamplugin/advanced-access-manager/issues/229](https://github.com/aamplugin/advanced-access-manager/issues/229)
96
 
4
  Requires at least: 4.7.0
5
  Requires PHP: 5.6.0
6
  Tested up to: 6.0.3
7
+ Stable tag: 6.9.3
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.9.3 =
95
+ * Fixed: Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable... [https://github.com/aamplugin/advanced-access-manager/issues/236](https://github.com/aamplugin/advanced-access-manager/issues/236)
96
+ * Fixed: Warning: Undefined variable $value in... [https://github.com/aamplugin/advanced-access-manager/issues/235](https://github.com/aamplugin/advanced-access-manager/issues/235)
97
+ * Changed: Deprecating offering of some AAM premium add-ons [https://github.com/aamplugin/advanced-access-manager/issues/237](https://github.com/aamplugin/advanced-access-manager/issues/237)
98
+
99
  = 6.9.2 =
100
  * Fixed: Compliance with WordPress.org code quality [https://github.com/aamplugin/advanced-access-manager/issues/229](https://github.com/aamplugin/advanced-access-manager/issues/229)
101