Admin Menu Editor - Version 1.10.2

Version Description

  • Added additional validation in escaping in multiple places.
  • Fixed a number of issues related to the WordPress coding standard and the WordPress-VIP-Go coding standard.
  • Fixed visual misalignment of menu property fields and accompanying dropdown buttons.
  • Fixed inconsistent spacing aroud some radio buttons on the settings page.
  • Introduced a limit to how many unique menu URLs can be remembered by the "highlight new menu items" feature. Previously, when this feature was enabled, the plugin would record each "seen" menu item, which could cause the associated database entry to grow endlessly. Now the plugin will remember up to 700 items per user.
  • Tested with WordPress 6.0 (release candidate) and 6.1-alpha.
Download this release

Release Info

Developer whiteshadow
Plugin Icon 128x128 Admin Menu Editor
Version 1.10.2
Comparing to
See all releases

Code changes from version 1.10.1 to 1.10.2

Files changed (41) hide show
  1. ajax-wrapper/AjaxWrapper.php +16 -27
  2. css/menu-editor.css +7 -17
  3. css/menu-editor.css.map +1 -1
  4. css/menu-editor.scss +9 -22
  5. includes/access-test-runner.php +7 -7
  6. includes/ame-utils.php +192 -3
  7. includes/auto-versioning.php +1 -1
  8. includes/cap-suggestion-box.php +5 -0
  9. includes/consistency-check.php +11 -11
  10. includes/editor-page.php +54 -27
  11. includes/generate-menu-dashicons.php +4 -2
  12. includes/menu-editor-core.php +77 -46
  13. includes/menu-item.php +2 -2
  14. includes/menu.php +2 -2
  15. includes/module.php +5 -1
  16. includes/persistent-module.php +1 -1
  17. includes/role-utils.php +2 -5
  18. includes/settings-page.php +27 -23
  19. includes/shadow_plugin_framework.php +13 -12
  20. includes/test-access-screen.php +5 -0
  21. js/actor-manager.js +1 -0
  22. js/actor-manager.js.map +1 -1
  23. js/menu-editor.js +40 -20
  24. menu-editor.php +1 -1
  25. modules/access-editor/access-editor-template.php +13 -13
  26. modules/actor-selector/actor-selector-template.php +5 -0
  27. modules/actor-selector/actor-selector.js +1 -0
  28. modules/actor-selector/actor-selector.js.map +1 -1
  29. modules/actor-selector/actor-selector.php +2 -2
  30. modules/highlight-new-menus/wsNewMenuHighlighter.php +44 -3
  31. modules/plugin-visibility/plugin-visibility-template.php +1 -1
  32. modules/plugin-visibility/plugin-visibility.js +1 -0
  33. modules/plugin-visibility/plugin-visibility.js.map +1 -1
  34. modules/plugin-visibility/plugin-visibility.php +7 -2
  35. modules/redirector/redirector-template.php +2 -2
  36. modules/redirector/redirector-ui.js +1 -0
  37. modules/redirector/redirector-ui.js.map +1 -0
  38. modules/redirector/redirector.php +8 -5
  39. phpcs.xml +49 -0
  40. readme.txt +11 -3
  41. tsconfig.json +8 -0
ajax-wrapper/AjaxWrapper.php CHANGED
@@ -113,10 +113,6 @@ if (!class_exists('Ajaw_v1_Action', false)):
113
 
114
  private $isScriptRegistered = false;
115
 
116
- public $get = array();
117
- public $post = array();
118
- public $request = array();
119
-
120
  public static $defaultValidators = array(
121
  'int' => array(__CLASS__, 'validateInt'),
122
  'float' => array(__CLASS__, 'validateFloat'),
@@ -192,7 +188,7 @@ if (!class_exists('Ajaw_v1_Action', false)):
192
  }
193
 
194
  protected function handleAction() {
195
- $method = strtoupper(filter_input(INPUT_SERVER, 'REQUEST_METHOD'));
196
  if (isset($this->method) && ($method !== $this->method)) {
197
  return new WP_Error(
198
  'http_method_not_allowed',
@@ -263,9 +259,19 @@ if (!class_exists('Ajaw_v1_Action', false)):
263
  return true;
264
  }
265
 
 
 
 
 
 
 
 
 
 
266
  protected function parseParameters() {
267
- $method = strtoupper(filter_input(INPUT_SERVER, 'REQUEST_METHOD'));
268
 
 
269
  //Retrieve request parameters.
270
  if ($method === 'GET') {
271
  $rawParams = $_GET;
@@ -274,6 +280,7 @@ if (!class_exists('Ajaw_v1_Action', false)):
274
  } else {
275
  $rawParams = $_REQUEST;
276
  }
 
277
 
278
  //Remove magic quotes. WordPress applies them in wp-settings.php.
279
  //There's no hook for wp_magic_quotes, so we use one that's closest in execution order.
@@ -284,7 +291,7 @@ if (!class_exists('Ajaw_v1_Action', false)):
284
  //Validate all parameters.
285
  $inputParams = $rawParams;
286
  foreach($this->params as $name => $settings) {
287
- //Verify that all of the required parameters are present.
288
  //Empty strings are treated as missing parameters.
289
  if (isset($inputParams[$name]) && ($inputParams[$name] !== '')) {
290
  $value = $this->validateParameter($settings, $inputParams[$name], $name);
@@ -379,7 +386,7 @@ if (!class_exists('Ajaw_v1_Action', false)):
379
 
380
  protected function outputJSON($response) {
381
  @header('Content-Type: application/json; charset=' . get_option('blog_charset'));
382
- echo json_encode($response);
383
  }
384
 
385
  public function registerScript() {
@@ -432,31 +439,13 @@ if (!class_exists('Ajaw_v1_Action', false)):
432
  return sprintf(
433
  'AjawV1.actionRegistry.add("%s", %s);' . "\n",
434
  esc_js($this->action),
435
- json_encode($properties)
436
  );
437
  }
438
 
439
  public function getScriptHandle() {
440
  return 'ajaw-v1-ajax-action-wrapper';
441
  }
442
-
443
- /**
444
- * Capture $_GET, $_POST and $_REQUEST without magic quotes.
445
- */
446
- function captureRequestVars() {
447
- $this->post = $_POST;
448
- $this->get = $_GET;
449
- $this->request = $_REQUEST;
450
-
451
- if (
452
- version_compare(phpversion(), '7.4.0alpha1', '<')
453
- && function_exists('get_magic_quotes_gpc')
454
- && get_magic_quotes_gpc()
455
- ) {
456
- $this->post = stripslashes_deep($this->post);
457
- $this->get = stripslashes_deep($this->get);
458
- }
459
- }
460
  }
461
 
462
  endif;
113
 
114
  private $isScriptRegistered = false;
115
 
 
 
 
 
116
  public static $defaultValidators = array(
117
  'int' => array(__CLASS__, 'validateInt'),
118
  'float' => array(__CLASS__, 'validateFloat'),
188
  }
189
 
190
  protected function handleAction() {
191
+ $method = $this->getRequestMethod();
192
  if (isset($this->method) && ($method !== $this->method)) {
193
  return new WP_Error(
194
  'http_method_not_allowed',
259
  return true;
260
  }
261
 
262
+ protected function getRequestMethod() {
263
+ return strtoupper(filter_input(
264
+ INPUT_SERVER,
265
+ 'REQUEST_METHOD',
266
+ FILTER_VALIDATE_REGEXP,
267
+ array('options' => array('regexp' => '/^[a-z]{3,20}$/i'))
268
+ ));
269
+ }
270
+
271
  protected function parseParameters() {
272
+ $method = $this->getRequestMethod();
273
 
274
+ // phpcs:disable WordPress.Security.NonceVerification -- checkAuthorization() is where nonce verification happens.
275
  //Retrieve request parameters.
276
  if ($method === 'GET') {
277
  $rawParams = $_GET;
280
  } else {
281
  $rawParams = $_REQUEST;
282
  }
283
+ // phpcs:enable
284
 
285
  //Remove magic quotes. WordPress applies them in wp-settings.php.
286
  //There's no hook for wp_magic_quotes, so we use one that's closest in execution order.
291
  //Validate all parameters.
292
  $inputParams = $rawParams;
293
  foreach($this->params as $name => $settings) {
294
+ //Verify that all the required parameters are present.
295
  //Empty strings are treated as missing parameters.
296
  if (isset($inputParams[$name]) && ($inputParams[$name] !== '')) {
297
  $value = $this->validateParameter($settings, $inputParams[$name], $name);
386
 
387
  protected function outputJSON($response) {
388
  @header('Content-Type: application/json; charset=' . get_option('blog_charset'));
389
+ echo wp_json_encode($response);
390
  }
391
 
392
  public function registerScript() {
439
  return sprintf(
440
  'AjawV1.actionRegistry.add("%s", %s);' . "\n",
441
  esc_js($this->action),
442
+ wp_json_encode($properties)
443
  );
444
  }
445
 
446
  public function getScriptHandle() {
447
  return 'ajaw-v1-ajax-action-wrapper';
448
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
  }
450
 
451
  endif;
css/menu-editor.css CHANGED
@@ -393,6 +393,7 @@ body.rtl .ws_container {
393
  .ame-is-wp53-plus #ws_menu_editor .ws_editbox input[type=text],
394
  .ame-is-wp53-plus #ws_menu_editor .ws_editbox select {
395
  height: 28px;
 
396
  }
397
 
398
  #ws_menu_editor .ws_edit_field label {
@@ -419,9 +420,10 @@ body.rtl .ws_container {
419
  height: 25px;
420
  min-height: 25px;
421
  margin: 1px 1px 1px 0;
422
- padding: 0;
423
  text-align: center;
424
- font-size: 9px !important;
 
425
  line-height: 25px;
426
  border-color: #dfdfdf;
427
  box-shadow: none;
@@ -429,14 +431,6 @@ body.rtl .ws_container {
429
  border-bottom-right-radius: 3px;
430
  border-top-left-radius: 0;
431
  border-bottom-left-radius: 0;
432
- -moz-border-radius-topright: 3px;
433
- -moz-border-radius-bottomright: 3px;
434
- -moz-border-radius-topleft: 0;
435
- -moz-border-radius-bottomleft: 0;
436
- -webkit-border-top-right-radius: 3px;
437
- -webkit-border-bottom-right-radius: 3px;
438
- -webkit-border-top-left-radius: 0;
439
- -webkit-border-bottom-left-radius: 0;
440
  }
441
 
442
  .ame-is-wp53-plus #ws_menu_editor .ws_dropdown_button,
@@ -445,7 +439,7 @@ body.rtl .ws_container {
445
  border-color: #7e8993;
446
  background-color: white;
447
  border-left-style: none;
448
- font-size: 10px !important;
449
  line-height: 24px;
450
  color: #555;
451
  }
@@ -478,16 +472,13 @@ to accommodate the drop-down button.
478
  border-right: 0;
479
  border-top-right-radius: 0;
480
  border-bottom-right-radius: 0;
481
- -moz-border-radius-topright: 0;
482
- -moz-border-radius-bottomright: 0;
483
- -webkit-border-top-right-radius: 0;
484
- -webkit-border-bottom-right-radius: 0;
485
  }
486
 
487
  #ws_menu_access_editor input.ws_has_dropdown {
488
  width: 90%;
489
  box-sizing: border-box;
490
  height: 27px;
 
491
  }
492
 
493
  #ws_menu_access_editor.ame-is-wp53-plus input.ws_has_dropdown {
@@ -1169,7 +1160,6 @@ a#ws-ame-delete-color-preset:hover {
1169
  }
1170
 
1171
  .ws_dialog_buttons {
1172
- /*height: 30px;*/
1173
  text-align: right;
1174
  margin-top: 20px;
1175
  margin-bottom: 1px;
@@ -1887,7 +1877,7 @@ span.description {
1887
  }
1888
 
1889
  .wrap :target {
1890
- background-color: rgba(255, 230, 81, 0.8);
1891
  }
1892
 
1893
  .test-wrap {
393
  .ame-is-wp53-plus #ws_menu_editor .ws_editbox input[type=text],
394
  .ame-is-wp53-plus #ws_menu_editor .ws_editbox select {
395
  height: 28px;
396
+ margin-top: 1px;
397
  }
398
 
399
  #ws_menu_editor .ws_edit_field label {
420
  height: 25px;
421
  min-height: 25px;
422
  margin: 1px 1px 1px 0;
423
+ padding: 0 1px 0 0;
424
  text-align: center;
425
+ font-family: dashicons;
426
+ font-size: 16px !important;
427
  line-height: 25px;
428
  border-color: #dfdfdf;
429
  box-shadow: none;
431
  border-bottom-right-radius: 3px;
432
  border-top-left-radius: 0;
433
  border-bottom-left-radius: 0;
 
 
 
 
 
 
 
 
434
  }
435
 
436
  .ame-is-wp53-plus #ws_menu_editor .ws_dropdown_button,
439
  border-color: #7e8993;
440
  background-color: white;
441
  border-left-style: none;
442
+ font-size: 16px !important;
443
  line-height: 24px;
444
  color: #555;
445
  }
472
  border-right: 0;
473
  border-top-right-radius: 0;
474
  border-bottom-right-radius: 0;
 
 
 
 
475
  }
476
 
477
  #ws_menu_access_editor input.ws_has_dropdown {
478
  width: 90%;
479
  box-sizing: border-box;
480
  height: 27px;
481
+ margin-top: 1px;
482
  }
483
 
484
  #ws_menu_access_editor.ame-is-wp53-plus input.ws_has_dropdown {
1160
  }
1161
 
1162
  .ws_dialog_buttons {
 
1163
  text-align: right;
1164
  margin-top: 20px;
1165
  margin-bottom: 1px;
1877
  }
1878
 
1879
  .wrap :target {
1880
+ background-color: rgba(255, 230, 81, 0.7);
1881
  }
1882
 
1883
  .test-wrap {
css/menu-editor.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["menu-editor.scss","_indeterminate-checkbox.scss","_test-access-screen.scss","_main-tabs.scss"],"names":[],"mappings":";AAAA;AAIA;EACC;;;AAGD;EACC;;;AAQD;EACC;EACA,OAPoB;EAQpB;EACA;EAEA;EACA;EACA;EAEA,eAb2B;EAc3B,oBAd2B;EAe3B,uBAf2B;;;AAkB5B;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AASD;EACC;EACA;EAEA;EACA;EAEA;;;AAGD;AAAA;AAAA;EAGC;;;AAGD;AAAA;EAEC;;;AAGD;AAAA;AAAA;AAGA;EACI;;;AAGJ;EACI;;;AAIH;EACC;EACA;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;;;AAIF;EACC;;;AAGD;AAAA;AAAA;AAKA;AAAA;EAG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ACA;EACA;EAEA;EACA;EACA;EAEA;;AAEA;EACC;;;AAIF;EACC;;;AAGD;AAAA;AAAA;EAGC;;;AAGD;AACA;AAAA;EAEC;;;AAGD;AAIA;AAAA;EAEC;EACA;EACA,OAPiB;EAQjB;EAEA;EACA;EAEA;EACA;;AAEA;AAAA;EACC,QAhBqB;;;AAoBvB;EACC;EACA;;;AAGD;EACC;;;AAGD;EACC;;AAEA;EACC,YAjCqB;;;AAqCvB;AAGA;AAAA;EAGC;EACA,OANqB;EAOrB;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;;AAGD;AAAA;EAGC,QA7EsB;EA+EtB;EACA;EACA;EAEA;EACA;EACA;;AAEA;AAAA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAAA;AAIA;AAAA;EAGC;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;AACA;EACC;;;AAGD;AAAA;AAAA;AAGA;EACC;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;;;AAED;AACC;AAAsB;EACtB;AAAkB;EAClB;EAEA;AAA2B;EAC3B;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;EACA;EAEA;AAA2B;EAC3B;;;AAGD;AAMA;AAAA;AAAA;AAIA;EACC;EAEA;EACA;EACA;EAEA;EACA;;;AASD;EACC;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAID;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAID;EACC;EACA;EACA,SAJ0B;;;AAO3B;EACC;;;AAGD;AAAA;AAAA;AAAA;AAAA;AAQA;EACC;EACA;EACA;;AAEA;EACC;EAEA;EACA;EACA;EACA;EAEA;;AAGD;EACC;EACA,qBApBwB;EAqBxB;;AAGD;EACC;;AAGD;EACC;;;AAIF;EACC;EACA;EACA,kBApCyB;;;AAyC1B;AAAA;AAAA;AAIA;EACC;EACA;EACA;EAEA;EACA;EACG;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAIJ;EACC;EACA;EAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACI;EACA;EACA;;;AAGJ;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;AACA;EACC;EACA;EACA;EAEG;EACA;EACH;;AAEA;EACC,QAneqB;EAoerB,YApeqB;EAqerB;;;AAIF;AACA;EACC;EACA;EACA;AAEA;AAAA;AAAA;AAAA;AAAA;EAKA;EACA;EACA;;AAEA;EACC;;;AAIF;AACA;EACC;EACA;EACA;EACA;;;AAOA;EACC;EACA;EAMA;;AAJA;EACC;;AAMF;EACC;EACA;EACA;;;AAIF;AACA;EACC;EACA;;;AAED;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;AAAe;EACf;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAAA;AAIA;EACC;;;AAID;AAAA;AAAA;AAIA;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EACA;EAEA;;;AAGJ;EACI;;AAEH;EACC;;;AAIF;EACI;;;AAGJ;EACC;EACA;EACA;;;AAGD;AACA;EACC;EAEA;EACA;EACA;EAEA;;;AAGD;EACC;EACA;;;AAGD;AACC;;;AAGD;EACC;EACA;;;AAED;EACC;;;AAGD;AAKA;EAGI;EACH;EACG,QAJgB;EAKhB,OATc;EAWd,cAVoB;EAWvB;EACG;EAEH;EACG;EACA;EACA;EAEH;;AAEA;EACC;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAIF;EACC;;;AAGD;EACI;EACA;EACA;EAEA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEG;EACA;;;AAGJ;EACI;;;AAIH;EACC;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAIF;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EAEA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGD;AACC;EACA;;AAQF;EACC;;;AAGD;EACC;;;AAIA;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;;;AAGD;AACC;EACA;EACA;EACG;EACA;;;AAGJ;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACC;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;AAAA;AAAA;AAIA;AAGA;EAEC,OAJuB;EAKvB,cAJwB;;;AAOzB;EACC;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;;;AAIF;EACC;EACA;EACA;EACA;;;AAGD;AAAA;EAEC;EACA;EACA;;;AAGD;AAAA;EAEC;;;AAGD;EACC;;;AAGD;AACC;AAAA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;AAAA;AAAA;AAGA;AAuBC;;AArBA;EACC;;AAGD;EACC;;AAGD;EACC;;AAIA;EACC;;AAED;EACC;;AAKF;EACC;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;EACA;;;AAKD;EACC,cAH0B;EAI1B;EACA;EACA;;;AAGD;EACC;;AAEA;EACC,cAbyB;;AAgB1B;EACC;EACA;;AAGD;AAAA;EAEC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAIA;EACC;;;AAQF;EACC;EACA;EACA;EACA;;AAGD;EACC;;AAID;EACC;;AAED;EACC;;AAKA;EACC;;AAED;EACC;;;AAQF;EACC;;;AAIF;AACA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;EAGA;EAEA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;;;AAGD;EACC;;;AAID;EAGC,WAFgB;EAGhB,QAHgB;EAIhB,OAJgB;EAOhB;EAEA;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAQA;EAEC;EACA,SAFoB;;;AAKrB;EACC;;AAEA;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA,OAtBwB;EAuBxB,QAtByB;EAwBzB;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;EAGA,KAFc;EAGd,MA7C0B;EA8C1B,OA9C0B;EAiD1B;EAEA;EACA;;AAGD;EACC;EAGA;EACA;EACA;EACA;;AAEA;EACC;EACA;EAEA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAID;EACC;;AAMD;EACC;;AAED;EACC;;AAED;EACC;;AAGD;EACC;;AAKA;EACC;;AAaH;EACC;EACA;EACA;EAEA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA,OAzJ2B;EA0J3B,QA1J2B;EA4J3B;EACA;;;AAKD;AAAA;AAAA;AAIA;EACI;;;AAMJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAID;EACC;;;AAID;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAGD;EACC;;;AAIF;EAEC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAGA;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;AAEA;EACC;EACA;;AAGD;EAEC,aA/0CyB;EAg1CzB,gBAh1CyB;;AAm1C1B;EACC;;AAGD;EACC;;AAEA;EACC;;;AAKH;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;;AAIF;EACC;;;AAGD;AACC;AAAA;;;AAID;AAAA;AAAA;AAIA;EACC;;;AAGD;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAIA;EACI;EAEH;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;;;AAGD;EACC;EAEA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EAEA;;;AAGJ;EACI;EACA;EAEA;EACA;;;AAGJ;EACI;;;AEvtEJ;AAAA;AAAA;AAIA;EACC;EACA;;;AAGD;EAEC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;;AAIF;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;ACjID;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;;AAAA;AAAA;AAAA;AAMA;EACC;;;AAIA;EACC;;;AAIF;AAAA;AAEA;EACC","file":"menu-editor.css"}
1
+ {"version":3,"sourceRoot":"","sources":["menu-editor.scss","_indeterminate-checkbox.scss","_test-access-screen.scss","_main-tabs.scss"],"names":[],"mappings":";AAAA;AAIA;EACC;;;AAGD;EACC;;;AAQD;EACC;EACA,OAPoB;EAQpB;EACA;EAEA;EACA;EACA;EAEA,eAb2B;EAc3B,oBAd2B;EAe3B,uBAf2B;;;AAkB5B;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AASD;EACC;EACA;EAEA;EACA;EAEA;;;AAGD;AAAA;AAAA;EAGC;;;AAGD;AAAA;EAEC;;;AAGD;AAAA;AAAA;AAGA;EACI;;;AAGJ;EACI;;;AAIH;EACC;EACA;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;;;AAIF;EACC;;;AAGD;AAAA;AAAA;AAKA;AAAA;EAGI;EACA;EACA;EACA;;ACjHH;AAAA;EACC;EACA,OAH4C;EAU5C;EACA;EAMA;EACA;EACA;EACA;EACA;;AAGD;EACC;AAAA;IAEC,QADU;IAEV,OAFU;IAGV,aAHU;IAIV;IAEA;IACA;IACA;;;;ADqFH;EAEE;IACC;IACA;;;AAKH;AACA;EACI;;;AAGJ;EACI;;;AAGJ;AAEA;EACI;;;AAGJ;EACI;;;AAGJ;AAAA;AAAA;AAIA;EACC;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;AAAA;AAAA;AAIA;EACC;;;AAGD;AAAA;AAAA;AAIA;EAMC;EACA,OANY;EAQZ,SAPc;EAQd;;AAEA;EACC,cATsB;EAUtB;;;AAWF;EACC;;;AAID;EACC;;;AAGD;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;;;AAMD;EACC;;;AAGD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AGD;EACC;;;AAGD;AACA;EACC;;;AAGD;AAAA;AAAA;AAGA;EACC;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;;;AAED;AACC;AAAsB;EACtB;AAAkB;EAClB;EAEA;AAA2B;EAC3B;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;EACA;EAEA;AAA2B;EAC3B;;;AAGD;AAMA;AAAA;AAAA;AAIA;EACC;EAEA;EACA;EACA;EAEA;EACA;;;AASD;EACC;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAID;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAID;EACC;EACA;EACA,SAJ0B;;;AAO3B;EACC;;;AAGD;AAAA;AAAA;AAAA;AAAA;AAQA;EACC;EACA;EACA;;AAEA;EACC;EAEA;EACA;EACA;EACA;EAEA;;AAGD;EACC;EACA,qBApBwB;EAqBxB;;AAGD;EACC;;AAGD;EACC;;;AAIF;EACC;EACA;EACA,kBApCyB;;;AAyC1B;AAAA;AAAA;AAIA;EACC;EACA;EACA;EAEA;EACA;EACG;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAIJ;EACC;EACA;EAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACI;EACA;EACA;;;AAGJ;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;AACA;EACC;EACA;EACA;EAEG;EACA;EACH;;AAEA;EACC,QAvdqB;EAwdrB,YAxdqB;EAydrB;;;AAIF;AACA;EACC;EACA;EACA;AAEA;AAAA;AAAA;AAAA;AAAA;EAKA;EACA;EACA;;AAEA;EACC;;;AAIF;AACA;EACC;EACA;EACA;EACA;;;AAOA;EACC;EACA;EAMA;;AAJA;EACC;;AAMF;EACC;EACA;EACA;;;AAIF;AACA;EACC;EACA;;;AAED;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;AAAe;EACf;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAAA;AAIA;EACC;;;AAID;AAAA;AAAA;AAIA;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EACA;EAEA;;;AAGJ;EACI;;AAEH;EACC;;;AAIF;EACI;;;AAGJ;EACC;EACA;EACA;;;AAGD;AACA;EACC;EAEA;EACA;EACA;EAEA;;;AAGD;EACC;EACA;;;AAGD;AACC;;;AAGD;EACC;EACA;;;AAED;EACC;;;AAGD;AAKA;EAGI;EACH;EACG,QAJgB;EAKhB,OATc;EAWd,cAVoB;EAWvB;EACG;EAEH;EACG;EACA;EACA;EAEH;;AAEA;EACC;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAIF;EACC;;;AAGD;EACI;EACA;EACA;EAEA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEG;EACA;;;AAGJ;EACI;;;AAIH;EACC;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAIF;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EAEA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGD;AACC;EACA;;AAQF;EACC;;;AAGD;EACC;;;AAIA;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;;;AAGD;EACC;EACA;EACG;EACA;;;AAGJ;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACC;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;AAAA;AAAA;AAIA;AAGA;EAEC,OAJuB;EAKvB,cAJwB;;;AAOzB;EACC;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;;;AAIF;EACC;EACA;EACA;EACA;;;AAGD;AAAA;EAEC;EACA;EACA;;;AAGD;AAAA;EAEC;;;AAGD;EACC;;;AAGD;AACC;AAAA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;AAAA;AAAA;AAGA;AAuBC;;AArBA;EACC;;AAGD;EACC;;AAGD;EACC;;AAIA;EACC;;AAED;EACC;;AAKF;EACC;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;EACA;;;AAKD;EACC,cAH0B;EAI1B;EACA;EACA;;;AAGD;EACC;;AAEA;EACC,cAbyB;;AAgB1B;EACC;EACA;;AAGD;AAAA;EAEC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAIA;EACC;;;AAQF;EACC;EACA;EACA;EACA;;AAGD;EACC;;AAID;EACC;;AAED;EACC;;AAKA;EACC;;AAED;EACC;;;AAQF;EACC;;;AAIF;AACA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;EAGA;EAEA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;;;AAGD;EACC;;;AAID;EAGC,WAFgB;EAGhB,QAHgB;EAIhB,OAJgB;EAOhB;EAEA;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAQA;EAEC;EACA,SAFoB;;;AAKrB;EACC;;AAEA;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA,OAtBwB;EAuBxB,QAtByB;EAwBzB;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;EAGA,KAFc;EAGd,MA7C0B;EA8C1B,OA9C0B;EAiD1B;EAEA;EACA;;AAGD;EACC;EAGA;EACA;EACA;EACA;;AAEA;EACC;EACA;EAEA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAID;EACC;;AAMD;EACC;;AAED;EACC;;AAED;EACC;;AAGD;EACC;;AAKA;EACC;;AAaH;EACC;EACA;EACA;EAEA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA,OAzJ2B;EA0J3B,QA1J2B;EA4J3B;EACA;;;AAKD;AAAA;AAAA;AAIA;EACI;;;AAMJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAID;EACC;;;AAID;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAGD;EACC;;;AAIF;EAEC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAGA;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;AAEA;EACC;EACA;;AAGD;EAEC,aA90CyB;EA+0CzB,gBA/0CyB;;AAk1C1B;EACC;;AAGD;EACC;;AAEA;EACC;;;AAKH;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;;AAIF;EACC;;;AAGD;AACC;AAAA;;;AAID;AAAA;AAAA;AAIA;EACC;;;AAGD;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAIA;EACI;EAEH;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;;;AAGD;EACC;EAEA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EAEA;;;AAGJ;EACI;EACA;EAEA;EACA;;;AAGJ;EACI;;;AE1sEJ;AAAA;AAAA;AAIA;EACC;EACA;;;AAGD;EAEC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;;AAIF;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;ACjID;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;;AAAA;AAAA;AAAA;AAMA;EACC;;;AAIA;EACC;;;AAIF;AAAA;AAEA;EACC","file":"menu-editor.css"}
css/menu-editor.scss CHANGED
@@ -451,6 +451,7 @@ $basicInputWp53Height: 28px;
451
 
452
  .ame-is-wp53-plus & {
453
  height: $basicInputWp53Height;
 
454
  }
455
  }
456
 
@@ -483,12 +484,14 @@ $dropdownButtonWidth: 25px;
483
  min-height: 25px;
484
 
485
  margin: 1px 1px 1px 0;
486
- padding: 0;
487
 
488
  text-align: center;
489
- font-size: 9px !important;
 
 
490
  line-height: 25px;
491
-
492
  border-color: #dfdfdf;
493
  box-shadow: none;
494
 
@@ -496,16 +499,6 @@ $dropdownButtonWidth: 25px;
496
  border-bottom-right-radius: 3px;
497
  border-top-left-radius: 0;
498
  border-bottom-left-radius: 0;
499
-
500
- -moz-border-radius-topright: 3px;
501
- -moz-border-radius-bottomright: 3px;
502
- -moz-border-radius-topleft: 0;
503
- -moz-border-radius-bottomleft: 0;
504
-
505
- -webkit-border-top-right-radius: 3px;
506
- -webkit-border-bottom-right-radius: 3px;
507
- -webkit-border-top-left-radius: 0;
508
- -webkit-border-bottom-left-radius: 0;
509
  }
510
 
511
  .ame-is-wp53-plus #ws_menu_editor .ws_dropdown_button,
@@ -517,7 +510,7 @@ $dropdownButtonWidth: 25px;
517
  background-color: white;
518
  border-left-style: none;
519
 
520
- font-size: 10px !important;
521
  line-height: 24px;
522
  color: #555;
523
 
@@ -552,18 +545,13 @@ to accommodate the drop-down button.
552
 
553
  border-top-right-radius: 0;
554
  border-bottom-right-radius: 0;
555
-
556
- -moz-border-radius-topright: 0;
557
- -moz-border-radius-bottomright: 0;
558
-
559
- -webkit-border-top-right-radius: 0;
560
- -webkit-border-bottom-right-radius: 0;
561
  }
