Nested Pages - Version 1.6.6

Version Description

  • Important security update: XSS vulnerability fix
Download this release

Release Info

Developer kylephillips
Plugin Icon 128x128 Nested Pages
Version 1.6.6
Comparing to
See all releases

Code changes from version 1.6.5.2 to 1.6.6

app/Entities/AdminMenu/AdminSubmenuExpander.php CHANGED
@@ -51,7 +51,7 @@ class AdminSubmenuExpander
51
  {
52
  $name = ( $type->name == 'page' ) ? '' : '-' . $type->name;
53
  if ( ($this->page->id == $type->name) && ($this->page->action == 'add') ){
54
- echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages' . $name . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages' . $name . ' a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages ul li:nth-child(3)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
55
  }
56
  }
57
 
@@ -70,8 +70,8 @@ class AdminSubmenuExpander
70
  */
71
  private function topLevelPostType($type)
72
  {
73
- if ( $this->page->id == 'toplevel_page_nestedpages-' . $type->name ){
74
- echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages-' . $type->name . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages-' . $type->name . ' a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages-' . $type->name . ' ul li:nth-child(2)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
75
  }
76
  }
77
 
@@ -81,7 +81,7 @@ class AdminSubmenuExpander
81
  private function defaultLink($type)
82
  {
83
  if ( $this->page->id == 'edit-' . $type->name ){
84
- echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages-' . $type->name . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages-' . $type->name . ' a:first").addClass("wp-has-current-submenu");});</script>';
85
  }
86
  }
87
 
51
  {
52
  $name = ( $type->name == 'page' ) ? '' : '-' . $type->name;
53
  if ( ($this->page->id == $type->name) && ($this->page->action == 'add') ){
54
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages' . esc_html($name) . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages' . esc_html($name) . ' a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages ul li:nth-child(3)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
55
  }
56
  }
57
 
70
  */
71
  private function topLevelPostType($type)
72
  {
73
+ if ( $this->page->id == 'toplevel_page_nestedpages-' . esc_attr( $type->name ) ){
74
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages-' . esc_attr( $type->name ) . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages-' . esc_attr( $type->name ) . ' a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages-' . esc_attr( $type->name ) . ' ul li:nth-child(2)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
75
  }
76
  }
77
 
81
  private function defaultLink($type)
82
  {
83
  if ( $this->page->id == 'edit-' . $type->name ){
84
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages-' . esc_attr( $type->name ) . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages-' . esc_attr( $type->name ) . ' a:first").addClass("wp-has-current-submenu");});</script>';
85
  }
86
  }
87
 
app/Entities/Confirmation/TrashConfirmation.php CHANGED
@@ -27,12 +27,12 @@ class TrashConfirmation implements ConfirmationInterface
27
  $post_type = get_post_type($trashed[0]);
28
  $post_type_object = get_post_type_object($post_type);
29
  $out .= ( count($trashed) > 1 )
30
- ? count($trashed) . ' ' . $post_type_object->labels->name . ' ' . __('moved to the Trash.', 'nestedpages')
31
  : '<strong>' . get_the_title($trashed[0]) . ' </strong>' . __('moved to the Trash.', 'nestedpages');
32
  // Undo Link
33
  if ( current_user_can('delete_pages') ) {
34
  $ids = preg_replace( '/[^0-9,]/', '', $_GET['ids'] );
35
- $out .= ' <a href="' . wp_nonce_url( admin_url( 'edit.php?&post_type=' . $post_type . '&amp;doaction=undo'. '&amp;action=untrash&amp;ids=' . $ids ), 'bulk-posts') . '">' . __( 'Undo' ) . "</a>";
36
  }
37
  endif;
38
 
27
  $post_type = get_post_type($trashed[0]);
28
  $post_type_object = get_post_type_object($post_type);
29
  $out .= ( count($trashed) > 1 )
30
+ ? count($trashed) . ' ' . esc_html($post_type_object->labels->name) . ' ' . __('moved to the Trash.', 'nestedpages')
31
  : '<strong>' . get_the_title($trashed[0]) . ' </strong>' . __('moved to the Trash.', 'nestedpages');
32
  // Undo Link
33
  if ( current_user_can('delete_pages') ) {
34
  $ids = preg_replace( '/[^0-9,]/', '', $_GET['ids'] );
35
+ $out .= ' <a href="' . wp_nonce_url( admin_url( 'edit.php?&post_type=' . esc_attr($post_type) . '&amp;doaction=undo'. '&amp;action=untrash&amp;ids=' . esc_attr($ids) ), 'bulk-posts') . '">' . __( 'Undo' ) . "</a>";
36
  }
37
  endif;
38
 
app/Entities/Listing/Listing.php CHANGED
@@ -328,10 +328,10 @@ class Listing
328
 
329
  if ( $this->post->status !== 'trash' ) :
330
 
331
- echo '<li id="menuItem_' . $this->post->id . '" class="page-row';
332
 
333
  // Post Type
334
- echo ' post-type-' . $this->post->post_type;
335
 
336
  // Published?
337
  if ( $this->post->status == 'publish' ) echo ' published';
328
 
329
  if ( $this->post->status !== 'trash' ) :
330
 
331
+ echo '<li id="menuItem_' . esc_attr($this->post->id) . '" class="page-row';
332
 
333
  // Post Type
334
+ echo ' post-type-' . esc_attr($this->post->post_type);
335
 
336
  // Published?
337
  if ( $this->post->status == 'publish' ) echo ' published';
app/Entities/NavMenu/NavMenuRepository.php CHANGED
@@ -43,7 +43,7 @@ class NavMenuRepository
43
  $term_relationships_table = $prefix . 'term_relationships';
44
  $term_taxonomy_table = $prefix . 'term_taxonomy';
45
  $terms_table = $prefix . 'terms';
46
- $sql = "SELECT
47
  pm.post_id,
48
  t.term_id,
49
  t.name,
@@ -57,8 +57,8 @@ class NavMenuRepository
57
  ON t.term_id = tt.term_id
58
  LEFT JOIN $meta_table AS pmx
59
  ON pmx.post_id = pm.post_id AND pmx.meta_key = '_menu_item_xfn'
60
- WHERE pm.meta_value = $id AND pm.meta_key = '_menu_item_object_id'
61
- ";
62
  $results = $wpdb->get_results($sql);
