WPFront User Role Editor - Version 2.11.3

Version Description

  • CSS fix.
Download this release

Release Info

Developer syammohanm
Plugin Icon 128x128 WPFront User Role Editor
Version 2.11.3
Comparing to
See all releases

Code changes from version 2.10 to 2.11.3

classes/base/class-wpfront-base.php CHANGED
@@ -68,6 +68,8 @@ if (!class_exists('WPFront_Base_URE')) {
68
  add_action('admin_init', array(&$this, 'admin_init'));
69
  add_action('admin_menu', array(&$this, 'admin_menu'));
70
  add_filter('plugin_action_links', array(&$this, 'action_links'), 10, 2);
 
 
71
  } else {
72
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
73
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
@@ -137,6 +139,14 @@ if (!class_exists('WPFront_Base_URE')) {
137
 
138
  public function enqueue_scripts() {
139
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
  public function enqueue_options_styles() {
68
  add_action('admin_init', array(&$this, 'admin_init'));
69
  add_action('admin_menu', array(&$this, 'admin_menu'));
70
  add_filter('plugin_action_links', array(&$this, 'action_links'), 10, 2);
71
+ add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_styles'));
72
+ add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
73
  } else {
74
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
75
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
139
 
140
  public function enqueue_scripts() {
141
 
142
+ }
143
+
144
+ public function admin_enqueue_styles() {
145
+
146
+ }
147
+
148
+ public function admin_enqueue_scripts() {
149
+
150
  }
151
 
152
  public function enqueue_options_styles() {
classes/base/images/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
classes/base/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
classes/class-wpfront-user-role-editor-controller-base.php CHANGED
@@ -183,6 +183,6 @@ if (!class_exists('WPFront_User_Role_Editor_Controller_Base')) {
183
 
184
  }
185
 
186
- add_action('admin_init', 'WPFront_User_Role_Editor_Controller_Base::register_ajax_handlers');
187
  wp_cache_add_non_persistent_groups(WPFront_User_Role_Editor::PLUGIN_SLUG);
188
  }
183
 
184
  }
185
 
186
+ add_action('admin_init', 'WPFront_User_Role_Editor_Controller_Base::register_ajax_handlers', 1001);
187
  wp_cache_add_non_persistent_groups(WPFront_User_Role_Editor::PLUGIN_SLUG);
188
  }
classes/class-wpfront-user-role-editor-go-pro.php CHANGED
@@ -43,17 +43,22 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
43
  private $pro_html = '';
44
  private $has_license = FALSE;
45
  private $need_license = FALSE;
 
46
  private $license_key = NULL;
47
  private $license_key_k = NULL;
48
  private $license_expires = NULL;
49
  private $license_expired = FALSE;
50
  private $product = NULL;
 
51
  private $error = NULL;
 
 
52
 
53
  public function __construct($main) {
54
  parent::__construct($main);
55
 
56
  $this->ajax_register('wp_ajax_wpfront_user_role_editor_license_functions', array($this, 'license_functions'));
 
57
  }
58
 
59
  public function go_pro() {
@@ -81,7 +86,7 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
81
 
82
  if ($time === NULL || $time < time() - 24 * 3600) {
83
  $options->update_option($time_key, time());
84
- $result = wp_remote_get(self::$go_pro_html_url, array('timeout' => 15, 'sslverify' => false));
85
  if (!is_wp_error($result) && wp_remote_retrieve_response_code($result) == 200) {
86
  $this->pro_html = wp_remote_retrieve_body($result);
87
  $options->update_option($html_key, $this->pro_html);
@@ -107,6 +112,7 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
107
  return;
108
 
109
  if ($key !== NULL) {
 
110
  $this->need_license = TRUE;
111
  $this->license_key_k = $key . '-license-key';
112
  $this->product = $product;
@@ -128,9 +134,22 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
128
  if (($result->activations_left === 'unlimited' || $result->activations_left >= 0) && ($result->license === 'valid' || $result->license === 'expired')) {
129
  $entity->update_option($this->license_key_k . '-status', $result->license);
130
  $entity->update_option($this->license_key_k . '-expires', $result->expires);
 
131
  } else {
132
- $this->deactivate_license(TRUE);
133
- return;
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
135
  }
136
  }
@@ -138,10 +157,21 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
138
  $this->license_expired = $entity->get_option($this->license_key_k . '-status') === 'expired';
139
  $this->license_expires = date('F d, Y', strtotime($entity->get_option($this->license_key_k . '-expires')));
140
 
141
- for ($i = 0; $i < strlen($this->license_key) - 4; $i++) {
142
- $this->license_key = substr_replace($this->license_key, 'X', $i, 1);
 
143
  }
144
 
 
 
 
 
 
 
 
 
 
 
145
  //Software licensing change
146
  $this->edd_plugin_update();
147
  //add_action('admin_init', array($this, 'edd_plugin_update'));
@@ -175,17 +205,18 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
175
  $entity->update_option($this->license_key_k, $license);
176
  $entity->update_option($this->license_key_k . '-status', $result->license === 'valid' ? 'valid' : 'expired');
177
  $entity->update_option($this->license_key_k . '-expires', $result->expires);
178
- $entity->update_option($this->license_key_k . '-last-checked', time());
179
 
 
180
  $this->set_license();
181
  } elseif ($result->error === 'no_activations_left') {
182
- $this->error = $this->__('ERROR') . ': ' . $this->__('License key activation limit reached');
183
  } else {
184
  $this->error = $this->__('ERROR') . ': ' . $this->__('Invalid license key');
185
  }
186
  }
187
 
188
- private function deactivate_license($forced = TRUE) {
189
  if ($this->license_key_k === NULL)
190
  return;
191
 
@@ -200,6 +231,10 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
200
  $entity->delete_option($this->license_key_k);
201
  $entity->delete_option($this->license_key_k . '-expires');
202
  $entity->delete_option($this->license_key_k . '-last-checked');
 
 
 
 
203
  } else {
204
  $this->error = $this->__('ERROR') . ': ' . $this->__('Unable to deactivate, expired license?');
205
  }
@@ -207,6 +242,12 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
207
  $this->set_license();
208
  }
209
 
 
 
 
 
 
 
210
  private function remote_get($action, $license) {
211
  if ($this->product === NULL)
212
  return NULL;
@@ -215,10 +256,11 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
215
  'edd_action' => $action,
216
  'license' => urlencode($license),
217
  'item_name' => urlencode($this->product),
218
- 'url' => urlencode(home_url())
 
219
  );
220
 
221
- $response = wp_remote_get(add_query_arg($api_params, self::$store_url), array('timeout' => 15, 'sslverify' => false));
222
  if (is_wp_error($response)) {
223
  $this->error = $this->__('ERROR') . ': ' . $this->__('Unable to contact wpfront.com')
224
  . '<br />'
@@ -239,12 +281,12 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
239
  public function edd_plugin_update() {
240
  $entity = new WPFront_User_Role_Editor_Entity_Options();
241
 
242
- new EDD_SL_Plugin_Updater(self::$store_url, WPFRONT_USER_ROLE_EDITOR_PLUGIN_FILE, array(
243
  'version' => WPFront_User_Role_Editor::VERSION,
244
  'license' => $entity->get_option($this->license_key_k),
245
  'item_name' => $this->product,
246
  'author' => 'Syam Mohan'
247
- ));
248
  }
249
 
250
  public function license_functions() {
@@ -266,6 +308,10 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
266
  $this->deactivate_license();
267
  }
268
 
 
 
 
 
269
  if ($this->error === NULL)
270
  echo 'true';
271
  else
@@ -280,6 +326,72 @@ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
280
  return TRUE;
281
  }
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  }
284
 
285
  }
43
  private $pro_html = '';
44
  private $has_license = FALSE;
45
  private $need_license = FALSE;
46
+ private $license_status = NULL;
47
  private $license_key = NULL;
