Advanced Access Manager - Version 4.9.1

Version Description

  • Improved UI
  • Improved [aam] shortcode
  • Improved plugin activation experience
Download this release

Release Info

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

Code changes from version 4.9 to 4.9.1

Application/Backend/phtml/object/post.phtml CHANGED
@@ -35,7 +35,7 @@
35
  <span><i class="icon-check"></i> <?php echo __('Settings are customized', AAM_KEY); ?></span>
36
  <span><a href="#" id="post-reset" class="btn btn-xs btn-primary"><?php echo __('Reset To Default', AAM_KEY); ?></a></span>
37
  </div>
38
-
39
  <?php if ($current->id) { ?>
40
  <input type="hidden" id="load-post-object" value="<?php echo ($current->type == 'post' ? $current->post->ID : $current->term->term_id); ?>" />
41
  <input type="hidden" id="load-post-object-type" value="<?php echo $current->type; ?>" />
@@ -56,16 +56,19 @@
56
  </table>
57
 
58
  <div class="aam-slide-form aam-access-form" data-type="type">
 
59
  <?php echo apply_filters('aam-post-type-ui-filter', AAM_Backend_View::getInstance()->loadPartial('post-type.phtml')); ?>
60
  <a href="#" class="btn btn-xs btn-primary post-back">&Lt; <?php echo __('Go Back', AAM_KEY); ?></a>
61
  </div>
62
 
63
  <div class="aam-slide-form aam-access-form" data-type="term">
 
64
  <?php echo apply_filters('aam-term-type-ui-filter', AAM_Backend_View::getInstance()->loadPartial('term-type.phtml')); ?>
65
  <a href="#" class="btn btn-xs btn-primary post-back">&Lt; <?php echo __('Go Back', AAM_KEY); ?></a>
66
  </div>
67
 
68
  <div class="aam-slide-form aam-access-form" data-type="post">
 
69
  <table class="table table-striped table-bordered">
70
  <tbody>
71
  <tr>
35
  <span><i class="icon-check"></i> <?php echo __('Settings are customized', AAM_KEY); ?></span>
36
  <span><a href="#" id="post-reset" class="btn btn-xs btn-primary"><?php echo __('Reset To Default', AAM_KEY); ?></a></span>
37
  </div>
38
+
39
  <?php if ($current->id) { ?>
40
  <input type="hidden" id="load-post-object" value="<?php echo ($current->type == 'post' ? $current->post->ID : $current->term->term_id); ?>" />
41
  <input type="hidden" id="load-post-object-type" value="<?php echo $current->type; ?>" />
56
  </table>
57
 
58
  <div class="aam-slide-form aam-access-form" data-type="type">
59
+ <a href="#" class="btn btn-xs btn-primary post-back btn-right">&Lt; <?php echo __('Go Back', AAM_KEY); ?></a>
60
  <?php echo apply_filters('aam-post-type-ui-filter', AAM_Backend_View::getInstance()->loadPartial('post-type.phtml')); ?>
61
  <a href="#" class="btn btn-xs btn-primary post-back">&Lt; <?php echo __('Go Back', AAM_KEY); ?></a>
62
  </div>
63
 
64
  <div class="aam-slide-form aam-access-form" data-type="term">
65
+ <a href="#" class="btn btn-xs btn-primary post-back btn-right">&Lt; <?php echo __('Go Back', AAM_KEY); ?></a>
66
  <?php echo apply_filters('aam-term-type-ui-filter', AAM_Backend_View::getInstance()->loadPartial('term-type.phtml')); ?>
67
  <a href="#" class="btn btn-xs btn-primary post-back">&Lt; <?php echo __('Go Back', AAM_KEY); ?></a>
68
  </div>
69
 
70
  <div class="aam-slide-form aam-access-form" data-type="post">
71
+ <a href="#" class="btn btn-xs btn-primary post-back btn-right">&Lt; <?php echo __('Go Back', AAM_KEY); ?></a>
72
  <table class="table table-striped table-bordered">
73
  <tbody>
74
  <tr>
Application/Core/API.php CHANGED
@@ -111,7 +111,7 @@ final class AAM_Core_API {
111
  *
112
  * @access public
113
  */
114
- public static function cURL($url, $send_cookies = TRUE, $params = array()) {
115
  $header = array('User-Agent' => AAM_Core_Request::server('HTTP_USER_AGENT'));
116
 
117
  $cookies = AAM_Core_Request::cookie(null, array());
@@ -132,7 +132,7 @@ final class AAM_Core_API {
132
  'method' => 'POST',
133
  'body' => $params,
134
  'cookies' => $requestCookies,
135
- 'timeout' => 10
136
  ));
137
  }
138
 
111
  *
112
  * @access public
113
  */
114
+ public static function cURL($url, $send_cookies = TRUE, $params = array(), $timeout = 20) {
115
  $header = array('User-Agent' => AAM_Core_Request::server('HTTP_USER_AGENT'));
116
 
117
  $cookies = AAM_Core_Request::cookie(null, array());
132
  'method' => 'POST',
133
  'body' => $params,
134
  'cookies' => $requestCookies,
135
+ 'timeout' => $timeout
136
  ));
137
  }