63
  foreach($results as $result){
64
  if ( $result->term_id == $menu_id && $result->xfn_type == 'page' ) $post_id = $result->post_id;
@@ -72,7 +72,7 @@ class NavMenuRepository
72
  global $wpdb;
73
  $prefix = $wpdb->prefix;
74
  $meta_table = $prefix . 'postmeta';
75
- $sql = "SELECT post_id FROM `$meta_table` WHERE meta_value = $id AND meta_key = '_menu_item_xfn'";
76
  $post_id = $wpdb->get_var($sql);
77
 
78
  $wpdb = $original_wpdb;
43
  $term_relationships_table = $prefix . 'term_relationships';
44
  $term_taxonomy_table = $prefix . 'term_taxonomy';
45
  $terms_table = $prefix . 'terms';
46
+ $sql = $wpdb->prepare("SELECT
47
  pm.post_id,
48
  t.term_id,
49
  t.name,
57
  ON t.term_id = tt.term_id
58
  LEFT JOIN $meta_table AS pmx
59
  ON pmx.post_id = pm.post_id AND pmx.meta_key = '_menu_item_xfn'
60
+ WHERE pm.meta_value = %d AND pm.meta_key = '_menu_item_object_id'
61
+ ", $id);
62
  $results = $wpdb->get_results($sql);
63
  foreach($results as $result){
64
  if ( $result->term_id == $menu_id && $result->xfn_type == 'page' ) $post_id = $result->post_id;
72
  global $wpdb;
73
  $prefix = $wpdb->prefix;
74
  $meta_table = $prefix . 'postmeta';
75
+ $sql = $wpdb->prepare("SELECT post_id FROM `$meta_table` WHERE meta_value = %d AND meta_key = '_menu_item_xfn'", $id);
76
  $post_id = $wpdb->get_var($sql);
77
 
78
  $wpdb = $original_wpdb;
app/Entities/NavMenu/NavMenuSyncMenu.php CHANGED
@@ -139,7 +139,7 @@ class NavMenuSyncMenu extends NavMenuSync
139
  'titleAttribute' => $item->attr_title
140
  );
141
  $post_id = $this->post_update_repo->saveRedirect($post_data);
142
- update_post_meta($item->ID, '_menu_item_xfn', $post_id);
143
  }
144
 
145
  /**
139
  'titleAttribute' => $item->attr_title
140
  );
141
  $post_id = $this->post_update_repo->saveRedirect($post_data);
142
+ update_post_meta($item->ID, '_menu_item_xfn', absint($post_id));
143
  }
144
 
145
  /**
app/NestedPages.php CHANGED
@@ -12,7 +12,7 @@ class NestedPages
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
- $np_version = '1.6.5.2';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  // if ( !is_admin() ) $app = new NestedPages\FrontEndBootstrap;
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
+ $np_version = '1.6.6';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  // if ( !is_admin() ) $app = new NestedPages\FrontEndBootstrap;
app/Redirects.php CHANGED
@@ -32,7 +32,7 @@ class Redirects
32
  'page' => 'nestedpages',
33
  'trashed' => true
34
  );
35
- if ( isset($_GET['ids']) ) $query_args['ids'] = $_GET['ids'];
36
  $redirect = add_query_arg(array('page'=>'nestedpages', 'trashed' => true ));
37
  wp_redirect($redirect);
38
  exit();
@@ -52,7 +52,7 @@ class Redirects
52
  (!isset($_GET['bulk'])) &&
53
  $this->arePagesNested()
54
  ){
55
- $redirect = add_query_arg(array('page'=>'nestedpages', 'untrashed' => true, 'untrashed' => $_GET['untrashed'] ));
56
  wp_redirect($redirect);
57
  exit();
58
  }
32
  'page' => 'nestedpages',
33
  'trashed' => true
34
  );
35
+ if ( isset($_GET['ids']) ) $query_args['ids'] = urlencode($_GET['ids']);
36
  $redirect = add_query_arg(array('page'=>'nestedpages', 'trashed' => true ));
37
  wp_redirect($redirect);
38
  exit();
52
  (!isset($_GET['bulk'])) &&
53
  $this->arePagesNested()
54
  ){
55
+ $redirect = add_query_arg(array('page'=>'nestedpages', 'untrashed' => true, 'untrashed' => urlencode($_GET['untrashed']) ));
56
  wp_redirect($redirect);
57
  exit();
58
  }
app/RedirectsFrontEnd.php CHANGED
@@ -51,14 +51,14 @@ class RedirectsFrontEnd
51
  $parent_slug = substr($parent_slug, 0, -5);
52
  }
53
  $parent_args = array(
54
- 'name' => $parent_slug,
55
  'posts_per_page' => 1
56
  );
57
  $parent_args['post_type'] = ( $redirect ) ? 'np-redirect' : 'any';
58
  $parent_post = get_posts($parent_args);
59
 
60
  $page_args = array(
61
- 'name' => $slug,
62
  'post_type' => 'any',
63
  'posts_per_page' => 1
64
  );
51
  $parent_slug = substr($parent_slug, 0, -5);
52
  }
53
  $parent_args = array(
54
+ 'name' => sanitize_text_field($parent_slug),
55
  'posts_per_page' => 1
56
  );
57
  $parent_args['post_type'] = ( $redirect ) ? 'np-redirect' : 'any';
58
  $parent_post = get_posts($parent_args);
59
 
60
  $page_args = array(
61
+ 'name' => sanitize_text_field($slug),
62
  'post_type' => 'any',
63
  'posts_per_page' => 1
64
  );
app/Views/forms/clone-form.php CHANGED
@@ -16,7 +16,7 @@
16
  <option value="1" selected="">1</option>
17
  <?php
18
  for ( $i = 2; $i < 11; $i++ ){
19
- echo '<option value="' . $i . '">' . $i . '</option>';
20
  }
21
  ?>
22
  </select>
16
  <option value="1" selected="">1</option>
17
  <?php
18
  for ( $i = 2; $i < 11; $i++ ){
19
+ echo '<option value="' . absint($i) . '">' . absint($i) . '</option>';
20
  }
21
  ?>
22
  </select>
app/Views/forms/empty-trash-modal.php CHANGED
@@ -10,7 +10,7 @@
10
  <p>Are you sure you would like to empty the trash? This action is not reversable.</p>
11
  <a href="#" class="np-cancel-trash button modal-close" data-dismiss="modal"><?php _e('Cancel', 'nestedpages'); ?></a>
12
  <a href="#" class="np-trash-confirm button-primary"><?php _e('Empty Trash', 'nestedpages'); ?></a>
13
- <input type="hidden" id="np-trash-posttype" value="<?php echo $this->post_type->name; ?>">
14
  </div>
15
  </div><!-- /.modal-content -->
16
  </div><!-- /.modal-dialog -->
10
  <p>Are you sure you would like to empty the trash? This action is not reversable.</p>
11
  <a href="#" class="np-cancel-trash button modal-close" data-dismiss="modal"><?php _e('Cancel', 'nestedpages'); ?></a>
12
  <a href="#" class="np-trash-confirm button-primary"><?php _e('Empty Trash', 'nestedpages'); ?></a>
13
+ <input type="hidden" id="np-trash-posttype" value="<?php echo esc_attr($this->post_type->name); ?>">
14
  </div>
15
  </div><!-- /.modal-content -->
16
  </div><!-- /.modal-dialog -->
app/Views/forms/link-form.php CHANGED
@@ -22,11 +22,11 @@ $can_publish = current_user_can( $post_type_object->cap->publish_posts );
22
  foreach ( $this->listing_repo->postTypes() as $name => $type ) {
23
  $recent_posts = $this->listing_repo->recentPosts($name);
24
  if ( !$recent_posts ) continue;
25
- $out = '<li><a href="#" data-np-menu-accordion-item>' . $type->labels->name . '</a>';
26
  $out .= '<ul>';
27
- $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="post_type" data-search-object="' . $name . '" placeholder="' . __('Search', 'nestedpages') . ' ' . $type->labels->name . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'nestedpages') . '</div></li>';
28
  foreach ( $recent_posts as $post ){
29
- $out .= '<li data-default-result><a href="#" data-np-menu-object="' . $name . '" data-np-menu-type="post_type" data-np-menu-objectid="' . $post->ID . '" data-np-permalink="' . get_the_permalink($post->ID) . '" data-np-object-name="' . $type->labels->singular_name . '" data-np-menu-selection>' . $post->post_title . '</a></li>';
30
  }
31
  $out .= '</ul>';
32
  $out .= '</li>';
@@ -39,11 +39,11 @@ $can_publish = current_user_can( $post_type_object->cap->publish_posts );
39
  foreach ( $this->listing_repo->taxonomies() as $name => $taxonomy ) {
40
  $terms = $this->listing_repo->terms($name);
41
  if ( !$terms ) continue;
42
- $out = '<li><a href="#" data-np-menu-accordion-item>' . $taxonomy->labels->name . '</a>';
43
  $out .= '<ul>';
44
- $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="taxonomy" data-search-object="' . $name . '" placeholder="' . __('Search', 'nestedpages') . ' ' . $taxonomy->labels->name . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'nestedpages') . '</div></li>';
45
  foreach ( $terms as $term ){
46
- $out .= '<li data-default-result><a href="#" data-np-menu-object="' . $name . '" data-np-menu-type="taxonomy" data-np-menu-objectid="' . $term->term_id . '" data-np-permalink="' . get_term_link($term) . '" data-np-object-name="' . $taxonomy->labels->name . '" data-np-menu-selection>' . $term->name . '</a></li>';
47
  }
48
  $out .= '</ul>';
49
  $out .= '</li>';
22
  foreach ( $this->listing_repo->postTypes() as $name => $type ) {
23
  $recent_posts = $this->listing_repo->recentPosts($name);
24
  if ( !$recent_posts ) continue;
25
+ $out = '<li><a href="#" data-np-menu-accordion-item>' . esc_html($type->labels->name) . '</a>';
26
  $out .= '<ul>';
27
+ $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="post_type" data-search-object="' . esc_attr($name) . '" placeholder="' . __('Search', 'nestedpages') . ' ' . esc_attr($type->labels->name) . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'nestedpages') . '</div></li>';
28
  foreach ( $recent_posts as $post ){
29
+ $out .= '<li data-default-result><a href="#" data-np-menu-object="' . esc_attr($name) . '" data-np-menu-type="post_type" data-np-menu-objectid="' . esc_attr($post->ID) . '" data-np-permalink="' . get_the_permalink($post->ID) . '" data-np-object-name="' . esc_attr($type->labels->singular_name) . '" data-np-menu-selection>' . esc_html($post->post_title) . '</a></li>';
30
  }
31
  $out .= '</ul>';
32
  $out .= '</li>';
39
  foreach ( $this->listing_repo->taxonomies() as $name => $taxonomy ) {
40
  $terms = $this->listing_repo->terms($name);
41
  if ( !$terms ) continue;
42
+ $out = '<li><a href="#" data-np-menu-accordion-item>' . esc_html($taxonomy->labels->name) . '</a>';
43
  $out .= '<ul>';
44
+ $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="taxonomy" data-search-object="' . esc_attr($name) . '" placeholder="' . __('Search', 'nestedpages') . ' ' . esc_attr($taxonomy->labels->name) . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'nestedpages') . '</div></li>';
45
  foreach ( $terms as $term ){
46
+ $out .= '<li data-default-result><a href="#" data-np-menu-object="' . esc_attr($name) . '" data-np-menu-type="taxonomy" data-np-menu-objectid="' . esc_attr($term->term_id) . '" data-np-permalink="' . esc_attr(get_term_link($term)) . '" data-np-object-name="' . esc_attr($taxonomy->labels->name) . '" data-np-menu-selection>' . esc_html($term->name) . '</a></li>';
47
  }
48
  $out .= '</ul>';
49
  $out .= '</li>';
app/Views/listing.php CHANGED
@@ -1,56 +1,51 @@
1
  <div class="wrap nestedpages">
2
- <?php
3
- // var_dump($this->post_type);
4
- // $post_type = strtolower($this->post_type->name) . 's';
5
- // $columns = apply_filters( "manage_{$post_type}_columns", array() );
6
- // var_dump($columns);?>
7
  <h2 class="nestedpages-listing-title">
8
- <?php _e($this->post_type->labels->name); ?>
9
 
10
  <a href="<?php echo $this->post_type_repo->addNewPostLink($this->post_type->name); ?>" class="add-new-h2">
11
- <?php _e($this->post_type->labels->add_new); ?>
12
  </a>
13
 
14
  <?php if ( current_user_can('publish_pages') && !$this->isSearch() ) : ?>
15
  <a href="#" class="add-new-h2 open-bulk-modal" title="<?php _e('Add Multiple', 'nestedpages'); ?>" data-parentid="0">
16
- <?php _e('Add Multiple', 'nestedpages'); ?>
17
  </a>
18
  <?php endif; ?>
19
 
20
  <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' && !$this->isSearch() && !$this->settings->menusDisabled() ) : ?>
21
  <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'nestedpages'); ?>" data-parentid="0">
22
- <?php _e('Add Link', 'nestedpages'); ?>
23
  </a>
24
  <?php endif; ?>
25
 
26
  </h2>
27
 
28
  <?php if ( $this->confirmation->getMessage() ) : ?>
29
- <div id="message" class="updated notice is-dismissible"><p><?php echo $this->confirmation->getMessage(); ?></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>
30
  <?php endif; ?>
31
 
32
- <div data-nestedpages-error class="updated error notice is-dismissible" style="display:none;"><p></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>
33
 
34
  <div class="nestedpages-top-toggles">
35
  <?php if ( $this->post_type->hierarchical && !$this->isSearch() ) : ?>
36
- <a href="#" class="np-btn nestedpages-toggleall" data-toggle="closed"><?php _e('Expand All', 'nestedpages'); ?></a>
37
  <?php endif; ?>
38
 
39
  <?php if ( $this->user->canSortPages() && !$this->isSearch() && !$this->isFiltered() ) : ?>
40
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
41
 
42
  <?php if ( $this->settings->autoPageOrderDisabled() ) : ?>
43
- <a href="#" class="np-btn" data-np-manual-order-sync><?php echo __('Sync', 'nestedpages') . ' ' . $this->post_type->labels->singular_name . ' ' . __('Order', 'nestedpages'); ?></a>
44
  <?php endif; ?>
45
 
46
  <?php if ( $this->post_type->name == 'page' && !$this->settings->hideMenuSync() && !$this->settings->menusDisabled() ) : ?>
47
 
48
  <?php if ( !$this->settings->autoMenuDisabled() ) : ?>
49
  <label>
50
- <input type="checkbox" name="np_sync_menu" class="np-sync-menu" value="sync" <?php if ( get_option('nestedpages_menusync') == 'sync' ) echo 'checked'; ?>/> <?php _e('Sync Menu', 'nestedpages'); ?>
51
  </label>
52
  <?php else : ?>
53
- <a href="#" class="np-btn" data-np-manual-menu-sync><?php _e('Sync Menu', 'nestedpages'); ?></a>
54
  <?php endif; ?>
55
 
56
  <?php endif; ?>
1
  <div class="wrap nestedpages">
 
 
 
 
 
2
  <h2 class="nestedpages-listing-title">
3
+ <?php esc_html_e($this->post_type->labels->name); ?>
4
 
5
  <a href="<?php echo $this->post_type_repo->addNewPostLink($this->post_type->name); ?>" class="add-new-h2">
6
+ <?php esc_html_e($this->post_type->labels->add_new); ?>
7
  </a>
8
 
9
  <?php if ( current_user_can('publish_pages') && !$this->isSearch() ) : ?>
10
  <a href="#" class="add-new-h2 open-bulk-modal" title="<?php _e('Add Multiple', 'nestedpages'); ?>" data-parentid="0">
11
+ <?php esc_html_e('Add Multiple', 'nestedpages'); ?>
12
  </a>
13
  <?php endif; ?>
14
 
15
  <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' && !$this->isSearch() && !$this->settings->menusDisabled() ) : ?>
16
  <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'nestedpages'); ?>" data-parentid="0">
17
+ <?php esc_html_e('Add Link', 'nestedpages'); ?>
18
  </a>
19
  <?php endif; ?>
20
 
21
  </h2>
22
 
23
  <?php if ( $this->confirmation->getMessage() ) : ?>
24
+ <div id="message" class="updated notice is-dismissible"><p><?php echo $this->confirmation->getMessage(); ?></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div>
25
  <?php endif; ?>
26
 
27
+ <div data-nestedpages-error class="updated error notice is-dismissible" style="display:none;"><p></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div>
28
 
29
  <div class="nestedpages-top-toggles">
30
  <?php if ( $this->post_type->hierarchical && !$this->isSearch() ) : ?>
31
+ <a href="#" class="np-btn nestedpages-toggleall" data-toggle="closed"><?php esc_html_e('Expand All', 'nestedpages'); ?></a>
32
  <?php endif; ?>
33
 
34
  <?php if ( $this->user->canSortPages() && !$this->isSearch() && !$this->isFiltered() ) : ?>
35
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
36
 
37
  <?php if ( $this->settings->autoPageOrderDisabled() ) : ?>
38
+ <a href="#" class="np-btn" data-np-manual-order-sync><?php echo __('Sync', 'nestedpages') . ' ' . esc_html($this->post_type->labels->singular_name) . ' ' . __('Order', 'nestedpages'); ?></a>
39
  <?php endif; ?>
40
 
41
  <?php if ( $this->post_type->name == 'page' && !$this->settings->hideMenuSync() && !$this->settings->menusDisabled() ) : ?>
42
 
43
  <?php if ( !$this->settings->autoMenuDisabled() ) : ?>
44
  <label>
45
+ <input type="checkbox" name="np_sync_menu" class="np-sync-menu" value="sync" <?php if ( get_option('nestedpages_menusync') == 'sync' ) echo 'checked'; ?>/> <?php esc_html_e('Sync Menu', 'nestedpages'); ?>
46
  </label>
47
  <?php else : ?>
48
+ <a href="#" class="np-btn" data-np-manual-menu-sync><?php esc_html_e('Sync Menu', 'nestedpages'); ?></a>
49
  <?php endif; ?>
50
 
51
  <?php endif; ?>
app/Views/partials/row-link.php CHANGED
@@ -50,21 +50,21 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
50
 
51
  <a href="#"
52
  class="np-btn np-quick-edit-redirect"
53
- data-id="<?php echo $this->post->id; ?>"
54
- data-parentid="<?php echo $this->post->parent_id; ?>"
55
- data-title="<?php echo $this->post->title; ?>"
56
- data-url="<?php echo NestedPages\Helpers::check_url($this->post->content); ?>"
57
- data-status="<?php echo $this->post->status; ?>"
58
- data-np-status="<?php echo $this->post->np_status; ?>"
59
- data-navstatus="<?php echo $this->post->nav_status; ?>"
60
- data-navtitleattr="<?php echo $this->post->nav_title_attr; ?>"
61
- data-navcss="<?php echo $this->post->nav_css; ?>"
62
- data-nav-type="<?php echo $this->post->nav_type; ?>"
63
- data-nav-object="<?php echo $this->post->nav_object; ?>"
64
- data-nav-object-id="<?php echo $this->post->nav_object_id; ?>"
65
- data-nav-original-link="<?php echo $this->post->nav_original_link; ?>"
66
- data-nav-original-title="<?php echo $this->post->nav_original_title; ?>"
67
- data-linktarget="<?php echo $this->post->link_target; ?>">
68
  <?php _e('Quick Edit'); ?>
69
  </a>
70
 
@@ -84,7 +84,7 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
84
 
85
  if ( $thumbnail_source ) :
86
  if ( has_post_thumbnail($this->post->nav_object_id) && $this->post->nav_type != 'taxonomy' ) :
87
- $out = '<div class="np-thumbnail ' . $thumbnail_size . '">';
88
  $image = get_the_post_thumbnail($this->post->nav_object_id, $thumbnail_source);
89
  $out .= apply_filters('nestedpages_thumbnail', $image, $this->post);
90
  else :
@@ -93,7 +93,7 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
93
  if ( $this->post->nav_type == 'taxonomy' ) $fallback_icon = 'np-icon-tag';
94
  if ( $this->post->nav_object == 'post' ) $fallback_icon = 'np-icon-post';
95
  if ( $this->post->nav_object == 'page' ) $fallback_icon = 'np-icon-page';
96
- $image_fallback = '<i class="' . $fallback_icon . '" /></i>';
97
  $image_fallback = apply_filters('nestedpages_thumbnail_fallback', $image_fallback, $this->post);
98
  if ( $image_fallback ) :
99
  $out .= $image_fallback;
@@ -105,6 +105,6 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
105
  ?>
106
 
107
  <div class="np-bulk-checkbox">
108
- <input type="checkbox" name="nestedpages_bulk[]" value="<?php echo $this->post->id; ?>" data-np-bulk-checkbox="<?php echo $this->post->title; ?>" class="np-redirect-bulk" data-np-post-type="<?php echo $this->post->post_type; ?>" />
109
  </div>
110
  </div><!-- .row -->
50
 
51
  <a href="#"
52
  class="np-btn np-quick-edit-redirect"
53
+ data-id="<?php echo esc_attr($this->post->id); ?>"
54
+ data-parentid="<?php echo esc_attr($this->post->parent_id); ?>"
55
+ data-title="<?php echo esc_attr($this->post->title); ?>"
56
+ data-url="<?php echo esc_attr(NestedPages\Helpers::check_url($this->post->content)); ?>"
57
+ data-status="<?php echo esc_attr($this->post->status); ?>"
58
+ data-np-status="<?php echo esc_attr($this->post->np_status); ?>"
59
+ data-navstatus="<?php echo esc_attr($this->post->nav_status); ?>"
60
+ data-navtitleattr="<?php echo esc_attr($this->post->nav_title_attr); ?>"
61
+ data-navcss="<?php echo esc_attr($this->post->nav_css); ?>"
62
+ data-nav-type="<?php echo esc_attr($this->post->nav_type); ?>"
63
+ data-nav-object="<?php echo esc_attr($this->post->nav_object); ?>"
64
+ data-nav-object-id="<?php echo esc_attr($this->post->nav_object_id); ?>"
65
+ data-nav-original-link="<?php echo esc_attr($this->post->nav_original_link); ?>"
66
+ data-nav-original-title="<?php echo esc_attr($this->post->nav_original_title); ?>"
67
+ data-linktarget="<?php echo esc_attr($this->post->link_target); ?>">
68
  <?php _e('Quick Edit'); ?>
69
  </a>
70
 
84
 
85
  if ( $thumbnail_source ) :
86
  if ( has_post_thumbnail($this->post->nav_object_id) && $this->post->nav_type != 'taxonomy' ) :
87
+ $out = '<div class="np-thumbnail ' . esc_attr($thumbnail_size) . '">';
88
  $image = get_the_post_thumbnail($this->post->nav_object_id, $thumbnail_source);
89
  $out .= apply_filters('nestedpages_thumbnail', $image, $this->post);
90
  else :
93
  if ( $this->post->nav_type == 'taxonomy' ) $fallback_icon = 'np-icon-tag';
94
  if ( $this->post->nav_object == 'post' ) $fallback_icon = 'np-icon-post';
95
  if ( $this->post->nav_object == 'page' ) $fallback_icon = 'np-icon-page';
96
+ $image_fallback = '<i class="' . esc_attr($fallback_icon) . '" /></i>';
97
  $image_fallback = apply_filters('nestedpages_thumbnail_fallback', $image_fallback, $this->post);
98
  if ( $image_fallback ) :
99
  $out .= $image_fallback;
105
  ?>
106
 
107
  <div class="np-bulk-checkbox">
108
+ <input type="checkbox" name="nestedpages_bulk[]" value="<?php echo esc_attr($this->post->id); ?>" data-np-bulk-checkbox="<?php echo esc_attr($this->post->title); ?>" class="np-redirect-bulk" data-np-post-type="<?php echo esc_attr($this->post->post_type); ?>" />
109
  </div>
110
  </div><!-- .row -->
app/Views/partials/row.php CHANGED
@@ -53,7 +53,7 @@ if ( $this->isSearch() ) $row_classes .= ' search';
53
  // Post Lock
54
  if ( $user = wp_check_post_lock($this->post->id) ){
55
  $u = get_userdata($user);
56
- echo '<span class="locked"><i class="np-icon-lock"></i><em> ' . $u->display_name . ' ' . __('currently editing', 'nestedpages') . '</em></span>';
57
  } elseif ( !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ){
58
  echo '<span class="locked"><i class="np-icon-lock"></i></span>';
59
  } else {
@@ -77,7 +77,7 @@ if ( $this->isSearch() ) $row_classes .= ' search';
77
 
78
  <?php
79
  if ( $this->integrations->plugins->yoast->installed ){
80
- echo '<span class="np-seo-indicator ' . $this->post->score . '"></span>';
81
  }
82
  ?>
83
 
@@ -110,27 +110,27 @@ if ( $this->isSearch() ) $row_classes .= ' search';
110
  <?php if ( !$user = wp_check_post_lock($this->post->id) || !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?>
111
  <a href="#"
112
  class="np-btn np-quick-edit"
113
- data-id="<?php echo $this->post->id; ?>"
114
- data-template="<?php echo $this->post->template; ?>"
115
- data-title="<?php echo $this->post->title; ?>"
116
- data-slug="<?php echo urldecode($post->post_name); ?>"
117
- data-commentstatus="<?php echo $cs; ?>"
118
- data-status="<?php echo $this->post->status; ?>"
119
- data-np-status="<?php echo $this->post->np_status; ?>"
120
- data-navstatus="<?php echo $this->post->nav_status; ?>"
121
- data-navtitleattr="<?php echo $this->post->nav_title_attr; ?>"
122
- data-navcss="<?php echo $this->post->nav_css; ?>"
123
- data-linktarget="<?php echo $this->post->link_target; ?>"
124
- data-navtitle="<?php echo $this->post->nav_title; ?>"
125
- data-author="<?php echo $post->post_author; ?>"
126
  <?php if ( current_user_can('publish_pages') ) : ?>
127
- data-password="<?php echo $post->post_password; ?>"
128
  <?php endif; ?>
129
- data-month="<?php echo $this->post->date->month; ?>"
130
- data-day="<?php echo $this->post->date->d; ?>"
131
- data-year="<?php echo $this->post->date->y; ?>"
132
- data-hour="<?php echo $this->post->date->h; ?>"
133
- data-minute="<?php echo $this->post->date->m;?>"
134
  data-datepicker="<?php echo date_i18n('n/j/Y', $this->post->date->datepicker); ?>"
135
  data-time="<?php echo date_i18n('H:i', $this->post->date->datepicker); ?>"
136
  data-formattedtime="<?php echo date_i18n('g:i', $this->post->date->datepicker); ?>"
@@ -175,6 +175,6 @@ if ( $this->isSearch() ) $row_classes .= ' search';
175
  ?>
176
 
177
  <div class="np-bulk-checkbox">
178
- <input type="checkbox" name="nestedpages_bulk[]" value="<?php echo $this->post->id; ?>" data-np-bulk-checkbox="<?php echo $this->post->title; ?>" data-np-post-type="<?php echo $this->post->post_type; ?>" />
179
  </div>
180
  </div><!-- .row -->
53
  // Post Lock
54
  if ( $user = wp_check_post_lock($this->post->id) ){
55
  $u = get_userdata($user);
56
+ echo '<span class="locked"><i class="np-icon-lock"></i><em> ' . esc_html($u->display_name) . ' ' . __('currently editing', 'nestedpages') . '</em></span>';
57
  } elseif ( !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ){
58
  echo '<span class="locked"><i class="np-icon-lock"></i></span>';
59
  } else {
77
 
78
  <?php
79
  if ( $this->integrations->plugins->yoast->installed ){
80
+ echo '<span class="np-seo-indicator ' . esc_html($this->post->score) . '"></span>';
81
  }
82
  ?>
83
 
110
  <?php if ( !$user = wp_check_post_lock($this->post->id) || !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?>
111
  <a href="#"
112
  class="np-btn np-quick-edit"
113
+ data-id="<?php echo esc_attr($this->post->id); ?>"
114
+ data-template="<?php echo esc_attr($this->post->template); ?>"
115
+ data-title="<?php echo esc_attr($this->post->title); ?>"
116
+ data-slug="<?php echo esc_attr(urldecode($post->post_name)); ?>"
117
+ data-commentstatus="<?php echo esc_attr($cs); ?>"
118
+ data-status="<?php echo esc_attr($this->post->status); ?>"
119
+ data-np-status="<?php echo esc_attr($this->post->np_status); ?>"
120
+ data-navstatus="<?php echo esc_attr($this->post->nav_status); ?>"
121
+ data-navtitleattr="<?php echo esc_attr($this->post->nav_title_attr); ?>"
122
+ data-navcss="<?php echo esc_attr($this->post->nav_css); ?>"
123
+ data-linktarget="<?php echo esc_attr($this->post->link_target); ?>"
124
+ data-navtitle="<?php echo esc_attr($this->post->nav_title); ?>"
125
+ data-author="<?php echo esc_attr($post->post_author); ?>"
126
  <?php if ( current_user_can('publish_pages') ) : ?>
127
+ data-password="<?php echo esc_attr($post->post_password); ?>"
128
  <?php endif; ?>
129
+ data-month="<?php echo esc_attr($this->post->date->month); ?>"
130
+ data-day="<?php echo esc_attr($this->post->date->d); ?>"
131
+ data-year="<?php echo esc_attr($this->post->date->y); ?>"
132
+ data-hour="<?php echo esc_attr($this->post->date->h); ?>"
133
+ data-minute="<?php echo esc_attr($this->post->date->m);?>"
134
  data-datepicker="<?php echo date_i18n('n/j/Y', $this->post->date->datepicker); ?>"
135
  data-time="<?php echo date_i18n('H:i', $this->post->date->datepicker); ?>"
136
  data-formattedtime="<?php echo date_i18n('g:i', $this->post->date->datepicker); ?>"
175
  ?>
176
 
177
  <div class="np-bulk-checkbox">
178
+ <input type="checkbox" name="nestedpages_bulk[]" value="<?php echo esc_attr($this->post->id); ?>" data-np-bulk-checkbox="<?php echo esc_attr($this->post->title); ?>" data-np-post-type="<?php echo esc_attr($this->post->post_type); ?>" />
179
  </div>
180
  </div><!-- .row -->
app/Views/partials/tool-list.php CHANGED
@@ -20,14 +20,14 @@
20
  <?php else : ?>
21
  <a href="#show" class="np-toggle-hidden"><?php _e('Hide Hidden', 'nestedpages'); ?> </a>
22
  <?php endif; ?>
23
- <span class="count">(<?php echo $this->post_repo->getHiddenCount(array($this->post_type->name)); ?>)</span>
24
  </li>
25
 
26
  <?php if ( current_user_can('delete_pages') && $trashedCount > 0) : ?>
27
  <li class="np-trash-links">
28
  |
29
- <a href="<?php echo $this->post_type_repo->trashLink($this->post_type->name); ?>"><?php _e('Trash'); ?> </a>
30
- <span class="count">(<a href="#" class="np-empty-trash" data-posttype="<?php echo $this->post_type->name; ?>"><?php _e('Empty', 'nestedpages'); ?></a> <?php echo $trashedCount; ?>)</span>
31
  </li>
32
  <?php endif; ?>
33
 
@@ -54,7 +54,7 @@
54
  foreach( $users as $user ){
55
  $out .= '<option value="' . $user->ID . '"';
56
  if ( isset($_GET['author']) && ($_GET['author'] == $user->ID) ) $out .= ' selected';
57
- $out .= '>' . $user->display_name . '</option>';
58
  }
59
  echo $out;
60
  ?>
@@ -72,7 +72,7 @@
72
  foreach ( $options as $key => $option ){
73
  $out .= '<option value="' . $key . '"';
74
  if ( isset($_GET['orderby']) && ($_GET['orderby'] == $key) ) $out .= ' selected';
75
- $out .= '>' . $option . '</option>';
76
  }
77
  echo $out;
78
  ?>
@@ -87,9 +87,9 @@
87
  );
88
  $out = '';
89
  foreach ( $options as $key => $option ){
90
- $out .= '<option value="' . $key . '"';
91
  if ( isset($_GET['order']) && ($_GET['order'] == $key) ) $out .= ' selected';
92
- $out .= '>' . $option . '</option>';
93
  }
94
  echo $out;
95
  ?>
@@ -107,17 +107,17 @@
107
  <div class="np-tools-primary">
108
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
109
  <input type="hidden" name="action" value="npCategoryFilter">
110
- <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
111
  <div class="select first">
112
  <select id="np_category" name="np_category" class="nestedpages-sort">
113
  <?php
114
  $tax = get_taxonomy('category');
115
- $out = '<option value="all">' . __('All ', 'nestedpages') . $tax->labels->name . '</option>';
116
  $terms = get_terms('category');
117
  foreach( $terms as $term ){
118
- $out .= '<option value="' . $term->term_id . '"';
119
  if ( isset($_GET['category']) && ($_GET['category'] == $term->term_id) ) $out .= ' selected';
120
- $out .= '>' . $term->name . '</option>';
121
  }
122
  echo $out;
123
  ?>
@@ -133,11 +133,11 @@
133
  <div class="np-tools-search">
134
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
135
  <input type="hidden" name="action" value="npSearch">
136
- <input type="hidden" name="posttype" value="<?php echo $this->post_type->name; ?>">
137
- <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
138
  <?php wp_nonce_field('nestedpages-nonce', 'nonce'); ?>
139
- <input type="search" name="search_term" id="nestedpages-search" placeholder="<?php echo $this->post_type->labels->search_items; ?>" <?php if ( $this->isSearch() ) echo ' value="' . sanitize_text_field($_GET['search']) . '"'; ?>>
140
- <input type="submit" name="" class="button" value="<?php echo $this->post_type->labels->search_items;?>">
141
  </form>
142
  </div><!-- .np-tools-search -->
143
 
20
  <?php else : ?>
21
  <a href="#show" class="np-toggle-hidden"><?php _e('Hide Hidden', 'nestedpages'); ?> </a>
22
  <?php endif; ?>
23
+ <span class="count">(<?php echo absint($this->post_repo->getHiddenCount(array($this->post_type->name))); ?>)</span>
24
  </li>
25
 
26
  <?php if ( current_user_can('delete_pages') && $trashedCount > 0) : ?>
27
  <li class="np-trash-links">
28
  |
29
+ <a href="<?php echo esc_url($this->post_type_repo->trashLink($this->post_type->name)); ?>"><?php _e('Trash'); ?> </a>
30
+ <span class="count">(<a href="#" class="np-empty-trash" data-posttype="<?php echo esc_attr($this->post_type->name); ?>"><?php _e('Empty', 'nestedpages'); ?></a> <?php echo absint($trashedCount); ?>)</span>
31
  </li>
32
  <?php endif; ?>
33
 
54
  foreach( $users as $user ){
55
  $out .= '<option value="' . $user->ID . '"';
56
  if ( isset($_GET['author']) && ($_GET['author'] == $user->ID) ) $out .= ' selected';
57
+ $out .= '>' . esc_html($user->display_name) . '</option>';
58
  }
59
  echo $out;
60
  ?>
72
  foreach ( $options as $key => $option ){
73
  $out .= '<option value="' . $key . '"';
74
  if ( isset($_GET['orderby']) && ($_GET['orderby'] == $key) ) $out .= ' selected';
75
+ $out .= '>' . esc_html($option) . '</option>';
76
  }
77
  echo $out;
78
  ?>
87
  );
88
  $out = '';
89
  foreach ( $options as $key => $option ){
90
+ $out .= '<option value="' . esc_attr($key) . '"';
91
  if ( isset($_GET['order']) && ($_GET['order'] == $key) ) $out .= ' selected';
92
+ $out .= '>' . esc_html($option) . '</option>';
93
  }
94
  echo $out;
95
  ?>
107
  <div class="np-tools-primary">
108
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
109
  <input type="hidden" name="action" value="npCategoryFilter">
110
+ <input type="hidden" name="page" value="<?php echo esc_url($this->pageURL()); ?>">
111
  <div class="select first">
112
  <select id="np_category" name="np_category" class="nestedpages-sort">
113
  <?php
114
  $tax = get_taxonomy('category');
115
+ $out = '<option value="all">' . __('All ', 'nestedpages') . esc_html($tax->labels->name) . '</option>';
116
  $terms = get_terms('category');
117
  foreach( $terms as $term ){
118
+ $out .= '<option value="' . esc_attr($term->term_id) . '"';
119
  if ( isset($_GET['category']) && ($_GET['category'] == $term->term_id) ) $out .= ' selected';
120
+ $out .= '>' . esc_html($term->name) . '</option>';
121
  }
122
  echo $out;
123
  ?>
133
  <div class="np-tools-search">
134
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
135
  <input type="hidden" name="action" value="npSearch">
136
+ <input type="hidden" name="posttype" value="<?php echo esc_attr($this->post_type->name); ?>">
137
+ <input type="hidden" name="page" value="<?php echo esc_url($this->pageURL()); ?>">
138
  <?php wp_nonce_field('nestedpages-nonce', 'nonce'); ?>
139
+ <input type="search" name="search_term" id="nestedpages-search" placeholder="<?php echo esc_attr($this->post_type->labels->search_items); ?>" <?php if ( $this->isSearch() ) echo ' value="' . esc_url(sanitize_text_field($_GET['search'])) . '"'; ?>>
140
+ <input type="submit" name="" class="button" value="<?php echo esc_attr($this->post_type->labels->search_items);?>">
141
  </form>
142
  </div><!-- .np-tools-search -->
143
 
app/Views/settings/settings-general.php CHANGED
@@ -33,7 +33,7 @@ settings_fields( 'nestedpages-general' );
33
  <p data-menu-enabled-option data-menu-hide-checkbox>
34
  <label>
35
  <input type="checkbox" name="nestedpages_ui[hide_menu_sync]" value="true" <?php if ( $this->settings->hideMenuSync() ) echo 'checked'; ?> />
36
- <?php _e('Hide Menu Sync Checkbox', 'nestedpages'); ?> (<?php echo $sync_status; ?>)
37
  </label>
38
  </p>
39
  <p data-menu-enabled-option data-menu-disable-auto>
@@ -62,7 +62,7 @@ settings_fields( 'nestedpages-general' );
62
  <?php foreach ( $this->user_repo->allRoles() as $role ) : ?>
63
  <label>
64
  <input type="checkbox" name="nestedpages_allowsorting[]" value="<?php echo $role['name']; ?>" <?php if ( in_array($role['name'], $allowsorting) ) echo 'checked'; ?> >
65
- <?php echo $role['label']; ?>
66
  </label>
67
  <br />
68
  <?php endforeach; ?>
33
  <p data-menu-enabled-option data-menu-hide-checkbox>
34
  <label>
35
  <input type="checkbox" name="nestedpages_ui[hide_menu_sync]" value="true" <?php if ( $this->settings->hideMenuSync() ) echo 'checked'; ?> />
36
+ <?php _e('Hide Menu Sync Checkbox', 'nestedpages'); ?> (<?php echo esc_html($sync_status); ?>)
37
  </label>
38
  </p>
39
  <p data-menu-enabled-option data-menu-disable-auto>
62
  <?php foreach ( $this->user_repo->allRoles() as $role ) : ?>
63
  <label>
64
  <input type="checkbox" name="nestedpages_allowsorting[]" value="<?php echo $role['name']; ?>" <?php if ( in_array($role['name'], $allowsorting) ) echo 'checked'; ?> >
65
+ <?php echo esc_html($role['label']); ?>
66
  </label>
67
  <br />
68
  <?php endforeach; ?>
app/Views/settings/settings-posttypes.php CHANGED
@@ -11,11 +11,11 @@ settings_fields( 'nestedpages-posttypes' );
11
  <div class="post-type">
12
  <div class="head">
13
  <div class="checkbox">
14
- <input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>]" value="<?php echo $type->name; ?>" <?php if ( $type->np_enabled ) echo 'checked'; ?> data-nestedpages-pt-checkbox id="post-type-<?php echo $type->name; ?>" />
15
  </div>
16
  <label for="post-type-<?php echo $type->name; ?>">
17
  <?php
18
- echo $type->label;
19
  if ( $type->hierarchical ) echo ' <em>(' . __('Hierarchical', 'nestedpages') . ')</em>';
20
  ?>
21
  </label>
@@ -30,7 +30,7 @@ settings_fields( 'nestedpages-posttypes' );
30
  <?php _e('Replace the default top-level item with the nested view link.', 'nestedpages'); ?></p>
31
  </div>
32
  <div class="field">
33
- <label><input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>][replace_menu]" value="true" <?php if ( $type->replace_menu ) echo 'checked'; ?> /><?php echo __('Replace Default') . ' ' . $type->label . ' ' . __('Menu', 'nestedpages'); ?></label>
34
  </div><!-- .field -->
35
  </div><!-- .row -->
36
  </li>
@@ -41,7 +41,7 @@ settings_fields( 'nestedpages-posttypes' );
41
  <?php _e('If the default menu is replaced, a link to the default view will be added. Select this to remove the link', 'nestedpages'); ?>
42
  </div>
43
  <div class="field">
44
- <label><input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>][hide_default]" value="true" <?php if ( $type->hide_default ) echo 'checked'; ?> /><?php echo __('Hide Default', 'nestedpages') . ' ' . $type->label . ' ' . __('Link', 'nestedpages'); ?></label>
45
  </div>
46
  </div><!-- .row -->
47
  </li>
@@ -53,7 +53,7 @@ settings_fields( 'nestedpages-posttypes' );
53
  <?php _e('To disable nesting on hierarchical post types, select this option.', 'nestedpages'); ?></p>
54
  </div>
55
  <div class="field">
56
- <label><input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>][disable_nesting]" value="true" <?php if ( $type->disable_nesting ) echo 'checked '; ?>/><?php echo __('Disable Nesting for', 'nestedpages') . ' ' . $type->label; ?></label>
57
  </div>
58
  </div><!-- .row -->
59
  </li>
@@ -71,16 +71,16 @@ settings_fields( 'nestedpages-posttypes' );
71
  <?php _e('Note: Thumbnail width is displayed at a maximum of 80px in the nested pages view. The image is scaled proportionally.', 'nestedpages'); ?></p>
72
  </div>
73
  <div class="field">
74
- <label><input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>][thumbnails][display]" value="true" <?php if ( $thumbnails_enabled ) echo 'checked'; ?> data-enable-thumbnails /><?php echo __('Display Thumbnails for', 'nestedpages') . ' ' . $type->label; ?></label>
75
 
76
  <div class="thumbnail-options" data-thumbnail-options <?php if ( !$thumbnails_enabled ) echo 'style="display:none;"'; ?>>
77
  <label><?php _e('Thumbnail Source', 'nestedpages'); ?></label>
78
  <select name="nestedpages_posttypes[<?php echo $type->name; ?>][thumbnails][size]">
79
  <?php
80
  foreach ( $thumbnail_sizes as $size ){
81
- echo '<option value="' . $size . '"';
82
  if ( $size == $thumbnail_source ) echo ' selected';
83
- echo '>' . $size . '</option>';
84
  }
85
  ?>
86
  </select>
@@ -114,10 +114,10 @@ settings_fields( 'nestedpages-posttypes' );
114
  if ( $name != 'taxonomies' ) :
115
  $out .= '<li>';
116
  $out .= '<label>';
117
- $out .= '<input type="checkbox" name="nestedpages_posttypes[' . $type->name . '][standard_fields][standard][' . $name . ']" value="true"';
118
  if ( $name == 'hide_taxonomies' ) $out .= ' data-hide-taxonomies';
119
  if ( $this->post_type_repo->fieldEnabled($type->name, 'standard', $name, 'standard_fields') ) $out .= ' checked';
120
- $out .= ' />' . $label;
121
  $out .= '</label>';
122
  $out .= '</li>';
123
  else : // Taxonomies
@@ -127,9 +127,9 @@ settings_fields( 'nestedpages-posttypes' );
127
  if ( $this->post_type_repo->fieldEnabled($type->name, 'standard', 'hide_taxonomies', 'standard_fields') ) $out .= 'display:none;';
128
  $out .= '">';
129
  $out .= '<label>';
130
- $out .= '<input type="checkbox" name="nestedpages_posttypes[' . $type->name . '][standard_fields][standard][taxonomies][' . $tax_name . ']" value="true"';
131
  if ( $disabled ) $out .= ' checked';
132
- $out .= ' />' . $tax_label;
133
  $out .= '</label>';
134
  $out .= '</li>';
135
  endforeach;
@@ -165,9 +165,9 @@ settings_fields( 'nestedpages-posttypes' );
165
  foreach ($acf_fields as $field){
166
  $out .= '<li>';
167
  $out .= '<label>';
168
- $out .= '<input type="checkbox" name="nestedpages_posttypes[' . $type->name . '][custom_fields][acf][' . $field['key'] . ']" value="' . $field['type'] . '"';
169
  if ( $this->post_type_repo->fieldEnabled($type->name, 'acf', $field['key']) ) $out .= ' checked';
170
- $out .= '/>' . $field['label'] . ' (' . $field['type'] . ')';
171
  $out .= '</label>';
172
  $out .= '</li>';
173
  }
11
  <div class="post-type">
12
  <div class="head">
13
  <div class="checkbox">
14
+ <input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>]" value="<?php echo esc_attr($type->name); ?>" <?php if ( $type->np_enabled ) echo 'checked'; ?> data-nestedpages-pt-checkbox id="post-type-<?php echo esc_attr($type->name); ?>" />
15
  </div>
16
  <label for="post-type-<?php echo $type->name; ?>">
17
  <?php
18
+ echo esc_html($type->label);
19
  if ( $type->hierarchical ) echo ' <em>(' . __('Hierarchical', 'nestedpages') . ')</em>';
20
  ?>
21
  </label>
30
  <?php _e('Replace the default top-level item with the nested view link.', 'nestedpages'); ?></p>
31
  </div>
32
  <div class="field">
33
+ <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][replace_menu]" value="true" <?php if ( $type->replace_menu ) echo 'checked'; ?> /><?php echo __('Replace Default') . ' ' . esc_html($type->label) . ' ' . __('Menu', 'nestedpages'); ?></label>
34
  </div><!-- .field -->
35
  </div><!-- .row -->
36
  </li>
41
  <?php _e('If the default menu is replaced, a link to the default view will be added. Select this to remove the link', 'nestedpages'); ?>
42
  </div>
43
  <div class="field">
44
+ <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][hide_default]" value="true" <?php if ( $type->hide_default ) echo 'checked'; ?> /><?php echo __('Hide Default', 'nestedpages') . ' ' . esc_html($type->label) . ' ' . __('Link', 'nestedpages'); ?></label>
45
  </div>
46
  </div><!-- .row -->
47
  </li>
53
  <?php _e('To disable nesting on hierarchical post types, select this option.', 'nestedpages'); ?></p>
54
  </div>
55
  <div class="field">
56
+ <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][disable_nesting]" value="true" <?php if ( $type->disable_nesting ) echo 'checked '; ?>/><?php echo __('Disable Nesting for', 'nestedpages') . ' ' . esc_html($type->label); ?></label>
57
  </div>
58
  </div><!-- .row -->
59
  </li>
71
  <?php _e('Note: Thumbnail width is displayed at a maximum of 80px in the nested pages view. The image is scaled proportionally.', 'nestedpages'); ?></p>
72
  </div>
73
  <div class="field">
74
+ <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][thumbnails][display]" value="true" <?php if ( $thumbnails_enabled ) echo 'checked'; ?> data-enable-thumbnails /><?php echo __('Display Thumbnails for', 'nestedpages') . ' ' . esc_html($type->label); ?></label>
75
 
76
  <div class="thumbnail-options" data-thumbnail-options <?php if ( !$thumbnails_enabled ) echo 'style="display:none;"'; ?>>
77
  <label><?php _e('Thumbnail Source', 'nestedpages'); ?></label>
78
  <select name="nestedpages_posttypes[<?php echo $type->name; ?>][thumbnails][size]">
79
  <?php
80
  foreach ( $thumbnail_sizes as $size ){
81
+ echo '<option value="' . esc_attr($size) . '"';
82
  if ( $size == $thumbnail_source ) echo ' selected';
83
+ echo '>' . esc_html($size) . '</option>';
84
  }
85
  ?>
86
  </select>
114
  if ( $name != 'taxonomies' ) :
115
  $out .= '<li>';
116
  $out .= '<label>';
117
+ $out .= '<input type="checkbox" name="nestedpages_posttypes[' . esc_attr($type->name) . '][standard_fields][standard][' . esc_attr($name) . ']" value="true"';
118
  if ( $name == 'hide_taxonomies' ) $out .= ' data-hide-taxonomies';
119
  if ( $this->post_type_repo->fieldEnabled($type->name, 'standard', $name, 'standard_fields') ) $out .= ' checked';
120
+ $out .= ' />' . esc_html($label);
121
  $out .= '</label>';
122
  $out .= '</li>';
123
  else : // Taxonomies
127
  if ( $this->post_type_repo->fieldEnabled($type->name, 'standard', 'hide_taxonomies', 'standard_fields') ) $out .= 'display:none;';
128
  $out .= '">';
129
  $out .= '<label>';
130
+ $out .= '<input type="checkbox" name="nestedpages_posttypes[' . esc_attr($type->name) . '][standard_fields][standard][taxonomies][' . esc_attr($tax_name) . ']" value="true"';
131
  if ( $disabled ) $out .= ' checked';
132
+ $out .= ' />' . esc_html($tax_label);
133
  $out .= '</label>';
134
  $out .= '</li>';
135
  endforeach;
165
  foreach ($acf_fields as $field){
166
  $out .= '<li>';
167
  $out .= '<label>';
168
+ $out .= '<input type="checkbox" name="nestedpages_posttypes[' . esc_attr($type)->name . '][custom_fields][acf][' . esc_attr($field['key']) . ']" value="' . esc_attr($field['type']) . '"';
169
  if ( $this->post_type_repo->fieldEnabled($type->name, 'acf', $field['key']) ) $out .= ' checked';
170
+ $out .= '/>' . esc_html($field['label']) . ' (' . esc_html($field['type']) . ')';
171
  $out .= '</label>';
172
  $out .= '</li>';
173
  }
nestedpages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while enhancing quick edit. Includes an auto-generated menu to match the nested interface, support for all post types and more.
6
- Version: 1.6.5.2
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while enhancing quick edit. Includes an auto-generated menu to match the nested interface, support for all post types and more.
6
+ Version: 1.6.6
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
readme.txt CHANGED
@@ -99,6 +99,9 @@ As of version 1.6, yes. Visit Settings > Nested Pages > Post Types to configure
99
 
100
  == Changelog ==
101
 
 
 
 
102
  = 1.6.5.2 =
103
  * Temporarily disabling front end redirects.
104
 
99
 
100
  == Changelog ==
101
 
102
+ = 1.6.6 =
103
+ * Important security update: XSS vulnerability fix
104
+
105
  = 1.6.5.2 =
106
  * Temporarily disabling front end redirects.
107