562
 
563
  #ws_menu_access_editor input.ws_has_dropdown {
564
  width: 90%;
565
  box-sizing: border-box;
566
  height: 27px;
 
567
  }
568
 
569
  #ws_menu_access_editor.ame-is-wp53-plus input.ws_has_dropdown {
@@ -1349,7 +1337,6 @@ $colorFieldRightMargin: 5px;
1349
  }
1350
 
1351
  .ws_dialog_buttons {
1352
- /*height: 30px;*/
1353
  text-align: right;
1354
  margin-top: 20px;
1355
  margin-bottom: 1px;
@@ -2233,7 +2220,7 @@ span.description {
2233
  }
2234
 
2235
  .wrap :target {
2236
- background-color: rgba(255, 230, 81, 0.8);
2237
  }
2238
 
2239
  .test-wrap {
451
 
452
  .ame-is-wp53-plus & {
453
  height: $basicInputWp53Height;
454
+ margin-top: 1px;
455
  }
456
  }
457
 
484
  min-height: 25px;
485
 
486
  margin: 1px 1px 1px 0;
487
+ padding: 0 1px 0 0;
488
 
489
  text-align: center;
490
+
491
+ font-family: dashicons;
492
+ font-size: 16px !important;
493
  line-height: 25px;
494
+
495
  border-color: #dfdfdf;
496
  box-shadow: none;
497
 
499
  border-bottom-right-radius: 3px;
500
  border-top-left-radius: 0;
501
  border-bottom-left-radius: 0;
 
 
 
 
 
 
 
 
 
 
502
  }
503
 
504
  .ame-is-wp53-plus #ws_menu_editor .ws_dropdown_button,
510
  background-color: white;
511
  border-left-style: none;
512
 
513
+ font-size: 16px !important;
514
  line-height: 24px;
515
  color: #555;
516
 
545
 
546
  border-top-right-radius: 0;
547
  border-bottom-right-radius: 0;
 
 
 
 
 
 
548
  }
549
 
550
  #ws_menu_access_editor input.ws_has_dropdown {
551
  width: 90%;
552
  box-sizing: border-box;
553
  height: 27px;
554
+ margin-top: 1px;
555
  }
556
 
557
  #ws_menu_access_editor.ame-is-wp53-plus input.ws_has_dropdown {
1337
  }
1338
 
1339
  .ws_dialog_buttons {
 
1340
  text-align: right;
1341
  margin-top: 20px;
1342
  margin-bottom: 1px;
2220
  }
2221
 
2222
  .wrap :target {
2223
+ background-color: rgba(255, 230, 81, 0.7);
2224
  }
2225
 