48
  private $license_key_k = NULL;
49
  private $license_expires = NULL;
50
  private $license_expired = FALSE;
51
  private $product = NULL;
52
+ private $slug = NULL;
53
  private $error = NULL;
54
+ private $plugin_updater = NULL;
55
+ private $mail_objects = array();
56
 
57
  public function __construct($main) {
58
  parent::__construct($main);
59
 
60
  $this->ajax_register('wp_ajax_wpfront_user_role_editor_license_functions', array($this, 'license_functions'));
61
+ add_action('shutdown', array($this, 'plugins_loaded'));
62
  }
63
 
64
  public function go_pro() {
86
 
87
  if ($time === NULL || $time < time() - 24 * 3600) {
88
  $options->update_option($time_key, time());
89
+ $result = WPFront_User_Role_Editor::wp_remote_get(self::$go_pro_html_url);
90
  if (!is_wp_error($result) && wp_remote_retrieve_response_code($result) == 200) {
91
  $this->pro_html = wp_remote_retrieve_body($result);
92
  $options->update_option($html_key, $this->pro_html);
112
  return;
113
 
114
  if ($key !== NULL) {
115
+ $this->slug = $key;
116
  $this->need_license = TRUE;
117
  $this->license_key_k = $key . '-license-key';
118
  $this->product = $product;
134
  if (($result->activations_left === 'unlimited' || $result->activations_left >= 0) && ($result->license === 'valid' || $result->license === 'expired')) {
135
  $entity->update_option($this->license_key_k . '-status', $result->license);
136
  $entity->update_option($this->license_key_k . '-expires', $result->expires);
137
+ $entity->update_option($this->license_key_k . '-invalid-count', 0);
138
  } else {
139
+ $invalid_count = $entity->get_option($this->license_key_k . '-invalid-count');
140
+ if (empty($invalid_count)) {
141
+ $invalid_count = 0;
142
+ }
143
+ $invalid_count = $invalid_count + 1;
144
+ $entity->update_option($this->license_key_k . '-invalid-count', $invalid_count);
145
+ $this->license_status = 'invalid';
146
+ if ($invalid_count === 1) {
147
+ $this->send_mail('invalid', $result, 'wpfront.com');
148
+ } else if ($invalid_count > 7) {
149
+ $this->deactivate_license(TRUE);
150
+ $this->send_mail('deactivated', $result, 'wpfront.com');
151
+ return;
152
+ }
153
  }
154
  }
155
  }
157
  $this->license_expired = $entity->get_option($this->license_key_k . '-status') === 'expired';
158
  $this->license_expires = date('F d, Y', strtotime($entity->get_option($this->license_key_k . '-expires')));
159
 
160
+ $invalid_count = $entity->get_option($this->license_key_k . '-invalid-count');
161
+ if ($invalid_count > 0) {
162
+ $this->license_status = 'invalid';
163
  }
164
 
165
+ if ($this->license_status === NULL) {
166
+ if ($this->license_expired) {
167
+ $this->license_status = 'expired';
168
+ } else {
169
+ $this->license_status = 'valid';
170
+ }
171
+ }
172
+
173
+ $this->license_key = str_repeat('X', strlen($this->license_key) - 4) . substr($this->license_key, strlen($this->license_key) - 4, 4);
174
+
175
  //Software licensing change
176
  $this->edd_plugin_update();
177
  //add_action('admin_init', array($this, 'edd_plugin_update'));
205
  $entity->update_option($this->license_key_k, $license);
206
  $entity->update_option($this->license_key_k . '-status', $result->license === 'valid' ? 'valid' : 'expired');
207
  $entity->update_option($this->license_key_k . '-expires', $result->expires);
208
+ $entity->update_option($this->license_key_k . '-last-checked', 0);
209
 
210
+ $this->send_mail('activate', $result, 'user');
211
  $this->set_license();
212
  } elseif ($result->error === 'no_activations_left') {
213
+ $this->error = $this->__('ERROR') . ': ' . $this->__('License key activation limit reached.') . ' ' . sprintf('<a href="%s" target="_blank">%s</a>', 'https://wpfront.com/user-role-editor-pro/faq/#activation-limit', $this->__('More information'));
214
  } else {
215
  $this->error = $this->__('ERROR') . ': ' . $this->__('Invalid license key');
216
  }
217
  }
218
 
219
+ private function deactivate_license($forced = FALSE) {
220
  if ($this->license_key_k === NULL)
221
  return;
222
 
231
  $entity->delete_option($this->license_key_k);
232
  $entity->delete_option($this->license_key_k . '-expires');
233
  $entity->delete_option($this->license_key_k . '-last-checked');
234
+
235
+ if (!$forced) {
236
+ $this->send_mail('deactivate', $result, 'user');
237
+ }
238
  } else {
239
  $this->error = $this->__('ERROR') . ': ' . $this->__('Unable to deactivate, expired license?');
240
  }
242
  $this->set_license();
243
  }
244
 
245
+ private function recheck_license() {
246
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
247
+ $entity->update_option($this->license_key_k . '-last-checked', 0);
248
+ $this->plugin_updater->recheck();
249
+ }
250
+
251
  private function remote_get($action, $license) {
252
  if ($this->product === NULL)
253
  return NULL;
256
  'edd_action' => $action,
257
  'license' => urlencode($license),
258
  'item_name' => urlencode($this->product),
259
+ 'url' => urlencode(home_url()),
260
+ 'plugin_version' => WPFront_User_Role_Editor::VERSION
261
  );
262
 
263
+ $response = WPFront_User_Role_Editor::wp_remote_get(add_query_arg($api_params, self::$store_url));
264
  if (is_wp_error($response)) {
265
  $this->error = $this->__('ERROR') . ': ' . $this->__('Unable to contact wpfront.com')
266
  . '<br />'
281
  public function edd_plugin_update() {
282
  $entity = new WPFront_User_Role_Editor_Entity_Options();
283
 
284
+ $this->plugin_updater = new WPFront_User_Role_Editor_Plugin_Updater(self::$store_url, WPFRONT_USER_ROLE_EDITOR_PLUGIN_FILE, array(
285
  'version' => WPFront_User_Role_Editor::VERSION,
286
  'license' => $entity->get_option($this->license_key_k),
287
  'item_name' => $this->product,
288
  'author' => 'Syam Mohan'
289
+ ), $this->slug);
290
  }
291
 
292
  public function license_functions() {
308
  $this->deactivate_license();
309
  }
310
 
311
+ if (!empty($_POST['recheck'])) {
312
+ $this->recheck_license();
313
+ }
314
+
315
  if ($this->error === NULL)
316
  echo 'true';
317
  else
326
  return TRUE;
327
  }
328
 