138
 
Application/Core/Server.php CHANGED
@@ -26,6 +26,27 @@ final class AAM_Core_Server {
26
  * Fallback endpoint
27
  */
28
  const FALLBACK_URL = 'http://rest.vasyltech.com/v1';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  /**
31
  * Fetch the extension list
@@ -126,14 +147,14 @@ final class AAM_Core_Server {
126
  *
127
  * @access protected
128
  */
129
- protected static function send($request, $params) {
130
  $response = self::parseResponse(
131
- AAM_Core_API::cURL(self::SERVER_URL . $request, false, $params)
132
  );
133
 
134
  if (empty($response) || is_wp_error($response)) {
135
  $response = self::parseResponse(
136
- AAM_Core_API::cURL(self::FALLBACK_URL . $request, false, $params)
137
  );
138
  }
139
 
26
  * Fallback endpoint
27
  */
28
  const FALLBACK_URL = 'http://rest.vasyltech.com/v1';
29
+
30
+ /**
31
+ * Fetch the extension list
32
+ *
33
+ * Fetch the extension list with versions from the server
34
+ *
35
+ * @return array
36
+ *
37
+ * @access public
38
+ */
39
+ public static function register() {
40
+ //prepare check params
41
+ $params = array(
42
+ 'domain' => parse_url(site_url(), PHP_URL_HOST),
43
+ 'version' => AAM_Core_API::version(),
44
+ 'uid' => AAM_Core_API::getOption('aam-uid', null, 'site'),
45
+ 'email' => AAM_Core_API::getOption('admin_email')
46
+ );
47
+
48
+ self::send('/register', $params);
49
+ }
50
 
51
  /**
52
  * Fetch the extension list
147
  *
148
  * @access protected
149
  */
150
+ protected static function send($request, $params, $timeout = 20) {
151
  $response = self::parseResponse(
152
+ AAM_Core_API::cURL(self::SERVER_URL . $request, false, $params, $timeout)
153
  );
154
 
155
  if (empty($response) || is_wp_error($response)) {
156
  $response = self::parseResponse(
157
+ AAM_Core_API::cURL(self::FALLBACK_URL . $request, false, $params, $timeout)
158
  );
159
  }
160
 
Application/Shortcode/Factory.php CHANGED
@@ -28,7 +28,7 @@ class AAM_Shortcode_Factory {
28
  * @param type $content
29
  */
30
  public function __construct($args, $content) {
31
- $context = !empty($args['context']) ? $args['context'] : null;
32
 
33
  $classname = 'AAM_Shortcode_Strategy_' . ucfirst($context);
34
 
28
  * @param type $content
29
  */
30
  public function __construct($args, $content) {
31
+ $context = !empty($args['context']) ? $args['context'] : 'content';
32
 
33
  $classname = 'AAM_Shortcode_Strategy_' . ucfirst($context);
34
 
Application/Shortcode/Strategy/Content.php CHANGED
@@ -99,15 +99,19 @@ class AAM_Shortcode_Strategy_Content implements AAM_Shortcode_Strategy_Interface
99
  */
100
  protected function check($user, $conditions) {
101
  $match = false;
 
102
 
103
  foreach($conditions as $condition) {
104
- if (preg_match('/^[\d\.*\-]+$/', $condition)) {
 
 
105
  $match = $this->checkIP(
106
  $condition, AAM_Core_Request::server('REMOTE_ADDR')
107
  );
108
  } else {
109
  $match = in_array($condition, $user);
110
  }
 
111
  if ($match) {
112
  break;
113
  }
99
  */
100
  protected function check($user, $conditions) {
101
  $match = false;
102
+ $auth = get_current_user_id();
103
 
104
  foreach($conditions as $condition) {
105
+ if (($condition == 'authenticated') && $auth) {
106
+ $match = true;
107
+ } else if (preg_match('/^[\d\.*\-]+$/', $condition)) {
108
  $match = $this->checkIP(
109
  $condition, AAM_Core_Request::server('REMOTE_ADDR')
110
  );
111
  } else {
112
  $match = in_array($condition, $user);
113
  }
114
+
115
  if ($match) {
116
  break;
117
  }
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: 4.9
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
@@ -189,6 +189,9 @@ class AAM {
189
  if (file_exists($dirname) === false) {
190
  @mkdir($dirname, fileperms( ABSPATH ) & 0777 | 0755);
191
  }
 
 
 
192
  }
193
 
194
  /**
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
+ Version: 4.9.1
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
189
  if (file_exists($dirname) === false) {
190
  @mkdir($dirname, fileperms( ABSPATH ) & 0777 | 0755);
191
  }
192
+
193
+ //register plugin
194
+ AAM_Core_Server::register();
195
  }
196
 
197
  /**
media/css/aam.css CHANGED
@@ -63,6 +63,7 @@
63
  .icon-download-cloud:before { content: '\e809' !important; } /* '' */
64
  .icon-eye-off:before { content: '\e80a' !important; } /* '' */
65
  .icon-attention-circled:before { content: '\e80b' !important; } /* '' */
 
66
  .icon-sort-down:before { content: '\e810' !important; } /* '' */
67
  .icon-pencil:before { content: '\e811' !important; } /* '' */
68
  .icon-arrows-cw:before { content: '\e812' !important; } /* '' */
@@ -363,6 +364,17 @@ a.btn:focus, a.btn:active {
363
  color: #fff;
364
  }
365
 
 
 
 
 
 
 
 
 
 
 
 
366
  .alert {
367
  border-radius: 0;
368
  margin-bottom: 0;
@@ -572,7 +584,7 @@ input[type=radio]:checked + label:before {
572
  background-color: #f0ad4e;
573
  color: #FFFFFF;
574
  font-weight: 700;
575
- margin-bottom: 15px;
576
  letter-spacing: 1px;
577
  }
578
 
@@ -718,7 +730,7 @@ input[type=radio]:checked + label:before {
718
  .aam-post-breadcrumb {
719
  border: 1px solid #E5E5E5;
720
  padding: 5px;
721
- margin-bottom: 15px;
722
  }
723
 
724
  .aam-post-breadcrumb a {
63
  .icon-download-cloud:before { content: '\e809' !important; } /* '' */
64
  .icon-eye-off:before { content: '\e80a' !important; } /* '' */
65
  .icon-attention-circled:before { content: '\e80b' !important; } /* '' */
66
+ .icon-basket:before { content: '\e80c'; } /* '' */
67
  .icon-sort-down:before { content: '\e810' !important; } /* '' */
68
  .icon-pencil:before { content: '\e811' !important; } /* '' */
69
  .icon-arrows-cw:before { content: '\e812' !important; } /* '' */
364
  color: #fff;
365
  }
366
 
367
+ .btn-right {
368
+ float: right;
369
+ margin-bottom: 10px;
370
+ }
371
+
372
+ .btn-right::after {
373
+ display: block;
374
+ content: " ";
375
+ clear: both;
376
+ }
377
+
378
  .alert {
379
  border-radius: 0;
380
  margin-bottom: 0;
584
  background-color: #f0ad4e;
585
  color: #FFFFFF;
586
  font-weight: 700;
587
+ margin-bottom: 10px;
588
  letter-spacing: 1px;
589
  }
590
 
730
  .aam-post-breadcrumb {
731
  border: 1px solid #E5E5E5;
732
  padding: 5px;
733
+ margin-bottom: 10px;
734
  }
735
 
736
  .aam-post-breadcrumb a {
media/font/fontello.eot CHANGED
Binary file
media/font/fontello.svg CHANGED
@@ -30,6 +30,8 @@
30
 
31
  <glyph glyph-name="attention-circled" unicode="&#xe80b;" d="M429 779q116 0 215-58t156-156 57-215-57-215-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58z m71-696v106q0 8-5 13t-12 5h-107q-8 0-13-5t-6-13v-106q0-8 6-13t13-6h107q7 0 12 6t5 13z m-1 192l10 346q0 7-6 10-5 5-13 5h-123q-8 0-13-5-6-3-6-10l10-346q0-6 5-10t14-4h103q8 0 13 4t6 10z" horiz-adv-x="857.1" />
32
 
 
 
33
  <glyph glyph-name="sort-down" unicode="&#xe810;" d="M571 243q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
34
 
35
  <glyph glyph-name="pencil" unicode="&#xe811;" d="M203-7l50 51-131 131-51-51v-60h72v-71h60z m291 518q0 12-12 12-5 0-9-4l-303-302q-4-4-4-10 0-12 13-12 5 0 9 4l303 302q3 4 3 10z m-30 107l232-232-464-465h-232v233z m381-54q0-29-20-50l-93-93-232 233 93 92q20 21 50 21 29 0 51-21l131-131q20-22 20-51z" horiz-adv-x="857.1" />
30
 
31
  <glyph glyph-name="attention-circled" unicode="&#xe80b;" d="M429 779q116 0 215-58t156-156 57-215-57-215-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58z m71-696v106q0 8-5 13t-12 5h-107q-8 0-13-5t-6-13v-106q0-8 6-13t13-6h107q7 0 12 6t5 13z m-1 192l10 346q0 7-6 10-5 5-13 5h-123q-8 0-13-5-6-3-6-10l10-346q0-6 5-10t14-4h103q8 0 13 4t6 10z" horiz-adv-x="857.1" />
32
 
33
+ <glyph glyph-name="basket" unicode="&#xe80c;" d="M357-7q0-29-21-50t-50-22-50 22-22 50 22 50 50 21 50-21 21-50z m500 0q0-29-21-50t-50-22-50 22-22 50 22 50 50 21 50-21 21-50z m72 607v-286q0-13-10-23t-22-12l-583-68q7-34 7-40 0-8-13-35h513q15 0 26-11t10-25-10-25-26-11h-571q-14 0-25 11t-11 25q0 6 5 18t9 20 12 22 8 17l-98 459h-114q-15 0-25 10t-11 25 11 26 25 10h143q9 0 16-3t10-9 8-14 4-14 3-17 3-14h670q14 0 25-11t11-25z" horiz-adv-x="928.6" />
34
+
35
  <glyph glyph-name="sort-down" unicode="&#xe810;" d="M571 243q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
36
 
37
  <glyph glyph-name="pencil" unicode="&#xe811;" d="M203-7l50 51-131 131-51-51v-60h72v-71h60z m291 518q0 12-12 12-5 0-9-4l-303-302q-4-4-4-10 0-12 13-12 5 0 9 4l303 302q3 4 3 10z m-30 107l232-232-464-465h-232v233z m381-54q0-29-20-50l-93-93-232 233 93 92q20 21 50 21 29 0 51-21l131-131q20-22 20-51z" horiz-adv-x="857.1" />
media/font/fontello.ttf CHANGED
Binary file
media/font/fontello.woff CHANGED
Binary file
media/font/fontello.woff2 CHANGED
Binary file
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.8
6
- Stable tag: 4.9
7
 
8
  Manage access to your website for any user, role or visitors for both frontend and backend.
9
 
@@ -110,6 +110,11 @@ Check our [help page](https://aamplugin.com/help) to find out more about AAM.
110
 
111
  == Changelog ==
112
 
 
 
 
 
 
113
  = 4.9 =
114
  * Fixed bug with Login Redirect duplicate settings saving
115
  * Added ability to hide license key with aam_display_license capability
2
  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.8.1
6
+ Stable tag: 4.9.1
7
 
8
  Manage access to your website for any user, role or visitors for both frontend and backend.
9
 
110
 
111
  == Changelog ==
112
 
113
+ = 4.9.1 =
114
+ * Improved UI
115
+ * Improved [aam] shortcode
116
+ * Improved plugin activation experience
117
+
118
  = 4.9 =
119
  * Fixed bug with Login Redirect duplicate settings saving
120
  * Added ability to hide license key with aam_display_license capability