2226
  .test-wrap {
includes/access-test-runner.php CHANGED
@@ -42,6 +42,7 @@ class ameAccessTestRunner implements ArrayAccess {
42
  public function ajax_set_test_configuration() {
43
  check_ajax_referer('ws_ame_set_test_configuration');
44
  if ( !$this->menuEditor->current_user_can_edit_menu() ) {
 
45
  exit($this->menuEditor->json_encode(array(
46
  'error' => 'You don\'t have permission to test menu settings.',
47
  )));
@@ -52,15 +53,14 @@ class ameAccessTestRunner implements ArrayAccess {
52
 
53
  $metaId = add_user_meta(get_current_user_id(), self::TEST_DATA_META_KEY, wp_slash($menuData), false);
54
  if ( $metaId === false ) {
 
55
  exit($this->menuEditor->json_encode(array(
56
  'error' => 'Failed to store test data. add_user_meta() returned FALSE.',
57
  )));
58
  }
59
 
60
- exit($this->menuEditor->json_encode(array(
61
- 'success' => true,
62
- 'meta_id' => $metaId,
63
- )));
64
  }
65
 
66
  public function init_access_test() {
@@ -96,7 +96,7 @@ class ameAccessTestRunner implements ArrayAccess {
96
  try {
97
  $test_menu = ameMenu::load_json($json);
98
  } catch (InvalidMenuException $e) {
99
- exit($e->getMessage());
100
  }
101
  $this->test_menu = $test_menu;
102
 
@@ -128,6 +128,7 @@ class ameAccessTestRunner implements ArrayAccess {
128
  }
129
 
130
  public function output_access_test_results() {
 
131
  echo $this->get_access_test_result_script();
132
  }
133
 
@@ -139,10 +140,9 @@ class ameAccessTestRunner implements ArrayAccess {
139
  )
140
  );
141
 
142
- $script = '<script type="text/javascript">
143
  window.parent.postMessage((' . $this->menuEditor->json_encode($response) . '), "*");
144
  </script>';
145
- return $script;
146
  }
147
 
148
  public function replace_die_handler_for_access_test($callback = null) {
42
  public function ajax_set_test_configuration() {
43
  check_ajax_referer('ws_ame_set_test_configuration');
44
  if ( !$this->menuEditor->current_user_can_edit_menu() ) {
45
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Outputs JSON, not HTML.
46
  exit($this->menuEditor->json_encode(array(
47
  'error' => 'You don\'t have permission to test menu settings.',
48
  )));
53
 
54
  $metaId = add_user_meta(get_current_user_id(), self::TEST_DATA_META_KEY, wp_slash($menuData), false);
55
  if ( $metaId === false ) {
56
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Outputs JSON, not HTML.
57
  exit($this->menuEditor->json_encode(array(
58
  'error' => 'Failed to store test data. add_user_meta() returned FALSE.',
59
  )));
60
  }
61
 
62
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Outputs JSON, not HTML.
63
+ exit($this->menuEditor->json_encode(array('success' => true, 'meta_id' => $metaId)));
 
 
64
  }
65
 
66
  public function init_access_test() {
96
  try {
97
  $test_menu = ameMenu::load_json($json);
98
  } catch (InvalidMenuException $e) {
99
+ exit(esc_html($e->getMessage()));
100
  }
101
  $this->test_menu = $test_menu;
102
 
128
  }
129
 
130
  public function output_access_test_results() {
131
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Intentionally outputs generated JS.
132
  echo $this->get_access_test_result_script();
133
  }
134
 
140
  )
141
  );
142
 
143
+ return '<script type="text/javascript">
144
  window.parent.postMessage((' . $this->menuEditor->json_encode($response) . '), "*");
145
  </script>';
 
146
  }
147
 
148
  public function replace_die_handler_for_access_test($callback = null) {
includes/ame-utils.php CHANGED
@@ -26,7 +26,9 @@ class ameUtils {
26
  $currentValue = $array;
27
  $pathExists = true;
28
  foreach ($path as $node) {
29
- if ( is_array($currentValue) && array_key_exists($node, $currentValue) ) {
 
 
30
  $currentValue = $currentValue[$node];
31
  } else if ( is_object($currentValue) && property_exists($currentValue, $node) ) {
32
  $currentValue = $currentValue->$node;
@@ -128,6 +130,8 @@ class ameFileLock {
128
  $this->fileName = $fileName;
129
  }
130
 
 
 
131
  public function acquire($timeout = null) {
132
  if ( $this->handle !== null ) {
133
  throw new RuntimeException('Cannot acquire a lock that is already held.');
@@ -169,6 +173,7 @@ class ameFileLock {
169
  $this->handle = null;
170
  }
171
  }
 
172
 
173
  /**
174
  * Wait for a random interval without going over $endTime.
@@ -182,7 +187,7 @@ class ameFileLock {
182
  return false;
183
  }
184
 
185
- $delayMs = rand(80, 300);
186
  $remainingTimeMs = ($endTime - $now) * 1000;
187
  if ( $delayMs < $remainingTimeMs ) {
188
  usleep($delayMs * 1000);
@@ -377,7 +382,7 @@ class ameOrderedMap implements Iterator, Countable {
377
  */
378
  public function filter($predicate) {
379
  $result = new self();
380
- foreach($this as $key => $value) {
381
  if ( call_user_func($predicate, $value, $key) ) {
382
  $result->append($key, $value);
383
  }
@@ -410,4 +415,188 @@ class ameLinkedListNode {
410
  $this->value = $value;
411
  $this->key = $key;
412
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  }
26
  $currentValue = $array;
27
  $pathExists = true;
28
  foreach ($path as $node) {
29
+ if ( ($currentValue instanceof ArrayAccess) && $currentValue->offsetExists($node) ) {
30
+ $currentValue = $currentValue[$node];
31
+ } else if ( is_array($currentValue) && array_key_exists($node, $currentValue) ) {
32
  $currentValue = $currentValue[$node];
33
  } else if ( is_object($currentValue) && property_exists($currentValue, $node) ) {
34
  $currentValue = $currentValue->$node;
130
  $this->fileName = $fileName;
131
  }
132
 
133
+ //fopen() and flock() should be fine here because we only need read permissions.
134
+ //phpcs:disable WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_flock,WordPress.WP.AlternativeFunctions.file_system_read_fopen
135
  public function acquire($timeout = null) {
136
  if ( $this->handle !== null ) {
137
  throw new RuntimeException('Cannot acquire a lock that is already held.');
173
  $this->handle = null;
174
  }
175
  }
176
+ //phpcs:enable
177
 
178
  /**
179
  * Wait for a random interval without going over $endTime.
187
  return false;
188
  }
189
 
190
+ $delayMs = wp_rand(80, 300);
191
  $remainingTimeMs = ($endTime - $now) * 1000;
192
  if ( $delayMs < $remainingTimeMs ) {
193
  usleep($delayMs * 1000);
382
  */
383
  public function filter($predicate) {
384
  $result = new self();
385
+ foreach ($this as $key => $value) {
386
  if ( call_user_func($predicate, $value, $key) ) {
387
  $result->append($key, $value);
388
  }
415
  $this->value = $value;
416
  $this->key = $key;
417
  }
418
+ }
419
+
420
+ class ameMultiDictionary {
421
+ const PATH_SEPARATOR = '.';
422
+ const MAX_PATH_DEPTH = 64;
423
+
424
+ /**
425
+ * Get a value from an array or object using a path.
426
+ *
427
+ * Supports multidimensional/nested arrays and objects.
428
+ *
429
+ * @param array|object $collection
430
+ * @param string|string[] $path
431
+ * @param mixed $defaultValue
432
+ * @param string $separator
433
+ * @return mixed|null The value at the specified path, or the default value
434
+ * if the path does not exist.
435
+ */
436
+ public static function get($collection, $path, $defaultValue = null, $separator = self::PATH_SEPARATOR) {
437
+ $path = self::parsePath($path, $separator);
438
+ if ( empty($path) ) {
439
+ return $collection;
440
+ }
441
+
442
+ //Follow the $path into the $collection as far as possible.
443
+ $currentValue = $collection;
444
+ $pathExists = true;
445
+ foreach ($path as $key) {
446
+ if ( ($currentValue instanceof ArrayAccess) && $currentValue->offsetExists($key) ) {
447
+ //Caution: offsetExists() may return false if the key exists but is null.
448
+ $currentValue = $currentValue[$key];
449
+ } else if ( is_array($currentValue) && array_key_exists($key, $currentValue) ) {
450
+ $currentValue = $currentValue[$key];
451
+ } else if ( is_object($currentValue) && property_exists($currentValue, $key) ) {
452
+ $currentValue = $currentValue->{$key};
453
+ } else {
454
+ $pathExists = false;
455
+ break;
456
+ }
457
+ }
458
+
459
+ if ( $pathExists ) {
460
+ return $currentValue;
461
+ }
462
+ return $defaultValue;
463
+ }
464
+
465
+ public static function set(
466
+ &$collection,
467
+ $path,
468
+ $value,
469
+ $createArrays = true,
470
+ $overwriteScalars = false,
471
+ $separator = self::PATH_SEPARATOR
472
+ ) {
473
+ $path = self::parsePath($path, $separator);
474
+ if ( empty($path) ) {
475
+ //An empty path doesn't make sense, we can't replace the collection itself.
476
+ throw new InvalidArgumentException('Cannot set a value because the path is empty.');
477
+ }
478
+
479
+ if ( !self::isCollection($collection) ) {
480
+ //The collection is not an array or an object, so we can't set a value in it.
481
+ throw new InvalidArgumentException('Collection must be an array or an object.');
482
+ }
483
+
484
+ $lastKey = array_pop($path);
485
+ if ( empty($path) ) {
486
+ $target = &$collection;
487
+ } else {
488
+ $target = &self::acquireNestedCollection(
489
+ $collection,
490
+ $path,
491
+ $createArrays,
492
+ $overwriteScalars
493
+ );
494
+ if ( $target === null ) {
495
+ return false;
496
+ }
497
+ }
498
+
499
+ if ( is_array($target) || ($target instanceof ArrayAccess) ) {
500
+ $target[$lastKey] = $value;
501
+ } else if ( is_object($target) ) {
502
+ $target->{$lastKey} = $value;
503
+ }
504
+ return true;
505
+ }
506
+
507
+ public static function delete(&$collection, $path, $separator = self::PATH_SEPARATOR) {
508
+ $path = self::parsePath($path, $separator);
509
+ if ( empty($path) ) {
510
+ throw new InvalidArgumentException('Cannot delete an item because the path is empty.');
511
+ }
512
+ if ( !self::isCollection($collection) ) {
513
+ throw new InvalidArgumentException('Collection must be an array or an object.');
514
+ }
515
+
516
+ $lastKey = array_pop($path);
517
+ $target = &self::acquireNestedCollection($collection, $path, false);
518
+ if ( $target !== null ) {
519
+ if ( is_array($target) || ($target instanceof ArrayAccess) ) {
520
+ unset($target[$lastKey]);
521
+ } else if ( is_object($target) ) {
522
+ unset($target->{$lastKey});
523
+ }
524
+ }
525
+ }
526
+
527
+ public static function parsePath($path, $separator = self::PATH_SEPARATOR) {
528
+ if ( is_array($path) ) {
529
+ return $path;
530
+ } else if ( ($path === '') || ($path === $separator) ) {
531
+ return array();
532
+ }
533
+ return explode($separator, $path, self::MAX_PATH_DEPTH);
534
+ }
535
+
536
+ /**
537
+ * @param array $prefix
538
+ * @param string|array $path
539
+ * @return array
540
+ */
541
+ public static function addPrefixToPath($prefix, $path, $separator = self::PATH_SEPARATOR) {
542
+ return array_merge($prefix, self::parsePath($path, $separator));
543
+ }
544
+
545
+ protected static function isCollection($collection) {
546
+ return is_array($collection) || is_object($collection);
547
+ }
548
+
549
+ protected static function &acquireNestedCollection(
550
+ &$collection,
551
+ $parsedPath,
552
+ $createArrays = true,
553
+ $overwriteScalars = false
554
+ ) {
555
+ $current = &$collection;
556
+ $notFound = null;
557
+ $previousNode = null;
558
+ $previousKey = null;
559
+ foreach ($parsedPath as $key) {
560
+ //The array and object branches are functionally identical,
561
+ //but they must be separated due to syntax differences.
562
+ if ( is_array($current) || ($current instanceof ArrayAccess) ) {
563
+ if ( !isset($current[$key]) ) {
564
+ if ( $createArrays ) {
565
+ $current[$key] = array();
566
+ } else {
567
+ return $notFound;
568
+ }
569
+ }
570
+ $current = &$current[$key];
571
+ } else if ( is_object($current) ) {
572
+ if ( !isset($current->{$key}) ) {
573
+ if ( $createArrays ) {
574
+ $current->{$key} = array();
575
+ } else {
576
+ return $notFound;
577
+ }
578
+ }
579
+ $current = &$current->{$key};
580
+ }
581
+
582
+ //Overwrite scalar values with associative arrays if necessary.
583
+ if ( !is_array($current) && !is_object($current) ) {
584
+ if ( $overwriteScalars && ($previousNode !== null) ) {
585
+ if ( is_array($previousNode) || ($previousNode instanceof ArrayAccess) ) {
586
+ $previousNode[$previousKey] = array();
587
+ } else if ( is_object($previousNode) ) {
588
+ $previousNode->{$previousKey} = array();
589
+ }
590
+ $current = &$previousNode[$previousKey];
591
+ } else {
592
+ return $notFound;
593
+ }
594
+ }
595
+
596
+ $previousNode = &$current;
597
+ $previousKey = $key;
598
+ }
599
+
600
+ return $current;
601
+ }
602
  }
includes/auto-versioning.php CHANGED
@@ -112,7 +112,7 @@ class AutoVersioning {
112
  }
113
  }
114
 
115
- } //class_exists()
116
 
117
  if ( !function_exists('wp_register_auto_versioned_script') ) {
118
  function wp_register_auto_versioned_script($handle, $src, $deps = array(), $in_footer = false, $add_ver_to_filename = false) {
112
  }
113
  }
114
 
115
+ } // End of class exists check
116
 
117
  if ( !function_exists('wp_register_auto_versioned_script') ) {
118
  function wp_register_auto_versioned_script($handle, $src, $deps = array(), $in_footer = false, $add_ver_to_filename = false) {
includes/cap-suggestion-box.php CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  <div id="ws_capability_suggestions" style="display: none;">
2
  <p id="ws_previewed_caps">&nbsp;</p>
3
  <table class="widefat striped">
1
+ <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit('Direct access denied.');
4
+ }
5
+ ?>
6
  <div id="ws_capability_suggestions" style="display: none;">
7
  <p id="ws_previewed_caps">&nbsp;</p>
8
  <table class="widefat striped">
includes/consistency-check.php CHANGED
@@ -97,13 +97,13 @@ foreach($requiredFiles as $filename) {
97
 
98
  echo '<pre>';
99
  $divider = str_repeat('-', 50);
100
- echo "File consistency checks:\n", $divider, "\n";
101
  foreach($log as $message) {
102
- echo $message, "\n";
103
  }
104
 
105
  //Test for buggy plugins_url filters.
106
- echo $divider, "\nTesting for problems with the 'plugins_url' hook...\n";
107
  add_filter('plugins_url', 'ame_plugins_url_test_first', -9999, 3);
108
  add_filter('plugins_url', 'ame_plugins_url_test_last', 9999, 3);
109
 
@@ -117,7 +117,7 @@ function ame_plugins_url_test_first($url, $path = '', $plugin = '') {
117
  '[Info] plugins_url() output before plugin hooks: %s' . "\n",
118
  esc_html($url)
119
  );
120
- echo ame_test_url_access($url, 'css/menu-editor.css'), "\n";
121
  return $url;
122
  }
123
 
@@ -126,7 +126,7 @@ function ame_plugins_url_test_last($url, $path = '', $plugin = '') {
126
  '[Info] plugins_url() output after plugin hooks: %s' . "\n",
127
  esc_html($url)
128
  );
129
- echo ame_test_url_access($url, 'css/menu-editor.css'), "\n";
130
  return $url;
131
  }
132
 
@@ -136,24 +136,24 @@ function ame_test_url_access($url, $filename) {
136
  if ( is_wp_error($result) ) {
137
  return sprintf(
138
  '[Error] Can not load URL: %s (%s)',
139
- esc_html($url),
140
  $result->get_error_message()
141
  );
142
  } else if ( $result['response']['code'] == 200 ) {
143
  return sprintf(
144
  '[OK] URL is accessible: %s',
145
- esc_html($url)
146
  );
147
  } else {
148
  return sprintf(
149
- '[Error] Can no load "%s", URL : %s (%d %s)',
150
- esc_html($filename),
151
- esc_html($url),
152
  $result['response']['code'],
153
  $result['response']['message']
154
  );
155
  }
156
  }
157
 
158
- echo $divider;
159
  echo '</pre>';
97
 
98
  echo '<pre>';
99
  $divider = str_repeat('-', 50);
100
+ echo "File consistency checks:\n", esc_html($divider), "\n";
101
  foreach($log as $message) {
102
+ echo esc_html($message), "\n";
103
  }
104
 
105
  //Test for buggy plugins_url filters.
106
+ echo esc_html($divider), "\nTesting for problems with the 'plugins_url' hook...\n";
107
  add_filter('plugins_url', 'ame_plugins_url_test_first', -9999, 3);
108
  add_filter('plugins_url', 'ame_plugins_url_test_last', 9999, 3);
109
 
117
  '[Info] plugins_url() output before plugin hooks: %s' . "\n",
118
  esc_html($url)
119
  );
120
+ echo esc_html(ame_test_url_access($url, 'css/menu-editor.css')), "\n";
121
  return $url;
122
  }
123
 
126
  '[Info] plugins_url() output after plugin hooks: %s' . "\n",
127
  esc_html($url)
128
  );
129
+ echo esc_html(ame_test_url_access($url, 'css/menu-editor.css')), "\n";
130
  return $url;
131
  }
132
 
136
  if ( is_wp_error($result) ) {
137
  return sprintf(
138
  '[Error] Can not load URL: %s (%s)',
139
+ $url,
140
  $result->get_error_message()
141
  );
142
  } else if ( $result['response']['code'] == 200 ) {
143
  return sprintf(
144
  '[OK] URL is accessible: %s',
145
+ $url
146
  );
147
  } else {
148
  return sprintf(
149
+ '[Error] Can not load "%s", URL : %s (%d %s)',
150
+ $filename,
151
+ $url,
152
  $result['response']['code'],
153
  $result['response']['message']
154
  );
155
  }
156
  }
157
 
158
+ echo esc_html($divider);
159
  echo '</pre>';
includes/editor-page.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * @var array $editor_data Various pieces of data passed by the plugin.
4
  */
5
- $current_user = wp_get_current_user();
6
  $images_url = $editor_data['images_url'];
7
  $is_pro_version = apply_filters('admin_menu_editor_is_pro', false);
8
  $is_second_toolbar_visible = isset($_COOKIE['ame-show-second-toolbar']) && (intval($_COOKIE['ame-show-second-toolbar']) === 1);
@@ -146,6 +146,7 @@ function ame_output_toolbar_row($buttons, $icons, $classes = array()) {
146
  $pairs[] = $name . '="' . esc_attr($value) . '"';
147
  }
148
 
 
149
  printf('<a %s>%s</a>' . "\n", implode(' ', $pairs), $icon);
150
  }
151
 
@@ -174,10 +175,9 @@ if ( !apply_filters('admin_menu_editor_is_pro', false) ){
174
  <?php do_action('admin_menu_editor-display_header'); ?>
175
 
176
  <?php
177
- if ( !empty($_GET['message']) ){
178
- if ( intval($_GET['message']) == 2 ) {
179
- echo '<div id="message" class="error"><p><strong>Failed to decode input! The menu wasn\'t modified.</strong></p></div>';
180
- }
181
  }
182
 
183
  include dirname(__FILE__) . '/../modules/access-editor/access-editor-template.php';
@@ -266,7 +266,7 @@ function ame_register_sort_buttons($toolbar) {
266
  <div class="ws_basic_container">
267
 
268
  <div class="ws_main_container" id="ws_editor_sidebar">
269
- <form method="post" action="<?php echo esc_attr(add_query_arg('noheader', '1', $editor_data['current_tab_url'])); ?>" id='ws_main_form' name='ws_main_form'>
270
  <?php wp_nonce_field('menu-editor-form'); ?>
271
  <input type="hidden" name="action" value="save_menu">
272
  <?php
@@ -302,7 +302,7 @@ function ame_register_sort_buttons($toolbar) {
302
  ?>
303
  <input type="button"
304
  id='ws_toggle_editor_layout'
305
- value="<?php echo $compact_layout_title; ?>"
306
  class="button ws_main_button" />
307
 
308
  <?php
@@ -321,7 +321,7 @@ function ame_register_sort_buttons($toolbar) {
321
  $box_class = $is_general_box_open ? '' : 'closed';
322
 
323
  ?>
324
- <div class="postbox ws_ame_custom_postbox <?php echo $box_class; ?>" id="ws_ame_general_vis_box">
325
  <button type="button" class="handlediv button-link">
326
  <span class="toggle-indicator"></span>
327
  </button>
@@ -346,11 +346,11 @@ function ame_register_sort_buttons($toolbar) {
346
  }
347
 
348
  /** @noinspection HtmlUnknownTarget */
349
- $how_to_link_template = '<a href="' . htmlspecialchars($tutorial_base_url) . '%1$s" target="_blank" title="Opens in a new tab">%2$s</a>';
350
  $how_to_item_template = '<li>' . $how_to_link_template . '</li>';
351
 
352
  ?>
353
- <div class="postbox ws_ame_custom_postbox <?php echo $box_class; ?>" id="ws_ame_how_to_box">
354
  <button type="button" class="handlediv button-link">
355
  <span class="toggle-indicator"></span>
356
  </button>
@@ -362,7 +362,12 @@ function ame_register_sort_buttons($toolbar) {
362
  //Pro version tutorials.
363
  ?>
364
  <li><?php
365
- printf($how_to_link_template, 'how-to-hide-a-menu-item/', 'Hide a Menu...');
 
 
 
 
 
366
  ?>
367
  <ul class="ame-tutorial-list">
368
  <?php
@@ -375,7 +380,12 @@ function ame_register_sort_buttons($toolbar) {
375
  )
376
  as $how_to_url => $how_to_title
377
  ) {
378
- printf($how_to_item_template, esc_attr($how_to_url), $how_to_title);
 
 
 
 
 
379
  }
380
  ?>
381
  </ul>
@@ -389,7 +399,12 @@ function ame_register_sort_buttons($toolbar) {
389
  )
390
  as $how_to_url => $how_to_title
391
  ) {
392
- printf($how_to_item_template, esc_attr($how_to_url), $how_to_title);
 
 
 
 
 
393
  }
394
 
395
  else:
@@ -402,7 +417,12 @@ function ame_register_sort_buttons($toolbar) {
402
  )
403
  as $how_to_url => $how_to_title
404
  ) {
405
- printf($how_to_item_template, esc_attr($how_to_url), $how_to_title);
 
 
 
 
 
406
  }
407
  endif;
408
  ?>
@@ -439,11 +459,11 @@ function ame_register_sort_buttons($toolbar) {
439
  <li>Hide items from specific users.</li>
440
  <li>Menu import and export.</li>
441
  <li>Change menu colors.</li>
442
- <li><?php echo $selected_variation; ?></li>
443
  </ul>
444
- <a href="<?php echo esc_attr($pro_version_link); ?>" target="_blank">Learn more</a>
445
  |
446
- <a href="http://amedemo.com/" target="_blank">Try online demo</a>
447
  </div>
448
  </div>
449
  <?php
@@ -471,7 +491,7 @@ function ame_register_sort_buttons($toolbar) {
471
  $capSelector[] = sprintf(
472
  '<option value="%s">%s</option>',
473
  esc_attr($role_id),
474
- $role_name
475
  );
476
  }
477
  $capSelector[] = '</optgroup>';
@@ -481,12 +501,13 @@ function ame_register_sort_buttons($toolbar) {
481
  $capSelector[] = sprintf(
482
  '<option value="%s">%s</option>',
483
  esc_attr($cap),
484
- $cap
485
  );
486
  }
487
  $capSelector[] = '</optgroup>';
488
  $capSelector[] = '</select>';
489
 
 
490
  echo implode("\n", $capSelector);
491
  ?>
492
 
@@ -500,15 +521,15 @@ function ame_register_sort_buttons($toolbar) {
500
  'admin_menu_editor-icon_selector_tabs',
501
  array('ws_core_icons_tab' => 'Dashicons')
502
  );
503
- foreach($iconSelectorTabs as $id => $caption) {
504
- printf('<li><a href="#%s">%s</a></li>', esc_attr($id), $caption);
505
  }
506
  ?>
507
  </ul>
508
 
509
  <?php
510
  //Let the user select a custom icon via the media uploader.
511
- //We only support the new WP 3.5+ media API. Hence the function_exists() check.
512
  if ( function_exists('wp_enqueue_media') ):
513
  ?>
514
  <input type="button" class="button"
@@ -540,7 +561,7 @@ function ame_register_sort_buttons($toolbar) {
540
  <div class="ws_icon_image icon16 icon-%2$s"><br></div>
541
  </div>',
542
  esc_attr(ucwords($icon)),
543
- $icon
544
  );
545
  }
546
  }
@@ -623,7 +644,7 @@ function ame_register_sort_buttons($toolbar) {
623
 
624
  ?>
625
  <div class="ws_icon_option ws_custom_image_icon" title="Custom image" style="display: none;">
626
- <img src="<?php echo esc_attr(admin_url('images/loading.gif')); ?>">
627
  </div>
628
 
629
  <div class="clear"></div>
@@ -691,7 +712,7 @@ function ame_register_sort_buttons($toolbar) {
691
  <?php
692
  submit_button('Hide it from all users', 'secondary', 'ws_hide_menu_from_everyone', false);
693
  submit_button(
694
- sprintf('Hide it from everyone except "%s"', $current_user->get('user_login')),
695
  'secondary',
696
  'ws_hide_menu_except_current_user',
697
  false
@@ -720,6 +741,12 @@ if ( $is_pro_version ) {
720
 
721
  <!--suppress JSUnusedLocalSymbols These variables are actually used by menu-editor.js -->
722
  <script type='text/javascript'>
723
- var defaultMenu = <?php echo $editor_data['default_menu_js']; ?>;
724
- var customMenu = <?php echo $editor_data['custom_menu_js']; ?>;
 
 
 
 
 
 
725
  </script>
2
  /**
3
  * @var array $editor_data Various pieces of data passed by the plugin.
4
  */
5
+ $ame_current_user = wp_get_current_user();
6
  $images_url = $editor_data['images_url'];
7
  $is_pro_version = apply_filters('admin_menu_editor_is_pro', false);
8
  $is_second_toolbar_visible = isset($_COOKIE['ame-show-second-toolbar']) && (intval($_COOKIE['ame-show-second-toolbar']) === 1);
146
  $pairs[] = $name . '="' . esc_attr($value) . '"';
147
  }
148
 
149
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Attribute $pairs and $icon attributes were escaped with esc_attr() above.
150
  printf('<a %s>%s</a>' . "\n", implode(' ', $pairs), $icon);
151
  }
152
 
175
  <?php do_action('admin_menu_editor-display_header'); ?>
176
 
177
  <?php
178
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Don't need that here, just showing a notice.
179
+ if ( !empty($_GET['message']) && (intval($_GET['message']) == 2) ){
180
+ echo '<div id="message" class="error"><p><strong>Failed to decode input! The menu wasn\'t modified.</strong></p></div>';
 
181
  }
182
 
183
  include dirname(__FILE__) . '/../modules/access-editor/access-editor-template.php';
266
  <div class="ws_basic_container">
267
 
268
  <div class="ws_main_container" id="ws_editor_sidebar">
269
+ <form method="post" action="<?php echo esc_url(add_query_arg('noheader', '1', $editor_data['current_tab_url'])); ?>" id='ws_main_form' name='ws_main_form'>
270
  <?php wp_nonce_field('menu-editor-form'); ?>
271
  <input type="hidden" name="action" value="save_menu">
272
  <?php
302
  ?>
303
  <input type="button"
304
  id='ws_toggle_editor_layout'
305
+ value="<?php echo esc_attr($compact_layout_title); ?>"
306
  class="button ws_main_button" />
307
 
308
  <?php
321
  $box_class = $is_general_box_open ? '' : 'closed';
322
 
323
  ?>
324
+ <div class="postbox ws_ame_custom_postbox <?php echo esc_attr($box_class); ?>" id="ws_ame_general_vis_box">
325
  <button type="button" class="handlediv button-link">
326
  <span class="toggle-indicator"></span>
327
  </button>
346
  }
347
 
348
  /** @noinspection HtmlUnknownTarget */
349
+ $how_to_link_template = '<a href="' . esc_url($tutorial_base_url) . '%1$s" target="_blank" title="Opens in a new tab">%2$s</a>';
350
  $how_to_item_template = '<li>' . $how_to_link_template . '</li>';
351
 
352
  ?>
353
+ <div class="postbox ws_ame_custom_postbox <?php echo esc_attr($box_class); ?>" id="ws_ame_how_to_box">
354
  <button type="button" class="handlediv button-link">
355
  <span class="toggle-indicator"></span>
356
  </button>
362
  //Pro version tutorials.
363
  ?>
364
  <li><?php
365
+ printf(
366
+ //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML template contains HTML.
367
+ $how_to_link_template,
368
+ 'how-to-hide-a-menu-item/',
369
+ 'Hide a Menu...'
370
+ );
371
  ?>
372
  <ul class="ame-tutorial-list">
373
  <?php
380
  )
381
  as $how_to_url => $how_to_title
382
  ) {
383
+ printf(
384
+ //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML template.
385
+ $how_to_item_template,
386
+ esc_attr($how_to_url),
387
+ esc_html($how_to_title)
388
+ );
389
  }
390
  ?>
391
  </ul>
399
  )
400
  as $how_to_url => $how_to_title
401
  ) {
402
+ printf(
403
+ //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML template
404
+ $how_to_item_template,
405
+ esc_attr($how_to_url),
406
+ esc_html($how_to_title)
407
+ );
408
  }