329
+ private function send_mail($action, $result, $source) {
330
+ $admin_email = get_site_option('admin_email');
331
+ $blog_name = is_multisite() ? get_site_option('site_name') : get_option('blogname');
332
+
333
+ if (function_exists('wp_get_current_user'))
334
+ $current_user = wp_get_current_user();
335
+
336
+ $to = array($admin_email);
337
+ if (!empty($result) && !empty($result->customer_email) && $to[0] !== $result->customer_email) {
338
+ $to[] = $result->customer_email;
339
+ }
340
+
341
+ $body = '<tr><td>' . $this->__('Site') . ':</td><td>' . get_site_option('siteurl') . '</td></tr>';
342
+ $body .= '<tr><td>' . $this->__('Product') . ':</td><td>' . $this->__($this->product) . '</td></tr>';
343
+
344
+ switch ($action) {
345
+ case 'activate':
346
+ $message = $this->__('Your WPFront User Role Editor Pro license was activated on the following site.');
347
+ $subject = '[' . $blog_name . '] ' . $this->__('WPFront User Role Editor Pro License Activated');
348
+ if ($source === 'user') {
349
+ $body .= '<tr><td>' . $this->__('Activated By') . ':</td><td>' . $current_user->user_firstname . ' ' . $current_user->user_lastname . ' [' . $current_user->user_login . ']' . '</td></tr>';
350
+ $body .= '<tr><td>' . $this->__('Activated On') . ':</td><td>' . gmdate("Y-m-d H:i:s") . ' GMT </td></tr>';
351
+ }
352
+ break;
353
+ case 'deactivate':
354
+ $message = $this->__('Your WPFront User Role Editor Pro license was deactivated on the following site.');
355
+ $subject = '[' . $blog_name . '] ' . $this->__('WPFront User Role Editor Pro License Deactivated');
356
+ if ($source === 'user') {
357
+ $body .= '<tr><td>' . $this->__('Deactivated By') . ':</td><td>' . $current_user->user_firstname . ' ' . $current_user->user_lastname . ' [' . $current_user->user_login . ']' . '</td></tr>';
358
+ $body .= '<tr><td>' . $this->__('Deactivated On') . ':</td><td>' . gmdate("Y-m-d H:i:s") . ' GMT </td></tr>';
359
+ }
360
+ break;
361
+ case 'invalid':
362
+ $message = $this->__('Your WPFront User Role Editor Pro license is invalid on the following site. Please activate a valid license immediately for the plugin to continue working.');
363
+ $subject = '[' . $blog_name . '] ' . $this->__('WPFront User Role Editor Pro Invalid License');
364
+ break;
365
+ case 'deactivated':
366
+ $message = $this->__('Your invalid WPFront User Role Editor Pro license was deactivated on the following site. Please activate a valid license immediately for the plugin to continue working.');
367
+ $subject = '[' . $blog_name . '] ' . $this->__('WPFront User Role Editor Pro License Deactivated');
368
+ $body .= '<tr><td>' . $this->__('Deactivated On') . ':</td><td>' . gmdate("Y-m-d H:i:s") . ' GMT </td></tr>';
369
+ break;
370
+ }
371
+
372
+ $body = $message
373
+ . '<br /><br />'
374
+ . '<table>'
375
+ . $body
376
+ . '</table>';
377
+
378
+ if (function_exists('wp_mail')) {
379
+ wp_mail($to, $subject, $body, array('Content-Type: text/html; charset=UTF-8'));
380
+ } else {
381
+ $this->mail_objects[] = (OBJECT) array(
382
+ 'to' => $to,
383
+ 'subject' => $subject,
384
+ 'body' => $body
385
+ );
386
+ }
387
+ }
388
+
389
+ public function plugins_loaded() {
390
+ foreach ($this->mail_objects as $value) {
391
+ wp_mail($value->to, $value->subject, $value->body, array('Content-Type: text/html; charset=UTF-8'));
392
+ }
393
+ }
394
+
395
  }
396
 
397
  }
