Advanced Access Manager - Version 3.9.3

Version Description

  • Bug fixing
  • Implemented license check mechanism
  • Improved media access control
  • Added ConfigPress extension
Download this release

Release Info

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

Code changes from version 3.9.2 to 3.9.3

Application/Backend/Feature/Abstract.php CHANGED
@@ -24,9 +24,11 @@ abstract class AAM_Backend_Feature_Abstract {
24
  * @throws Exception
25
  */
26
  public function __construct() {
27
- $cap = AAM_Core_Config::get($this->getAccessOption(), 'administrator');
28
- if (!AAM::getUser()->hasCapability($cap)) {
29
- Throw new Exception(__('Access Denied', AAM_KEY));
 
 
30
  }
31
  }
32
 
24
  * @throws Exception
25
  */
26
  public function __construct() {
27
+ if (is_admin()) {
28
+ $cap = AAM_Core_Config::get($this->getAccessOption(), 'administrator');
29
+ if (!AAM::getUser()->hasCapability($cap)) {
30
+ wp_die(__('Access Denied', AAM_KEY));
31
+ }
32
  }
33
  }
34
 
Application/Backend/Feature/Extension.php CHANGED
@@ -46,6 +46,7 @@ class AAM_Backend_Feature_Extension extends AAM_Backend_Feature_Abstract {
46
  $filtered = array();
47
  foreach($products as $product) {
48
  if ($product['type'] == $filter) {
 
49
  $filtered[] = $product;
50
  }
51
  }
@@ -76,6 +77,11 @@ class AAM_Backend_Feature_Extension extends AAM_Backend_Feature_Abstract {
76
  }elseif ($error = $repo->checkDirectory()) {
77
  $response = $this->installFailureResponse($error, $package);
78
  $this->storeLicense($package->title, $license);
 
 
 
 
 
79
  } else { //otherwise install the extension
80
  $result = $repo->addExtension(base64_decode($package->content));
81
  if (is_wp_error($result)) {
@@ -131,8 +137,8 @@ class AAM_Backend_Feature_Extension extends AAM_Backend_Feature_Abstract {
131
  /**
132
  * Install extension failure response
133
  *
134
- * In case the filesystem fails, AAM allows to download the extension for
135
- * manuall installation
136
  *
137
  * @param string $error
138
  * @param stdClass $package
@@ -171,6 +177,18 @@ class AAM_Backend_Feature_Extension extends AAM_Backend_Feature_Abstract {
171
  AAM_Core_API::updateOption('aam-extension-license', $list);
172
  }
173
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  /**
175
  * Register Extension feature
176
  *
46
  $filtered = array();
47
  foreach($products as $product) {
48
  if ($product['type'] == $filter) {
49
+ $product['license'] = $this->retrieveLicense($product['id']);
50
  $filtered[] = $product;
51
  }
52
  }
77
  }elseif ($error = $repo->checkDirectory()) {
78
  $response = $this->installFailureResponse($error, $package);
79
  $this->storeLicense($package->title, $license);
80
+ } elseif (empty($package->content)) { //any unpredictable scenario
81
+ $response = array(
82
+ 'status' => 'failure',
83
+ 'error' => 'Failed to download the extension. Try again or contact us.'
84
+ );
85
  } else { //otherwise install the extension
86
  $result = $repo->addExtension(base64_decode($package->content));
87
  if (is_wp_error($result)) {
137
  /**
138
  * Install extension failure response
139
  *
140
+ * In case the file system fails, AAM allows to download the extension for
141
+ * manual installation
142
  *
143
  * @param string $error
144
  * @param stdClass $package
177
  AAM_Core_API::updateOption('aam-extension-license', $list);
178
  }
179
 
180
+ /**
181
+ *
182
+ * @param type $title
183
+ * @return type
184
+ */
185
+ protected function retrieveLicense($title) {
186
+ //retrieve the installed list of extensions
187
+ $list = AAM_Core_API::getOption('aam-extension-license', array());
188
+
189
+ return (isset($list[$title]) ? $list[$title] : null);
190
+ }
191
+
192
  /**
193
  * Register Extension feature
194
  *
Application/Backend/Feature/Post.php CHANGED
@@ -343,13 +343,10 @@ class AAM_Backend_Feature_Post extends AAM_Backend_Feature_Abstract {
343
  static $list = null;
344
 
345
  if (is_null($list)) {
346
- $list = apply_filters(
347
- 'aam-post-access-options-filter',
348
- require_once dirname(__FILE__) . '/../View/PostOptionList.php'
349
- );
350
  }
351
 
352
- return $list[$area];
353
  }
354
 
355
  /**
343
  static $list = null;
344
 
345
  if (is_null($list)) {
346
+ $list = require_once dirname(__FILE__) . '/../View/PostOptionList.php';
 
 
 
347
  }
348
 
349
+ return apply_filters('aam-post-access-options-filter', $list[$area], $area);
350
  }
351
 
352
  /**
Application/Backend/Feature/User.php CHANGED
@@ -101,7 +101,7 @@ class AAM_Backend_Feature_User {
101
  protected function prepareRowActions(WP_User $user) {
102
  $max = AAM_Core_API::maxLevel(wp_get_current_user()->allcaps);
103
 
104
- $allowed = ($max > AAM_Core_API::maxLevel($user->allcaps));
105
 
106
  if ($allowed || ($user->ID == get_current_user_id())) {
107
  $actions = array('manage');
101
  protected function prepareRowActions(WP_User $user) {
102
  $max = AAM_Core_API::maxLevel(wp_get_current_user()->allcaps);
103
 
104
+ $allowed = ($max >= AAM_Core_API::maxLevel($user->allcaps));
105
 
106
  if ($allowed || ($user->ID == get_current_user_id())) {
107
  $actions = array('manage');
Application/Backend/Filter.php CHANGED
@@ -207,12 +207,13 @@ class AAM_Backend_Filter {
207
  * @access public
208
  */
209
  public function adminActionEdit() {
210
- global $post;
211
 
212
  if (is_a($post, 'WP_Post')) {
213
  $object = AAM::getUser()->getObject('post', $post->ID);
214
  $edit = $object->has('backend.edit');
215
  $others = $object->has('backend.edit_others');
 
216
  if ($edit || ($others && !$this->isAuthor($post))) {
217
  AAM_Core_API::reject(
218
  'backend',
207
  * @access public
208
  */
209
  public function adminActionEdit() {
210
+ $post = $this->getPost();
211
 
212
  if (is_a($post, 'WP_Post')) {
213
  $object = AAM::getUser()->getObject('post', $post->ID);
214
  $edit = $object->has('backend.edit');
215
  $others = $object->has('backend.edit_others');
216
+
217
  if ($edit || ($others && !$this->isAuthor($post))) {
218
  AAM_Core_API::reject(
219
  'backend',
Application/Backend/Manager.php CHANGED
@@ -84,7 +84,7 @@ class AAM_Backend_Manager {
84
  }
85
 
86
  //register CodePinch affiliate
87
- AAM_Backend_View_CodePinch::bootstrap(AAM_CODEPINCH_AFFILIATE_CODE);
88
  }
89
 
90
  /**
@@ -113,12 +113,10 @@ class AAM_Backend_Manager {
113
  *
114
  */
115
  protected function checkExtensionList() {
116
- $list = AAM_Core_API::getOption('aam-extension-repository', array());
117
- $repo = AAM_Core_Repository::getInstance();
118
 
119
- foreach((is_array($list) ? $list : array()) as $extension) {
120
- $status = $repo->extensionStatus($extension->title);
121
- if ($status == AAM_Core_Repository::STATUS_UPDATE) {
122
  AAM_Core_Console::add(
123
  sprintf(
124
  __('Extension %s has new update available for download.'),
@@ -126,6 +124,14 @@ class AAM_Backend_Manager {
126
  )
127
  );
128
  }
 
 
 
 
 
 
 
 
129
  }
130
 
131
  //TODO - Remove in Dec 2016
84
  }
85
 
86
  //register CodePinch affiliate
87
+ AAM_Backend_View_CodePinch::bootstrap();
88
  }
89
 
90
  /**
113
  *
114
  */
115
  protected function checkExtensionList() {
116
+ $list = AAM_Core_Repository::getInstance()->getExtensionList();
 
117
 
118
+ foreach($list as $extension) {
119
+ if ($extension->status == AAM_Core_Repository::STATUS_UPDATE) {
 
120
  AAM_Core_Console::add(
121
  sprintf(
122
  __('Extension %s has new update available for download.'),
124
  )
125
  );
126
  }
127
+ if (!empty($extension->violation) && ($extension->status != AAM_Core_Repository::STATUS_DOWNLOAD)) {
128
+ AAM_Core_Console::add(
129
+ sprintf(
130
+ __('Extension %s is not licensed for this website and will be removed automatically at any time. Insert correct license on the Extensions tab or contact us immediately.'),
131
+ $extension->title
132
+ )
133
+ );
134
+ }
135
  }
136
 
137
  //TODO - Remove in Dec 2016
Application/Backend/View/CodePinch.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /**
4
- * Copyright (C) <2016> Vasyl Martyniuk <vasyl@vasyltech.com>
5
  *
6
  * This program is free software: you can redistribute it and/or modify
7
  * it under the terms of the GNU General Public License as published by
@@ -16,342 +16,137 @@
16
  * You should have received a copy of the GNU General Public License
17
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
 
 
 
 
 
 
19
  class AAM_Backend_View_CodePinch {
20
 
21
  /**
22
- * Plugin slug
23
  */
24
  const SLUG = 'WP Error Fix';
25
-
26
- /**
27
- *
28
- */
29
- const PLUGIN_URL = 'https://downloads.wordpress.org/plugin/wp-error-fix.zip';
30
-
31
- /**
32
- *
33
- */
34
- const SCRIPT_BASE = 'https://codepinch.io/affiliate/wp/';
35
 
36
  /**
37
  * Single instance of itself
38
  *
39
- * @var CodePinch_Affiliate
40
  *
41
- * @access protected
42
- * @static
43
  */
44
- protected static $instance = null;
45
-
46
- /**
47
- *
48
- * @var type
49
- */
50
- private $_affiliate = null;
51
 
52
  /**
53
- * Affiliate contruct
54
- *
55
- * Register CodePinch Installation page and all necessary JS and CSS to
56
- * support UI.
57
  *
58
  * @return void
59
  *
60
  * @access protected
61
  */
62
- protected function __construct($affiliate) {
63
  if (is_admin()) {
64
- //manager Admin Menu
65
- add_action('admin_menu', array($this, 'adminMenu'), 999);
66
-
67
- //manager AAM Ajax Requests
68
- add_action('wp_ajax_cpi', array($this, 'ajax'));
69
-
70
- //print required JS & CSS
71
- add_action('admin_print_scripts', array($this, 'printJavascript'));
72
- add_action('admin_print_styles', array($this, 'printStylesheet'));
73
-
74
- $this->setAffiliate($affiliate);
75
  }
76
  }
77
-
78
- /**
79
- *
80
- * @param type $affiliate
81
- */
82
- public function setAffiliate($affiliate) {
83
- $this->_affiliate = $affiliate;
84
- }
85
-
86
- /**
87
- *
88
- * @return type
89
- */
90
- public function getAffiliate() {
91
- return $this->_affiliate;
92
- }
93
-
94
- /**
95
- * Bootstrap CodePinch affiliate
96
- *
97
- * @return boolean
98
- *
99
- * @access public
100
- * @static
101
- */
102
- public static function bootstrap($affiliate = null) {
103
- self::$instance = new self($affiliate);
104
- }
105
-
106
- /**
107
- *
108
- * @return type
109
- */
110
- public static function getInstance() {
111
- return self::$instance;
112
- }
113
 
114
  /**
115
- * Handle ajax installation call
116
- *
117
- * @return void
118
- *
119
- * @access public
120
- */
121
- public function ajax() {
122
- $affiliate = filter_input(INPUT_POST, 'affiliate');
123
-
124
- //Multiple plugins can be registered to the same action
125
- if ($affiliate == $this->getAffiliate()) {
126
- check_ajax_referer('cpi_ajax');
127
-
128
- $response = array('status' => 'failure');
129
-
130
- //clean buffer to make sure that nothing messing around with system
131
- while (@ob_end_clean()) {}
132
-
133
- if ($this->isAllowed()) {
134
- try {
135
- //downloading plugin
136
- $source = $this->fetchSource();
137
-
138
- //installing
139
- $this->install($source);
140
-
141
- //activate
142
- $this->activate();
143
-
144
- //register
145
- ErrorFix::getInstance()->register($affiliate);
146
-
147
- $response['status'] = 'success';
148
- } catch (Exception $e) {
149
- $response['reason'] = $e->getMessage();
150
- }
151
- } else {
152
- $response['reason'] = 'You are not allowed to install and activate plugins';
153
- }
154
-
155
- echo json_encode($response);
156
- exit;
157
- }
158
- }
159
-
160
- /**
161
  *
162
- * @param type $source
163
- * @throws Exception
164
- */
165
- protected function install($source) {
166
- $basedir = ABSPATH . 'wp-admin/includes/';
167
-
168
- require_once($basedir . 'class-wp-upgrader.php');
169
- require_once($basedir . 'class-automatic-upgrader-skin.php');
170
-
171
- $upgrader = new Plugin_Upgrader(new Automatic_Upgrader_Skin());
172
- $upgrader->install($source);
173
- $results = $upgrader->skin->get_upgrade_messages();
174
-
175
- $status = array_pop($results);
176
-
177
- if ($status != $upgrader->strings['process_success']) {
178
- Throw new Exception($status);
179
- }
180
- }
181
-
182
- /**
183
  *
184
- * @throws Exception
185
- */
186
- protected function activate() {
187
- $result = activate_plugin('wp-error-fix/wp-error-fix.php');
188
-
189
- if (is_wp_error($result)) {
190
- Throw new Exception($result->get_error_code());
191
- }
192
- }
193
-
194
- /**
195
  *
196
- * @param type $uri
197
- * @param array $params
198
  */
199
- protected function fetchSource() {
200
- $tmp = $this->getDir() . '/' . uniqid();
201
-
202
- if (function_exists('curl_init')) {
203
- //initialiaze the curl and send the request
204
- $ch = curl_init();
205
 
206
- // set URL and other appropriate options
207
- curl_setopt($ch, CURLOPT_URL, self::PLUGIN_URL);
208
- curl_setopt($ch, CURLOPT_HEADER, false);
209
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
210
- curl_setopt($ch, CURLOPT_TIMEOUT, 28);
211
-
212
- $source = curl_exec($ch);
213
- curl_close($ch);
214
- } else {
215
- Throw new Exception('cURL library is required');
216
- }
217
-
218
- if (!@file_put_contents($tmp, $source)) {
219
- Throw new Exception('Failed to get the plugin from WordPress Repository');
220
  }
221
-
222
- return $tmp;
223
  }
224
 
225
  /**
226
- * Query plugin status
 
 
 
227
  *
228
  * @return void
229
  *
230
- * @access protected
231
  * @static
232
  */
233
- public function getStatus() {
234
- require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
235
-
236
- $plugin = plugins_api('plugin_information', array('slug' => self::SLUG));
237
- $result = install_plugin_install_status($plugin);
238
-
239
- if (!empty($result)) {
240
- $response = $result;
241
- //overwrite install URL
242
- $response['url'] = admin_url(
243
- 'index.php?page=codepinch-install&affiliate=' . $this->getAffiliate()
244
- );
245
- } else {
246
- $response = array(
247
- 'status' => 'failure',
248
- 'reason' => 'Failed to retrieve plugin\'s information'
249
- );
250
- }
251
-
252
- return $response;
253
  }
254
 
255
  /**
 
256
  *
257
- */
258
- public function adminMenu() {
259
- add_submenu_page(
260
- null,
261
- 'CodePinch Installation',
262
- null,
263
- 'administrator',
264
- 'codepinch-install',
265
- array($this, 'renderUI')
266
- );
267
- }
268
-
269
- /**
270
  *
271
- */
272
- public function renderUI() {
273
- require dirname(__FILE__) . '/../phtml/codepinch.phtml';
274
- }
275
-
276
- /**
277
  *
278
- * @return type
279
- */
280
- public function isAllowed() {
281
- return current_user_can('activate_plugins') && current_user_can('install_plugins');
282
- }
283
-
284
- /**
285
  *
286
- * @return type
287
- */
288
- public function isInstalled() {
289
- $info = $this->getStatus();
290
-
291
- $statuses = array('latest_installed', 'update_available');
292
-
293
- return (in_array($info['status'], $statuses) ? true: false);
294
- }
295
-
296
- /**
297
- * Print javascript libraries
298
- *
299
- * @return void
300
- *
301
  * @access public
302
  */
303
- public function printJavascript() {
304
- if ($this->isPageUI() && $this->isAllowed()) {
305
- wp_enqueue_script('cpi-main', self::SCRIPT_BASE . 'script-v1.js');
 
306
 
307
- //add plugin localization
308
- wp_localize_script('cpi-main', 'cpiLocal', array(
309
- 'nonce' => wp_create_nonce('cpi_ajax'),
310
- 'ajaxurl' => admin_url('admin-ajax.php')
311
- ));
312
- }
313
- }
314
-
315
- /**
316
- * Print necessary styles
317
- *
318
- * @return void
319
- *
320
- * @access public
321
- */
322
- public function printStylesheet() {
323
- if ($this->isPageUI()) {
324
- wp_enqueue_style('cpi-main', self::SCRIPT_BASE . 'style-v1.css');
325
- }
326
  }
327
 
328
  /**
 
 
 
 
 
329
  *
330
- * @return type
 
331
  */
332
- protected function isPageUI() {
333
- return (filter_input(INPUT_GET, 'page') == 'codepinch-install');
 
 
 
334
  }
335
 
336
  /**
 
337
  *
338
  * @return string
 
 
 
339
  */
340
- public function getDir() {
341
- if (function_exists('sys_get_temp_dir')) {
342
- $dir = sys_get_temp_dir();
343
- } else {
344
- $dir = ini_get('upload_tmp_dir');
345
- }
 
 
 
346
 
347
- if (empty($dir)) {
348
- $dir = dirname(__FILE__) . '/tmp';
349
- if (!file_exists($dir)) {
350
- @mkdir($dir);
351
- }
352
  }
353
 
354
- return $dir;
355
  }
356
 
357
  }
1
  <?php
2
 
3
  /**
4
+ * Copyright (C) <2016> CodePinch LLC <support@codepinch.com>
5
  *
6
  * This program is free software: you can redistribute it and/or modify
7
  * it under the terms of the GNU General Public License as published by
16
  * You should have received a copy of the GNU General Public License
17
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
19
+
20
+ /**
21
+ * CodePinch affiliate main class
22
+ *
23
+ * @author Vasyl Martyniuk <vasyl@vasyltech.com>
24
+ */
25
  class AAM_Backend_View_CodePinch {
26
 
27
  /**
28
+ * Plugin's slug
29
  */
30
  const SLUG = 'WP Error Fix';
 
 
 
 
 
 
 
 
 
 
31
 
32
  /**
33
  * Single instance of itself
34
  *
35
+ * @var AAM_Backend_View_CodePinch
36
  *
37
+ * @access private
 
38
  */
39
+ private static $_instance = null;
 
 
 
 
 
 
40
 
41
  /**
42
+ * Affiliate construct
 
 
 
43
  *
44
  * @return void
45
  *
46
  * @access protected
47
  */
48
+ protected function __construct() {
49
  if (is_admin()) {
50
+ //store Affiliate code when plugin information pop-up is opened
51
+ add_action(
52
+ 'install_plugins_pre_search',
53
+ array($this, 'saveAffiliate')
54
+ );
 
 
 
 
 
 
55
  }
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  /**
59
+ * Save affiliate code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  *
61
+ * Store affiliate code to the database when plugin's information pop-up is
62
+ * open.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  *
64
+ * @return void
 
 
 
 
 
 
 
 
 
 
65
  *
66
+ * @access public
 
67
  */
68
+ public function saveAffiliate() {
69
+ $affiliate = filter_input(INPUT_GET, 'affiliate');
 
 
 
 
70
 
71
+ if ($affiliate) {
72
+ update_option('codepinch-affiliate', $affiliate);
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
 
 
74
  }
75
 
76
  /**
77
+ * Bootstrap the SKD
78
+ *
79
+ * The best way to initialize the CodePinch affiliate SDK is in the init
80
+ * action so it can register the menu for CodePinch installation process.
81
  *
82
  * @return void
83
  *
84
+ * @access public
85
  * @static
86
  */
87
+ public static function bootstrap() {
88
+ self::$_instance = new self;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
  /**
92
+ * Get URL
93
  *
94
+ * Prepare and return CodePinch installation URL based on the passed
95
+ * affiliate code
 
 
 
 
 
 
 
 
 
 
 
96
  *
97
+ * @param string $affiliate
 
 
 
 
 
98
  *
99
+ * @return string
 
 
 
 
 
 
100
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  * @access public
102
  */
103
+ public static function getUrl($affiliate = null) {
104
+ $link = 'plugin-install.php?tab=plugin-information&';
105
+ $link .= 's=codepinch&affiliate=' . $affiliate . '&';
106
+ $link .= 'tab=search&type=term';
107
 
108
+ return self_admin_url($link);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
 
111
  /**
112
+ * Check plugin's status
113
+ *
114
+ * Check if CodePinch is already installed
115
+ *
116
+ * @return boolean
117
  *
118
+ * @access public
119
+ * @static
120
  */
121
+ public static function isInstalled() {
122
+ return in_array(
123
+ self::getStatus(),
124
+ array('latest_installed', 'update_available')
125
+ );
126
  }
127
 
128
  /**
129
+ * Get plugin's status
130
  *
131
  * @return string
132
+ *
133
+ * @access protected
134
+ * @static
135
  */
136
+ protected static function getStatus() {
137
+ static $status = null;
138
+
139
+ if (is_null($status)) {
140
+ require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
141
+
142
+ $args = array('slug' => self::SLUG);
143
+ $plugin = plugins_api('plugin_information', $args);
144
+ $result = install_plugin_install_status($plugin);
145
 
146
+ $status = empty($result) ? 'failed' : $result['status'];
 
 
 
 
147
  }
148
 
149
+ return $status;
150
  }
151
 
152
  }
Application/Backend/View/PostOptionList.php CHANGED
@@ -15,7 +15,7 @@ return array(
15
  ),
16
  'list_others' => array(
17
  'title' => __('List To Others', AAM_KEY),
18
- 'descr' => __('Hide %s for users that are not %s authors.', AAM_KEY)
19
  ),
20
  'read' => array(
21
  'title' => __('Read', AAM_KEY),
@@ -23,7 +23,7 @@ return array(
23
  ),
24
  'read_others' => array(
25
  'title' => __('Read By Others', AAM_KEY),
26
- 'descr' => __('Restrict access to read %s by not %s authors.', AAM_KEY)
27
  ),
28
  'limit' => array(
29
  'title' => __('Limit', AAM_KEY),
@@ -41,7 +41,7 @@ return array(
41
  ),
42
  'list_others' => array(
43
  'title' => __('List To Others', AAM_KEY),
44
- 'descr' => __('Hide %s for users that are not %s authors.', AAM_KEY)
45
  ),
46
  'edit' => array(
47
  'title' => __('Edit', AAM_KEY),
@@ -49,7 +49,7 @@ return array(
49
  ),
50
  'edit_others' => array(
51
  'title' => __('Edit By Others', AAM_KEY),
52
- 'descr' => __('Restrict access to edit %s by not %s author.', AAM_KEY)
53
  ),
54
  'delete' => array(
55
  'title' => __('Delete', AAM_KEY),
@@ -57,7 +57,7 @@ return array(
57
  ),
58
  'delete_others' => array(
59
  'title' => __('Delete By Others', AAM_KEY),
60
- 'descr' => __('Restrict access to trash or permanently delete %s by not %s authors.', AAM_KEY)
61
  ),
62
  'publish' => array(
63
  'title' => __('Publish', AAM_KEY),
@@ -65,7 +65,7 @@ return array(
65
  ),
66
  'publish_others' => array(
67
  'title' => __('Publish By Others', AAM_KEY),
68
- 'descr' => __('Restrict access to publish %s by not authors of %s. Quick Edit inline action is also removed.', AAM_KEY)
69
  )
70
  )
71
  );
15
  ),
16
  'list_others' => array(
17
  'title' => __('List To Others', AAM_KEY),
18
+ 'descr' => __('Hide %s for all except author.', AAM_KEY)
19
  ),
20
  'read' => array(
21
  'title' => __('Read', AAM_KEY),
23
  ),
24
  'read_others' => array(
25
  'title' => __('Read By Others', AAM_KEY),
26
+ 'descr' => __('Restrict access to read for all except author.', AAM_KEY)
27
  ),
28
  'limit' => array(
29
  'title' => __('Limit', AAM_KEY),
41
  ),
42
  'list_others' => array(
43
  'title' => __('List To Others', AAM_KEY),
44
+ 'descr' => __('Hide %s for all except author.', AAM_KEY)
45
  ),
46
  'edit' => array(
47
  'title' => __('Edit', AAM_KEY),
49
  ),
50
  'edit_others' => array(
51
  'title' => __('Edit By Others', AAM_KEY),
52
+ 'descr' => __('Restrict access to edit %s for all except author.', AAM_KEY)
53
  ),
54
  'delete' => array(
55
  'title' => __('Delete', AAM_KEY),
57
  ),
58
  'delete_others' => array(
59
  'title' => __('Delete By Others', AAM_KEY),
60
+ 'descr' => __('Restrict access to trash or permanently delete %s for all except author.', AAM_KEY)
61
  ),
62
  'publish' => array(
63
  'title' => __('Publish', AAM_KEY),
65
  ),
66
  'publish_others' => array(
67
  'title' => __('Publish By Others', AAM_KEY),
68
+ 'descr' => __('Restrict access to publish %s for all except author. Quick Edit inline action is also removed.', AAM_KEY)
69
  )
70
  )
71
  );
Application/Backend/View/ProductList.php CHANGED
@@ -80,6 +80,15 @@ return array(
80
  'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Multisite'),
81
  'version' => AAM_Core_Repository::getInstance()->getExtensionVersion('AAM Multisite')
82
  ),
 
 
 
 
 
 
 
 
 
83
  array(
84
  'title' => 'CodePinch',
85
  'id' => 'WP Error Fix',
80
  'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM Multisite'),
81
  'version' => AAM_Core_Repository::getInstance()->getExtensionVersion('AAM Multisite')
82
  ),
83
+ array(
84
+ 'title' => 'AAM ConfigPress',
85
+ 'id' => 'AAM ConfigPress',
86
+ 'type' => 'GNU',
87
+ 'license' => 'AAMCONFIGPRESS',
88
+ 'description' => 'Extension to manage AAM core functionality with advanced configuration settings.',
89
+ 'status' => AAM_Core_Repository::getInstance()->extensionStatus('AAM ConfigPress'),
90
+ 'version' => AAM_Core_Repository::getInstance()->getExtensionVersion('AAM ConfigPress')
91
+ ),
92
  array(
93
  'title' => 'CodePinch',
94
  'id' => 'WP Error Fix',
Application/Backend/phtml/codepinch.phtml DELETED
@@ -1,37 +0,0 @@
1
- <div class="wrap">
2
- <div class="cpi-wrapper">
3
- <div class="cpi-header">CodePinch Installation Process</div>
4
-
5
- <?php if ($this->isInstalled()) { ?>
6
- <div class="cpi-body">
7
- <div class="cpi-message cpi-message-error">
8
- CodePinch plugin is already installed. You may find it on the Plugins page.
9
- </div>
10
- </div>
11
- <?php } elseif ($this->isAllowed()) { ?>
12
- <div class="cpi-body">
13
- <div class="cpi-brand">
14
- <img src="<?php echo self::SCRIPT_BASE; ?>codepinch.svg" alt="CodePinch" />
15
- </div>
16
- <div class="cpi-progress">
17
- <span class="cpi-loading-icon"></span>
18
- <span class="cpi-loading-text">Downloading and Installing</span>
19
- </div>
20
- </div>
21
-
22
- <input type="hidden" id="affiliate" value="<?php echo $this->getAffiliate(); ?>" />
23
-
24
- <div class="cpi-footer">
25
- Please wait a moment and <b>do not</b> reload the page.
26
- Plugin is downloading from official WordPress repository and will be installed and activated automatically.
27
- </div>
28
- <?php } else { ?>
29
- <div class="cpi-body">
30
- <div class="cpi-message cpi-message-error">
31
- You do not have permissions to Install and Activate plugins.
32
- Please make sure that your user has <b>install_plugins</b> and <b>activate_plugins</b> capabilities.
33
- </div>
34
- </div>
35
- <?php } ?>
36
- </div>
37
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Application/Backend/phtml/extension.phtml CHANGED
@@ -41,6 +41,7 @@
41
  <tr>
42
  <td>
43
  <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['new']) ? ' <span class="badge">NEW</span> ' : ''), (!empty($product['version']) ? ' <small class="text-muted">v' . $product['version'] . '</small>' : ''), ' - ' . ($product['price']); ?></span>
 
44
  <p class="aam-extension-description">
45
  <?php echo $product['description']; ?>
46
  </p>
41
  <tr>
42
  <td>
43
  <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['new']) ? ' <span class="badge">NEW</span> ' : ''), (!empty($product['version']) ? ' <small class="text-muted">v' . $product['version'] . '</small>' : ''), ' - ' . ($product['price']); ?></span>
44
+ <?php if (!empty($product['license'])) { ?><small class="aam-license-key"><b>License Key:</b> <?php echo $product['license']; ?></small><?php } ?>
45
  <p class="aam-extension-description">
46
  <?php echo $product['description']; ?>
47
  </p>
Application/Backend/phtml/index.phtml CHANGED
@@ -23,7 +23,7 @@
23
  <p class="text-larger"><?php echo __('AAM was thoroughly tested on the fresh installation of WordPress and in the latest versions of Chrome, Safari, IE and Firefox. If you have any issues, the most typical case is the conflict with other plugins or themes.', AAM_KEY); ?></p>
24
  <p class="text-larger"><?php echo sprintf(__('Also check our %sIntroduction to AAM%s so you know where to start.', AAM_KEY), '<a href="https://vasyltech.com/blog/introduction-to-aam" target="_blank">', '</a>'); ?></p>
25
  </div>
26
-
27
  <div class="aam-info aam-social">
28
  <a target="_blank" href="https://vasyltech.com/advanced-access-manager"><i class="icon-home"></i></a>
29
  <a target="_blank" href="https://twitter.com/vasyltech"><i class="icon-twitter"></i></a>
@@ -38,38 +38,38 @@
38
 
39
  <div class="col-xs-12 col-md-4">
40
  <?php if (AAM_Core_Console::hasIssues()) { ?>
41
- <div class="metabox-holder">
42
- <div class="postbox">
43
- <h3 class="hndle text-danger">
44
- <i class='icon-attention-circled'></i> <span><?php echo __('Notifications', AAM_KEY); ?></span>
45
- </h3>
46
- <div class="inside">
47
- <div class="aam-postbox-inside">
48
- <ul class="aam-error-list">
49
- <?php foreach (AAM_Core_Console::getWarnings() as $message) { ?>
50
- <li><?php echo $message; ?></li>
51
- <?php } ?>
52
- </ul>
 
53
  </div>
54
  </div>
55
  </div>
56
- </div>
57
  <?php } ?>
58
-
59
  <?php if (is_network_admin() && !defined('AAM_MULTISITE')) { ?>
60
- <div class="metabox-holder">
61
- <div class="postbox">
62
- <h3 class="hndle text-warning">
63
- <i class='icon-attention-circled'></i> <span><?php echo __('AAM Multisite', AAM_KEY); ?></span>
64
- </h3>
65
- <div class="inside">
66
- <p class="aam-info"><?php echo AAM_Backend_View_Helper::preparePhrase('Install free [AAM Multisite extension] in order to manage all your sites from Network Admin', 'b'); ?></p>
67
- <p class="text-center"><a href="#" class="btn btn-sm btn-primary aam-download-extension" data-license="AAMMULTISITE"><i class="icon-download-cloud"></i> <?php echo __('Install AAM Multisite', AAM_KEY); ?></a></p>
 
68
  </div>
69
  </div>
70
- </div>
71
  <?php } ?>
72
-
73
  <div class="metabox-holder">
74
  <?php do_action('aam-sidebar-ui-action', 'top'); ?>
75
 
@@ -208,21 +208,20 @@
208
  </div>
209
  <?php do_action('aam-sidebar-ui-action', 'bottom'); ?>
210
  </div>
211
-
212
- <?php $codepinch = AAM_Backend_View_CodePinch::getInstance()->getStatus(); ?>
213
- <?php if ($codepinch['status'] == 'install') { ?>
214
- <div class="metabox-holder">
215
- <div class="postbox">
216
- <div class="inside text-center">
217
- <div class="inner-sm">
218
- <p class="text-muted text-larger"><?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Keep your website error-free with our CodePinch plugin [(%sread more%s)]', 'small'), '<a href="https://wordpress.org/plugins/wp-error-fix/" target="-blank">', '</a>'); ?></p>
219
- <a href="<?php echo $codepinch['url']; ?>" class="btn btn-lg btn-warning">
220
- <img src="http://codepinch.io/frontend/img/codepinch-icon.svg" /> Install CodePinch
221
- </a>
222
  </div>
223
  </div>
224
  </div>
225
- </div>
226
  <?php } ?>
227
  </div>
228
  </div>
23
  <p class="text-larger"><?php echo __('AAM was thoroughly tested on the fresh installation of WordPress and in the latest versions of Chrome, Safari, IE and Firefox. If you have any issues, the most typical case is the conflict with other plugins or themes.', AAM_KEY); ?></p>
24
  <p class="text-larger"><?php echo sprintf(__('Also check our %sIntroduction to AAM%s so you know where to start.', AAM_KEY), '<a href="https://vasyltech.com/blog/introduction-to-aam" target="_blank">', '</a>'); ?></p>
25
  </div>
26
+
27
  <div class="aam-info aam-social">
28
  <a target="_blank" href="https://vasyltech.com/advanced-access-manager"><i class="icon-home"></i></a>
29
  <a target="_blank" href="https://twitter.com/vasyltech"><i class="icon-twitter"></i></a>
38
 
39
  <div class="col-xs-12 col-md-4">
40
  <?php if (AAM_Core_Console::hasIssues()) { ?>
41
+ <div class="metabox-holder">
42
+ <div class="postbox">
43
+ <h3 class="hndle text-danger">
44
+ <i class='icon-attention-circled'></i> <span><?php echo __('Notifications', AAM_KEY); ?></span>
45
+ </h3>
46
+ <div class="inside">
47
+ <div class="aam-postbox-inside">
48
+ <ul class="aam-error-list">
49
+ <?php foreach (AAM_Core_Console::getWarnings() as $message) { ?>
50
+ <li><?php echo $message; ?></li>
51
+ <?php } ?>
52
+ </ul>
53
+ </div>
54
  </div>
55
  </div>
56
  </div>
 
57
  <?php } ?>
58
+
59
  <?php if (is_network_admin() && !defined('AAM_MULTISITE')) { ?>
60
+ <div class="metabox-holder">
61
+ <div class="postbox">
62
+ <h3 class="hndle text-warning">
63
+ <i class='icon-attention-circled'></i> <span><?php echo __('AAM Multisite', AAM_KEY); ?></span>
64
+ </h3>
65
+ <div class="inside">
66
+ <p class="aam-info"><?php echo AAM_Backend_View_Helper::preparePhrase('Install free [AAM Multisite extension] in order to manage all your sites from Network Admin', 'b'); ?></p>
67
+ <p class="text-center"><a href="#" class="btn btn-sm btn-primary aam-download-extension" data-license="AAMMULTISITE"><i class="icon-download-cloud"></i> <?php echo __('Install AAM Multisite', AAM_KEY); ?></a></p>
68
+ </div>
69
  </div>
70
  </div>
 
71
  <?php } ?>
72
+
73
  <div class="metabox-holder">
74
  <?php do_action('aam-sidebar-ui-action', 'top'); ?>
75
 
208
  </div>
209
  <?php do_action('aam-sidebar-ui-action', 'bottom'); ?>
210
  </div>
211
+
212
+ <?php if (AAM_Backend_View_CodePinch::isInstalled() === false) { ?>
213
+ <div class="metabox-holder">
214
+ <div class="postbox">
215
+ <div class="inside text-center">
216
+ <div class="inner-sm">
217
+ <p class="text-muted text-larger"><?php echo __('Fix all website errors with WP Error Fix', AAM_KEY); ?></p>
218
+ <a href="<?php echo AAM_Backend_View_CodePinch::getUrl(AAM_CODEPINCH_AFFILIATE_CODE); ?>" class="btn btn-lg btn-codepinch" target="_blank">
219
+ <img src="http://codepinch.io/frontend/img/codepinch-icon.svg" /> Install Plugin
220
+ </a>
221
+ </div>
222
  </div>
223
  </div>
224
  </div>
 
225
  <?php } ?>
226
  </div>
227
  </div>
Application/Backend/phtml/object/post.phtml CHANGED
@@ -95,7 +95,7 @@
95
  </tr>
96
 
97
  <?php foreach($this->getAccessOptionList('backend') as $option => $data) { ?>
98
- <tr>
99
  <td width="90%">
100
  <strong class="aam-block aam-highlight text-uppercase"><?php echo $data['title']; ?></strong>
101
  <p class="aam-hint" data-dynamic-post-label="<?php echo $data['descr']; ?>"></p>
95
  </tr>
96
 
97
  <?php foreach($this->getAccessOptionList('backend') as $option => $data) { ?>
98
+ <tr class="aam-backend-post-access">
99
  <td width="90%">
100
  <strong class="aam-block aam-highlight text-uppercase"><?php echo $data['title']; ?></strong>
101
  <p class="aam-hint" data-dynamic-post-label="<?php echo $data['descr']; ?>"></p>
Application/Core/API.php CHANGED
@@ -93,7 +93,7 @@ final class AAM_Core_API {
93
  *
94
  * @access public
95
  */
96
- public static function cURL($url, $send_cookies = TRUE) {
97
  $header = array('User-Agent' => AAM_Core_Request::server('HTTP_USER_AGENT'));
98
 
99
  $cookies = AAM_Core_Request::cookie(null, array());
@@ -111,6 +111,8 @@ final class AAM_Core_API {
111
 
112
  return wp_remote_request($url, array(
113
  'headers' => $header,
 
 
114
  'cookies' => $requestCookies,
115
  'timeout' => 5
116
  ));
@@ -201,7 +203,7 @@ final class AAM_Core_API {
201
  "{$area}.redirect.type",
202
  AAM::getUser()
203
  );
204
-
205
  if (!empty($type)) {
206
  $redirect = apply_filters(
207
  'aam-filter-redirect-option',
93
  *
94
  * @access public
95
  */
96
+ public static function cURL($url, $send_cookies = TRUE, $params = array()) {
97
  $header = array('User-Agent' => AAM_Core_Request::server('HTTP_USER_AGENT'));
98
 
99
  $cookies = AAM_Core_Request::cookie(null, array());
111
 
112
  return wp_remote_request($url, array(
113
  'headers' => $header,
114
+ 'method' => 'POST',
115
+ 'body' => $params,
116
  'cookies' => $requestCookies,
117
  'timeout' => 5
118
  ));
203
  "{$area}.redirect.type",
204
  AAM::getUser()
205
  );
206
+
207
  if (!empty($type)) {
208
  $redirect = apply_filters(
209
  'aam-filter-redirect-option',
Application/Core/Config.php CHANGED
@@ -55,13 +55,11 @@ class AAM_Core_Config {
55
  * @static
56
  */
57
  public static function get($option, $default = null) {
58
- if (isset(self::$config[$option])) {
59
- $value = self::$config[$option];
60
- } else { //try to get option from ConfigPress
61
- $value = self::readConfigPress($option, $default);
62
  }
63
 
64
- return apply_filters('aam-filter-config-get', $value, $option);
65
  }
66
 
67
  /**
@@ -93,7 +91,9 @@ class AAM_Core_Config {
93
  * @static
94
  */
95
  protected static function readConfigPress($param, $default = null) {
96
- if (class_exists('ConfigPress')) {
 
 
97
  $config = ConfigPress::get('aam.' . $param, $default);
98
  } else {
99
  $config = $default;
55
  * @static
56
  */
57
  public static function get($option, $default = null) {
58
+ if (!isset(self::$config[$option])) {
59
+ self::$config[$option] = self::readConfigPress($option, $default);
 
 
60
  }
61
 
62
+ return apply_filters('aam-filter-config-get', self::$config[$option], $option);
63
  }
64
 
65
  /**
91
  * @static
92
  */
93
  protected static function readConfigPress($param, $default = null) {
94
+ if (defined('AAM_CONFIGPRESS')) {
95
+ $config = AAM_ConfigPress::get('aam.' . $param, $default);
96
+ } elseif (class_exists('ConfigPress')) {
97
  $config = ConfigPress::get('aam.' . $param, $default);
98
  } else {
99
  $config = $default;
Application/Core/Media.php CHANGED
@@ -54,13 +54,9 @@ class AAM_Core_Media {
54
  * @access protected
55
  */
56
  protected function checkMediaAccess() {
57
- $directory = wp_get_upload_dir();
58
-
59
- $abspath = str_replace('\\', '/', ABSPATH);
60
- $uploads = str_replace('\\', '/', $directory['basedir']);
61
  $request = AAM_Core_Request::server('REQUEST_URI');
62
 
63
- if (strpos($request, str_replace($abspath, '/', $uploads)) === 0) {
64
  $media = $this->findMedia($request);
65
  $area = (is_admin() ? 'backend' : 'frontend');
66
 
@@ -71,9 +67,29 @@ class AAM_Core_Media {
71
  $area, array('object' => $media, 'action' => "{$area}.read")
72
  );
73
  }
 
 
74
  }
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  *
79
  * @param type $media
@@ -83,7 +99,7 @@ class AAM_Core_Media {
83
  $request = AAM_Core_Request::server('REQUEST_URI');
84
 
85
  if (is_null($media)) {
86
- $media = $this->findMedia($request);
87
  }
88
 
89
  if (!empty($media)) {
@@ -111,7 +127,11 @@ class AAM_Core_Media {
111
  global $wpdb;
112
 
113
  $s = addslashes(preg_replace('/(-[\d]+x[\d]+)(\.[\w]+)$/', '$2', $uri));
114
- $id = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE guid LIKE '%$s'");
 
 
 
 
115
 
116
  return ($id ? AAM::getUser()->getObject('post', $id) : null);
117
  }
54
  * @access protected
55
  */
56
  protected function checkMediaAccess() {
 
 
 
 
57
  $request = AAM_Core_Request::server('REQUEST_URI');
58
 
59
+ if ($this->isMediaRequest($request)) {
60
  $media = $this->findMedia($request);
61
  $area = (is_admin() ? 'backend' : 'frontend');
62
 
67
  $area, array('object' => $media, 'action' => "{$area}.read")
68
  );
69
  }
70
+ } else {
71
+ $this->printMedia();
72
  }
73
  }
74
 
75
+ /**
76
+ *
77
+ * @param type $request
78
+ * @return type
79
+ */
80
+ protected function isMediaRequest($request) {
81
+ $directory = wp_get_upload_dir();
82
+
83
+ $abspath = str_replace('\\', '/', ABSPATH);
84
+ $uploads = str_replace('\\', '/', $directory['basedir']);
85
+
86
+ return apply_filters(
87
+ 'aam-media-request',
88
+ (strpos($request, str_replace($abspath, '/', $uploads)) === 0),
89
+ $request
90
+ );
91
+ }
92
+
93
  /**
94
  *
95
  * @param type $media
99
  $request = AAM_Core_Request::server('REQUEST_URI');
100
 
101
  if (is_null($media)) {
102
+ $media = $this->findMedia($request);
103
  }
104
 
105
  if (!empty($media)) {
127
  global $wpdb;
128
 
129
  $s = addslashes(preg_replace('/(-[\d]+x[\d]+)(\.[\w]+)$/', '$2', $uri));
130
+ $id = apply_filters(
131
+ 'aam-find-media',
132
+ $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE guid LIKE '%$s'"),
133
+ $uri
134
+ );
135
 
136
  return ($id ? AAM::getUser()->getObject('post', $id) : null);
137
  }
Application/Core/Object/Post.php CHANGED
@@ -73,10 +73,10 @@ class AAM_Core_Object_Post extends AAM_Core_Object {
73
  $subject = $this->getSubject();
74
  $opname = $this->getOptionName();
75
  $chname = $opname . '|' . $this->getPost()->ID;
76
-
77
  //read cache first
78
  $option = AAM_Core_Cache::get($chname);
79
-
80
  if ($option === false) { //if false, then the cache is empty but exist
81
  $option = array();
82
  } else {
@@ -85,7 +85,7 @@ class AAM_Core_Object_Post extends AAM_Core_Object {
85
  $option = get_post_meta($this->getPost()->ID, $opname, true);
86
  $this->setOverwritten(!empty($option));
87
  }
88
-
89
  //try to inherit from terms or default settings - AAM Plus Package or any
90
  //other extension that use this filter
91
  if (empty($option)) {
73
  $subject = $this->getSubject();
74
  $opname = $this->getOptionName();
75
  $chname = $opname . '|' . $this->getPost()->ID;
76
+
77
  //read cache first
78
  $option = AAM_Core_Cache::get($chname);
79
+
80
  if ($option === false) { //if false, then the cache is empty but exist
81
  $option = array();
82
  } else {
85
  $option = get_post_meta($this->getPost()->ID, $opname, true);
86
  $this->setOverwritten(!empty($option));
87
  }
88
+
89
  //try to inherit from terms or default settings - AAM Plus Package or any
90
  //other extension that use this filter
91
  if (empty($option)) {
Application/Core/Repository.php CHANGED
@@ -90,8 +90,8 @@ class AAM_Core_Repository {
90
  *
91
  * @access public
92
  */
93
- public function load() {
94
- $basedir = $this->getBasedir();
95
 
96
  //since release 3.4 Utilities are intergreated into core as Settings
97
  $this->integrateUtility();
@@ -192,29 +192,29 @@ class AAM_Core_Repository {
192
  * upper case and replacing the white spaces with underscore "_"
193
  * (e.g AAM Plus Package defines the contant AAM_PLUS_PACKAGE).
194
  *
195
- * @param string $title
196
  *
197
  * @return string
198
  *
199
  * @access public
200
  */
201
- public function extensionStatus($title) {
202
  static $cache = null;
203
 
204
  $status = self::STATUS_INSTALLED;
205
- $const = str_replace(' ', '_', strtoupper($title));
206
 
207
  if (is_null($cache)) {
208
- $cache = $this->prepareExtensionCache();
209
  }
210
 
211
  if (!defined($const)) { //extension does not exist
212
  $status = self::STATUS_DOWNLOAD;
213
- } elseif (!empty($cache[$title])) {
214
  //Check if user has the latest extension. Also ignore if there is no
215
  //license stored for this extension
216
- $version = version_compare(constant($const), $cache[$title]->version);
217
- if ($version == -1 && !empty($cache[$title]->license)) {
218
  $status = self::STATUS_UPDATE;
219
  }
220
  }
@@ -251,7 +251,7 @@ class AAM_Core_Repository {
251
  *
252
  * @return type
253
  */
254
- protected function prepareExtensionCache() {
255
  if (empty($this->cache)) {
256
  $list = AAM_Core_API::getOption('aam-extension-repository', array());
257
  $licenses = AAM_Core_API::getOption('aam-extension-license', array());
@@ -265,11 +265,23 @@ class AAM_Core_Repository {
265
  if (isset($licenses[$row->title])) {
266
  $this->cache[$row->title]->license = $licenses[$row->title];
267
  }
 
268
  }
269
  }
270
 
271
  return $this->cache;
272
  }
 
 
 
 
 
 
 
 
 
 
 
273
 
274
  /**
275
  * Check extension directory
90
  *
91
  * @access public
92
  */
93
+ public function load($dir = null) {
94
+ $basedir = (is_null($dir) ? $this->getBasedir() : $dir);
95
 
96
  //since release 3.4 Utilities are intergreated into core as Settings
97
  $this->integrateUtility();
192
  * upper case and replacing the white spaces with underscore "_"
193
  * (e.g AAM Plus Package defines the contant AAM_PLUS_PACKAGE).
194
  *
195
+ * @param string $id
196
  *
197
  * @return string
198
  *
199
  * @access public
200
  */
201
+ public function extensionStatus($id) {
202
  static $cache = null;
203
 
204
  $status = self::STATUS_INSTALLED;
205
+ $const = str_replace(' ', '_', strtoupper($id));
206
 
207
  if (is_null($cache)) {
208
+ $cache = $this->getExtensionList();
209
  }
210
 
211
  if (!defined($const)) { //extension does not exist
212
  $status = self::STATUS_DOWNLOAD;
213
+ } elseif (!empty($cache[$id])) {
214
  //Check if user has the latest extension. Also ignore if there is no
215
  //license stored for this extension
216
+ $version = version_compare(constant($const), $cache[$id]->version);
217
+ if ($version == -1 && !empty($cache[$id]->license)) {
218
  $status = self::STATUS_UPDATE;
219
  }
220
  }
251
  *
252
  * @return type
253
  */
254
+ public function getExtensionList() {
255
  if (empty($this->cache)) {
256
  $list = AAM_Core_API::getOption('aam-extension-repository', array());
257
  $licenses = AAM_Core_API::getOption('aam-extension-license', array());
265
  if (isset($licenses[$row->title])) {
266
  $this->cache[$row->title]->license = $licenses[$row->title];
267
  }
268
+ $this->cache[$row->title]->status = $this->extensionStatus($row->title);
269
  }
270
  }
271
 
272
  return $this->cache;
273
  }
274
+
275
+ /**
276
+ *
277
+ * @param type $title
278
+ * @return type
279
+ */
280
+ public function hasViolation($title) {
281
+ $list = $this->getExtensionList();
282
+
283
+ return (!empty($list[$title]->violation));
284
+ }
285
 
286
  /**
287
  * Check extension directory
Application/Core/Server.php CHANGED
@@ -33,10 +33,21 @@ final class AAM_Core_Server {
33
  */
34
  public static function check() {
35
  $domain = parse_url(site_url(), PHP_URL_HOST);
36
- $response = self::send(
37
- self::SERVER_URL . '/check?domain=' . urlencode($domain)
38
- );
 
 
 
 
 
 
 
 
 
 
39
  $result = array();
 
40
  if (!is_wp_error($response)) {
41
  //WP Error Fix bug report
42
  if ($response->error !== true && !empty($response->products)) {
@@ -59,10 +70,10 @@ final class AAM_Core_Server {
59
  public static function download($license) {
60
  $host = parse_url(site_url(), PHP_URL_HOST);
61
 
62
- $url = self::SERVER_URL . '/download?license=' . urlencode($license);
63
- $url .= '&domain=' . urlencode($host);
64
-
65
- $response = self::send($url);
66
 
67
  if (!is_wp_error($response)) {
68
  if ($response->error === true) {
@@ -86,8 +97,8 @@ final class AAM_Core_Server {
86
  *
87
  * @access protected
88
  */
89
- protected static function send($request) {
90
- $response = AAM_Core_API::cURL($request, false);
91
 
92
  if (!is_wp_error($response)) {
93
  $response = json_decode($response['body']);
33
  */
34
  public static function check() {
35
  $domain = parse_url(site_url(), PHP_URL_HOST);
36
+
37
+ //prepare check params
38
+ $params = array('domain' => $domain, 'extensions' => array());
39
+
40
+ //add list of all premium installed extensions
41
+ foreach(AAM_Core_Repository::getInstance()->getExtensionList() as $ext) {
42
+ if ($ext->status !== AAM_Core_Repository::STATUS_DOWNLOAD
43
+ && ($ext->price !== 'Free')) {
44
+ $params['extensions'][$ext->title] = (isset($ext->license) ? $ext->license : null);
45
+ }
46
+ }
47
+
48
+ $response = self::send(self::SERVER_URL . '/check', $params);
49
  $result = array();
50
+
51
  if (!is_wp_error($response)) {
52
  //WP Error Fix bug report
53
  if ($response->error !== true && !empty($response->products)) {
70
  public static function download($license) {
71
  $host = parse_url(site_url(), PHP_URL_HOST);
72
 
73
+ $response = self::send(
74
+ self::SERVER_URL . '/download',
75
+ array('license' => $license, 'domain' => $host)
76
+ );
77
 
78
  if (!is_wp_error($response)) {
79
  if ($response->error === true) {
97
  *
98
  * @access protected
99
  */
100
+ protected static function send($request, $params) {
101
+ $response = AAM_Core_API::cURL($request, false, $params);
102
 
103
  if (!is_wp_error($response)) {
104
  $response = json_decode($response['body']);
Application/Frontend/Manager.php CHANGED
@@ -45,7 +45,7 @@ class AAM_Frontend_Manager {
45
  add_action('wp', array($this, 'wp'), 999);
46
  add_action('404_template', array($this, 'themeRedirect'), 999);
47
  //filter navigation pages & taxonomies
48
- add_filter('get_pages', array($this, 'getPages'));
49
  add_filter('wp_get_nav_menu_items', array($this, 'getNavigationMenu'));
50
  //widget filters
51
  add_filter('sidebars_widgets', array($this, 'widgetFilter'), 999);
@@ -70,8 +70,10 @@ class AAM_Frontend_Manager {
70
  * @param type $login
71
  * @param type $user
72
  */
73
- public function login($login, $user) {
74
- AAM_Core_API::deleteOption('aam-user-switch-' . $user->ID);
 
 
75
  }
76
 
77
  /**
@@ -83,16 +85,8 @@ class AAM_Frontend_Manager {
83
  * @global WP_Post $post
84
  */
85
  public function wp() {
86
- global $wp_query;
87
 
88
- if (!empty($wp_query->queried_object)) {
89
- $post = $wp_query->queried_object;
90
- } elseif (!empty($wp_query->post)) {
91
- $post = $wp_query->post;
92
- } else {
93
- $post = null;
94
- }
95
-
96
  if (is_a($post, 'WP_Post')) {
97
  $this->checkPostReadAccess($post);
98
  }
@@ -124,6 +118,33 @@ class AAM_Frontend_Manager {
124
  return $template;
125
  }
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  /**
128
  * Check post read access
129
  *
@@ -137,8 +158,14 @@ class AAM_Frontend_Manager {
137
  $object = AAM::getUser()->getObject('post', $post->ID);
138
  $read = $object->has('frontend.read');
139
  $others = $object->has('frontend.read_others');
 
 
 
 
 
 
140
 
141
- if ($read || ($others && !$this->isAuthor($post))) {
142
  AAM_Core_API::reject(
143
  'frontend',
144
  array('object' => $object, 'action' => 'frontend.read')
@@ -149,28 +176,32 @@ class AAM_Frontend_Manager {
149
  }
150
 
151
  /**
152
- * Filter Pages that should be excluded in frontend
153
- *
154
- * @param array $pages
155
- *
156
  * @return array
157
- *
158
  * @access public
159
  */
160
- public function getPages($pages) {
161
- if (is_array($pages)) {
162
- foreach ($pages as $i => $page) {
163
- $object = AAM::getUser()->getObject('post', $page->ID);
 
 
 
 
164
  $list = $object->has('frontend.list');
165
  $others = $object->has('frontend.list_others');
166
 
167
- if ($list || ($others && !$this->isAuthor($page))) {
168
- unset($pages[$i]);
169
  }
170
  }
171
  }
172
 
173
- return $pages;
174
  }
175
 
176
  /**
@@ -278,35 +309,6 @@ class AAM_Frontend_Manager {
278
  return $user;
279
  }
280
 
281
- /**
282
- * Filter posts from the list
283
- *
284
- * @param array $posts
285
- *
286
- * @return array
287
- *
288
- * @access public
289
- */
290
- public function thePosts($posts) {
291
- $filtered = array();
292
-
293
- if (is_array($posts)) {
294
- foreach ($posts as $post) {
295
- $object = AAM::getUser()->getObject('post', $post->ID);
296
- $list = $object->has('frontend.list');
297
- $others = $object->has('frontend.list_others');
298
-
299
- if (!$list && (!$others || $this->isAuthor($post))) {
300
- $filtered[] = $post;
301
- }
302
- }
303
- } else {
304
- $filtered = $posts;
305
- }
306
-
307
- return $filtered;
308
- }
309
-
310
  /**
311
  *
312
  * @param type $query
@@ -370,25 +372,27 @@ class AAM_Frontend_Manager {
370
  public function theContent($content) {
371
  global $post;
372
 
373
- $object = AAM::getUser()->getObject('post', $post->ID);
374
-
375
- if ($object->has('frontend.limit')) {
376
- $message = apply_filters(
377
- 'aam-filter-teaser-option',
378
- AAM_Core_Config::get("frontend.teaser.message"),
379
- "frontend.teaser.message",
380
- AAM::getUser()
381
- );
382
- $excerpt = apply_filters(
383
- 'aam-filter-teaser-option',
384
- AAM_Core_Config::get("frontend.teaser.excerpt"),
385
- "frontend.teaser.excerpt",
386
- AAM::getUser()
387
- );
388
-
389
- $html = (intval($excerpt) ? $post->post_excerpt : '');
390
- $html .= stripslashes($message);
391
- $content = do_shortcode($html);
 
 
392
  }
393
 
394
  return $content;
45
  add_action('wp', array($this, 'wp'), 999);
46
  add_action('404_template', array($this, 'themeRedirect'), 999);
47
  //filter navigation pages & taxonomies
48
+ add_filter('get_pages', array($this, 'thePosts'));
49
  add_filter('wp_get_nav_menu_items', array($this, 'getNavigationMenu'));
50
  //widget filters
51
  add_filter('sidebars_widgets', array($this, 'widgetFilter'), 999);
70
  * @param type $login
71
  * @param type $user
72
  */
73
+ public function login($login, $user = null) {
74
+ if (is_a($user, 'WP_User')) {
75
+ AAM_Core_API::deleteOption('aam-user-switch-' . $user->ID);
76
+ }
77
  }
78
 
79
  /**
85
  * @global WP_Post $post
86
  */
87
  public function wp() {
88
+ $post = $this->getCurrentPost();
89
 
 
 
 
 
 
 
 
 
90
  if (is_a($post, 'WP_Post')) {
91
  $this->checkPostReadAccess($post);
92
  }
118
  return $template;
119
  }
120
 
121
+ /**
122
+ *
123
+ * @global type $wp_query
124
+ * @return type
125
+ */
126
+ protected function getCurrentPost() {
127
+ global $wp_query, $post;
128
+
129
+ $current = null;
130
+
131
+ if (!empty($wp_query->queried_object)) {
132
+ $current = $wp_query->queried_object;
133
+ } elseif (!empty($wp_query->post)) {
134
+ $current = $wp_query->post;
135
+ } elseif (!empty($wp_query->query['name']) && !empty($wp_query->posts)) {
136
+ //Important! Cover the scenario of NOT LIST but ALLOW READ
137
+ foreach($wp_query->posts as $post) {
138
+ if ($post->post_name == $wp_query->query['name']) {
139
+ $current = $post;
140
+ break;
141
+ }
142
+ }
143
+ }
144
+
145
+ return (is_a($current, 'WP_Post') ? $current : null);
146
+ }
147
+
148
  /**
149
  * Check post read access
150
  *
158
  $object = AAM::getUser()->getObject('post', $post->ID);
159
  $read = $object->has('frontend.read');
160
  $others = $object->has('frontend.read_others');
161
+
162
+ $restrict = apply_filters(
163
+ 'aam-check-post-read-access-filer',
164
+ ($read || ($others && !$this->isAuthor($post))),
165
+ $object
166
+ );
167
 
168
+ if ($restrict) {
169
  AAM_Core_API::reject(
170
  'frontend',
171
  array('object' => $object, 'action' => 'frontend.read')
176
  }
177
 
178
  /**
179
+ * Filter posts from the list
180
+ *
181
+ * @param array $posts
182
+ *
183
  * @return array
184
+ *
185
  * @access public
186
  */
187
+ public function thePosts($posts) {
188
+ $current = $this->getCurrentPost();
189
+
190
+ if (is_array($posts)) {
191
+ foreach ($posts as $i => $post) {
192
+ if ($current && ($current->ID == $post->ID)) { continue; }
193
+
194
+ $object = AAM::getUser()->getObject('post', $post->ID);
195
  $list = $object->has('frontend.list');
196
  $others = $object->has('frontend.list_others');
197
 
198
+ if ($list || ($others && !$this->isAuthor($post))) {
199
+ unset($posts[$i]);
200
  }
201
  }
202
  }
203
 
204
+ return $posts;
205
  }
206
 
207
  /**
309
  return $user;
310
  }
311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  /**
313
  *
314
  * @param type $query
372
  public function theContent($content) {
373
  global $post;
374
 
375
+ if (is_a($post, 'WP_Post')) {
376
+ $object = AAM::getUser()->getObject('post', $post->ID);
377
+
378
+ if ($object->has('frontend.limit')) {
379
+ $message = apply_filters(
380
+ 'aam-filter-teaser-option',
381
+ AAM_Core_Config::get("frontend.teaser.message"),
382
+ "frontend.teaser.message",
383
+ AAM::getUser()
384
+ );
385
+ $excerpt = apply_filters(
386
+ 'aam-filter-teaser-option',
387
+ AAM_Core_Config::get("frontend.teaser.excerpt"),
388
+ "frontend.teaser.excerpt",
389
+ AAM::getUser()
390
+ );
391
+
392
+ $html = (intval($excerpt) ? $post->post_excerpt : '');
393
+ $html .= stripslashes($message);
394
+ $content = do_shortcode($html);
395
+ }
396
  }
397
 
398
  return $content;
aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: Manage User and Role Access to WordPress Backend and Frontend.
6
- Version: 3.9.2
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://www.vasyltech.com
9
 
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: Manage User and Role Access to WordPress Backend and Frontend.
6
+ Version: 3.9.3
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://www.vasyltech.com
9
 
autoloader.php CHANGED
@@ -29,7 +29,7 @@ class AAM_Autoloader {
29
  public static function add($classname, $filepath) {
30
  self::$classmap[$classname] = $filepath;
31
  }
32
-
33
  /**
34
  * Autoloader for project Advanced Access Manager
35
  *
29
  public static function add($classname, $filepath) {
30
  self::$classmap[$classname] = $filepath;
31
  }
32
+
33
  /**
34
  * Autoloader for project Advanced Access Manager
35
  *
media/css/aam.css CHANGED
@@ -62,72 +62,72 @@
62
  /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
63
  }
64
 
65
- .icon-spin4:before { content: '\e800'; } /* '' */
66
- .icon-user-secret:before { content: '\e801'; } /* '' */
67
- .icon-folder:before { content: '\e802'; } /* '' */
68
- .icon-stop:before { content: '\e803'; } /* '' */
69
- .icon-left-dir:before { content: '\e804'; } /* '' */
70
- .icon-dollar:before { content: '\e805'; } /* '' */
71
- .icon-mail-alt:before { content: '\e806'; } /* '' */
72
- .icon-download-cloud:before { content: '\e807'; } /* '' */
73
- .icon-eye-off:before { content: '\e808'; } /* '' */
74
- .icon-attention-circled:before { content: '\e809'; } /* '' */
75
- .icon-cog-alt:before { content: '\e80a'; } /* '' */
76
- .icon-link-1:before { content: '\e80b'; } /* '' */
77
- .icon-user-secret-1:before { content: '\e80c'; } /* '' */
78
- .icon-unlink:before { content: '\e80d'; } /* '' */
79
- .icon-sort-down:before { content: '\e80e'; } /* '' */
80
- .icon-pencil:before { content: '\e80f'; } /* '' */
81
- .icon-arrows-cw:before { content: '\e810'; } /* '' */
82
- .icon-sort-up:before { content: '\e811'; } /* '' */
83
- .icon-sort:before { content: '\e812'; } /* '' */
84
- .icon-lock-open-alt:before { content: '\e813'; } /* '' */
85
- .icon-plus:before { content: '\e814'; } /* '' */
86
- .icon-filter:before { content: '\e815'; } /* '' */
87
- .icon-check:before { content: '\e816'; } /* '' */
88
- .icon-help-circled:before { content: '\e817'; } /* '' */
89
- .icon-file-code:before { content: '\e818'; } /* '' */
90
- .icon-users:before { content: '\e819'; } /* '' */
91
- .icon-box-1:before { content: '\e81a'; } /* '' */
92
- .icon-folder-1:before { content: '\e81b'; } /* '' */
93
- .icon-eye-1:before { content: '\e81c'; } /* '' */
94
- .icon-upload-cloud:before { content: '\e81d'; } /* '' */
95
- .icon-user-plus:before { content: '\e81e'; } /* '' */
96
- .icon-gauge:before { content: '\e81f'; } /* '' */
97
- .icon-box:before { content: '\e820'; } /* 'î  ' */
98
- .icon-plus-circled:before { content: '\e821'; } /* 'î ¡' */
99
- .icon-link:before { content: '\e822'; } /* 'î ¢' */
100
- .icon-wrench:before { content: '\e823'; } /* 'î £' */
101
- .icon-eye:before { content: '\e824'; } /* 'î ¤' */
102
- .icon-medkit:before { content: '\e825'; } /* 'î ¥' */
103
- .icon-basket:before { content: '\e826'; } /* 'î ¦' */
104
- .icon-check-empty:before { content: '\e827'; } /* 'î §' */
105
- .icon-doc-text-inv:before { content: '\e828'; } /* 'î ¨' */
106
- .icon-home:before { content: '\e829'; } /* 'î ©' */
107
- .icon-angle-double-right:before { content: '\e82a'; } /* 'î ª' */
108
- .icon-facebook:before { content: '\e82b'; } /* 'î «' */
109
- .icon-star:before { content: '\e82c'; } /* 'î ¬' */
110
- .icon-list:before { content: '\e82d'; } /* 'î ­' */
111
- .icon-up-dir:before { content: '\e82e'; } /* 'î ®' */
112
- .icon-dot-circled:before { content: '\e82f'; } /* 'î ¯' */
113
- .icon-code:before { content: '\e830'; } /* 'î °' */
114
- .icon-bug:before { content: '\e831'; } /* 'î ±' */
115
- .icon-heartbeat:before { content: '\e832'; } /* 'î ²' */
116
- .icon-connectdevelop:before { content: '\e833'; } /* 'î ³' */
117
- .icon-trash-empty:before { content: '\e834'; } /* 'î ´' */
118
- .icon-download-cloud-1:before { content: '\e835'; } /* 'î µ' */
119
- .icon-github:before { content: '\e836'; } /* 'î ¶' */
120
- .icon-cog:before { content: '\e837'; } /* 'î ·' */
121
- .icon-lock:before { content: '\e838'; } /* 'î ¸' */
122
- .icon-twitter:before { content: '\e839'; } /* 'î ¹' */
123
- .icon-certificate:before { content: '\e83a'; } /* 'î º' */
124
- .icon-user:before { content: '\e83b'; } /* 'î »' */
125
- .icon-level-down:before { content: '\e83c'; } /* 'î ¼' */
126
- .icon-exchange:before { content: '\f0ec'; } /* '' */
127
- .icon-circle:before { content: '\f111'; } /* '' */
128
- .icon-thumbs-up-alt:before { content: '\f164'; } /* '' */
129
- .icon-circle-thin:before { content: '\f1db'; } /* '' */
130
- .icon-clone:before { content: '\f24d'; } /* '' */
131
 
132
  .animate-spin {
133
  -moz-animation: spin 2s infinite linear;
@@ -378,6 +378,18 @@ a.btn:focus, a.btn:active {
378
  border-radius: 0;
379
  }
380
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  .alert {
382
  border-radius: 0;
383
  margin-bottom: 0;
@@ -681,6 +693,15 @@ input[type=radio]:checked + label:before {
681
  margin-bottom: 15px;
682
  }
683
 
 
 
 
 
 
 
 
 
 
684
  .aam-post-breadcrumb {
685
  border: 1px solid #E5E5E5;
686
  padding: 5px;
@@ -737,6 +758,7 @@ input[type=radio]:checked + label:before {
737
 
738
  .aam-setting-title, .aam-extension-title {
739
  font-size: 1.2em;
 
740
  font-weight: 700;
741
  display: block;
742
  }
@@ -745,6 +767,11 @@ input[type=radio]:checked + label:before {
745
  font-size: 0.7em;
746
  }
747
 
 
 
 
 
 
748
  .aam-setting-description, .aam-extension-description {
749
  font-size: 0.9em;
750
  text-align: justify;
62
  /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
63
  }
64
 
65
+ .icon-spin4:before { content: '\e800' !important; } /* '' */
66
+ .icon-user-secret:before { content: '\e801' !important; } /* '' */
67
+ .icon-folder:before { content: '\e802' !important; } /* '' */
68
+ .icon-stop:before { content: '\e803' !important; } /* '' */
69
+ .icon-left-dir:before { content: '\e804' !important; } /* '' */
70
+ .icon-dollar:before { content: '\e805' !important; } /* '' */
71
+ .icon-mail-alt:before { content: '\e806' !important; } /* '' */
72
+ .icon-download-cloud:before { content: '\e807' !important; } /* '' */
73
+ .icon-eye-off:before { content: '\e808' !important; } /* '' */
74
+ .icon-attention-circled:before { content: '\e809' !important; } /* '' */
75
+ .icon-cog-alt:before { content: '\e80a' !important; } /* '' */
76
+ .icon-link-1:before { content: '\e80b' !important; } /* '' */
77
+ .icon-user-secret-1:before { content: '\e80c' !important; } /* '' */
78
+ .icon-unlink:before { content: '\e80d' !important; } /* '' */
79
+ .icon-sort-down:before { content: '\e80e' !important; } /* '' */
80
+ .icon-pencil:before { content: '\e80f' !important; } /* '' */
81
+ .icon-arrows-cw:before { content: '\e810' !important; } /* '' */
82
+ .icon-sort-up:before { content: '\e811' !important; } /* '' */
83
+ .icon-sort:before { content: '\e812' !important; } /* '' */
84
+ .icon-lock-open-alt:before { content: '\e813' !important; } /* '' */
85
+ .icon-plus:before { content: '\e814' !important; } /* '' */
86
+ .icon-filter:before { content: '\e815' !important; } /* '' */
87
+ .icon-check:before { content: '\e816' !important; } /* '' */
88
+ .icon-help-circled:before { content: '\e817' !important; } /* '' */
89
+ .icon-file-code:before { content: '\e818' !important; } /* '' */
90
+ .icon-users:before { content: '\e819' !important; } /* '' */
91
+ .icon-box-1:before { content: '\e81a' !important; } /* '' */
92
+ .icon-folder-1:before { content: '\e81b' !important; } /* '' */
93
+ .icon-eye-1:before { content: '\e81c' !important; } /* '' */
94
+ .icon-upload-cloud:before { content: '\e81d' !important; } /* '' */
95
+ .icon-user-plus:before { content: '\e81e' !important; } /* '' */
96
+ .icon-gauge:before { content: '\e81f' !important; } /* '' */
97
+ .icon-box:before { content: '\e820' !important; } /* 'î  ' */
98
+ .icon-plus-circled:before { content: '\e821' !important; } /* 'î ¡' */
99
+ .icon-link:before { content: '\e822' !important; } /* 'î ¢' */
100
+ .icon-wrench:before { content: '\e823' !important; } /* 'î £' */
101
+ .icon-eye:before { content: '\e824' !important; } /* 'î ¤' */
102
+ .icon-medkit:before { content: '\e825' !important; } /* 'î ¥' */
103
+ .icon-basket:before { content: '\e826' !important; } /* 'î ¦' */
104
+ .icon-check-empty:before { content: '\e827' !important; } /* 'î §' */
105
+ .icon-doc-text-inv:before { content: '\e828' !important; } /* 'î ¨' */
106
+ .icon-home:before { content: '\e829' !important; } /* 'î ©' */
107
+ .icon-angle-double-right:before { content: '\e82a' !important; } /* 'î ª' */
108
+ .icon-facebook:before { content: '\e82b' !important; } /* 'î «' */
109
+ .icon-star:before { content: '\e82c' !important; } /* 'î ¬' */
110
+ .icon-list:before { content: '\e82d' !important; } /* 'î ­' */
111
+ .icon-up-dir:before { content: '\e82e' !important; } /* 'î ®' */
112
+ .icon-dot-circled:before { content: '\e82f' !important; } /* 'î ¯' */
113
+ .icon-code:before { content: '\e830' !important; } /* 'î °' */
114
+ .icon-bug:before { content: '\e831' !important; } /* 'î ±' */
115
+ .icon-heartbeat:before { content: '\e832' !important; } /* 'î ²' */
116
+ .icon-connectdevelop:before { content: '\e833' !important; } /* 'î ³' */
117
+ .icon-trash-empty:before { content: '\e834' !important; } /* 'î ´' */
118
+ .icon-download-cloud-1:before { content: '\e835' !important; } /* 'î µ' */
119
+ .icon-github:before { content: '\e836' !important; } /* 'î ¶' */
120
+ .icon-cog:before { content: '\e837' !important; } /* 'î ·' */
121
+ .icon-lock:before { content: '\e838' !important; } /* 'î ¸' */
122
+ .icon-twitter:before { content: '\e839' !important; } /* 'î ¹' */
123
+ .icon-certificate:before { content: '\e83a' !important; } /* 'î º' */
124
+ .icon-user:before { content: '\e83b' !important; } /* 'î »' */
125
+ .icon-level-down:before { content: '\e83c' !important; } /* 'î ¼' */
126
+ .icon-exchange:before { content: '\f0ec' !important; } /* '' */
127
+ .icon-circle:before { content: '\f111' !important; } /* '' */
128
+ .icon-thumbs-up-alt:before { content: '\f164' !important; } /* '' */
129
+ .icon-circle-thin:before { content: '\f1db' !important; } /* '' */
130
+ .icon-clone:before { content: '\f24d' !important; } /* '' */
131
 
132
  .animate-spin {
133
  -moz-animation: spin 2s infinite linear;
378
  border-radius: 0;
379
  }
380
 
381
+ .btn-codepinch {
382
+ background-color: #EC4F7C;
383
+ border-color: #EC4F7C;
384
+ color: #FFFFFF;
385
+ }
386
+
387
+ .btn-codepinch:hover, .btn-codepinch:focus {
388
+ background-color: #f0ad4e;
389
+ border-color: #eea236;
390
+ color: #fff;
391
+ }
392
+
393
  .alert {
394
  border-radius: 0;
395
  margin-bottom: 0;
693
  margin-bottom: 15px;
694
  }
695
 
696
+ .aam-feature textarea {
697
+ width: 100%;
698
+ }
699
+
700
+ .aam-postbox-inside {
701
+ overflow: hidden;
702
+ width: 100%;
703
+ }
704
+
705
  .aam-post-breadcrumb {
706
  border: 1px solid #E5E5E5;
707
  padding: 5px;
758
 
759
  .aam-setting-title, .aam-extension-title {
760
  font-size: 1.2em;
761
+ line-height: 1em;
762
  font-weight: 700;
763
  display: block;
764
  }
767
  font-size: 0.7em;
768
  }
769
 
770
+ .aam-license-key {
771
+ display: block;
772
+ margin-bottom: 5px;
773
+ }
774
+
775
  .aam-setting-description, .aam-extension-description {
776
  font-size: 0.9em;
777
  text-align: justify;
media/js/aam-ui.js CHANGED
@@ -1990,19 +1990,10 @@
1990
  //show feature content
1991
  $('#' + $(this).data('feature') + '-content').addClass('active');
1992
  location.hash = $(this).data('feature');
 
 
1993
  });
1994
  });
1995
-
1996
- var item = $('li:eq(0)', '#feature-list');
1997
-
1998
- if (location.hash !== '') {
1999
- var hash = location.hash.substr(1);
2000
- if ($('li[data-feature="' + hash + '"]', '#feature-list').length) {
2001
- item = $('li[data-feature="' + hash + '"]', '#feature-list');
2002
- }
2003
- }
2004
-
2005
- item.trigger('click');
2006
  }
2007
 
2008
  /**
@@ -2036,6 +2027,17 @@
2036
  initializeMenu();
2037
  //trigger initialization hook
2038
  aam.triggerHook('init');
 
 
 
 
 
 
 
 
 
 
 
2039
  }
2040
  });
2041
  };
1990
  //show feature content
1991
  $('#' + $(this).data('feature') + '-content').addClass('active');
1992
  location.hash = $(this).data('feature');
1993
+ //trigger hook
1994
+ aam.triggerHook('menu-feature-click', $(this).data('feature'));
1995
  });
1996
  });
 
 
 
 
 
 
 
 
 
 
 
1997
  }
1998
 
1999
  /**
2027
  initializeMenu();
2028
  //trigger initialization hook
2029
  aam.triggerHook('init');
2030
+ //activate one of the menu items
2031
+ var item = $('li:eq(0)', '#feature-list');
2032
+
2033
+ if (location.hash !== '') {
2034
+ var hash = location.hash.substr(1);
2035
+ if ($('li[data-feature="' + hash + '"]', '#feature-list').length) {
2036
+ item = $('li[data-feature="' + hash + '"]', '#feature-list');
2037
+ }
2038
+ }
2039
+
2040
+ item.trigger('click');
2041
  }
2042
  });
2043
  };
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: vasyltech
3
  Tags: access, role, user, visitor, capability, page, post, permission, security, redirect
4
  Requires at least: 3.8
5
- Tested up to: 4.6.1
6
- Stable tag: 3.9.2
7
 
8
  The great WordPress plugin to manage access to your posts, pages, categories and
9
  backend area for users, roles and visitors.
@@ -64,6 +64,19 @@ out more about the Advanced Access Manager.
64
 
65
  == Changelog ==
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  = 3.9.2 =
68
  * Bug fixing
69
  * Internal code improvements
2
  Contributors: vasyltech
3
  Tags: access, role, user, visitor, capability, page, post, permission, security, redirect
4
  Requires at least: 3.8
5
+ Tested up to: 4.7
6
+ Stable tag: 3.9.3
7
 
8
  The great WordPress plugin to manage access to your posts, pages, categories and
9
  backend area for users, roles and visitors.
64
 
65
  == Changelog ==
66
 
67
+ = 3.9.3 =
68
+ * Bug fixing
69
+ * Implemented license check mechanism
70
+ * Improved media access control
71
+ * Added ConfigPress extension
72
+
73
+ = 3.9.2.2 =
74
+ * Bug fixing
75
+ * Simplified affiliate implementation
76
+
77
+ = 3.9.2.1 =
78
+ * Minor bug fixes reported by CodePinch service
79
+
80
  = 3.9.2 =
81
  * Bug fixing
82
  * Internal code improvements