409
 
410
  else:
417
  )
418
  as $how_to_url => $how_to_title
419
  ) {
420
+ printf(
421
+ //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML template
422
+ $how_to_item_template,
423
+ esc_attr($how_to_url),
424
+ esc_html($how_to_title)
425
+ );
426
  }
427
  endif;
428
  ?>
459
  <li>Hide items from specific users.</li>
460
  <li>Menu import and export.</li>
461
  <li>Change menu colors.</li>
462
+ <li><?php echo esc_html($selected_variation); ?></li>
463
  </ul>
464
+ <a href="<?php echo esc_url($pro_version_link); ?>" target="_blank">Learn more</a>
465
  |
466
+ <a href="https://amedemo.com/" target="_blank">Try online demo</a>
467
  </div>
468
  </div>
469
  <?php
491
  $capSelector[] = sprintf(
492
  '<option value="%s">%s</option>',
493
  esc_attr($role_id),
494
+ esc_html($role_name)
495
  );
496
  }
497
  $capSelector[] = '</optgroup>';
501
  $capSelector[] = sprintf(
502
  '<option value="%s">%s</option>',
503
  esc_attr($cap),
504
+ esc_html($cap)
505
  );
506
  }
507
  $capSelector[] = '</optgroup>';
508
  $capSelector[] = '</select>';
509
 
510
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Generated HTML, should be escaped above.
511
  echo implode("\n", $capSelector);
512
  ?>
513
 
521
  'admin_menu_editor-icon_selector_tabs',
522
  array('ws_core_icons_tab' => 'Dashicons')
523
  );
524
+ foreach($iconSelectorTabs as $tabId => $caption) {
525
+ printf('<li><a href="#%s">%s</a></li>', esc_attr($tabId), esc_html($caption));
526
  }
527
  ?>
528
  </ul>
529
 
530
  <?php
531
  //Let the user select a custom icon via the media uploader.
532
+ //We only support the new WP 3.5+ media API. Hence, the function_exists() check.
533
  if ( function_exists('wp_enqueue_media') ):
534
  ?>
535
  <input type="button" class="button"
561
  <div class="ws_icon_image icon16 icon-%2$s"><br></div>
562
  </div>',
563
  esc_attr(ucwords($icon)),
564
+ esc_attr($icon)
565
  );
566
  }
567
  }
644
 
645
  ?>
646
  <div class="ws_icon_option ws_custom_image_icon" title="Custom image" style="display: none;">
647
+ <img src="<?php echo esc_url(admin_url('images/loading.gif')); ?>" alt="Loading indicator">
648
  </div>
649
 
650
  <div class="clear"></div>
712
  <?php
713
  submit_button('Hide it from all users', 'secondary', 'ws_hide_menu_from_everyone', false);
714
  submit_button(
715
+ sprintf('Hide it from everyone except "%s"', $ame_current_user->get('user_login')),
716
  'secondary',
717
  'ws_hide_menu_except_current_user',
718
  false
741
 
742
  <!--suppress JSUnusedLocalSymbols These variables are actually used by menu-editor.js -->
743
  <script type='text/javascript'>
744
+ var defaultMenu = <?php
745
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Should be JSON.
746
+ echo $editor_data['default_menu_js'];
747
+ ?>;
748
+ var customMenu = <?php
749
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Should also be JSON.
750
+ echo $editor_data['custom_menu_js'];
751
+ ?>;
752
  </script>
includes/generate-menu-dashicons.php CHANGED
@@ -21,6 +21,7 @@ $allDashiconDefinitions = '';
21
  $ignoreIcons = array('dashboard', 'editor-bold', 'editor-italic');
22
  $ignoreIcons = array_flip($ignoreIcons);
23
 
 
24
  $parser = new Sabberworm\CSS\Parser(file_get_contents($dashiconsStylesheet));
25
  $cssDocument = $parser->parse();
26
 
@@ -74,8 +75,9 @@ foreach($blocks as $block) {
74
 
75
  $dashiconComment = sprintf(
76
  "/*\nThis file was automatically generated from /wp-includes/css/dashicons.css.\nLast update: %s\n*/",
77
- date('c')
78
  );
 
79
  file_put_contents(
80
  dirname(__FILE__) . '/../css/_dashicons.scss',
81
  $dashiconComment . "\n" . $allDashiconDefinitions
@@ -101,7 +103,7 @@ foreach($icons as $name => $character) {
101
  //Output each icon for visual verification.
102
  printf(
103
  '<div class="ame-debug-dashicon"><div class="dashicons dashicons-%1$s"></div> %1$s</div>',
104
- $name
105
  );
106
 
107
  //Wrap the array definition at about 80 characters for legibility.
21
  $ignoreIcons = array('dashboard', 'editor-bold', 'editor-italic');
22
  $ignoreIcons = array_flip($ignoreIcons);
23
 
24
+ // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown -- Not fetching remote data.
25
  $parser = new Sabberworm\CSS\Parser(file_get_contents($dashiconsStylesheet));
26
  $cssDocument = $parser->parse();
27
 
75
 
76
  $dashiconComment = sprintf(
77
  "/*\nThis file was automatically generated from /wp-includes/css/dashicons.css.\nLast update: %s\n*/",
78
+ gmdate('c')
79
  );
80
+ // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_file_put_contents -- Dev stuff; WP_DEBUG must be enabled to get here.
81
  file_put_contents(
82
  dirname(__FILE__) . '/../css/_dashicons.scss',
83
  $dashiconComment . "\n" . $allDashiconDefinitions
103
  //Output each icon for visual verification.
104
  printf(
105
  '<div class="ame-debug-dashicon"><div class="dashicons dashicons-%1$s"></div> %1$s</div>',
106
+ esc_html($name)
107
  );
108
 
109
  //Wrap the array definition at about 80 characters for legibility.
includes/menu-editor-core.php CHANGED
@@ -688,6 +688,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
688
  $message .= $this->get_formatted_security_log();
689
  }
690
  do_action('admin_page_access_denied');
 
691
  wp_die($message);
692
  } else {
693
  $this->log_security_note('ALLOW access.');
@@ -740,8 +741,10 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
740
  $this->old_wp_menu = $menu;
741
  $this->old_wp_submenu = $submenu;
742
 
 
743
  $menu = $this->custom_wp_menu;
744
  $submenu = $this->custom_wp_submenu;
 
745
 
746
  $this->user_cap_cache_enabled = true;
747
  $this->filter_global_menu();
@@ -757,9 +760,11 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
757
  * @return void
758
  */
759
  public function restore_wp_menu() {
 
760
  global $menu, $submenu;
761
  $menu = $this->old_wp_menu;
762
  $submenu = $this->old_wp_submenu;
 
763
  }
764
 
765
  /**
@@ -780,6 +785,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
780
  * @return void
781
  */
782
  private function filter_global_menu() {
 
783
  global $menu, $submenu;
784
  global $_wp_menu_nopriv; //Caution: Modifying this array could lead to unexpected consequences.
785
 
@@ -873,6 +879,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
873
 
874
  //Add display-specific classes like "menu-top-first" and others.
875
  $menu = add_menu_classes($menu);
 
876
  }
877
 
878
  public function register_base_dependencies() {
@@ -1247,10 +1254,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
1247
  * less likely.
1248
  */
1249
  public function move_editor_scripts_to_top() {
1250
- global $wp_scripts;
1251
- if ( !(isset($wp_scripts) && ($wp_scripts instanceof WP_Scripts)) ) {
1252
- $wp_scripts = new WP_Scripts();
1253
- }
1254
 
1255
  //Sanity check. If the wp_scripts implementation has changed significantly, don't touch it.
1256
  if ( !isset($wp_scripts->queue) || (!is_array($wp_scripts->queue) || ($wp_scripts->queue instanceof Traversable)) ) {
@@ -1642,7 +1646,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
1642
  && ($item['menu_title'] !== $default_menu_title)
1643
  && (($default_menu_title === $default_title) || ($default_title === ''))
1644
  ) {
1645
- $custom_title = strip_tags($item['menu_title']);
1646
  }
1647
 
1648
  if ( isset($custom_title) ) {
@@ -1776,7 +1780,6 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
1776
 
1777
  //If we don't unset these they will fuck up the next two loops where the same names are used.
1778
  unset($topmenu);
1779
- unset($item);
1780
 
1781
  //Now we have some items marked as missing, and some items in lookup arrays
1782
  //that are not marked as used. Lets remove the missing items from the tree.
@@ -2180,7 +2183,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2180
  $this->custom_menu_is_deep = true;
2181
 
2182
  if ( $uniquePrefix === null ) {
2183
- $uniquePrefix = (string) rand(1000, 9999);
2184
  }
2185
 
2186
  $submenuCounter++;
@@ -2568,7 +2571,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2568
  if ( !$this->current_user_can_edit_menu() ){
2569
  wp_die(sprintf(
2570
  'You do not have sufficient permissions to use Admin Menu Editor. Required: <code>%s</code>.',
2571
- htmlentities($this->options['plugin_access'])
2572
  ));
2573
  }
2574
 
@@ -2625,6 +2628,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2625
  }
2626
 
2627
  echo '<div class="wrap"><h1>Repairing database...</h1><p></p>';
 
2628
 
2629
  $options_to_repair = array(
2630
  $this->option_name,
@@ -2633,10 +2637,10 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2633
  'ws_abe_admin_bar_settings',
2634
  );
2635
 
2636
- echo "Repair {$wpdb->sitemeta}<br>";
2637
  $wpdb->query('REPAIR TABLE ' . $wpdb->sitemeta);
2638
 
2639
- echo "Lock {$wpdb->sitemeta}<br>";
2640
  $wpdb->query('LOCK TABLES ' . $wpdb->sitemeta);
2641
 
2642
  foreach($options_to_repair as $option) {
@@ -2644,7 +2648,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2644
  continue; //Sanity check.
2645
  }
2646
 
2647
- echo "Fetch option {$option}<br>";
2648
  /** @noinspection SqlResolve */
2649
  $row = $wpdb->get_row($wpdb->prepare(
2650
  "SELECT * FROM {$wpdb->sitemeta} WHERE meta_key = %s LIMIT 1",
@@ -2656,10 +2660,10 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2656
  continue;
2657
  }
2658
 
2659
- echo "Delete all rows where meta_key = {$option}<br>";
2660
  $wpdb->delete($wpdb->sitemeta, array('meta_key' => $option), '%s');
2661
 
2662
- echo "Recreate the first copy of {$option}<br>";
2663
  $wpdb->insert(
2664
  $wpdb->sitemeta,
2665
  array(
@@ -2671,8 +2675,9 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2671
  );
2672
  }
2673
 
2674
- echo "Unlock {$wpdb->sitemeta}<br>";
2675
  $wpdb->query('UNLOCK TABLES');
 
2676
 
2677
  echo "Done.<br>";
2678
  echo '<div>';
@@ -2689,24 +2694,26 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2689
  try {
2690
  $menu = ameMenu::load_json($post['data'], true);
2691
  } catch (InvalidMenuException $ex) {
2692
- $debugData = '';
2693
- $debugData .= "Exception:\n" . $ex->getMessage() . "\n\n";
2694
  $debugData .= "Used POST data:\n" . print_r($this->post, true) . "\n\n";
2695
  $debugData .= "Original POST:\n" . print_r($this->originalPost, true) . "\n\n";
2696
  $debugData .= "\$_POST global:\n" . print_r($_POST, true);
2697
 
2698
- $debugData = sprintf(
2699
  "<textarea rows=\"30\" cols=\"100\">%s</textarea>",
2700
- htmlentities($debugData)
2701
  );
2702
 
2703
  wp_die(
2704
  "Error: Failed to decode menu data!<br><br>\n"
2705
  . "Please send this debugging information to the developer: <br>"
2706
- . $debugData
 
2707
  );
2708
 
2709
  return;
 
2710
  }
2711
 
2712
  //Sanitize menu item properties.
@@ -2724,7 +2731,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2724
  //Add a modification timestamp to help ensure that the new menu data will be different.
2725
  //This way update_option() and similar functions should only return false when there is
2726
  //an actual error, not just because the data hasn't changed.
2727
- $menu['last_modified_on'] = date('c');
2728
 
2729
  //Which menu configuration are we changing?
2730
  $config_id = isset($post['config_id']) ? $post['config_id'] : null;
@@ -2764,6 +2771,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2764
  );
2765
  }
2766
  }
 
2767
  wp_die(implode("<br>\n", $messages));
2768
  }
2769
 
@@ -2796,7 +2804,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2796
  intval($this->post['data_length'])
2797
  );
2798
  }
2799
- wp_die($message);
2800
  }
2801
 
2802
  } else if ( $action == 'save_settings' ) {
@@ -2917,6 +2925,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
2917
 
2918
  $this->save_options();
2919
  wp_redirect(add_query_arg('message', 1, $this->get_settings_page_url()));
 
2920
  }
2921
  }
2922
 
@@ -3063,15 +3072,17 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3063
  $wrap_classes[] = 'ame-is-wp53-plus';
3064
  }
3065
 
3066
- echo '<div class="', implode(' ', $wrap_classes), '">';
3067
  printf(
3068
  '<%1$s id="ws_ame_editor_heading">%2$s</%1$s>',
 
3069
  self::$admin_heading_tag,
3070
- apply_filters('admin_menu_editor-self_page_title', 'Menu Editor')
3071
  );
3072
 
3073
  do_action('admin_menu_editor-display_tabs');
3074
 
 
3075
  if ( isset($_GET['message']) && (intval($_GET['message']) === 1) ) {
3076
  add_settings_error('ame-settings-page', 'settings_updated', __('Settings saved.'), 'updated');
3077
  }
@@ -3093,7 +3104,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3093
  esc_attr(add_query_arg('sub_section', $slug, self_admin_url($this->settings_link))),
3094
  esc_attr('ws_ame_' . $slug . '_tab'),
3095
  $slug === $this->current_tab ? ' nav-tab-active' : '',
3096
- $title
3097
  );
3098
  }
3099
  echo '</h2>';
@@ -3336,6 +3347,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3336
  */