classes/class-wpfront-user-role-editor-nav-menu-walker.php CHANGED
@@ -43,6 +43,8 @@ if (!class_exists('WPFront_User_Role_Editor_Nav_Menu_Walker')) {
43
  * @see Walker_Nav_Menu::start_el()
44
  * @since 3.0.0
45
  *
 
 
46
  * @param string $output Passed by reference. Used to append additional content.
47
  * @param object $item Menu item data object.
48
  * @param int $depth Depth of menu item. Used for padding.
@@ -100,8 +102,8 @@ if (!class_exists('WPFront_User_Role_Editor_Nav_Menu_Walker')) {
100
 
101
  ?>
102
  <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo implode(' ', $classes ); ?>">
103
- <dl class="menu-item-bar">
104
- <dt class="menu-item-handle">
105
  <span class="item-title"><span class="menu-item-title"><?php echo esc_html( $title ); ?></span> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span><?php do_action( 'wp_nav_menu_item_title_user_restriction_type', $item_id, $item, $depth, $args ); ?></span>
106
  <span class="item-controls">
107
  <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
@@ -136,11 +138,11 @@ if (!class_exists('WPFront_User_Role_Editor_Nav_Menu_Walker')) {
136
  echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
137
  ?>"><?php _e( 'Edit Menu Item' ); ?></a>
138
  </span>
139
- </dt>
140
- </dl>
141
 
142
  <div class="menu-item-settings" id="menu-item-settings-<?php echo $item_id; ?>">
143
- <?php if( 'custom' == $item->type ) : ?>
144
  <p class="field-url description description-wide">
145
  <label for="edit-menu-item-url-<?php echo $item_id; ?>">
146
  <?php _e( 'URL' ); ?><br />
@@ -148,13 +150,13 @@ if (!class_exists('WPFront_User_Role_Editor_Nav_Menu_Walker')) {
148
  </label>
149
  </p>
150
  <?php endif; ?>
151
- <p class="description description-thin">
152
  <label for="edit-menu-item-title-<?php echo $item_id; ?>">
153
  <?php _e( 'Navigation Label' ); ?><br />
154
  <input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->title ); ?>" />
155
  </label>
156
  </p>
157
- <p class="description description-thin">
158
  <label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
159
  <?php _e( 'Title Attribute' ); ?><br />
160
  <input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_excerpt ); ?>" />
@@ -193,16 +195,16 @@ if (!class_exists('WPFront_User_Role_Editor_Nav_Menu_Walker')) {
193
  <p class="field-move hide-if-no-js description description-wide">
194
  <label>
195
  <span><?php _e( 'Move' ); ?></span>
196
- <a href="#" class="menus-move-up"><?php _e( 'Up one' ); ?></a>
197
- <a href="#" class="menus-move-down"><?php _e( 'Down one' ); ?></a>
198
- <a href="#" class="menus-move-left"></a>
199
- <a href="#" class="menus-move-right"></a>
200
- <a href="#" class="menus-move-top"><?php _e( 'To the top' ); ?></a>
201
  </label>
202
  </p>
203
 
204
  <div class="menu-item-actions description-wide submitbox">
205
- <?php if( 'custom' != $item->type && $original_title !== false ) : ?>
206
  <p class="link-to-original">
207
  <?php printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
208
  </p>
43
  * @see Walker_Nav_Menu::start_el()
44
  * @since 3.0.0
45
  *
46
+ * @global int $_wp_nav_menu_max_depth
47
+ *
48
  * @param string $output Passed by reference. Used to append additional content.
49
  * @param object $item Menu item data object.
50
  * @param int $depth Depth of menu item. Used for padding.
102
 
103
  ?>
104
  <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo implode(' ', $classes ); ?>">
105
+ <div class="menu-item-bar">
106
+ <div class="menu-item-handle">
107
  <span class="item-title"><span class="menu-item-title"><?php echo esc_html( $title ); ?></span> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span><?php do_action( 'wp_nav_menu_item_title_user_restriction_type', $item_id, $item, $depth, $args ); ?></span>
108
  <span class="item-controls">
109
  <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
138
  echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
139
  ?>"><?php _e( 'Edit Menu Item' ); ?></a>
140
  </span>
141
+ </div>
142
+ </div>
143
 
144
  <div class="menu-item-settings" id="menu-item-settings-<?php echo $item_id; ?>">
145
+ <?php if ( 'custom' == $item->type ) : ?>
146
  <p class="field-url description description-wide">
147
  <label for="edit-menu-item-url-<?php echo $item_id; ?>">
148
  <?php _e( 'URL' ); ?><br />
150
  </label>
151
  </p>
152
  <?php endif; ?>
153
+ <p class="description description-wide">
154
  <label for="edit-menu-item-title-<?php echo $item_id; ?>">
155
  <?php _e( 'Navigation Label' ); ?><br />
156
  <input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->title ); ?>" />
157
  </label>
158
  </p>
159
+ <p class="field-title-attribute description description-wide">
160
  <label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
161
  <?php _e( 'Title Attribute' ); ?><br />
162
  <input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_excerpt ); ?>" />
195
  <p class="field-move hide-if-no-js description description-wide">
196
  <label>
197
  <span><?php _e( 'Move' ); ?></span>
198
+ <a href="#" class="menus-move menus-move-up" data-dir="up"><?php _e( 'Up one' ); ?></a>
199
+ <a href="#" class="menus-move menus-move-down" data-dir="down"><?php _e( 'Down one' ); ?></a>
200
+ <a href="#" class="menus-move menus-move-left" data-dir="left"></a>
201
+ <a href="#" class="menus-move menus-move-right" data-dir="right"></a>
202
+ <a href="#" class="menus-move menus-move-top" data-dir="top"><?php _e( 'To the top' ); ?></a>
203
  </label>
204
  </p>
205
 
206
  <div class="menu-item-actions description-wide submitbox">
207
+ <?php if ( 'custom' != $item->type && $original_title !== false ) : ?>
208
  <p class="link-to-original">
209
  <?php printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
210
  </p>
classes/class-wpfront-user-role-editor.php CHANGED
@@ -38,13 +38,27 @@ if (!class_exists('WPFront_User_Role_Editor')) {
38
  class WPFront_User_Role_Editor extends WPFront_Base_URE {
39
 
40
  //Constants
41
- const VERSION = '2.10';
42
  const OPTIONS_GROUP_NAME = 'wpfront-user-role-editor-options-group';
43
  const OPTION_NAME = 'wpfront-user-role-editor-options';
44
  const PLUGIN_SLUG = 'wpfront-user-role-editor';
45
 
46
  public static $DYNAMIC_CAPS = array();
47
- public static $ROLE_CAPS = array('list_roles', 'create_roles', 'edit_roles', 'delete_roles', 'edit_role_menus', 'edit_posts_role_permissions', 'edit_pages_role_permissions', 'edit_nav_menu_permissions', 'edit_content_shortcodes', 'delete_content_shortcodes', 'edit_login_redirects', 'delete_login_redirects');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  public static $DEFAULT_ROLES = array(self::ADMINISTRATOR_ROLE_KEY, self::EDITOR_ROLE_KEY, self::AUTHOR_ROLE_KEY, self::CONTRIBUTOR_ROLE_KEY, self::SUBSCRIBER_ROLE_KEY);
49
  public static $STANDARD_CAPABILITIES = array(
50
  'Dashboard' => array(
@@ -145,6 +159,7 @@ if (!class_exists('WPFront_User_Role_Editor')) {
145
  private static $CAPABILITIES = NULL;
146
  //Variables
147
  protected $admin_menu = array();
 
148
  protected $options;
149
  protected $objList;
150
  protected $objAddEdit;
@@ -208,6 +223,14 @@ if (!class_exists('WPFront_User_Role_Editor')) {
208
  $this->admin_menu[$position] = array($title, $name, $capability, $slug, $func, $scripts, $styles, $controller, $admin_bar_parent, $admin_bar_title);
209
  }
210
 
 
 
 
 
 
 
 
 
211
  protected function add_pro_page() {
212
  if (isset($this->admin_menu[1000]))
213
  return;
@@ -244,6 +267,10 @@ if (!class_exists('WPFront_User_Role_Editor')) {
244
  }
245
 
246
  foreach ($this->admin_menu as $key => $value) {
 
 
 
 
247
  $page_hook_suffix = add_submenu_page($menu_slug, $value[0], $value[1], $value[2], $value[3], $value[4]);
248
  add_action('admin_print_scripts-' . $page_hook_suffix, array($this, $value[5]));
249
  add_action('admin_print_styles-' . $page_hook_suffix, array($this, $value[6]));
@@ -305,6 +332,11 @@ if (!class_exists('WPFront_User_Role_Editor')) {
305
  $styleRoot = $this->pluginURLRoot . 'css/';
306
  wp_enqueue_style('wpfront-user-role-editor-options', $styleRoot . 'options.css', array(), self::VERSION);
307
  }
 
 
 
 
 
308
 
309
  public function get_capability_string($capability) {
310
  if ($this->enable_role_capabilities())
@@ -456,6 +488,8 @@ if (!class_exists('WPFront_User_Role_Editor')) {
456
  if (isset($caps->$key)) {
457
  $custom_caps[] = $caps->$key;
458
  unset($caps->$key);
 
 
459
  }
460
  }
461
  foreach ($caps as $key => $value) {
@@ -631,6 +665,25 @@ if (!class_exists('WPFront_User_Role_Editor')) {
631
  new WPFront_User_Role_Editor();
632
  }
633
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
634
  }
635
 
636
  }
38
  class WPFront_User_Role_Editor extends WPFront_Base_URE {
39
 
40
  //Constants
41
+ const VERSION = '2.11.3';
42
  const OPTIONS_GROUP_NAME = 'wpfront-user-role-editor-options-group';
43
  const OPTION_NAME = 'wpfront-user-role-editor-options';
44
  const PLUGIN_SLUG = 'wpfront-user-role-editor';
45
 
46
  public static $DYNAMIC_CAPS = array();
47
+ public static $ROLE_CAPS = array(
48
+ 'list_roles',
49
+ 'create_roles',
50
+ 'edit_roles',
51
+ 'delete_roles',
52
+ 'edit_role_menus',
53
+ 'edit_posts_role_permissions',
54
+ 'edit_pages_role_permissions',
55
+ 'edit_nav_menu_permissions',
56
+ 'edit_content_shortcodes',
57
+ 'delete_content_shortcodes',
58
+ 'edit_login_redirects',
59
+ 'delete_login_redirects',
60
+ 'bulk_edit_roles'
61
+ );
62
  public static $DEFAULT_ROLES = array(self::ADMINISTRATOR_ROLE_KEY, self::EDITOR_ROLE_KEY, self::AUTHOR_ROLE_KEY, self::CONTRIBUTOR_ROLE_KEY, self::SUBSCRIBER_ROLE_KEY);
63
  public static $STANDARD_CAPABILITIES = array(
64
  'Dashboard' => array(
159
  private static $CAPABILITIES = NULL;
160
  //Variables
161
  protected $admin_menu = array();
162
+ protected $remove_admin_menu = array();
163
  protected $options;
164
  protected $objList;
165
  protected $objAddEdit;
223
  $this->admin_menu[$position] = array($title, $name, $capability, $slug, $func, $scripts, $styles, $controller, $admin_bar_parent, $admin_bar_title);
224
  }
225
 
226
+ protected function remove_submenu_page($position) {
227
+ $this->remove_admin_menu[$position] = TRUE;
228
+ }
229
+
230
+ public function get_submenu_page_item($position) {
231
+ return $this->admin_menu[$position];
232
+ }
233
+
234
  protected function add_pro_page() {
235
  if (isset($this->admin_menu[1000]))
236
  return;
267
  }
268
 
269
  foreach ($this->admin_menu as $key => $value) {
270
+ if (!empty($this->remove_admin_menu[$key])) {
271
+ continue;
272
+ }
273
+
274
  $page_hook_suffix = add_submenu_page($menu_slug, $value[0], $value[1], $value[2], $value[3], $value[4]);
275
  add_action('admin_print_scripts-' . $page_hook_suffix, array($this, $value[5]));
276
  add_action('admin_print_styles-' . $page_hook_suffix, array($this, $value[6]));
332
  $styleRoot = $this->pluginURLRoot . 'css/';
333
  wp_enqueue_style('wpfront-user-role-editor-options', $styleRoot . 'options.css', array(), self::VERSION);
334
  }
335
+
336
+ public function admin_enqueue_styles() {
337
+ $styleRoot = $this->pluginURLRoot . 'css/';
338
+ wp_enqueue_style('wpfront-user-role-editor-admin-css', $styleRoot . 'admin-style.css', array(), self::VERSION);
339
+ }
340
 
341
  public function get_capability_string($capability) {
342
  if ($this->enable_role_capabilities())
488
  if (isset($caps->$key)) {
489
  $custom_caps[] = $caps->$key;
490
  unset($caps->$key);
491
+ } elseif (isset($post_type_object->cap->$key)) {
492
+ $custom_caps[] = $post_type_object->cap->$key;
493
  }
494
  }
495
  foreach ($caps as $key => $value) {
665
  new WPFront_User_Role_Editor();
666
  }
667
 
668
+ public static function wp_remote_get($url, $params = NULL) {
669
+ if ($params === NULL) {
670
+ $params = array('timeout' => 10);
671
+ } else {
672
+ $params = array_merge(array('timeout' => 10), $params);
673
+ }
674
+
675
+ $params['sslverify'] = FALSE;
676
+
677
+ $result = wp_remote_get($url, $params);
678
+
679
+ if (is_wp_error($result) || wp_remote_retrieve_response_code($result) !== 200) {
680
+ $params['sslverify'] = TRUE;
681
+ $result = wp_remote_get($url, $params);
682
+ }
683
+
684
+ return $result;
685
+ }
686
+
687
  }
688
 
689
  }
classes/entities/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
classes/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
classes/integration/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
classes/integration/plugins/duplicator/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
classes/integration/plugins/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
css/admin-style.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ #adminmenu ul.wp-submenu li a span.wpfront-go-pro {
2
+ color: #F18500;
3
+ }
css/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
css/style.css CHANGED
@@ -20,10 +20,6 @@
20
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
  */
22
 
23
- #adminmenu ul.wp-submenu li a span.wpfront-go-pro {
24
- color: #F18500;
25
- }
26
-
27
  #adminmenu ul.wp-submenu li.current a.current span.wpfront-go-pro {
28
  color: inherit;
29
  }
@@ -156,6 +152,7 @@ div.wrap.go-pro #license_key {
156
  padding-bottom: 5px;
157
  }
158
 
 
159
  div.wrap.go-pro div.license-container table.form-table td.expired {
160
  color: red;
161
  }
20
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
  */
22
 
 
 
 
 
23
  #adminmenu ul.wp-submenu li.current a.current span.wpfront-go-pro {
24
  color: inherit;
25
  }
152
  padding-bottom: 5px;
153
  }
154
 
155
+ div.wrap.go-pro div.license-container table.form-table td.invalid,
156
  div.wrap.go-pro div.license-container table.form-table td.expired {
157
  color: red;
158
  }
images/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
js/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
languages/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
languages/wpfront-user-role-editor-pt_BR/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
languages/wpfront-user-role-editor-sv_SE/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
languages/wpfront-user-role-editor.mo CHANGED
Binary file
languages/wpfront-user-role-editor.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
- "POT-Creation-Date: 2015-05-21 15:30-0700\n"
5
- "PO-Revision-Date: 2015-05-21 15:31-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
@@ -63,7 +63,7 @@ msgid "More information about %s"
63
  msgstr "More information about %s"
64
 
65
  #: ../classes/base/class-wpfront-base-menu.php:158
66
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:225
67
  msgid "Details"
68
  msgstr "Details"
69
 
@@ -102,8 +102,8 @@ msgid "Settings"
102
  msgstr "Settings"
103
 
104
  #: ../classes/base/class-wpfront-base-menu.php:181
105
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:113
106
- #: ../templates/go-pro.php:71 ../templates/go-pro.php:72
107
  msgid "Activate"
108
  msgstr "Activate"
109
 
@@ -536,11 +536,11 @@ msgstr "Documentation on Multisite Roles"
536
 
537
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:48
538
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:77
539
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:182
540
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:184
541
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:204
542
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:223
543
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:232
544
  #: ../classes/class-wpfront-user-role-editor-restore.php:87
545
  #: ../templates/add-edit-role.php:51 ../templates/add-edit-role.php:59
546
  #: ../templates/business-pro/sync-roles.php:21
@@ -944,26 +944,105 @@ msgstr "Review"
944
  msgid "Contact"
945
  msgstr "Contact"
946
 
947
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:182
948
- msgid "License key activation limit reached"
949
- msgstr "License key activation limit reached"
 
 
 
 
 
950
 
951
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:184
952
  msgid "Invalid license key"
953
  msgstr "Invalid license key"
954
 
955
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:204
956
  msgid "Unable to deactivate, expired license?"
957
  msgstr "Unable to deactivate, expired license?"
958
 
959
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:223
960
  msgid "Unable to contact wpfront.com"
961
  msgstr "Unable to contact wpfront.com"
962
 
963
- #: ../classes/class-wpfront-user-role-editor-go-pro.php:232
964
  msgid "Unable to parse response"
965
  msgstr "Unable to parse response"
966
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
967
  #: ../classes/class-wpfront-user-role-editor-list.php:221
968
  #: ../templates/add-edit-role.php:117
969
  #: ../templates/personal-pro/menu-editor.php:132
@@ -1833,40 +1912,40 @@ msgstr ""
1833
  msgid "Documentation on Menu Editor"
1834
  msgstr "Documentation on Menu Editor"
1835
 
1836
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:89
1837
  #: ../templates/personal-pro/menu-editor.php:9
1838
  msgid "Menu Editor"
1839
  msgstr "Menu Editor"
1840
 
1841
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:90
1842
  #: ../templates/personal-pro/content-shortcodes.php:9
1843
  msgid "Content Shortcodes"
1844
  msgstr "Content Shortcodes"
1845
 
1846
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:90
1847
  msgid "Shortcodes"
1848
  msgstr "Shortcodes"
1849
 
1850
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:91
1851
  #: ../templates/personal-pro/export-roles.php:9
1852
  msgid "Export Roles"
1853
  msgstr "Export Roles"
1854
 
1855
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:91
1856
  msgid "Export"
1857
  msgstr "Export"
1858
 
1859
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:92
1860
  #: ../templates/personal-pro/import-roles.php:9
1861
  #: ../templates/personal-pro/import-roles.php:88
1862
  msgid "Import Roles"
1863
  msgstr "Import Roles"
1864
 
1865
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:92
1866
  msgid "Import"
1867
  msgstr "Import"
1868
 
1869
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:112
1870
  #, php-format
1871
  msgid "%s license not activated."
1872
  msgstr "%s license not activated."
@@ -2054,11 +2133,31 @@ msgstr "WPFront User Role Editor Pro"
2054
  msgid "License Key"
2055
  msgstr "License Key"
2056
 
2057
- #: ../templates/go-pro.php:74 ../templates/go-pro.php:75
2058
  msgid "Deactivate"
2059
  msgstr "Deactivate"
2060
 
2061
- #: ../templates/go-pro.php:82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2062
  msgid "License Expires"
2063
  msgstr "License Expires"
2064
 
@@ -2127,10 +2226,6 @@ msgstr ""
2127
  "Menu walker class is overriden by a theme/plugin. Current value = %s. "
2128
  "Navigation menu permissions may still work. %s"
2129
 
2130
- #: ../templates/options-template.php:47
2131
- msgid "More information"
2132
- msgstr "More information"
2133
-
2134
  #: ../templates/options-template.php:103
2135
  msgid "Customize Permissions (custom post types)"
2136
  msgstr "Customize Permissions (custom post types)"
@@ -2260,6 +2355,9 @@ msgstr "Restored"
2260
  msgid "Unexpected error / Timed out"
2261
  msgstr "Unexpected error / Timed out"
2262
 
 
 
 
2263
  #~ msgid "Settings Description"
2264
  #~ msgstr "Settings Description"
2265
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
+ "POT-Creation-Date: 2015-06-26 19:32-0700\n"
5
+ "PO-Revision-Date: 2015-06-26 19:32-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
63
  msgstr "More information about %s"
64
 
65
  #: ../classes/base/class-wpfront-base-menu.php:158
66
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:266
67
  msgid "Details"
68
  msgstr "Details"
69
 
102
  msgstr "Settings"
103
 
104
  #: ../classes/base/class-wpfront-base-menu.php:181
105
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:114
106
+ #: ../templates/go-pro.php:71
107
  msgid "Activate"
108
  msgstr "Activate"
109
 
536
 
537
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:48
538
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:77
539
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:213
540
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:215
541
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:239
542
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:264
543
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:273
544
  #: ../classes/class-wpfront-user-role-editor-restore.php:87
545
  #: ../templates/add-edit-role.php:51 ../templates/add-edit-role.php:59
546
  #: ../templates/business-pro/sync-roles.php:21
944
  msgid "Contact"
945
  msgstr "Contact"
946
 
947
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:213
948
+ msgid "License key activation limit reached."
949
+ msgstr "License key activation limit reached."
950
+
951
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:213
952
+ #: ../templates/options-template.php:47
953
+ msgid "More information"
954
+ msgstr "More information"
955
 
956
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:215
957
  msgid "Invalid license key"
958
  msgstr "Invalid license key"
959
 
960
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:239
961
  msgid "Unable to deactivate, expired license?"
962
  msgstr "Unable to deactivate, expired license?"
963
 
964
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:264
965
  msgid "Unable to contact wpfront.com"
966
  msgstr "Unable to contact wpfront.com"
967
 
968
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:273
969
  msgid "Unable to parse response"
970
  msgstr "Unable to parse response"
971
 
972
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:340
973
+ msgid "Site"
974
+ msgstr "Site"
975
+
976
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:341
977
+ msgid "Product"
978
+ msgstr "Product"
979
+
980
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:345
981
+ msgid ""
982
+ "Your WPFront User Role Editor Pro license was activated on the following "
983
+ "site."
984
+ msgstr ""
985
+ "Your WPFront User Role Editor Pro license was activated on the following "
986
+ "site."
987
+
988
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:346
989
+ msgid "WPFront User Role Editor Pro License Activated"
990
+ msgstr "WPFront User Role Editor Pro License Activated"
991
+
992
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:348
993
+ msgid "Activated By"
994
+ msgstr "Activated By"
995
+
996
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:349
997
+ msgid "Activated On"
998
+ msgstr "Activated On"
999
+
1000
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:353
1001
+ msgid ""
1002
+ "Your WPFront User Role Editor Pro license was deactivated on the following "
1003
+ "site."
1004
+ msgstr ""
1005
+ "Your WPFront User Role Editor Pro license was deactivated on the following "
1006
+ "site."
1007
+
1008
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:354
1009
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:366
1010
+ msgid "WPFront User Role Editor Pro License Deactivated"
1011
+ msgstr "WPFront User Role Editor Pro License Deactivated"
1012
+
1013
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:356
1014
+ msgid "Deactivated By"
1015
+ msgstr "Deactivated By"
1016
+
1017
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:357
1018
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:367
1019
+ msgid "Deactivated On"
1020
+ msgstr "Deactivated On"
1021
+
1022
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:361
1023
+ msgid ""
1024
+ "Your WPFront User Role Editor Pro license is invalid on the following site. "
1025
+ "Please activate a valid license immediately for the plugin to continue "
1026
+ "working."
1027
+ msgstr ""
1028
+ "Your WPFront User Role Editor Pro license is invalid on the following site. "
1029
+ "Please activate a valid license immediately for the plugin to continue "
1030
+ "working."
1031
+
1032
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:362
1033
+ msgid "WPFront User Role Editor Pro Invalid License"
1034
+ msgstr "WPFront User Role Editor Pro Invalid License"
1035
+
1036
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:365
1037
+ msgid ""
1038
+ "Your invalid WPFront User Role Editor Pro license was deactivated on the "
1039
+ "following site. Please activate a valid license immediately for the plugin "
1040
+ "to continue working."
1041
+ msgstr ""
1042
+ "Your invalid WPFront User Role Editor Pro license was deactivated on the "
1043
+ "following site. Please activate a valid license immediately for the plugin "
1044
+ "to continue working."
1045
+
1046
  #: ../classes/class-wpfront-user-role-editor-list.php:221
1047
  #: ../templates/add-edit-role.php:117
1048
  #: ../templates/personal-pro/menu-editor.php:132
1912
  msgid "Documentation on Menu Editor"
1913
  msgstr "Documentation on Menu Editor"
1914
 
1915
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:90
1916
  #: ../templates/personal-pro/menu-editor.php:9
1917
  msgid "Menu Editor"
1918
  msgstr "Menu Editor"
1919
 
1920
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:91
1921
  #: ../templates/personal-pro/content-shortcodes.php:9
1922
  msgid "Content Shortcodes"
1923
  msgstr "Content Shortcodes"
1924
 
1925
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:91
1926
  msgid "Shortcodes"
1927
  msgstr "Shortcodes"
1928
 
1929
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:92
1930
  #: ../templates/personal-pro/export-roles.php:9
1931
  msgid "Export Roles"
1932
  msgstr "Export Roles"
1933
 
1934
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:92
1935
  msgid "Export"
1936
  msgstr "Export"
1937
 
1938
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:93
1939
  #: ../templates/personal-pro/import-roles.php:9
1940
  #: ../templates/personal-pro/import-roles.php:88
1941
  msgid "Import Roles"
1942
  msgstr "Import Roles"
1943
 
1944
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:93
1945
  msgid "Import"
1946
  msgstr "Import"
1947
 
1948
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:113
1949
  #, php-format
1950
  msgid "%s license not activated."
1951
  msgstr "%s license not activated."
2133
  msgid "License Key"
2134
  msgstr "License Key"
2135
 
2136
+ #: ../templates/go-pro.php:73
2137
  msgid "Deactivate"
2138
  msgstr "Deactivate"
2139
 
2140
+ #: ../templates/go-pro.php:74
2141
+ msgid "Recheck"
2142
+ msgstr "Recheck"
2143
+
2144
+ #: ../templates/go-pro.php:81
2145
+ msgid "License Status"
2146
+ msgstr "License Status"
2147
+
2148
+ #: ../templates/go-pro.php:87
2149
+ msgid "Valid"
2150
+ msgstr "Valid"
2151
+
2152
+ #: ../templates/go-pro.php:90
2153
+ msgid "Expired"
2154
+ msgstr "Expired"
2155
+
2156
+ #: ../templates/go-pro.php:93
2157
+ msgid "Invalid"
2158
+ msgstr "Invalid"
2159
+
2160
+ #: ../templates/go-pro.php:101
2161
  msgid "License Expires"
2162
  msgstr "License Expires"
2163
 
2226
  "Menu walker class is overriden by a theme/plugin. Current value = %s. "
2227
  "Navigation menu permissions may still work. %s"
2228
 
 
 
 
 
2229
  #: ../templates/options-template.php:103
2230
  msgid "Customize Permissions (custom post types)"
2231
  msgstr "Customize Permissions (custom post types)"
2355
  msgid "Unexpected error / Timed out"
2356
  msgstr "Unexpected error / Timed out"
2357
 
2358
+ #~ msgid "License key activation limit reached"
2359
+ #~ msgstr "License key activation limit reached"
2360
+
2361
  #~ msgid "Settings Description"
2362
  #~ msgstr "Settings Description"
2363
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpfront.com/donate/
4
  Tags: WordPress user role editor, user role editor, role editor, user role, role, WordPress user roles, user roles, roles, user roles editor, roles editor, role manager, roles manager, manage roles, manage role, access, capability, editor, permission, role, security, user, capability editor, capability manager, custom post types, custom post type permissions, custom post type capabilities, post type permissions, post type capabilities, menu editor, role menu, role menu editor, multisite roles, multisite role editor, multisite user roles, import roles, export roles
5
  Requires at least: 3.5
6
  Tested up to: 4.3
7
- Stable tag: 2.10
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -86,6 +86,25 @@ Please visit [WPFront User Role Editor FAQ](https://wpfront.com/user-role-editor
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  = 2.10 =
90
  * User level permissions added. [Documentation](https://wpfront.com/user-role-editor-pro/user-level-permissions/).
91
  * UI enhancements.
@@ -177,6 +196,21 @@ Please visit [WPFront User Role Editor FAQ](https://wpfront.com/user-role-editor
177
 
178
  == Upgrade Notice ==
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  = 2.10 =
181
  * User level permissions.
182
 
4
  Tags: WordPress user role editor, user role editor, role editor, user role, role, WordPress user roles, user roles, roles, user roles editor, roles editor, role manager, roles manager, manage roles, manage role, access, capability, editor, permission, role, security, user, capability editor, capability manager, custom post types, custom post type permissions, custom post type capabilities, post type permissions, post type capabilities, menu editor, role menu, role menu editor, multisite roles, multisite role editor, multisite user roles, import roles, export roles
5
  Requires at least: 3.5
6
  Tested up to: 4.3
7
+ Stable tag: 2.11.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
86
 
87
  == Changelog ==
88
 
89
+ = 2.11.3 =
90
+ * CSS fix.
91
+
92
+ = 2.11.2 =
93
+ * Navigation menu bug fix.
94
+
95
+ = 2.11.1 =
96
+ * WP 4.3 Compatibility.
97
+
98
+ = 2.11 =
99
+ * Bulk edit added. [Documentation](https://wpfront.com/user-role-editor-pro/bulk-edit/).
100
+ * License form compatibility fix.
101
+
102
+ = 2.10.1.3 =
103
+ * License recheck and activation email added.
104
+ * Performance improvements.
105
+ * Custom post type capabilities compatibility fix.
106
+ * SSL verify compatibility fix.
107
+
108
  = 2.10 =
109
  * User level permissions added. [Documentation](https://wpfront.com/user-role-editor-pro/user-level-permissions/).
110
  * UI enhancements.
196
 
197
  == Upgrade Notice ==
198
 
199
+ = 2.11.3 =
200
+ * CSS fix.
201
+
202
+ = 2.11.2 =
203
+ * Bug fix.
204
+
205
+ = 2.11.1 =
206
+ * WP 4.3 Compatibility.
207
+
208
+ = 2.11 =
209
+ * Bulk edit.
210
+
211
+ = 2.10.1.3 =
212
+ * Performance improvements.
213
+
214
  = 2.10 =
215
  * User level permissions.
216
 
templates/add-edit-role.php CHANGED
@@ -144,7 +144,10 @@ if (!defined('ABSPATH')) {
144
  </div>
145
 
146
  <script type="text/javascript">
147
- (function($) {
 
 
 
148
  function change_select_all(chk) {
149
  var chks = chk.closest("div.main").find("input");
150
  if (chks.length == chks.filter(":checked").length) {
@@ -155,15 +158,17 @@ if (!defined('ABSPATH')) {
155
  }
156
  }
157
 
158
- $("div.role-add-new div.postbox input.select-all").click(function() {
159
  $(this).closest('div.postbox').find("input").prop("checked", $(this).prop("checked"));
160
- }).parent().click(function(event) {
161
  event.stopPropagation();
162
  });
163
- $("div.role-add-new div.postbox div.main input").click(function() {
 
164
  change_select_all($(this));
165
  });
166
- $("div.role-add-new table.sub-head td.sub-head-controls input.chk-helpers").click(function() {
 
167
  if ($(this).hasClass('select-all')) {
168
  $("div.role-add-new div.postbox").find("input:not(:disabled)").prop("checked", true);
169
  }
@@ -171,15 +176,15 @@ if (!defined('ABSPATH')) {
171
  $("div.role-add-new div.postbox").find("input:not(:disabled)").prop("checked", false);
172
  }
173
  });
174
- <?php
175
- if ($this->role == NULL) {
176
- ?>
177
- $("#display_name").keyup(function() {
178
  if ($.trim($(this).val()) == "")
179
  return;
180
  $("#role_name").val($.trim($(this).val()).toLowerCase().replace(/ /g, "_").replace(/\W/g, ""));
181
  });
182
- $("#role_name").blur(function() {
 
183
  var ele = $(this);
184
  var str = $.trim(ele.val()).toLowerCase();
185
  str = str.replace(/ /g, "_").replace(/\W/g, "");
@@ -188,17 +193,16 @@ if ($this->role == NULL) {
188
  ele.parent().parent().removeClass("form-invalid");
189
  }
190
  });
191
- <?php
192
- }
193
- ?>
194
 
195
- $("#display_name").blur(function() {
196
  if ($.trim($(this).val()) != "") {
197
  $(this).parent().parent().removeClass("form-invalid");
198
  }
199
  $("#role_name").blur();
200
  });
201
- $("#createusersub").click(function() {
 
202
  var role_name = $("#role_name");
203
  var display_name = $("#display_name");
204
  if ($.trim(role_name.val()) == "") {
@@ -221,7 +225,8 @@ if ($this->role == NULL) {
221
 
222
  return true;
223
  });
224
- $("#cap_apply").click(function() {
 
225
  if ($(this).prev().val() == "")
226
  return;
227
  var button = $(this).prop("disabled", true);
@@ -231,14 +236,10 @@ if ($this->role == NULL) {
231
  "referer": <?php echo json_encode($_SERVER['REQUEST_URI']); ?>,
232
  "nonce": <?php echo json_encode(wp_create_nonce($_SERVER['REQUEST_URI'])); ?>
233
  };
234
- <?php
235
- if ($this->multisite) {
236
- ?>
237
- data["multisite"] = true;
238
- <?php
239
- }
240
- ?>
241
- $.post(ajaxurl, data, function(response) {
242
  $("div.role-add-new div.postbox input").prop("checked", false);
243
  for (m in response) {
244
  change_select_all($("div.role-add-new input#" + m).prop("checked", response[m]));
@@ -247,12 +248,12 @@ if ($this->multisite) {
247
  }, 'json');
248
  });
249
 
250
- $("div.role-add-new div.postbox div.main input:first-child").each(function() {
251
  change_select_all($(this));
252
  });
253
 
254
  //postbox
255
- $(function() {
256
  $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
257
  postboxes.add_postbox_toggles('<?php echo self::MENU_SLUG; ?>');
258
  $('div.postbox div.main.hidden').closest('div.postbox').addClass('hide-if-js');
144
  </div>
145
 
146
  <script type="text/javascript">
147
+ (function ($) {
148
+ var roleExists = <?php echo $this->role == NULL ? 'false' : 'true'; ?>;
149
+ var isMultisite = <?php echo $this->multisite ? 'false' : 'true'; ?>;
150
+
151
  function change_select_all(chk) {
152
  var chks = chk.closest("div.main").find("input");
153
  if (chks.length == chks.filter(":checked").length) {
158
  }
159
  }
160
 
161
+ $("div.role-add-new div.postbox input.select-all").click(function () {
162
  $(this).closest('div.postbox').find("input").prop("checked", $(this).prop("checked"));
163
+ }).parent().click(function (event) {
164
  event.stopPropagation();
165
  });
166
+
167
+ $("div.role-add-new div.postbox div.main input").click(function () {
168
  change_select_all($(this));
169
  });
170
+
171
+ $("div.role-add-new table.sub-head td.sub-head-controls input.chk-helpers").click(function () {
172
  if ($(this).hasClass('select-all')) {
173
  $("div.role-add-new div.postbox").find("input:not(:disabled)").prop("checked", true);
174
  }
176
  $("div.role-add-new div.postbox").find("input:not(:disabled)").prop("checked", false);
177
  }
178
  });
179
+
180
+ if (!roleExists) {
181
+ $("#display_name").keyup(function () {
 
182
  if ($.trim($(this).val()) == "")
183
  return;
184
  $("#role_name").val($.trim($(this).val()).toLowerCase().replace(/ /g, "_").replace(/\W/g, ""));
185
  });
186
+
187
+ $("#role_name").blur(function () {
188
  var ele = $(this);
189
  var str = $.trim(ele.val()).toLowerCase();
190
  str = str.replace(/ /g, "_").replace(/\W/g, "");
193
  ele.parent().parent().removeClass("form-invalid");
194
  }
195
  });
196
+ }
 
 
197
 
198
+ $("#display_name").blur(function () {
199
  if ($.trim($(this).val()) != "") {
200
  $(this).parent().parent().removeClass("form-invalid");
201
  }
202
  $("#role_name").blur();
203
  });
204
+
205
+ $("#createusersub").click(function () {
206
  var role_name = $("#role_name");
207
  var display_name = $("#display_name");
208
  if ($.trim(role_name.val()) == "") {
225
 
226
  return true;
227
  });
228
+
229
+ $("#cap_apply").click(function () {
230
  if ($(this).prev().val() == "")
231
  return;
232
  var button = $(this).prop("disabled", true);
236
  "referer": <?php echo json_encode($_SERVER['REQUEST_URI']); ?>,
237
  "nonce": <?php echo json_encode(wp_create_nonce($_SERVER['REQUEST_URI'])); ?>
238
  };
239
+
240
+ data["multisite"] = isMultisite;
241
+
242
+ $.post(ajaxurl, data, function (response) {
 
 
 
 
243
  $("div.role-add-new div.postbox input").prop("checked", false);
244
  for (m in response) {
245
  change_select_all($("div.role-add-new input#" + m).prop("checked", response[m]));
248
  }, 'json');
249
  });
250
 
251
+ $("div.role-add-new div.postbox div.main input:first-child").each(function () {
252
  change_select_all($(this));
253
  });
254
 
255
  //postbox
256
+ $(function () {
257
  $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
258
  postboxes.add_postbox_toggles('<?php echo self::MENU_SLUG; ?>');
259
  $('div.postbox div.main.hidden').closest('div.postbox').addClass('hide-if-js');
templates/go-pro-table CHANGED
@@ -21,7 +21,7 @@
21
 
22
  div.wrap.go-pro div.container {
23
  text-align: center;
24
- display: inline-block;
25
  }
26
 
27
  div.wrap.go-pro div.container div.col {
21
 
22
  div.wrap.go-pro div.container {
23
  text-align: center;
24
+ /* display: inline-block; */
25
  }
26
 
27
  div.wrap.go-pro div.container div.col {
templates/go-pro.php CHANGED
@@ -68,15 +68,34 @@ if (!defined('ABSPATH')) {
68
  <td>
69
  <input name="license_key" type="text" id="license_key" class="regular-text" value="<?php echo $this->license_key; ?>" aria-required="true" <?php echo $this->has_license ? 'disabled' : ''; ?> />
70
  <?php if (!$this->has_license) { ?>
71
- <input type="hidden" name="activate" value="<?php echo $this->__('Activate'); ?>" />
72
- <input type="submit" class="button-secondary" value="<?php echo $this->__('Activate'); ?>" />
73
  <?php } else { ?>
74
- <input type="hidden" name="deactivate" value="<?php echo $this->__('Deactivate'); ?>" />
75
- <input type="submit" class="button-secondary" value="<?php echo $this->__('Deactivate'); ?>" />
76
  <?php } ?>
77
  </td>
78
  </tr>
79
  <?php if ($this->has_license) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  <tr>
81
  <th scope="row">
82
  <?php echo $this->__('License Expires'); ?>
@@ -92,9 +111,9 @@ if (!defined('ABSPATH')) {
92
  </div>
93
 
94
  <script type="text/javascript">
95
- (function($) {
96
  var noblock = false;
97
- var $form = $('#license-form').submit(function() {
98
  if (noblock)
99
  return;
100
 
@@ -102,22 +121,29 @@ if (!defined('ABSPATH')) {
102
  "action": "wpfront_user_role_editor_license_functions"
103
  };
104
 
105
- $(this).find("input").prop('disabled', true).each(function() {
106
  var $input = $(this);
107
  data[$input.attr('name')] = $input.val();
108
  });
109
 
110
- $.post(ajaxurl, data, function(response) {
111
  if (response)
112
  window.location.replace(window.location.href);
113
  else {
114
  noblock = true;
 
115
  $form.find("input").prop('disabled', false);
116
- $form.submit();
 
 
 
 
117
  }
118
  }, 'json');
119
 
120
  return false;
 
 
121
  });
122
  })(jQuery);
123
  </script>
68
  <td>
69
  <input name="license_key" type="text" id="license_key" class="regular-text" value="<?php echo $this->license_key; ?>" aria-required="true" <?php echo $this->has_license ? 'disabled' : ''; ?> />
70
  <?php if (!$this->has_license) { ?>
71
+ <input type="submit" name="activate" class="button-secondary" value="<?php echo $this->__('Activate'); ?>" />
 
72
  <?php } else { ?>
73
+ <input type="submit" name="deactivate" class="button-secondary" value="<?php echo $this->__('Deactivate'); ?>" />
74
+ <input type="button" name="recheck" class="button-secondary" value="<?php echo $this->__('Recheck'); ?>" />
75
  <?php } ?>
76
  </td>
77
  </tr>
78
  <?php if ($this->has_license) { ?>
79
+ <tr>
80
+ <th scope="row">
81
+ <?php echo $this->__('License Status'); ?>
82
+ </th>
83
+ <td class="<?php echo $this->license_status; ?>">
84
+ <?php
85
+ switch ($this->license_status) {
86
+ case 'valid':
87
+ echo $this->__('Valid');
88
+ break;
89
+ case 'expired':
90
+ echo $this->__('Expired');
91
+ break;
92
+ case 'invalid':
93
+ echo $this->__('Invalid');
94
+ break;
95
+ }
96
+ ?>
97
+ </td>
98
+ </tr>
99
  <tr>
100
  <th scope="row">
101
  <?php echo $this->__('License Expires'); ?>
111
  </div>
112
 
113
  <script type="text/javascript">
114
+ (function ($) {
115
  var noblock = false;
116
+ var $form = $('#license-form').submit(function () {
117
  if (noblock)
118
  return;
119
 
121
  "action": "wpfront_user_role_editor_license_functions"
122
  };
123
 
124
+ $(this).find("input").prop('disabled', true).each(function () {
125
  var $input = $(this);
126
  data[$input.attr('name')] = $input.val();
127
  });
128
 
129
+ $.post(ajaxurl, data, function (response) {
130
  if (response)
131
  window.location.replace(window.location.href);
132
  else {
133
  noblock = true;
134
+ var $form = $('#license-form');
135
  $form.find("input").prop('disabled', false);
136
+ $form.find("input").removeAttr('disabled');
137
+ $form.find("input[type='submit']").click();
138
+ setTimeout(function () {
139
+ $form.find("input[type='submit']").click();
140
+ }, 500);
141
  }
142
  }, 'json');
143
 
144
  return false;
145
+ }).find('input[name="recheck"]').click(function () {
146
+ $(this).prev().attr("name", "recheck").click();
147
  });
148
  })(jQuery);
149
  </script>
templates/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
wpfront-user-role-editor.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WPFront User Role Editor
5
  * Plugin URI: http://wpfront.com/user-role-editor-pro/
6
  * Description: Allows you to manage user roles.
7
- * Version: 2.10
8
  * Author: Syam Mohan
9
  * Author URI: http://wpfront.com
10
  * License: GPL v3
4
  * Plugin Name: WPFront User Role Editor
5
  * Plugin URI: http://wpfront.com/user-role-editor-pro/
6
  * Description: Allows you to manage user roles.
7
+ * Version: 2.11.3
8
  * Author: Syam Mohan
9
  * Author URI: http://wpfront.com
10
  * License: GPL v3