3337
  function ajax_save_screen_options(){
3338
  if (!$this->current_user_can_edit_menu() || !check_ajax_referer('ws_ame_save_screen_options', false, false)){
 
3339
  die( $this->json_encode( array(
3340
  'error' => "You're not allowed to do that!"
3341
  )));
@@ -3396,9 +3408,9 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3396
  */
3397
  public function ajax_get_pages() {
3398
  if ( !check_ajax_referer('ws_ame_get_pages', false, false) ) {
3399
- exit(json_encode(array('error' => 'Invalid nonce.')));
3400
  } else if ( !$this->current_user_can_edit_menu() ) {
3401
- exit(json_encode(array('error' => 'You don\'t have sufficient permissions to edit the admin menu.')));
3402
  }
3403
 
3404
  $pages = get_pages(array(
@@ -3421,7 +3433,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3421
  );
3422
  }
3423
 
3424
- exit(json_encode($results));
3425
  }
3426
 
3427
  /**
@@ -3429,13 +3441,13 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3429
  */
3430
  public function ajax_get_page_details() {
3431
  if ( !check_ajax_referer('ws_ame_get_page_details', false, false) ) {
3432
- exit(json_encode(array('error' => 'Invalid nonce.')));
3433
  } else if ( !$this->current_user_can_edit_menu() ) {
3434
- exit(json_encode(array('error' => 'You don\'t have sufficient permissions to edit the admin menu.')));
3435
  }
3436
 
3437
- $post_id = intval($_GET['post_id']);
3438
- $blog_id = intval($_GET['blog_id']);
3439
  $should_switch = function_exists('get_current_blog_id') && ($blog_id !== get_current_blog_id());
3440
 
3441
  if ( $should_switch ) {
@@ -3444,7 +3456,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3444
 
3445
  $page = get_post($post_id);
3446
  if ( !$page ) {
3447
- exit(json_encode(array('error' => 'Not found')));
3448
  }
3449
 
3450
  if ( $should_switch ) {
@@ -3456,7 +3468,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3456
  'blog_id' => $blog_id,
3457
  'post_title' => $page->post_title,
3458
  );
3459
- exit(json_encode($response));
3460
  }
3461
 
3462
  /**
@@ -3496,8 +3508,8 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3496
 
3497
  $this->log_security_note(sprintf(
3498
  'The current menu item is "%s", menu template ID: "%s"',
3499
- htmlentities($current_item['menu_title']),
3500
- htmlentities(ameMenuItem::get($current_item, 'template_id', 'N/A'))
3501
  ));
3502
  if ( isset($current_item['access_check_log']) ) {
3503
  $this->log_security_note($current_item['access_check_log']);
@@ -3508,7 +3520,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3508
  $this->log_security_note(sprintf(
3509
  'The current user %1$s the "%2$s" capability.',
3510
  $allow ? 'has' : 'does not have',
3511
- htmlentities($current_item['access_level'])
3512
  ));
3513
 
3514
  return $allow;
@@ -3599,7 +3611,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3599
  $admin_url_is_filtered = has_filter('admin_url');
3600
 
3601
  $current_url = $base_site_url . remove_query_arg('___ame_dummy_param___');
3602
- $this->log_security_note(sprintf('Current URL: "%s"', htmlentities($current_url)));
3603
 
3604
  $current_url = $this->parse_url($current_url);
3605
 
@@ -3729,7 +3741,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3729
  'fragment' => '',
3730
  );
3731
 
3732
- $parsed = @parse_url($url);
3733
  if ( !is_array($parsed) ) {
3734
  $parsed = array();
3735
  }
@@ -3847,8 +3859,17 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3847
  if ( empty($capabilities) ) {
3848
  $capabilities = array();
3849
  } else {
3850
- trigger_error("Unexpected capability array: " . print_r($capabilities, true), E_USER_WARNING);
 
 
 
 
 
 
 
 
3851
  return array();
 
3852
  }
3853
  }
3854
  foreach($capabilities as $capability => $value) {
@@ -3911,6 +3932,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3911
  * @return void
3912
  */
3913
  function capture_request_vars(){
 
3914
  $this->post = $this->originalPost = $_POST;
3915
  $this->get = $_GET;
3916
 
@@ -3922,6 +3944,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
3922
  $this->post = stripslashes_deep($this->post);
3923
  $this->get = stripslashes_deep($this->get);
3924
  }
 
3925
  }
3926
 
3927
  /**
@@ -4026,7 +4049,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4026
  /**
4027
  * Log a security-related message.
4028
  *
4029
- * @param string|array $message The message to add tot he log, or an array of messages.
4030
  */
4031
  private function log_security_note($message) {
4032
  if ( !$this->should_store_security_log() ) {
@@ -4053,7 +4076,11 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4053
  ?>
4054
  <div class="updated">
4055
  <h3>Admin Menu Editor security log</h3>
4056
- <?php echo $this->get_formatted_security_log(); ?>
 
 
 
 
4057
  </div>
4058
  <?php
4059
  }
@@ -4667,6 +4694,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4667
 
4668
  //Disable the notice when the user hides it or visits any of our admin pages.
4669
  $hideNoticeParameter = 'ame-plugin-menu-notice';
 
4670
  if ( !empty($_GET[$hideNoticeParameter]) || $this->is_editor_page() || $this->is_settings_page() ) {
4671
  $this->options['show_plugin_menu_notice'] = false;
4672
  $this->save_options();
@@ -4687,13 +4715,15 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4687
  $message = 'Tip: Go to <a href="%1$s">Settings -&gt; %2$s</a> to start customizing the admin menu.';
4688
  }
4689
  printf(
 
4690
  '<div class="updated" id="ame-plugin-menu-notice">
4691
  <p>' . $message . '</p>
4692
  <p><a href="%3$s" id="ame-hide-plugin-menu-notice">Hide this message</a></p>
4693
  </div>',
4694
- esc_attr(self_admin_url($this->settings_link)),
4695
- apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor'),
4696
- esc_attr($dismissUrl)
 
4697
  );
4698
 
4699
  }
@@ -4725,6 +4755,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4725
 
4726
  $power_filename = AME_ROOT_DIR . '/includes/capabilities/cap-power.csv';
4727
  if ( is_file($power_filename) && is_readable($power_filename) ) {
 
4728
  $csv = fopen($power_filename, 'r');
4729
  $firstLineSkipped = false;
4730
 
@@ -4962,7 +4993,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
4962
 
4963
  $label = ameMenuItem::get($item, 'menu_title', '');
4964
  if ( $label !== '' ) {
4965
- $label = trim(strip_tags(ameMenuItem::remove_update_count($label)));
4966
  } else {
4967
  $label = '[' . $key . ']';
4968
  }
@@ -5201,7 +5232,7 @@ class ameMenuTemplateBuilder {
5201
  * @return string
5202
  */
5203
  private function sanitizeMenuTitle($title) {
5204
- $title = strip_tags( preg_replace('@<span[^>]*>.*</span>@i', '', $title) );
5205
 
5206
  //Compact whitespace.
5207
  $title = rtrim(preg_replace('@[\s\t\r\n]+@', ' ', $title));
688
  $message .= $this->get_formatted_security_log();
689
  }
690
  do_action('admin_page_access_denied');
691
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML should already be escaped as necessary.
692
  wp_die($message);
693
  } else {
694
  $this->log_security_note('ALLOW access.');
741
  $this->old_wp_menu = $menu;
742
  $this->old_wp_submenu = $submenu;
743
 
744
+ // phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited -- Overriding menus is the whole point of this plugin.
745
  $menu = $this->custom_wp_menu;
746
  $submenu = $this->custom_wp_submenu;
747
+ // phpcs:enable
748
 
749
  $this->user_cap_cache_enabled = true;
750
  $this->filter_global_menu();
760
  * @return void
761
  */
762
  public function restore_wp_menu() {
763
+ // phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
764
  global $menu, $submenu;
765
  $menu = $this->old_wp_menu;
766
  $submenu = $this->old_wp_submenu;
767
+ // phpcs:enable
768
  }
769
 
770
  /**
785
  * @return void
786
  */
787
  private function filter_global_menu() {
788
+ // phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
789
  global $menu, $submenu;
790
  global $_wp_menu_nopriv; //Caution: Modifying this array could lead to unexpected consequences.
791
 
879
 
880
  //Add display-specific classes like "menu-top-first" and others.
881
  $menu = add_menu_classes($menu);
882
+ // phpcs:enable
883
  }
884
 
885
  public function register_base_dependencies() {
1254
  * less likely.
1255
  */
1256
  public function move_editor_scripts_to_top() {
1257
+ $wp_scripts = wp_scripts(); //Requires WordPress 4.2.0+
 
 
 
1258
 
1259
  //Sanity check. If the wp_scripts implementation has changed significantly, don't touch it.
1260
  if ( !isset($wp_scripts->queue) || (!is_array($wp_scripts->queue) || ($wp_scripts->queue instanceof Traversable)) ) {
1646
  && ($item['menu_title'] !== $default_menu_title)
1647
  && (($default_menu_title === $default_title) || ($default_title === ''))
1648
  ) {
1649
+ $custom_title = wp_strip_all_tags($item['menu_title']);
1650
  }
1651
 
1652
  if ( isset($custom_title) ) {
1780
 
1781
  //If we don't unset these they will fuck up the next two loops where the same names are used.
1782
  unset($topmenu);
 
1783
 
1784
  //Now we have some items marked as missing, and some items in lookup arrays
1785
  //that are not marked as used. Lets remove the missing items from the tree.
2183
  $this->custom_menu_is_deep = true;
2184
 
2185
  if ( $uniquePrefix === null ) {
2186
+ $uniquePrefix = (string) wp_rand(1000, 9999);
2187
  }
2188
 
2189
  $submenuCounter++;
2571
  if ( !$this->current_user_can_edit_menu() ){
2572
  wp_die(sprintf(
2573
  'You do not have sufficient permissions to use Admin Menu Editor. Required: <code>%s</code>.',
2574
+ esc_html($this->options['plugin_access'])
2575
  ));
2576
  }
2577
 
2628
  }
2629
 
2630
  echo '<div class="wrap"><h1>Repairing database...</h1><p></p>';
2631
+ // phpcs:disable WordPress.DB.DirectDatabaseQuery,WordPress.DB.SlowDBQuery -- Special case: Data recovery attempt.
2632
 
2633
  $options_to_repair = array(
2634
  $this->option_name,
2637
  'ws_abe_admin_bar_settings',
2638
  );
2639
 
2640
+ printf("Repair %s<br>", esc_html($wpdb->sitemeta));
2641
  $wpdb->query('REPAIR TABLE ' . $wpdb->sitemeta);
2642
 
2643
+ printf("Lock %s<br>", esc_html($wpdb->sitemeta));
2644
  $wpdb->query('LOCK TABLES ' . $wpdb->sitemeta);
2645
 
2646
  foreach($options_to_repair as $option) {
2648
  continue; //Sanity check.
2649
  }
2650
 
2651
+ printf("Fetch option %s<br>", esc_html($option));
2652
  /** @noinspection SqlResolve */
2653
  $row = $wpdb->get_row($wpdb->prepare(
2654
  "SELECT * FROM {$wpdb->sitemeta} WHERE meta_key = %s LIMIT 1",
2660
  continue;
2661
  }
2662
 
2663
+ printf("Delete all rows where meta_key = %s<br>", esc_html($option));
2664
  $wpdb->delete($wpdb->sitemeta, array('meta_key' => $option), '%s');
2665
 
2666
+ printf("Recreate the first copy of %s<br>", esc_html($option));
2667
  $wpdb->insert(
2668
  $wpdb->sitemeta,
2669
  array(
2675
  );
2676
  }
2677
 
2678
+ printf("Unlock %s<br>", esc_html($wpdb->sitemeta));
2679
  $wpdb->query('UNLOCK TABLES');
2680
+ // phpcs:enable
2681
 
2682
  echo "Done.<br>";
2683
  echo '<div>';
2694
  try {
2695
  $menu = ameMenu::load_json($post['data'], true);
2696
  } catch (InvalidMenuException $ex) {
2697
+ // phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_print_r -- Debug output for exceptional cases.
2698
+ $debugData = "Exception:\n" . $ex->getMessage() . "\n\n";
2699
  $debugData .= "Used POST data:\n" . print_r($this->post, true) . "\n\n";
2700
  $debugData .= "Original POST:\n" . print_r($this->originalPost, true) . "\n\n";
2701
  $debugData .= "\$_POST global:\n" . print_r($_POST, true);
2702
 
2703
+ $debugOutput = sprintf(
2704
  "<textarea rows=\"30\" cols=\"100\">%s</textarea>",
2705
+ esc_textarea($debugData)
2706
  );
2707
 
2708
  wp_die(
2709
  "Error: Failed to decode menu data!<br><br>\n"
2710
  . "Please send this debugging information to the developer: <br>"
2711
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above, see sprintf() call.
2712
+ . $debugOutput
2713
  );
2714
 
2715
  return;
2716
+ // phpcs:enable
2717
  }
2718
 
2719
  //Sanitize menu item properties.
2731
  //Add a modification timestamp to help ensure that the new menu data will be different.
2732
  //This way update_option() and similar functions should only return false when there is
2733
  //an actual error, not just because the data hasn't changed.
2734
+ $menu['last_modified_on'] = gmdate('c');
2735
 
2736
  //Which menu configuration are we changing?
2737
  $config_id = isset($post['config_id']) ? $post['config_id'] : null;
2771
  );
2772
  }
2773
  }
2774
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Should be escaped before.
2775
  wp_die(implode("<br>\n", $messages));
2776
  }
2777
 
2804
  intval($this->post['data_length'])
2805
  );
2806
  }
2807
+ wp_die(esc_html($message));
2808
  }
2809
 
2810
  } else if ( $action == 'save_settings' ) {
2925
 
2926
  $this->save_options();
2927
  wp_redirect(add_query_arg('message', 1, $this->get_settings_page_url()));
2928
+ exit;
2929
  }
2930
  }
2931
 
3072
  $wrap_classes[] = 'ame-is-wp53-plus';
3073
  }
3074
 
3075
+ echo '<div class="', esc_attr(implode(' ', $wrap_classes)), '">';
3076
  printf(
3077
  '<%1$s id="ws_ame_editor_heading">%2$s</%1$s>',
3078
+ //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Should only ever be "h1" or "h2".
3079
  self::$admin_heading_tag,
3080
+ esc_html(apply_filters('admin_menu_editor-self_page_title', 'Menu Editor'))
3081
  );
3082
 
3083
  do_action('admin_menu_editor-display_tabs');
3084
 
3085
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Just showing a "settings saved" notice.
3086
  if ( isset($_GET['message']) && (intval($_GET['message']) === 1) ) {
3087
  add_settings_error('ame-settings-page', 'settings_updated', __('Settings saved.'), 'updated');
3088
  }
3104
  esc_attr(add_query_arg('sub_section', $slug, self_admin_url($this->settings_link))),
3105
  esc_attr('ws_ame_' . $slug . '_tab'),
3106
  $slug === $this->current_tab ? ' nav-tab-active' : '',
3107
+ esc_html($title)
3108
  );
3109
  }
3110
  echo '</h2>';
3347
  */
3348
  function ajax_save_screen_options(){
3349
  if (!$this->current_user_can_edit_menu() || !check_ajax_referer('ws_ame_save_screen_options', false, false)){
3350
+ //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Outputs JSON, not HTML.
3351
  die( $this->json_encode( array(
3352
  'error' => "You're not allowed to do that!"
3353
  )));
3408
  */
3409
  public function ajax_get_pages() {
3410
  if ( !check_ajax_referer('ws_ame_get_pages', false, false) ) {
3411
+ exit(wp_json_encode(array('error' => 'Invalid nonce.')));
3412
  } else if ( !$this->current_user_can_edit_menu() ) {
3413
+ exit(wp_json_encode(array('error' => 'You don\'t have sufficient permissions to edit the admin menu.')));
3414
  }
3415
 
3416
  $pages = get_pages(array(
3433
  );
3434
  }
3435
 
3436
+ exit(wp_json_encode($results));
3437
  }
3438
 
3439
  /**
3441
  */
3442
  public function ajax_get_page_details() {
3443
  if ( !check_ajax_referer('ws_ame_get_page_details', false, false) ) {
3444
+ exit(wp_json_encode(array('error' => 'Invalid nonce.')));
3445
  } else if ( !$this->current_user_can_edit_menu() ) {
3446
+ exit(wp_json_encode(array('error' => 'You don\'t have sufficient permissions to edit the admin menu.')));
3447
  }
3448
 
3449
+ $post_id = !empty($_GET['post_id']) ? intval($_GET['post_id']) : 0;
3450
+ $blog_id = !empty($_GET['blog_id']) ? intval($_GET['blog_id']) : 0;
3451
  $should_switch = function_exists('get_current_blog_id') && ($blog_id !== get_current_blog_id());
3452
 
3453
  if ( $should_switch ) {
3456
 
3457
  $page = get_post($post_id);
3458
  if ( !$page ) {
3459
+ exit(wp_json_encode(array('error' => 'Not found')));
3460
  }
3461
 
3462
  if ( $should_switch ) {
3468
  'blog_id' => $blog_id,
3469
  'post_title' => $page->post_title,
3470
  );
3471
+ exit(wp_json_encode($response));
3472
  }
3473
 
3474
  /**
3508
 
3509
  $this->log_security_note(sprintf(
3510
  'The current menu item is "%s", menu template ID: "%s"',
3511
+ esc_html($current_item['menu_title']),
3512
+ esc_html(ameMenuItem::get($current_item, 'template_id', 'N/A'))
3513
  ));
3514
  if ( isset($current_item['access_check_log']) ) {
3515
  $this->log_security_note($current_item['access_check_log']);
3520
  $this->log_security_note(sprintf(
3521
  'The current user %1$s the "%2$s" capability.',
3522
  $allow ? 'has' : 'does not have',
3523
+ esc_html($current_item['access_level'])
3524
  ));
3525
 
3526
  return $allow;
3611
  $admin_url_is_filtered = has_filter('admin_url');
3612
 
3613
  $current_url = $base_site_url . remove_query_arg('___ame_dummy_param___');
3614
+ $this->log_security_note(sprintf('Current URL: "%s"', esc_html($current_url)));
3615
 
3616
  $current_url = $this->parse_url($current_url);
3617
 
3741
  'fragment' => '',
3742
  );
3743
 
3744
+ $parsed = wp_parse_url($url); //Requires WP 4.7+ for full functionality.
3745
  if ( !is_array($parsed) ) {
3746
  $parsed = array();
3747
  }
3859
  if ( empty($capabilities) ) {
3860
  $capabilities = array();
3861
  } else {
3862
+ //phpcs:disable WordPress.PHP.DevelopmentFunctions
3863
+ //This should never happen, but if it does, it's not a critical error, so an exception
3864
+ //doesn't seem warranted. We'll log a warning so that technical users can investigate.
3865
+ trigger_error(
3866
+ //WP coding standard thinks some users will have display_errors enabled,
3867
+ //so, regrettably, the error message needs to be escaped.
3868
+ esc_html("Unexpected capability array: " . print_r($capabilities, true)),
3869
+ E_USER_WARNING
3870
+ );
3871
  return array();
3872
+ //phpcs:enable
3873
  }
3874
  }
3875
  foreach($capabilities as $capability => $value) {
3932
  * @return void
3933
  */
3934
  function capture_request_vars(){
3935
+ //phpcs:disable WordPress.Security.NonceVerification -- This just captures the request vars. Any verification happens later.
3936
  $this->post = $this->originalPost = $_POST;
3937
  $this->get = $_GET;
3938
 
3944
  $this->post = stripslashes_deep($this->post);
3945
  $this->get = stripslashes_deep($this->get);
3946
  }
3947
+ //phpcs:enable
3948
  }
3949
 
3950
  /**
4049
  /**
4050
  * Log a security-related message.
4051
  *
4052
+ * @param string|array $message The message to add to the log, or an array of messages. Should be HTML safe.
4053
  */
4054
  private function log_security_note($message) {
4055
  if ( !$this->should_store_security_log() ) {
4076
  ?>
4077
  <div class="updated">
4078
  <h3>Admin Menu Editor security log</h3>
4079
+ <?php
4080
+ //Log formatting uses HTML, and log contents should already be escaped.
4081
+ //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
4082
+ echo $this->get_formatted_security_log();
4083
+ ?>
4084
  </div>
4085
  <?php
4086
  }
4694
 
4695
  //Disable the notice when the user hides it or visits any of our admin pages.
4696
  $hideNoticeParameter = 'ame-plugin-menu-notice';
4697
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Just hiding an optional help message.
4698
  if ( !empty($_GET[$hideNoticeParameter]) || $this->is_editor_page() || $this->is_settings_page() ) {
4699
  $this->options['show_plugin_menu_notice'] = false;
4700
  $this->save_options();
4715
  $message = 'Tip: Go to <a href="%1$s">Settings -&gt; %2$s</a> to start customizing the admin menu.';
4716
  }
4717
  printf(
4718
+ //phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- $message can be a HTML template.
4719
  '<div class="updated" id="ame-plugin-menu-notice">
4720
  <p>' . $message . '</p>
4721
  <p><a href="%3$s" id="ame-hide-plugin-menu-notice">Hide this message</a></p>
4722
  </div>',
4723
+ //phpcs:enable
4724
+ esc_url(self_admin_url($this->settings_link)),
4725
+ esc_html(apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor')),
4726
+ esc_url($dismissUrl)
4727
  );
4728
 
4729
  }
4755
 
4756
  $power_filename = AME_ROOT_DIR . '/includes/capabilities/cap-power.csv';
4757
  if ( is_file($power_filename) && is_readable($power_filename) ) {
4758
+ // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen -- Should be fine, we only need read permissions.
4759
  $csv = fopen($power_filename, 'r');
4760
  $firstLineSkipped = false;
4761
 
4993
 
4994
  $label = ameMenuItem::get($item, 'menu_title', '');
4995
  if ( $label !== '' ) {
4996
+ $label = trim(wp_strip_all_tags(ameMenuItem::remove_update_count($label)));
4997
  } else {
4998
  $label = '[' . $key . ']';
4999
  }
5232
  * @return string
5233
  */
5234
  private function sanitizeMenuTitle($title) {
5235
+ $title = wp_strip_all_tags( preg_replace('@<span[^>]*>.*</span>@i', '', $title) );
5236
 
5237
  //Compact whitespace.
5238
  $title = rtrim(preg_replace('@[\s\t\r\n]+@', ' ', $title));
includes/menu-item.php CHANGED
@@ -484,14 +484,14 @@ abstract class ameMenuItem {
484
  foreach($capability_fields as $field) {
485
  $value = self::get($item, $field);
486
  if ( !self::is_default($item, $field) && is_string($value) ) {
487
- $item[$field] = strip_tags($value);
488
  }
489
  }
490
 
491
  //Menu icons can be all kinds of stuff (dashicons, data URIs, etc), but they can't contain HTML.
492
  //See /wp-admin/menu-header.php line #90 and onwards for how WordPress handles icons.
493
  if ( !self::is_default($item, 'icon_url') ) {
494
- $item['icon_url'] = strip_tags($item['icon_url']);
495
  }
496
 
497
  //WordPress already sanitizes the menu ID (hookname) on display, but, again, lets clean it just in case.
484
  foreach($capability_fields as $field) {
485
  $value = self::get($item, $field);
486
  if ( !self::is_default($item, $field) && is_string($value) ) {
487
+ $item[$field] = wp_strip_all_tags($value);
488
  }
489
  }
490
 
491
  //Menu icons can be all kinds of stuff (dashicons, data URIs, etc), but they can't contain HTML.
492
  //See /wp-admin/menu-header.php line #90 and onwards for how WordPress handles icons.
493
  if ( !self::is_default($item, 'icon_url') ) {
494
+ $item['icon_url'] = wp_strip_all_tags($item['icon_url']);
495
  }
496
 
497
  //WordPress already sanitizes the menu ID (hookname) on display, but, again, lets clean it just in case.
includes/menu.php CHANGED
@@ -97,7 +97,7 @@ abstract class ameMenu {
97
  $color_presets = array();
98
 
99
  foreach($arr['color_presets'] as $name => $preset) {
100
- $name = substr(trim(strip_tags(strval($name))), 0, 250);
101
  if ( empty($name) || !is_array($preset) ) {
102
  continue;
103
  }
@@ -228,7 +228,7 @@ abstract class ameMenu {
228
  public static function to_json($menu) {
229
  $menu = self::add_format_header($menu);
230
  //todo: Maybe use wp_json_encode() instead. At least one user had invalid UTF-8 characters in their menu.
231
- $result = json_encode($menu);
232
  if ( !is_string($result) ) {
233
  $message = sprintf(
234
  'Failed to encode the menu configuration as JSON. json_encode returned a %s.',
97
  $color_presets = array();
98
 
99
  foreach($arr['color_presets'] as $name => $preset) {
100
+ $name = substr(trim(wp_strip_all_tags(strval($name))), 0, 250);
101
  if ( empty($name) || !is_array($preset) ) {
102
  continue;
103
  }
228
  public static function to_json($menu) {
229
  $menu = self::add_format_header($menu);
230
  //todo: Maybe use wp_json_encode() instead. At least one user had invalid UTF-8 characters in their menu.
231
+ $result = wp_json_encode($menu);
232
  if ( !is_string($result) ) {
233
  $message = sprintf(
234
  'Failed to encode the menu configuration as JSON. json_encode returned a %s.',
includes/module.php CHANGED
@@ -65,7 +65,11 @@ abstract class ameModule {
65
  $this->menuEditor->display_settings_page_header();
66
 
67
  if ( !$this->outputMainTemplate() ) {
68
- printf("[ %1\$s : Module \"%2\$s\" doesn't have a primary template. ]", __METHOD__, $this->moduleId);
 
 
 
 
69
  }
70
 
71
  $this->menuEditor->display_settings_page_footer();
65
  $this->menuEditor->display_settings_page_header();
66
 
67
  if ( !$this->outputMainTemplate() ) {
68
+ printf(
69
+ "[ %1\$s : Module \"%2\$s\" doesn't have a primary template. ]",
70
+ esc_html(__METHOD__),
71
+ esc_html($this->moduleId)
72
+ );
73
  }
74
 
75
  $this->menuEditor->display_settings_page_footer();
includes/persistent-module.php CHANGED
@@ -42,7 +42,7 @@ abstract class amePersistentModule extends ameModule {
42
  }
43
 
44
  public function saveSettings() {
45
- $settings = json_encode($this->settings);
46
  //Save per site or site-wide based on plugin configuration.
47
  $this->setScopedOption($this->optionName, $settings);
48
  }
42
  }
43
 
44
  public function saveSettings() {
45
+ $settings = wp_json_encode($this->settings);
46
  //Save per site or site-wide based on plugin configuration.
47
  $this->setScopedOption($this->optionName, $settings);
48
  }
includes/role-utils.php CHANGED
@@ -75,10 +75,7 @@ class ameRoleUtils {
75
  * @return WP_Roles
76
  */
77
  public static function get_roles() {
78
- global $wp_roles;
79
- if ( !isset($wp_roles) ) {
80
- $wp_roles = new WP_Roles();
81
- }
82
- return $wp_roles;
83
  }
84
  }
75
  * @return WP_Roles
76
  */
77
  public static function get_roles() {
78
+ //Requires WP 4.3.0.
79
+ return wp_roles();
 
 
 
80
  }
81
  }
includes/settings-page.php CHANGED
@@ -18,7 +18,7 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
18
 
19
  <?php do_action('admin_menu_editor-display_header'); ?>
20
 
21
- <form method="post" action="<?php echo esc_attr($formActionUrl); ?>" id="ws_plugin_settings_form">
22
 
23
  <table class="form-table">
24
  <tbody>
@@ -66,8 +66,8 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
66
 
67
  <br>
68
  <span class="description">
69
- Login: <?php echo $currentUser->user_login; ?>,
70
- user ID: <?php echo get_current_user_id(); ?>
71
  </span>
72
  </label>
73
  </p>
@@ -106,17 +106,18 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
106
  <?php disabled(!$isMultisite || !$isSuperAdmin); ?>>
107
  Global &mdash;
108
  Use the same admin menu settings for all network sites.
109
- </label><br>
110
  </p>
111
 
112
-
113
- <label>
114
- <input type="radio" name="menu_config_scope" value="site"
115
- <?php checked('site', $settings['menu_config_scope']); ?>
116
- <?php disabled(!$isMultisite || !$isSuperAdmin); ?>>
117
- Per-site &mdash;
118
- Use different admin menu settings for each site.
119
- </label>
 
120
  </fieldset>
121
  </td>
122
  </tr>
@@ -138,7 +139,7 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
138
  <fieldset>
139
  <?php
140
  global $wp_menu_editor;
141
- foreach ($wp_menu_editor->get_available_modules() as $id => $module) {
142
  if ( !empty($module['isAlwaysActive']) ) {
143
  continue;
144
  }
@@ -149,8 +150,8 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
149
  if ( version_compare(phpversion(), $module['requiredPhpVersion'], '<') ) {
150
  $compatibilityNote = sprintf(
151
  'Required PHP version: %1$s or later. Installed PHP version: %2$s',
152
- htmlentities($module['requiredPhpVersion']),
153
- htmlentities(phpversion())
154
  );
155
  }
156
  }
@@ -162,13 +163,15 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
162
  <input type="checkbox" name="active_modules[]" value="%1$s" %2$s %3$s>
163
  %4$s
164
  </label>',
165
- esc_attr($id),
166
- $wp_menu_editor->is_module_active($id, $module) ? 'checked="checked"' : '',
 
167
  $isCompatible ? '' : 'disabled="disabled"',
168
- !empty($module['title']) ? $module['title'] : htmlentities($id)
169
  );
170
 
171
  if ( !empty($compatibilityNote) ) {
 
172
  printf('<br><span class="description">%s</span>', $compatibilityNote);
173
  }
174
 
@@ -387,13 +390,13 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
387
  <p>
388
  <label>
389
  <input type="radio" name="deep_nesting_enabled"
390
- value="<?php echo esc_attr(json_encode($nestingSetting)); ?>"
391
  <?php
392
  if ( $settings['deep_nesting_enabled'] === $nestingSetting ) {
393
  echo ' checked="checked"';
394
  }
395
  ?>>
396
- <?php echo $label; ?>
397
  </label>
398
  </p>
399
  <?php endforeach; ?>
@@ -450,7 +453,7 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
450
  <fieldset id="ame-submenu-icons-settings">
451
  <p>
452
  <label>
453
- <input type="radio" name="error_verbosity" value="<?php echo WPMenuEditor::VERBOSITY_LOW ?>>"
454
  <?php checked(WPMenuEditor::VERBOSITY_LOW, $settings['error_verbosity']); ?>>
455
  Low
456
 
@@ -462,7 +465,7 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
462
 
463
  <p>
464
  <label>
465
- <input type="radio" name="error_verbosity" value="<?php echo WPMenuEditor::VERBOSITY_NORMAL; ?>>"
466
  <?php checked(WPMenuEditor::VERBOSITY_NORMAL, $settings['error_verbosity']); ?>>
467
  Normal
468
 
@@ -475,7 +478,7 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
475
 
476
  <p>
477
  <label>
478
- <input type="radio" name="error_verbosity" value="<?php echo WPMenuEditor::VERBOSITY_VERBOSE; ?>>"
479
  <?php checked(WPMenuEditor::VERBOSITY_VERBOSE, $settings['error_verbosity']); ?>>
480
  Verbose
481
 
@@ -547,6 +550,7 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
547
  <?php
548
  printf(
549
  '%.2f MiB of %s',
 
550
  memory_get_peak_usage() / (1024 * 1024),
551
  esc_html(ini_get('memory_limit'))
552
  );
18
 
19
  <?php do_action('admin_menu_editor-display_header'); ?>
20
 
21
+ <form method="post" action="<?php echo esc_url($formActionUrl); ?>" id="ws_plugin_settings_form">
22
 
23
  <table class="form-table">
24
  <tbody>
66
 
67
  <br>
68
  <span class="description">
69
+ Login: <?php echo esc_html($currentUser->user_login); ?>,
70
+ user ID: <?php echo esc_html(get_current_user_id()); ?>
71
  </span>
72
  </label>
73
  </p>
106
  <?php disabled(!$isMultisite || !$isSuperAdmin); ?>>
107
  Global &mdash;
108
  Use the same admin menu settings for all network sites.
109
+ </label>
110
  </p>
111
 
112
+ <p>
113
+ <label>
114
+ <input type="radio" name="menu_config_scope" value="site"
115
+ <?php checked('site', $settings['menu_config_scope']); ?>
116
+ <?php disabled(!$isMultisite || !$isSuperAdmin); ?>>
117
+ Per-site &mdash;
118
+ Use different admin menu settings for each site.
119
+ </label>
120
+ </p>
121
  </fieldset>
122
  </td>
123
  </tr>
139
  <fieldset>
140
  <?php
141
  global $wp_menu_editor;
142
+ foreach ($wp_menu_editor->get_available_modules() as $moduleId => $module) {
143
  if ( !empty($module['isAlwaysActive']) ) {
144
  continue;
145
  }
150
  if ( version_compare(phpversion(), $module['requiredPhpVersion'], '<') ) {
151
  $compatibilityNote = sprintf(
152
  'Required PHP version: %1$s or later. Installed PHP version: %2$s',
153
+ esc_html($module['requiredPhpVersion']),
154
+ esc_html(phpversion())
155
  );
156
  }
157
  }
163
  <input type="checkbox" name="active_modules[]" value="%1$s" %2$s %3$s>
164
  %4$s
165
  </label>',
166
+ esc_attr($moduleId),
167
+ $wp_menu_editor->is_module_active($moduleId, $module) ? 'checked="checked"' : '',
168
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Constant strings.
169
  $isCompatible ? '' : 'disabled="disabled"',
170
+ esc_html(!empty($module['title']) ? $module['title'] : $moduleId)
171
  );
172
 
173
  if ( !empty($compatibilityNote) ) {
174
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $compatibilityNote was escaped when generated.
175
  printf('<br><span class="description">%s</span>', $compatibilityNote);
176
  }
177
 
390
  <p>
391
  <label>
392
  <input type="radio" name="deep_nesting_enabled"
393
+ value="<?php echo esc_attr(wp_json_encode($nestingSetting)); ?>"
394
  <?php
395
  if ( $settings['deep_nesting_enabled'] === $nestingSetting ) {
396
  echo ' checked="checked"';
397
  }
398
  ?>>
399
+ <?php echo esc_html($label); ?>
400
  </label>
401
  </p>
402
  <?php endforeach; ?>
453
  <fieldset id="ame-submenu-icons-settings">
454
  <p>
455
  <label>
456
+ <input type="radio" name="error_verbosity" value="<?php echo esc_attr(WPMenuEditor::VERBOSITY_LOW); ?>>"
457
  <?php checked(WPMenuEditor::VERBOSITY_LOW, $settings['error_verbosity']); ?>>
458
  Low
459
 
465
 
466
  <p>
467
  <label>
468
+ <input type="radio" name="error_verbosity" value="<?php echo esc_attr(WPMenuEditor::VERBOSITY_NORMAL); ?>>"
469
  <?php checked(WPMenuEditor::VERBOSITY_NORMAL, $settings['error_verbosity']); ?>>
470
  Normal
471
 
478
 
479
  <p>
480
  <label>
481
+ <input type="radio" name="error_verbosity" value="<?php echo esc_attr(WPMenuEditor::VERBOSITY_VERBOSE); ?>>"
482
  <?php checked(WPMenuEditor::VERBOSITY_VERBOSE, $settings['error_verbosity']); ?>>
483
  Verbose
484
 
550
  <?php
551
  printf(
552
  '%.2f MiB of %s',
553
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We're using sprintf() to format a float.
554
  memory_get_peak_usage() / (1024 * 1024),
555
  esc_html(ini_get('memory_limit'))
556
  );
includes/shadow_plugin_framework.php CHANGED
@@ -129,7 +129,6 @@ class MenuEd_ShadowPluginFramework {
129
  && function_exists('gzuncompress')
130
  ) {
131
  //TODO: Maybe this would be faster if we stored the flag separately?
132
- /** @noinspection PhpComposerExtensionStubsInspection */
133
  $this->options = unserialize(gzuncompress(base64_decode(substr($this->options, strlen($prefix)))));
134
  }
135
 
@@ -160,7 +159,6 @@ class MenuEd_ShadowPluginFramework {
160
  }
161
 
162
  if ( $this->zlib_compression && function_exists('gzcompress') ) {
163
- /** @noinspection PhpComposerExtensionStubsInspection */
164
  $stored_options = 'gzcompress:' . base64_encode(gzcompress(serialize($stored_options)));
165
  }
166
 
@@ -185,6 +183,7 @@ class MenuEd_ShadowPluginFramework {
185
  * @return bool
186
  */
187
  public static function atomic_update_site_option($option_name, $data) {
 
188
  global $wpdb; /** @var wpdb $wpdb */
189
  $lock = 'ame.' . (is_multisite() ? $wpdb->sitemeta : $wpdb->options ) . '.' . $option_name;
190
 
@@ -196,7 +195,7 @@ class MenuEd_ShadowPluginFramework {
196
  $wpdb->query($wpdb->prepare('SELECT RELEASE_LOCK(%s)', $lock));
197
 
198
  return $updated;
199
-
200
  }
201
 
202
 
@@ -216,9 +215,8 @@ class MenuEd_ShadowPluginFramework {
216
  $json = new Services_JSON($flag);
217
  return( $json->decode($data) );
218
  } else {
219
- trigger_error('No JSON parser available', E_USER_ERROR);
220
- return null;
221
- }
222
  }
223
 
224
  /**
@@ -228,16 +226,19 @@ class MenuEd_ShadowPluginFramework {
228
  * @return string
229
  */
230
  function json_encode($data) {
231
- if ( function_exists('json_encode') ){
232
- return json_encode($data);
233
- }
 
 
 
 
234
  if ( class_exists('Services_JSON') ){
235
  $json = new Services_JSON();
236
  return( $json->encodeUnsafe($data) );
237
  } else {
238
- trigger_error('No JSON parser available', E_USER_ERROR);
239
- return '';
240
- }
241
  }
242
 
243
 
129
  && function_exists('gzuncompress')
130
  ) {
131
  //TODO: Maybe this would be faster if we stored the flag separately?
 
132
  $this->options = unserialize(gzuncompress(base64_decode(substr($this->options, strlen($prefix)))));
133
  }
134
 
159
  }
160
 
161
  if ( $this->zlib_compression && function_exists('gzcompress') ) {
 
162
  $stored_options = 'gzcompress:' . base64_encode(gzcompress(serialize($stored_options)));
163
  }
164
 
183
  * @return bool
184
  */
185
  public static function atomic_update_site_option($option_name, $data) {
186
+ // phpcs:disable WordPress.DB.DirectDatabaseQuery -- WPDB doesn't have utility methods for locking, so direct queries are needed.
187
  global $wpdb; /** @var wpdb $wpdb */
188
  $lock = 'ame.' . (is_multisite() ? $wpdb->sitemeta : $wpdb->options ) . '.' . $option_name;
189
 
195
  $wpdb->query($wpdb->prepare('SELECT RELEASE_LOCK(%s)', $lock));
196
 
197
  return $updated;
198
+ // phpcs:enable
199
  }
200
 
201
 
215
  $json = new Services_JSON($flag);
216
  return( $json->decode($data) );
217
  } else {
218
+ throw new RuntimeException('No JSON parser available');
219
+ }
 
220
  }
221
 
222
  /**
226
  * @return string
227
  */
228
  function json_encode($data) {
229
+ if ( function_exists('wp_json_encode') ) {
230
+ return wp_json_encode($data);
231
+ } else if ( function_exists('json_encode') ) {
232
+ // phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode -- Fallback.
233
+ return json_encode($data);
234
+ }
235
+
236
  if ( class_exists('Services_JSON') ){
237
  $json = new Services_JSON();
238
  return( $json->encodeUnsafe($data) );
239
  } else {
240
+ throw new RuntimeException('No JSON parser available');
241
+ }
 
242
  }
243
 
244
 
includes/test-access-screen.php CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  <div id="ws_ame_test_access_screen">
2
  <div id="ws_ame_test_inputs">
3
  <label class="ws_ame_test_input">
1
+ <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit('Direct access denied');
4
+ }
5
+ ?>
6
  <div id="ws_ame_test_access_screen">
7
  <div id="ws_ame_test_inputs">
8
  <label class="ws_ame_test_input">
js/actor-manager.js CHANGED
@@ -666,3 +666,4 @@ if (typeof wsAmeActorData !== 'undefined') {
666
  AmeActors.generateCapabilitySuggestions(wsAmeActorData['capPower']);
667
  }
668
  }
 
666
  AmeActors.generateCapabilitySuggestions(wsAmeActorData['capPower']);
667
  }
668
  }
669
+ //# sourceMappingURL=actor-manager.js.map
js/actor-manager.js.map CHANGED
@@ -1 +1 @@
1
- {"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AAK,WAAW,EAAE;IAC1C,SAAS,GAAG,IAAI,eAAe,CAC9B,cAAc,CAAC,KAAK,EACpB,cAAc,CAAC,KAAK,EACpB,cAAc,CAAC,WAAW,EAC1B,cAAc,CAAC,iBAAiB,CAChC,CAAC;IAEF,IAAI,OAAO,cAAc,CAAC,UAAU,CAAC,KAAK,WAAW,EAAE;QACtD,SAAS,CAAC,6BAA6B,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;KACpE;CACD"}
js/menu-editor.js CHANGED
@@ -508,6 +508,7 @@ function loadMenuConfiguration(adminMenu) {
508
  const $item = buildMenuItem(itemData, isTopLevel);
509
 
510
  if ((typeof afterNode !== 'undefined') && (afterNode !== null)) {
 
511
  $(afterNode).after($item);
512
  } else {
513
  $item.appendTo(itemList);
@@ -1256,12 +1257,12 @@ var knownMenuFields = {
1256
  caption : 'Menu title',
1257
  display: function(menuItem, displayValue, input, containerNode) {
1258
  //Update the header as well.
1259
- containerNode.find('.ws_item_title').html(formatMenuTitle(displayValue) + '&nbsp;');
1260
  return displayValue;
1261
  },
1262
  write: function(menuItem, value, input, containerNode) {
1263
  menuItem.menu_title = value;
1264
- containerNode.find('.ws_item_title').html(stripAllTags(input.val()) + '&nbsp;');
1265
  }
1266
  }),
1267
 
@@ -1764,10 +1765,16 @@ function buildEditboxFields(fieldContainer, entry, isTopLevel){
1764
 
1765
  //Add a link that shows/hides advanced fields
1766
  fieldContainer.append(
1767
- '<div class="ws_toggle_container"><a href="#" class="ws_toggle_advanced_fields"'+
1768
- (wsEditorData.hideAdvancedSettings ? '' : ' style="display:none;" ' )+'>'+
1769
- (wsEditorData.hideAdvancedSettings ? wsEditorData.captionShowAdvanced : wsEditorData.captionHideAdvanced)
1770
- +'</a></div>'
 
 
 
 
 
 
1771
  );
1772
  }
1773
 
@@ -1796,9 +1803,10 @@ function buildEditboxField(entry, field_name, field_settings){
1796
  break;
1797
 
1798
  case 'checkbox':
1799
- inputBox = $('<label><input type="checkbox" class="ws_field_value"> <span class="ws_field_label_text">'+
1800
- field_settings.caption + '</span></label>'
1801
- );
 
1802
  break;
1803
 
1804
  case 'access_editor':
@@ -1818,7 +1826,7 @@ function buildEditboxField(entry, field_name, field_settings){
1818
  break;
1819
 
1820
  case 'heading':
1821
- inputBox = $('<span>' + field_settings.caption + '</span>');
1822
  break;
1823
 
1824
  case 'text':
@@ -1839,23 +1847,30 @@ function buildEditboxField(entry, field_name, field_settings){
1839
  className += ' ws_field_group_heading';
1840
  }
1841
 
1842
- var caption = '';
1843
  if (field_settings.standardCaption) {
1844
- var tooltip = '';
 
 
 
1845
  if (field_settings.tooltip !== null) {
1846
- tooltip = ' <a class="ws_field_tooltip_trigger"><div class="dashicons dashicons-info"></div></a>';
 
 
1847
  }
1848
- caption = '<span class="ws_field_label_text">' + field_settings.caption + tooltip + '</span><br>';
 
1849
  }
1850
- var editField = $('<div>' + caption + '</div>')
1851
  .attr('class', className)
 
1852
  .append(inputBox);
1853
 
1854
  if (field_settings.addDropdown) {
1855
  //Add a dropdown button
1856
  var dropdownId = field_settings.addDropdown;
1857
  editField.append(
1858
- $('<input type="button" value="&#9660;">')
1859
  .addClass('button ws_dropdown_button ' + dropdownId + '_trigger')
1860
  .attr('tabindex', '-1')
1861
  .data('dropdownId', dropdownId)
@@ -2987,6 +3002,7 @@ function ameOnDomReady() {
2987
 
2988
  //Update the item.
2989
  if (knownMenuFields[fieldName].write !== null) {
 
2990
  knownMenuFields[fieldName].write(menuItem, value, input, containerNode);
2991
  } else {
2992
  menuItem[fieldName] = value;
@@ -5397,17 +5413,19 @@ function ameOnDomReady() {
5397
  var indicator = $(this),
5398
  extPermissions = indicator.data('ext_permissions'),
5399
  text = 'Additional permission settings are available. Click "Edit..." to change them.',
5400
- heading = '';
 
5401
 
5402
  if (extPermissions && extPermissions.hasOwnProperty('title')) {
5403
  heading = extPermissions.title;
5404
  if (extPermissions.hasOwnProperty('type')) {
5405
  heading = _.capitalize(_.startCase(extPermissions.type).toLowerCase()) + ': ' + heading;
5406
  }
5407
- text = '<strong>' + heading + '</strong><br>' + text;
5408
  }
5409
 
5410
- return text;
 
5411
  }
5412
  },
5413
  show: {
@@ -5605,8 +5623,10 @@ function ameOnDomReady() {
5605
  return;
5606
  }
5607
 
 
5608
  //Caution: Won't work in IE. Needs compat checks.
5609
- var testPageUrl = new URL(menuUrl, window.location.href);
 
5610
  testPageUrl.searchParams.append('ame-test-menu-access-as', $('#ws_ame_test_access_username').val());
5611
  testPageUrl.searchParams.append('_wpnonce', wsEditorData.testAccessNonce);
5612
  testPageUrl.searchParams.append('ame-test-relevant-role', testActorList.val());
508
  const $item = buildMenuItem(itemData, isTopLevel);
509
 
510
  if ((typeof afterNode !== 'undefined') && (afterNode !== null)) {
511
+ //phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions -- buildMenuItem() should be safe.
512
  $(afterNode).after($item);
513
  } else {
514
  $item.appendTo(itemList);
1257
  caption : 'Menu title',
1258
  display: function(menuItem, displayValue, input, containerNode) {
1259
  //Update the header as well.
1260
+ containerNode.find('.ws_item_title').text(formatMenuTitle(displayValue) + '\xa0');
1261
  return displayValue;
1262
  },
1263
  write: function(menuItem, value, input, containerNode) {
1264
  menuItem.menu_title = value;
1265
+ containerNode.find('.ws_item_title').text(stripAllTags(input.val()) + '\xa0');
1266
  }
1267
  }),
1268
 
1765
 
1766
  //Add a link that shows/hides advanced fields
1767
  fieldContainer.append(
1768
+ $('<div>').addClass('ws_toggle_container').append(
1769
+ $('<a></a>', {href: '#'})
1770
+ .addClass('ws_toggle_advanced_fields')
1771
+ .text(
1772
+ wsEditorData.hideAdvancedSettings
1773
+ ? wsEditorData.captionShowAdvanced
1774
+ : wsEditorData.captionHideAdvanced
1775
+ )
1776
+ .toggle(!!wsEditorData.hideAdvancedSettings) //Conver to boolean because it could be a string ("1" or "0").
1777
+ )
1778
  );
1779
  }
1780
 
1803
  break;
1804
 
1805
  case 'checkbox':
1806
+ inputBox = $('<label></label>')
1807
+ .append($('<input>', {type: 'checkbox', "class": 'ws_field_value'}))
1808
+ .append(' ')
1809
+ .append($('<span></span>', {"class": 'ws_field_label_text'}).text(field_settings.caption))
1810
  break;
1811
 
1812
  case 'access_editor':
1826
  break;
1827
 
1828
  case 'heading':
1829
+ inputBox = $('<span></span>').text(field_settings.caption);
1830
  break;
1831
 
1832
  case 'text':
1847
  className += ' ws_field_group_heading';
1848
  }
1849
 
1850
+ var caption = $(); //Empty set by default.
1851
  if (field_settings.standardCaption) {
1852
+ var $labelText = $('<span></span>')
1853
+ .addClass('ws_field_label_text')
1854
+ .text(field_settings.caption + ' ');
1855
+
1856
  if (field_settings.tooltip !== null) {
1857
+ $labelText.append(
1858
+ '<a class="ws_field_tooltip_trigger"><div class="dashicons dashicons-info"></div></a>'
1859
+ );
1860
  }
1861
+
1862
+ caption = caption.add($labelText).add('<br>'); //Note: add(), not append().
1863
  }
1864
+ var editField = $('<div></div>')
1865
  .attr('class', className)
1866
+ .append(caption)
1867
  .append(inputBox);
1868
 
1869
  if (field_settings.addDropdown) {
1870
  //Add a dropdown button
1871
  var dropdownId = field_settings.addDropdown;
1872
  editField.append(
1873
+ $('<input type="button" value="&#xf347;">')
1874
  .addClass('button ws_dropdown_button ' + dropdownId + '_trigger')
1875
  .attr('tabindex', '-1')
1876
  .data('dropdownId', dropdownId)
3002
 
3003
  //Update the item.
3004
  if (knownMenuFields[fieldName].write !== null) {
3005
+ // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.write -- Misdetected. Not document.write().
3006
  knownMenuFields[fieldName].write(menuItem, value, input, containerNode);
3007
  } else {
3008
  menuItem[fieldName] = value;
5413
  var indicator = $(this),
5414
  extPermissions = indicator.data('ext_permissions'),
5415
  text = 'Additional permission settings are available. Click "Edit..." to change them.',
5416
+ heading = '',
5417
+ $content = $('<span></span>');
5418
 
5419
  if (extPermissions && extPermissions.hasOwnProperty('title')) {
5420
  heading = extPermissions.title;
5421
  if (extPermissions.hasOwnProperty('type')) {
5422
  heading = _.capitalize(_.startCase(extPermissions.type).toLowerCase()) + ': ' + heading;
5423
  }
5424
+ $content.append($('<strong></strong>').text(heading)).append('<br>');
5425
  }
5426
 
5427
+ $content.append($(document.createTextNode(text)));
5428
+ return $content;
5429
  }
5430
  },
5431
  show: {
5623
  return;
5624
  }
5625
 
5626
+ throw new Error('Not fully implemented yet!');
5627
  //Caution: Won't work in IE. Needs compat checks.
5628
+ //var testPageUrl = new URL(menuUrl, window.location.href);
5629
+ var testPageUrl = 'fixme';
5630
  testPageUrl.searchParams.append('ame-test-menu-access-as', $('#ws_ame_test_access_username').val());
5631
  testPageUrl.searchParams.append('_wpnonce', wsEditorData.testAccessNonce);
5632
  testPageUrl.searchParams.append('ame-test-relevant-role', testActorList.val());
menu-editor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Admin Menu Editor
4
  Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
5
  Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
6
- Version: 1.10.1
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/blog/
9
  License: GPLv3
3
  Plugin Name: Admin Menu Editor
4
  Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
5
  Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
6
+ Version: 1.10.2
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/blog/
9
  License: GPLv3
modules/access-editor/access-editor-template.php CHANGED
@@ -4,7 +4,7 @@ if ( isset($GLOBALS['wp_version']) && version_compare($GLOBALS['wp_version'], '5
4
  $ameDialogClasses[] = 'ame-is-wp53-plus';
5
  }
6
  ?>
7
- <div id="ws_menu_access_editor" title="Permissions" class="<?php echo implode(' ', $ameDialogClasses); ?>">
8
 
9
  <div class="ws_dialog_panel">
10
  <div class="error inline" id="ws_hardcoded_role_error">
@@ -86,21 +86,21 @@ if ( isset($GLOBALS['wp_version']) && version_compare($GLOBALS['wp_version'], '5
86
  <table class="widefat ws_ext_permissions_table" id="ws_post_type_permissions_table">
87
  <?php foreach($cpt_actions as $group => $actions): ?>
88
  <tr>
89
- <td class="ws_ext_group_title" colspan="2"><?php echo $group; ?></td>
90
  </tr>
91
- <?php foreach($actions as $action => $readable_name): ?>
92
- <?php $checkbox_id = 'ws_cpt_action-' . $action; ?>
93
- <tr class="ws_ext_action-<?php echo esc_attr($action); ?>">
94
  <td class="ws_ext_action_check_column">
95
  <input
96
  type="checkbox"
97
  id="<?php echo esc_attr($checkbox_id); ?>"
98
  class="ws_ext_action_allowed"
99
- data-ext_action="<?php echo esc_attr($action); ?>">
100
  </td>
101
  <td class="ws_ext_action_name_column">
102
  <label for="<?php echo esc_attr($checkbox_id); ?>" class="ws_ext_action_name">
103
- <?php echo $readable_name; ?>
104
  </label>
105
  </td>
106
  </tr>
@@ -120,19 +120,19 @@ if ( isset($GLOBALS['wp_version']) && version_compare($GLOBALS['wp_version'], '5
120
  ?>
121
 
122
  <table class="widefat ws_ext_permissions_table" id="ws_taxonomy_permissions_table">
123
- <?php foreach($taxonomy_actions as $action => $readable_name): ?>
124
- <?php $checkbox_id = 'ws_taxonomy_action-' . $action; ?>
125
- <tr class="ws_ext_action-<?php echo esc_attr($action); ?>">
126
  <td class="ws_ext_action_check_column">
127
  <input
128
  type="checkbox"
129
  id="<?php echo esc_attr($checkbox_id); ?>"
130
  class="ws_ext_action_allowed"
131
- data-ext_action="<?php echo esc_attr($action); ?>">
132
  </td>
133
  <td class="ws_ext_action_name_column">
134
  <label for="<?php echo esc_attr($checkbox_id); ?>" class="ws_ext_action_name">
135
- <?php echo $readable_name; ?>
136
  </label>
137
  </td>
138
  </tr>
@@ -174,7 +174,7 @@ if ( isset($GLOBALS['wp_version']) && version_compare($GLOBALS['wp_version'], '5
174
  Leave empty to disable.
175
  ">[?]</a>
176
  <br>
177
- <input type="text" id="ws_extra_capability" class="ws_has_dropdown" value=""><input type="button" id="ws_trigger_capability_dropdown" value="&#9660;"
178
  class="button ws_dropdown_button" tabindex="-1">
179
  </div>
180
 
4
  $ameDialogClasses[] = 'ame-is-wp53-plus';
5
  }
6
  ?>
7
+ <div id="ws_menu_access_editor" title="Permissions" class="<?php echo esc_attr(implode(' ', $ameDialogClasses)); ?>">
8
 
9
  <div class="ws_dialog_panel">
10
  <div class="error inline" id="ws_hardcoded_role_error">
86
  <table class="widefat ws_ext_permissions_table" id="ws_post_type_permissions_table">
87
  <?php foreach($cpt_actions as $group => $actions): ?>
88
  <tr>
89
+ <td class="ws_ext_group_title" colspan="2"><?php echo esc_html($group); ?></td>
90
  </tr>
91
+ <?php foreach($actions as $action_key => $readable_name): ?>
92
+ <?php $checkbox_id = 'ws_cpt_action-' . $action_key; ?>
93
+ <tr class="ws_ext_action-<?php echo esc_attr($action_key); ?>">
94
  <td class="ws_ext_action_check_column">
95
  <input
96
  type="checkbox"
97
  id="<?php echo esc_attr($checkbox_id); ?>"
98
  class="ws_ext_action_allowed"
99
+ data-ext_action="<?php echo esc_attr($action_key); ?>">
100
  </td>
101
  <td class="ws_ext_action_name_column">
102
  <label for="<?php echo esc_attr($checkbox_id); ?>" class="ws_ext_action_name">
103
+ <?php echo esc_html($readable_name); ?>
104
  </label>
105
  </td>
106
  </tr>
120
  ?>
121
 
122
  <table class="widefat ws_ext_permissions_table" id="ws_taxonomy_permissions_table">
123
+ <?php foreach($taxonomy_actions as $action_key => $readable_name): ?>
124
+ <?php $checkbox_id = 'ws_taxonomy_action-' . $action_key; ?>
125
+ <tr class="ws_ext_action-<?php echo esc_attr($action_key); ?>">
126
  <td class="ws_ext_action_check_column">
127
  <input
128
  type="checkbox"
129
  id="<?php echo esc_attr($checkbox_id); ?>"
130
  class="ws_ext_action_allowed"
131
+ data-ext_action="<?php echo esc_attr($action_key); ?>">
132
  </td>
133
  <td class="ws_ext_action_name_column">
134
  <label for="<?php echo esc_attr($checkbox_id); ?>" class="ws_ext_action_name">
135
+ <?php echo esc_html($readable_name); ?>
136
  </label>
137
  </td>
138
  </tr>
174
  Leave empty to disable.
175
  ">[?]</a>
176
  <br>
177
+ <input type="text" id="ws_extra_capability" class="ws_has_dropdown" value=""><input type="button" id="ws_trigger_capability_dropdown" value="&#xf347;"
178
  class="button ws_dropdown_button" tabindex="-1">
179
  </div>
180
 
modules/actor-selector/actor-selector-template.php CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  <div id="ws_actor_selector_container">
2
  <ul id="ws_actor_selector" class="subsubsub" style="display: none;">
3
  <!-- Contents will be generated by JS -->
1
+ <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit('Direct access denied.');
4
+ }
5
+ ?>
6
  <div id="ws_actor_selector_container">
7
  <ul id="ws_actor_selector" class="subsubsub" style="display: none;">
8
  <!-- Contents will be generated by JS -->
modules/actor-selector/actor-selector.js CHANGED
@@ -261,3 +261,4 @@ var AmeActorSelector = /** @class */ (function () {
261
  AmeActorSelector._ = wsAmeLodash;
262
  return AmeActorSelector;
263
  }());
 
261
  AmeActorSelector._ = wsAmeLodash;
262
  return AmeActorSelector;
263
  }());
264
+ //# sourceMappingURL=actor-selector.js.map
modules/actor-selector/actor-selector.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"actor-selector.js","sourceRoot":"","sources":["actor-selector.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,kDAAkD;AAClD,kDAAkD;AAuBlD;IAkBC,0BACC,YAAsC,EACtC,YAAsB,EACtB,gBAAgC;QAAhC,iCAAA,EAAA,uBAAgC;QAHjC,iBA2BC;QA1CM,kBAAa,GAAW,IAAI,CAAC;QAC7B,wBAAmB,GAAW,KAAK,CAAC;QAEnC,iBAAY,GAAa,EAAE,CAAC;QAC5B,gBAAW,GAAmC,EAAE,CAAC;QAGxC,iBAAY,GAAY,KAAK,CAAC;QAE9B,qBAAgB,GAAY,IAAI,CAAC;QAE1C,wBAAmB,GAAgB,IAAI,CAAC;QAS/C,IAAI,CAAC,YAAY,GAAG,Y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AU,CACvC,CAAC,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CACrF,CAAC;QACF,IAAM,gBAAgB,GAAG,EAAE,CAAC,QAAQ,CAAiB;YACpD,IAAI,EAAE;gBACL,OAAO,kBAAkB,EAAE,CAAC;YAC7B,CAAC;YACD,KAAK,EAAE,UAAC,QAAwB;gBAC/B,KAAI,CAAC,gBAAgB,CACpB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAC7C,CAAC;YACH,CAAC;SACD,CAAC,CAAC;QAEH,IAAM,IAAI,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,CAAC,UAAU,gBAAwB;YAC/C,IAAI,gBAAgB,KAAK,IAAI,EAAE;gBAC9B,kBAAkB,CAAC,IAAI,CAAC,CAAC;aACzB;iBAAM;gBACN,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;aACjE;QACF,CAAC,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IACzB,CAAC;IA9Tc,kBAAC,GAAG,WAAW,CAAC;IA+ThC,uBAAC;CAAA,AAhUD,IAgUC"}
modules/actor-selector/actor-selector.php CHANGED
@@ -42,10 +42,10 @@ class ameActorSelector extends ameModule {
42
 
43
  public function ajaxSetVisibleUsers() {
44
  if ( !check_ajax_referer(self::ajaxUpdateAction, false, false) ){
45
- die(__("Access denied. Invalid nonce.", 'admin-menu-editor'));
46
  }
47
  if ( !$this->menuEditor->current_user_can_edit_menu() ) {
48
- die(__("You don't have permission to use Admin Menu Editor Pro.", 'admin-menu-editor'));
49
  }
50
 
51
  $post = $this->menuEditor->get_post_params();
42
 
43
  public function ajaxSetVisibleUsers() {
44
  if ( !check_ajax_referer(self::ajaxUpdateAction, false, false) ){
45
+ die(esc_html__("Access denied. Invalid nonce.", 'admin-menu-editor'));
46
  }
47
  if ( !$this->menuEditor->current_user_can_edit_menu() ) {
48
+ die(esc_html__("You don't have permission to use Admin Menu Editor Pro.", 'admin-menu-editor'));
49
  }
50
 
51
  $post = $this->menuEditor->get_post_params();
modules/highlight-new-menus/wsNewMenuHighlighter.php CHANGED
@@ -9,6 +9,10 @@ class wsNewMenuHighlighter {
9
  const AJAX_FLAG_ACTION = 'nmh-flag-as-seen';
10
  const COOKIE_NAME = 'ws_nmh_pending_seen_urls';
11
 
 
 
 
 
12
  static $blacklist = array(
13
  //These items are invisible when the theme customizer is available.
14
  'themes.php?page=custom-header' => true,
@@ -101,7 +105,7 @@ class wsNewMenuHighlighter {
101
  if ( $this->isFirstRun ) {
102
  $urls = array_keys($this->seenMenuUrls);
103
  $this->seenMenuUrls = array();
104
- $this->flagAsSeen($urls);
105
  }
106
  }
107
 
@@ -230,6 +234,9 @@ class wsNewMenuHighlighter {
230
  exit('Error: The required "urls" parameter is missing.');
231
  }
232
 
 
 
 
233
  $json = strval($_POST['urls']);
234
  //Unfortunately, WP applies magic quotes to POST data.
235
  if ( function_exists('wp_magic_quotes') && did_action('plugins_loaded') ) {
@@ -248,6 +255,8 @@ class wsNewMenuHighlighter {
248
  return;
249
  }
250
 
 
 
251
  $urls = json_decode(stripslashes($_COOKIE[self::COOKIE_NAME]), true);
252
  if ( is_array($urls) ) {
253
  $this->flagAsSeen(array_keys($urls));
@@ -260,11 +269,16 @@ class wsNewMenuHighlighter {
260
  }
261
  }
262
 
263
- private function flagAsSeen($menuUrls) {
264
  if ( empty($menuUrls) || !is_array($menuUrls) ) {
265
  return false;
266
  }
267
- $menuUrls = array_filter($menuUrls);
 
 
 
 
 
268
  $this->seenMenuUrls = $this->loadSeenMenus();
269
 
270
  //Optimization: Save only if there are changes / new URLs.
@@ -272,9 +286,36 @@ class wsNewMenuHighlighter {
272
  $newUrls = array_diff_key($urlIndex, $this->seenMenuUrls);
273
  if ( !empty($newUrls) ) {
274
  $this->seenMenuUrls = array_merge($this->seenMenuUrls, $urlIndex);
 
 
 
 
 
 
 
 
 
 
 
275
  return update_user_meta(get_current_user_id(), self::STORAGE_KEY, $this->seenMenuUrls);
276
  } else {
277
  return false;
278
  }
279
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  }
9
  const AJAX_FLAG_ACTION = 'nmh-flag-as-seen';
10
  const COOKIE_NAME = 'ws_nmh_pending_seen_urls';
11
 
12
+ const MAX_URLS_PER_USER = 700;
13
+ const MAX_URLS_PER_REQUEST = 100;
14
+ const MAX_URL_LENGTH = 512;
15
+
16
  static $blacklist = array(
17
  //These items are invisible when the theme customizer is available.
18
  'themes.php?page=custom-header' => true,
105
  if ( $this->isFirstRun ) {
106
  $urls = array_keys($this->seenMenuUrls);
107
  $this->seenMenuUrls = array();
108
+ $this->flagAsSeen($urls, true);
109
  }
110
  }
111
 
234
  exit('Error: The required "urls" parameter is missing.');
235
  }
236
 
237
+ //JSON decoding will reject severely malformed data, and flagAsSeen() will
238
+ //further validate the input.
239
+ //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
240
  $json = strval($_POST['urls']);
241
  //Unfortunately, WP applies magic quotes to POST data.
242
  if ( function_exists('wp_magic_quotes') && did_action('plugins_loaded') ) {
255
  return;
256
  }
257
 
258
+ //As above, flagAsSeen() does some validation.
259
+ //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
260
  $urls = json_decode(stripslashes($_COOKIE[self::COOKIE_NAME]), true);
261
  if ( is_array($urls) ) {
262
  $this->flagAsSeen(array_keys($urls));
269
  }
270
  }
271
 
272
+ private function flagAsSeen($menuUrls, $isInternalCall = false) {
273
  if ( empty($menuUrls) || !is_array($menuUrls) ) {
274
  return false;
275
  }
276
+ //Reduce the risk of DoS attacks by limiting the number of URLs per request.
277
+ if ( !$isInternalCall && (count($menuUrls) > self::MAX_URLS_PER_REQUEST) ) {
278
+ return false;
279
+ }
280
+
281
+ $menuUrls = array_filter($menuUrls, array($this, 'couldBeMenuUrl'));
282
  $this->seenMenuUrls = $this->loadSeenMenus();
283
 
284
  //Optimization: Save only if there are changes / new URLs.
286
  $newUrls = array_diff_key($urlIndex, $this->seenMenuUrls);
287
  if ( !empty($newUrls) ) {
288
  $this->seenMenuUrls = array_merge($this->seenMenuUrls, $urlIndex);
289
+
290
+ //To avoid creating huge user meta rows, let's save only the most recent URLs.
291
+ if ( count($this->seenMenuUrls) > self::MAX_URLS_PER_USER ) {
292
+ $this->seenMenuUrls = array_slice(
293
+ $this->seenMenuUrls,
294
+ -self::MAX_URLS_PER_USER,
295
+ self::MAX_URLS_PER_USER,
296
+ true
297
+ );
298
+ }
299
+
300
  return update_user_meta(get_current_user_id(), self::STORAGE_KEY, $this->seenMenuUrls);
301
  } else {
302
  return false;
303
  }
304
  }
305
+
306
+ private function couldBeMenuUrl($input) {
307
+ if ( !is_string($input) || ($input === '') ) {
308
+ return false;
309
+ }
310
+
311
+ $input = wp_check_invalid_utf8($input);
312
+ if ( !$input ) {
313
+ return false;
314
+ }
315
+
316
+ //Admin menu URLs are not necessarily fully qualified, or even valid
317
+ //URLs. Some plugins use weird hacks. Let's just verify that the "URL"
318
+ //is not too huge.
319
+ return (strlen($input) < self::MAX_URL_LENGTH);
320
+ }
321
  }
modules/plugin-visibility/plugin-visibility-template.php CHANGED
@@ -6,7 +6,7 @@
6
 
7
  <div id="ame-plugin-visibility-editor">
8
  <form method="post" data-bind="submit: saveChanges" class="ame-pv-save-form" action="<?php
9
- echo esc_attr(add_query_arg(array('noheader' => '1'), $tabUrl));
10
  ?>">
11
 
12
  <?php submit_button('Save Changes', 'primary', 'submit', false); ?>
6
 
7
  <div id="ame-plugin-visibility-editor">
8
  <form method="post" data-bind="submit: saveChanges" class="ame-pv-save-form" action="<?php
9
+ echo esc_url(add_query_arg(array('noheader' => '1'), $tabUrl));
10
  ?>">
11
 
12
  <?php submit_button('Save Changes', 'primary', 'submit', false); ?>
modules/plugin-visibility/plugin-visibility.js CHANGED
@@ -314,3 +314,4 @@ jQuery(function ($) {
314
  AjawV1.getAction('ws_ame_dismiss_pv_usage_notice').request();
315
  });
316
  });
 
314
  AjawV1.getAction('ws_ame_dismiss_pv_usage_notice').request();
315
  });
316
  });
317
+ //# sourceMappingURL=plugin-visibility.js.map
modules/plugin-visibility/plugin-visibility.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-visibility.js","sourceRoot":"","sources":["plugin-visibility.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,6CAA6C;AAC7C,+CAA+C;AAC/C,kDAAkD;AAClD,uEAAuE;AACvE,oEAAoE;AAwCpE;IAoBC,mCAAY,UAAsC;QAAlD,iBAgEC;QA/DA,IAAM,CAAC,GAAG,yBAAyB,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,aAAa,GAAG,IAAI,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;QAE9E,wFAAwF;QACxF,IAAI,cAAc,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QACrE,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC,QAAQ,CAAS;YACxC,IAAI,EAAE;gBACL,MAAM,CAAC,cAAc,EAAE,CAAC;YACzB,CAAC;YACD,KAAK,EAAE,UAAC,QAAgB;gBACvB,KAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC/C,CAAC;SACD,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAC,gBAAwB;YACpD,cAAc,CAAC,gBAAgB,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,6EAA6E;QAC7E,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;QAE7C,IAAI,CAAC,oBAAoB,GAAG,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SAC/B;QACD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAEM,sBAAY,GAAnB,UAAoB,KAAK;QACxB,kDAAkD;QAClD,IAAM,IAAI,GAAG,gCAAgC,EAC5C,kBAAkB,GAAG,0CAA0C,CAAC;QACjE,OAAO,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;IA/Ge,+BAAqB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAgHjG,gBAAC;CAAA,AAtHD,IAsHC;AAED,MAAM,CAAC,UAAU,CAAC;IACjB,mBAAmB,GAAG,IAAI,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAC5E,EAAE,CAAC,aAAa,CAAC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE/F,8CAA8C;IAC9C,CAAC,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE;QACxD,MAAM,CAAC,SAAS,CAAC,gCAAgC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
modules/plugin-visibility/plugin-visibility.php CHANGED
@@ -237,6 +237,10 @@ class amePluginVisibility extends amePersistentModule {
237
  * @param string $action
238
  */
239
  public function authorizePluginAction($action) {
 
 
 
 
240
  //Is the user trying to edit a plugin?
241
  if (preg_match('@^edit-plugin_(?P<file>.+)$@', $action, $matches)) {
242
 
@@ -278,7 +282,7 @@ class amePluginVisibility extends amePersistentModule {
278
  if (!$isVisible) {
279
  wp_die(sprintf(
280
  'You do not have sufficient permissions to %s this plugin.',
281
- $matches['action']
282
  ));
283
  }
284
 
@@ -290,11 +294,12 @@ class amePluginVisibility extends amePersistentModule {
290
  if (!$this->isPluginVisible(strval($pluginFile), $user)) {
291
  wp_die(sprintf(
292
  'You do not have sufficient permissions to manage this plugin: "%s".',
293
- $pluginFile
294
  ));
295
  }
296
  }
297
  }
 
298
  }
299
 
300
  public function addSettingsTab($tabs) {
237
  * @param string $action
238
  */
239
  public function authorizePluginAction($action) {
240
+ //PHPCS special case: This hook callback runs inside a function that validates
241
+ //nonces and selectively overrides the behaviour of that function.
242
+ //phpcs:disable WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- See above
243
+
244
  //Is the user trying to edit a plugin?
245
  if (preg_match('@^edit-plugin_(?P<file>.+)$@', $action, $matches)) {
246
 
282
  if (!$isVisible) {
283
  wp_die(sprintf(
284
  'You do not have sufficient permissions to %s this plugin.',
285
+ esc_html($matches['action'])
286
  ));
287
  }
288
 
294
  if (!$this->isPluginVisible(strval($pluginFile), $user)) {
295
  wp_die(sprintf(
296
  'You do not have sufficient permissions to manage this plugin: "%s".',
297
+ esc_html($pluginFile)
298
  ));
299
  }
300
  }
301
  }
302
+ //phpcs:enable
303
  }
304
 
305
  public function addSettingsTab($tabs) {
modules/redirector/redirector-template.php CHANGED
@@ -134,7 +134,7 @@ if ( defined('AME_DISABLE_REDIRECTS') && constant('AME_DISABLE_REDIRECTS') ) {
134
  </div>
135
 
136
  <form class="ame-rui-save-form" method="post" data-bind="submit: saveChanges" action="<?php
137
- echo esc_attr(add_query_arg(array('noheader' => '1'), $moduleTabUrl));
138
  ?>">
139
  <?php
140
  submit_button(
@@ -168,7 +168,7 @@ if ( defined('AME_DISABLE_REDIRECTS') && constant('AME_DISABLE_REDIRECTS') ) {
168
  class="ame-rui-redirect-list">
169
  <div class="ame-rui-redirect">
170
  <div class="ame-rui-drag-handle">
171
- <img src="<?php echo esc_attr($dragIconUrl); ?>" alt="Drag indicator" width="24">
172
  </div>
173
  <div class="ame-rui-redirect-content">
174
  <div class="ame-rui-actor">
134
  </div>
135
 
136
  <form class="ame-rui-save-form" method="post" data-bind="submit: saveChanges" action="<?php
137
+ echo esc_url(add_query_arg(array('noheader' => '1'), $moduleTabUrl));
138
  ?>">
139
  <?php
140
  submit_button(
168
  class="ame-rui-redirect-list">
169
  <div class="ame-rui-redirect">
170
  <div class="ame-rui-drag-handle">
171
+ <img src="<?php echo esc_url($dragIconUrl); ?>" alt="Drag indicator" width="24">
172
  </div>
173
  <div class="ame-rui-redirect-content">
174
  <div class="ame-rui-actor">
modules/redirector/redirector-ui.js CHANGED
@@ -795,3 +795,4 @@ jQuery(function ($) {
795
  }
796
  });
797
  });
 
795
  }
796
  });
797
  });
798
+ //# sourceMappingURL=redirector-ui.js.map
modules/redirector/redirector-ui.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"redirector-ui.js","sourceRoot":"","sources":["redirector-ui.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,6CAA6C;AAC7C,+CAA+C;AAC/C,kDAAkD;AAClD,4DAA4D;AAC5D,6CAA6C;AAC7C,oEAAoE;;;;;;;;;;;;;;;;AAKpE,IAAU,eAAe,CAm3BxB;AAn3BD,WAAU,eAAe;IACxB,IAAM,gBAAgB,GAAG;QACxB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,IAAI;KAChB,CAAA;IAED,IAAM,CAAC,GAAG,WAAW,CAAC;IAQtB;QAAA;QAKA,CAAC;QAAD,gCAAC;IAAD,CAAC,AALD,IAKC;IA4BD,IAAM,cAAc,GAAG,iBAAiB,CAAC;IACzC,IAAM,YAAY,GAAc;QAC/B,cAAc,EAAd;YACC,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,KAAK,EAAL;YACC,OAAO,cAAc,CAAC;QACvB,CAAC;KACD,CAAA;IAED;QAmBC,kBAAY,UAA8B,EAAE,aAAmC;YAA/E,iBAmEC;YAnE2C,8BAAA,EAAA,oBAAmC;YAC9E,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC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,CAAC,CAAC;SAC1C;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
modules/redirector/redirector.php CHANGED
@@ -166,6 +166,7 @@ class Module extends amePersistentModule {
166
  * @noinspection PhpUnusedParameterInspection The parameters are defined by the hook and can't be changed.
167
  */
168
  public function filterLoginRedirect($redirectTo, $requestedRedirectTo = '', $user = null) {
 
169
  if ( $this->checkFirstLogin($user) ) {
170
  $trigger = Triggers::FIRST_LOGIN;
171
  } else {
@@ -211,7 +212,7 @@ class Module extends amePersistentModule {
211
  //WordPress uses wp_safe_redirect() for login, logout, and registration redirects, which
212
  //only allows local redirects by default. Let's temporarily add the domain name of the URL
213
  //to the allowed host list to let the user set any redirect URL they want.
214
- $redirectHost = parse_url($url, PHP_URL_HOST);
215
  if ( !empty($redirectHost) ) {
216
  add_filter('allowed_redirect_hosts', function ($allowedHosts) use ($redirectHost) {
217
  $allowedHosts[] = $redirectHost;
@@ -362,9 +363,12 @@ class Module extends amePersistentModule {
362
  'hasMoreUsers' => $hasMoreUsers,
363
  ];
364
 
 
365
  if ( isset($_GET['selectedTrigger']) && in_array($_GET['selectedTrigger'], Triggers::getValues()) ) {
 
366
  $scriptData['selectedTrigger'] = $_GET['selectedTrigger'];
367
  }
 
368
 
369
  wp_add_inline_script(
370
  self::UI_SCRIPT_HANDLE,
@@ -390,8 +394,7 @@ class Module extends amePersistentModule {
390
 
391
  if ( is_wp_error($validationResult) ) {
392
  //It seems that wp_die() doesn't automatically escape special characters, so let's do that.
393
- $message = esc_html($validationResult->get_error_message());
394
- wp_die($message);
395
  }
396
 
397
  $newRedirects = new RedirectCollection();
@@ -981,7 +984,7 @@ class MenuExtractor {
981
  $url = ameMenuItem::get($item, 'url');
982
 
983
  $rawTitle = ameMenuItem::get($item, 'menu_title', '[Untitled]');
984
- $fullTitle = trim(strip_tags(ameMenuItem::remove_update_count($rawTitle)));
985
  if ( $parentTitle !== null ) {
986
  $fullTitle = $parentTitle . ' → ' . $fullTitle;
987
  }
@@ -1012,7 +1015,7 @@ class MenuExtractor {
1012
  * @return boolean
1013
  */
1014
  private function looksLikeDashboardUrl($url) {
1015
- $scheme = parse_url($url, PHP_URL_SCHEME);
1016
  if ( !empty($scheme) ) {
1017
  return false;
1018
  }
166
  * @noinspection PhpUnusedParameterInspection The parameters are defined by the hook and can't be changed.
167
  */
168
  public function filterLoginRedirect($redirectTo, $requestedRedirectTo = '', $user = null) {
169
+ //TODO: If there are no "first login" settings for this user, apply the regular login redirect.
170
  if ( $this->checkFirstLogin($user) ) {
171
  $trigger = Triggers::FIRST_LOGIN;
172
  } else {
212
  //WordPress uses wp_safe_redirect() for login, logout, and registration redirects, which
213
  //only allows local redirects by default. Let's temporarily add the domain name of the URL
214
  //to the allowed host list to let the user set any redirect URL they want.
215
+ $redirectHost = wp_parse_url($url, PHP_URL_HOST);
216
  if ( !empty($redirectHost) ) {
217
  add_filter('allowed_redirect_hosts', function ($allowedHosts) use ($redirectHost) {
218
  $allowedHosts[] = $redirectHost;
363
  'hasMoreUsers' => $hasMoreUsers,
364
  ];
365
 
366
+ //phpcs:disable WordPress.Security.NonceVerification.Recommended
367
  if ( isset($_GET['selectedTrigger']) && in_array($_GET['selectedTrigger'], Triggers::getValues()) ) {
368
+ //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Already validated by checking against Triggers::getValues().
369
  $scriptData['selectedTrigger'] = $_GET['selectedTrigger'];
370
  }
371
+ //phpcs:enable
372
 
373
  wp_add_inline_script(
374
  self::UI_SCRIPT_HANDLE,
394
 
395
  if ( is_wp_error($validationResult) ) {
396
  //It seems that wp_die() doesn't automatically escape special characters, so let's do that.
397
+ wp_die(esc_html($validationResult->get_error_message()));
 
398
  }
399
 
400
  $newRedirects = new RedirectCollection();
984
  $url = ameMenuItem::get($item, 'url');
985
 
986
  $rawTitle = ameMenuItem::get($item, 'menu_title', '[Untitled]');
987
+ $fullTitle = trim(wp_strip_all_tags(ameMenuItem::remove_update_count($rawTitle)));
988
  if ( $parentTitle !== null ) {
989
  $fullTitle = $parentTitle . ' → ' . $fullTitle;
990
  }
1015
  * @return boolean
1016
  */
1017
  private function looksLikeDashboardUrl($url) {
1018
+ $scheme = wp_parse_url($url, PHP_URL_SCHEME);
1019
  if ( !empty($scheme) ) {
1020
  return false;
1021
  }
phpcs.xml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="AME_PHPCS_Settings">
3
+ <description>PHPCS settings for Admin Menu Editor</description>
4
+
5
+ <arg name="basepath" value="."/>
6
+ <arg name="warning-severity" value="5"/>
7
+ <arg name="error-severity" value="5"/>
8
+ <arg value="sp"/>
9
+
10
+ <!-- Check the current directory by default -->
11
+ <file>./</file>
12
+
13
+ <!-- Include the WordPress-VIP-Go standard -->
14
+ <rule ref="WordPress-VIP-Go">
15
+ <!-- Surely server-side caching isn't an issue for admin pages? -->
16
+ <exclude name="WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE" />
17
+ <exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.cookies_setcookie" />
18
+
19
+ <!-- This plugin is not exclusive to WP VIP, so it doesn't use vip_safe_wp_remote_get() and such. -->
20
+ <exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get" />
21
+
22
+ <!-- This plugin does a lot of DOM manipulation and these sniffs generate too many false positives. -->
23
+ <exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions.append" />
24
+ <exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions.appendTo" />
25
+ <exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions.prepend" />
26
+ <exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions.prependTo" />
27
+ <exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions.insertBefore" />
28
+ <exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions.insertAfter" />
29
+
30
+ <!-- Questionable, but not a security issue or bug. -->
31
+ <exclude name="Squiz.PHP.CommentedOutCode.Found" />
32
+ </rule>
33
+
34
+ <exclude-pattern type="relative">^/vendor/*</exclude-pattern>
35
+ <!-- Third-party JavaScript libraries and jQuery plugins -->
36
+ <exclude-pattern type="relative">^js/knockout\.js</exclude-pattern>
37
+ <exclude-pattern type="relative">^js/lodash\.js</exclude-pattern>
38
+ <exclude-pattern type="relative">^js/lodash\.min\.js</exclude-pattern>
39
+ <exclude-pattern type="relative">^js/lazyload\.min\.js</exclude-pattern>
40
+ <exclude-pattern type="relative">^js/jquery\.sort\.js</exclude-pattern>
41
+ <exclude-pattern type="relative">^js/jquery\.form\.js</exclude-pattern>
42
+ <exclude-pattern type="relative">^js/jquery\.qtip\.js</exclude-pattern>
43
+ <exclude-pattern type="relative">^js/jquery\.qtip\.min\.js</exclude-pattern>
44
+ <exclude-pattern type="relative">^css/jquery\.qtip\.css</exclude-pattern>
45
+ <exclude-pattern type="relative">^css/jquery\.qtip\.min\.css</exclude-pattern>
46
+ <!-- Third-party CSS parser -->
47
+ <exclude-pattern type="relative">^includes/PHP-CSS-Parser/lib/*</exclude-pattern>
48
+
49
+ </ruleset>
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: whiteshadow
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
4
  Tags: admin, dashboard, menu, security, wpmu
5
- Requires at least: 4.1
6
- Tested up to: 5.9.3
7
- Stable tag: 1.10.1
8
 
9
  Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
10
 
@@ -75,6 +75,14 @@ Plugins installed in the `mu-plugins` directory are treated as "always on", so y
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
 
 
 
78
  = 1.10.1 =
79
  * Fixed the `[ame-user-info]` shortcode not working in login redirects. It would always output "(No user)" instead of the actual user data.
80
  * Fixed a warning caused by a conflict with plugins and themes that call the "login_redirect" filter with only 1 parameter instead of the expected 3.
2
  Contributors: whiteshadow
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
4
  Tags: admin, dashboard, menu, security, wpmu
5
+ Requires at least: 4.7
6
+ Tested up to: 6.0
7
+ Stable tag: 1.10.2
8
 
9
  Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
10
 
75
 
76
  == Changelog ==
77
 
78
+ = 1.10.2 =
79
+ * Added additional validation in escaping in multiple places.
80
+ * Fixed a number of issues related to the WordPress coding standard and the WordPress-VIP-Go coding standard.
81
+ * Fixed visual misalignment of menu property fields and accompanying dropdown buttons.
82
+ * Fixed inconsistent spacing aroud some radio buttons on the settings page.
83
+ * Introduced a limit to how many unique menu URLs can be remembered by the "highlight new menu items" feature. Previously, when this feature was enabled, the plugin would record each "seen" menu item, which could cause the associated database entry to grow endlessly. Now the plugin will remember up to 700 items per user.
84
+ * Tested with WordPress 6.0 (release candidate) and 6.1-alpha.
85
+
86
  = 1.10.1 =
87
  * Fixed the `[ame-user-info]` shortcode not working in login redirects. It would always output "(No user)" instead of the actual user data.
88
  * Fixed a warning caused by a conflict with plugins and themes that call the "login_redirect" filter with only 1 parameter instead of the expected 3.
tsconfig.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "module": "none",
4
+ "target": "es5",
5
+ "sourceMap": true
6
+ },
7
+ "exclude": []
8
+ }