WP-Paginate - Version 2.1.9

Version Description

  • Added code to prevent script injection into a hidden field on the settings page
Download this release

Release Info

Developer AlanP57
Plugin Icon 128x128 WP-Paginate
Version 2.1.9
Comparing to
See all releases

Code changes from version 2.1.8 to 2.1.9

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wp-paginate.php +149 -142
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: maxfoundry, emartin24, AlanP57
3
  Tags: paginate, pagination, navigation, page, wp-paginate, comments, rtl, seo, usability
4
  Requires at least: 2.6.0 (2.7.0 for comments pagination)
5
  Tested up to: 6.0
6
- Stable tag: 2.1.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -161,6 +161,9 @@ Example (also applies to `wp_paginate_comments()`):
161
  When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.
162
 
163
  == Changelog ==
 
 
 
164
  = 2.1.8 =
165
  * Add the <nav> tag to the list of allowed tags for pagination markup
166
 
3
  Tags: paginate, pagination, navigation, page, wp-paginate, comments, rtl, seo, usability
4
  Requires at least: 2.6.0 (2.7.0 for comments pagination)
5
  Tested up to: 6.0
6
+ Stable tag: 2.1.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
161
  When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.
162
 
163
  == Changelog ==
164
+ = 2.1.9 =
165
+ * Added code to prevent script injection into a hidden field on the settings page
166
+
167
  = 2.1.8 =
168
  * Add the <nav> tag to the list of allowed tags for pagination markup
169
 
wp-paginate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Paginate
4
  Plugin URI: https://wordpress.org/plugins/wp-paginate/
5
  Description: A simple and flexible pagination plugin for WordPress posts and comments.
6
- Version: 2.1.8
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: 'wp-paginate'
@@ -60,7 +60,7 @@ if (!class_exists('WPPaginate')) {
60
  /**
61
  * @var string The plugin version
62
  */
63
- public $version = '2.1.8';
64
 
65
  /**
66
  * @var string The options string name for this plugin
@@ -127,28 +127,28 @@ if (!class_exists('WPPaginate')) {
127
  add_action('wp_ajax_wpp_set_review_later', array($this, 'wpp_set_review_later'));
128
 
129
  $this->positions = array(
130
- 'none' => __('Function only', 'wp-paginate'),
131
- 'below' => __('Below the Content', 'wp-paginate'),
132
- 'above' => __('Above the Content', 'wp-paginate'),
133
- 'both' => __('Above and Below the Content', 'wp-paginate')
134
  );
135
 
136
  $this->fonts = array(
137
- 'font-inherit' => __('inherit', 'wp-paginate'),
138
- 'font-initial' => __('initial', 'wp-paginate'),
139
- 'font-arial' => __('Arial', 'wp-paginate'),
140
- 'font-georgia' => __('Georgia', 'wp-paginate'),
141
- 'font-tahoma' => __('Tahoma', 'wp-paginate'),
142
- 'font-times' => __('Times New Roman', 'wp-paginate'),
143
- 'font-trebuchet' => __('Trebuchet MS', 'wp-paginate'),
144
- 'font-verdana' => __('Verdana', 'wp-paginate')
145
  );
146
 
147
  $this->presets = array(
148
- array('default', __('Grey Buttons', 'wp-paginate'), 'default.jpg'),
149
- array('wpp-blue-cta', __('Blue Buttons', 'wp-paginate'), 'blue-cta-buttons.jpg'),
150
- array('wpp-modern-grey', __('Modern Grey Buttons', 'wp-paginate'), 'modern-grey-buttons.jpg'),
151
- array('wpp-neon-pink', __('Neon Pink Buttons', 'wp-paginate'), 'neon-pink-buttons.png'),
152
  );
153
 
154
  if ($this->options['css'])
@@ -374,9 +374,9 @@ if (!class_exists('WPPaginate')) {
374
  $prevlink = rtrim($prevlink, '/');
375
  $contains_param = (strpos($prevlink, '?') !== false) ? true : false;
376
  if($slash_option && !$contains_param)
377
- $output .= sprintf('<li><a href="%s/" class="prev" aria-label="' . __('Go to previous page', 'wp-paginate') . '">%s</a></li>', $prevlink, stripslashes($previouspage));
378
  else
379
- $output .= sprintf('<li><a href="%s" class="prev" aria-label="' . __('Go to previous page', 'wp-paginate') . '">%s</a></li>', $prevlink, stripslashes($previouspage));
380
  }
381
 
382
  $min_links = $range * 2 + 1;
@@ -416,9 +416,9 @@ if (!class_exists('WPPaginate')) {
416
  $nextlink = rtrim($nextlink, '/');
417
  $contains_param = (strpos($nextlink, '?') !== false) ? true : false;
418
  if($slash_option && !$contains_param)
419
- $output .= sprintf('<li><a href="%s/" class="next" aria-label="' . __('Go to next page', 'wp-paginate') . '">%s</a></li>', $nextlink, stripslashes($nextpage));
420
  else
421
- $output .= sprintf('<li><a href="%s" class="next" aria-label="' . __('Go to next page', 'wp-paginate') . '">%s</a></li>', $nextlink, stripslashes($nextpage));
422
  }
423
  $output .= "</ol>";
424
  }
@@ -442,7 +442,7 @@ if (!class_exists('WPPaginate')) {
442
  $p = ($this->type === 'posts') ? rtrim(esc_url(get_pagenum_link($i)), '/') : get_comments_pagenum_link($i);
443
  $output .= ($page == intval($i))
444
  ? "<li><span class='page current'>$i</span></li>"
445
- : "<li><a href='$p' title='$i' aria-label='" . __('Go to page', 'wp-paginate') . " $i' class='page'>$i</a></li>";
446
  //: "<li><a href='$p' title='$i' aria-label='Go to page $i' class='page'>$i</a></li>";
447
  }
448
  return $output;
@@ -533,7 +533,7 @@ if (!class_exists('WPPaginate')) {
533
  * @desc Adds the Settings link to the plugin activate/deactivate page
534
  */
535
  function filter_plugin_actions($links, $file) {
536
- $settings_link = '<a href="options-general.php?page=' . basename(__FILE__) . '">' . __('Settings', 'wp-paginate') . '</a>';
537
  array_unshift($links, $settings_link); // before other links
538
 
539
  return $links;
@@ -556,7 +556,8 @@ if (!class_exists('WPPaginate')) {
556
  'em' => array(),
557
  'strong' => array()
558
  );
559
-
 
560
 
561
  if (isset($_POST['wp_paginate_save'])) {
562
  if (wp_verify_nonce($_POST['_wpnonce'], 'wp-paginate-update-options')) {
@@ -565,9 +566,9 @@ if (!class_exists('WPPaginate')) {
565
  error_log("wp_paginate_save");
566
  }
567
 
568
- $this->options['title'] = trim(stripslashes(strip_tags($_POST['title'])));
569
- $this->options['previouspage'] = trim(stripslashes(strip_tags($_POST['previouspage'])));
570
- $this->options['nextpage'] = trim(stripslashes(strip_tags($_POST['nextpage'])));
571
  $this->options['before'] = wp_kses($_POST['before'], $allowed_html);
572
  $this->options['after'] = wp_kses($_POST['after'], $allowed_html);
573
  $this->options['empty'] = (isset($_POST['empty']) && $_POST['empty'] === 'on') ? true : false;
@@ -583,20 +584,26 @@ if (!class_exists('WPPaginate')) {
583
  $this->options['category-page'] = (isset($_POST['category-page']) && $_POST['category-page'] === 'on') ? true : false;
584
  $this->options['archive-page'] = (isset($_POST['archive-page']) && $_POST['archive-page'] === 'on') ? true : false;
585
  if(isset($_POST['position']))
586
- $this->options['position'] = $_POST['position'];
587
  $this->options['hide-standard-pagination'] = (isset($_POST['hide-standard-pagination']) && $_POST['hide-standard-pagination'] === 'on') ? true : false;
588
  $this->options['hide-ellipses'] = (isset($_POST['hide-ellipses']) && $_POST['hide-ellipses'] === 'on') ? true : false;
589
  if(isset($_POST['font']))
590
- $this->options['font'] = $_POST['font'];
591
- if(isset($_POST['preset']))
592
- $this->options['preset'] = trim(stripslashes(strip_tags($_POST['preset'])));
 
 
 
 
 
 
593
 
594
  $this->save_admin_options();
595
 
596
- echo '<div class="updated"><p>' . __('Success! Your changes were successfully saved!', 'wp-paginate') . '</p></div>';
597
  }
598
  else {
599
- echo '<div class="error"><p>' . __('Whoops! There was a problem with the data you posted. Please try again.', 'wp-paginate') . '</p></div>';
600
  }
601
  }
602
 
@@ -606,9 +613,9 @@ if (!class_exists('WPPaginate')) {
606
  <div class="icon32" id="icon-options-general"><br/></div>
607
  <h1>WP-Paginate</h1>
608
  <h2 class="nav-tab-wrapper">
609
- <a class="nav-tab<?php if ( ! isset( $_GET['action'] ) ) echo ' nav-tab-active'; ?>" href="options-general.php?page=wp-paginate.php"><?php _e( 'Settings', 'wp-paginate' ); ?></a>
610
- <a class="nav-tab <?php if ( isset( $_GET['action'] ) && 'custom_css' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="options-general.php?page=wp-paginate.php&amp;action=custom_css"><?php _e( 'Custom CSS', 'wp-paginate' ); ?></a>
611
- <a class="nav-tab <?php if ( isset( $_GET['action'] ) && 'upgrade_to_pro' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="options-general.php?page=wp-paginate.php&amp;action=upgrade_to_pro"><?php _e( 'Upgrade to Pro', 'wp-paginate' ); ?></a>
612
  </h2>
613
 
614
  <?php if ( ! isset( $_GET['action'] ) || $_GET['action'] == 'appearance' ) { ?>
@@ -616,29 +623,29 @@ if (!class_exists('WPPaginate')) {
616
  <form method="post" id="wp_paginate_options">
617
  <?php wp_nonce_field('wp-paginate-update-options'); ?>
618
 
619
- <h3><?php _e('General', 'wp-paginate'); ?></h3>
620
  <table class="form-table">
621
  <tr valign="top">
622
- <th scope="row"><?php _e('Pagination Label:', 'wp-paginate'); ?></th>
623
- <td><input name="title" type="text" id="title" size="40" value="<?php echo esc_attr(stripslashes(htmlspecialchars($this->options['title']))); ?>"/>
624
- <span class="description"><?php _e('The optional text/HTML to display before the list of pages.', 'wp-paginate'); ?></span></td>
625
  </tr>
626
  <tr valign="top">
627
- <th scope="row"><?php _e('Previous Page:', 'wp-paginate'); ?></th>
628
- <td><input name="previouspage" type="text" id="previouspage" size="40" value="<?php echo esc_attr(stripslashes(htmlspecialchars($this->options['previouspage']))); ?>"/>
629
- <span class="description"><?php _e('The text/HTML to display for the previous page link.', 'wp-paginate'); ?></span></td>
630
  </tr>
631
  <tr valign="top">
632
- <th scope="row"><?php _e('Next Page:', 'wp-paginate'); ?></th>
633
- <td><input name="nextpage" type="text" id="nextpage" size="40" value="<?php echo esc_attr(stripslashes(htmlspecialchars($this->options['nextpage']))); ?>"/>
634
- <span class="description"><?php _e('The text/HTML to display for the next page link.', 'wp-paginate'); ?></span></td>
635
  </tr>
636
  </table>
637
  <p>&nbsp;</p>
638
- <h3><?php _e('Location &amp; Position', 'wp-paginate'); ?></h3>
639
  <table class="form-table">
640
  <tr valign="top">
641
- <th scope="row"><?php _e('Everywhere:', 'wp-paginate'); ?></th>
642
  <td><label for="everywhere">
643
  <?php
644
  if(isset($this->options['everywhere']))
@@ -646,10 +653,10 @@ if (!class_exists('WPPaginate')) {
646
  else
647
  $everywhere = false;
648
  ?>
649
- <input class="everywhere-cb" type="checkbox" id="everywhere" name="everywhere" <?php echo ($everywhere === true) ? "checked='checked'" : ""; ?>/> <?php _e('Display pagination everywhere. (Comments pagination not included.)', 'wp-paginate'); ?></label></td>
650
  </tr>
651
  <tr valign="top">
652
- <th scope="row"><?php _e('Home Page:', 'wp-paginate'); ?></th>
653
  <td><label for="home-page">
654
  <?php
655
  if(isset($this->options['home-page']))
@@ -657,10 +664,10 @@ if (!class_exists('WPPaginate')) {
657
  else
658
  $home_page = false;
659
  ?>
660
- <input class="not-everywhere-cb" type="checkbox" id="home-page" name="home-page" <?php echo ($home_page === true) ? "checked='checked'" : ""; ?>/> <?php _e('Display pagination on the home page.', 'wp-paginate'); ?></label></td>
661
  </tr>
662
  <tr valign="top">
663
- <th scope="row"><?php _e('Blog Page:', 'wp-paginate'); ?></th>
664
  <td><label for="blog-page">
665
  <?php
666
  if(isset($this->options['blog-page']))
@@ -668,10 +675,10 @@ if (!class_exists('WPPaginate')) {
668
  else
669
  $blog_page = false;
670
  ?>
671
- <input class="not-everywhere-cb" type="checkbox" id="blog-page" name="blog-page" <?php echo ($blog_page === true) ? "checked='checked'" : ""; ?>/> <?php _e('Display pagination on the blog page.', 'wp-paginate'); ?></label></td>
672
  </tr>
673
  <tr valign="top">
674
- <th scope="row"><?php _e('Search Page:', 'wp-paginate'); ?></th>
675
  <td><label for="search-page">
676
  <?php
677
  if(isset($this->options['search-page']))
@@ -679,10 +686,10 @@ if (!class_exists('WPPaginate')) {
679
  else
680
  $search_page = false;
681
  ?>
682
- <input class="not-everywhere-cb" type="checkbox" id="search-page" name="search-page" <?php echo ($search_page === true) ? "checked='checked'" : ""; ?>/> <?php _e('Display pagination on the search page.', 'wp-paginate'); ?></label></td>
683
  </tr>
684
  <tr valign="top">
685
- <th scope="row"><?php _e('Category Pages:', 'wp-paginate'); ?></th>
686
  <td><label for="category-page">
687
  <?php
688
  if(isset($this->options['category-page']))
@@ -690,10 +697,10 @@ if (!class_exists('WPPaginate')) {
690
  else
691
  $category_page = false;
692
  ?>
693
- <input class="not-everywhere-cb" type="checkbox" id="search-page" name="category-page" <?php echo ($category_page === true) ? "checked='checked'" : ""; ?>/> <?php _e('Display pagination on category pages.', 'wp-paginate'); ?></label></td>
694
  </tr>
695
  <tr valign="top">
696
- <th scope="row"><?php _e('Archive Pages:', 'wp-paginate'); ?></th>
697
  <td><label for="archive-page">
698
  <?php
699
  if(isset($this->options['archive-page']))
@@ -701,7 +708,7 @@ if (!class_exists('WPPaginate')) {
701
  else
702
  $archive_page = false;
703
  ?>
704
- <input class="not-everywhere-cb" type="checkbox" id="archive-page" name="archive-page" <?php echo ($archive_page === true) ? "checked='checked'" : ""; ?>/> <?php _e('Display pagination on archive pages.', 'wp-paginate'); ?></label></td>
705
  </tr>
706
 
707
  <script>
@@ -726,7 +733,7 @@ if (!class_exists('WPPaginate')) {
726
  </script>
727
 
728
  <tr valign="top">
729
- <th scope="row"><?php _e('Position:', 'wp-paginate'); ?></th>
730
  <td>
731
  <?php
732
  if(isset($this->options['position']))
@@ -737,13 +744,13 @@ if (!class_exists('WPPaginate')) {
737
  <select name="position" id="range">
738
  <?php foreach ($this->positions as $key => $name) { ?>
739
  <?php $selected = ($position == $key) ? 'selected="selected"' : ''; ?>
740
- <option value="<?php echo $key ?>" <?php echo $selected ?>><?php echo $name ?></option>
741
  <?php } ?>
742
  </select>
743
- <span class="description"><?php _e('Where to display the pagination on the page.', 'wp-paginate'); ?></span></td>
744
  </tr>
745
  <tr valign="top">
746
- <th scope="row"><?php _e('Hide Standard Pagination:', 'wp-paginate'); ?></th>
747
  <td><label for="hide-standard-pagination">
748
  <?php
749
  if(isset($this->options['hide-standard-pagination']))
@@ -751,14 +758,14 @@ if (!class_exists('WPPaginate')) {
751
  else
752
  $hide_standard_pagination = 'none';
753
  ?>
754
- <input type="checkbox" id="hide-standard-pagination" name="hide-standard-pagination" <?php echo ($hide_standard_pagination === true) ? "checked='checked'" : ""; ?>/> <?php _e('Hide the standard theme default pagination.', 'wp-paginate'); ?></label></td>
755
  </tr>
756
  </table>
757
  <p>&nbsp;</p>
758
- <h3><?php _e('Appearance', 'wp-paginate'); ?></h3>
759
  <table class="form-table">
760
  <tr valign="top">
761
- <th scope="row"><?php _e('Pagination Font:', 'wp-paginate'); ?></th>
762
  <td>
763
  <?php
764
  if(isset($this->options['font']))
@@ -769,13 +776,13 @@ if (!class_exists('WPPaginate')) {
769
  <select name="font" id="font">
770
  <?php foreach ($this->fonts as $key => $name) { ?>
771
  <?php $selected = ($font == $key) ? 'selected="selected"' : ''; ?>
772
- <option value="<?php echo $key ?>" <?php echo $selected ?>><?php echo $name ?></option>
773
  <?php } ?>
774
  </select>
775
- <span class="description"><?php _e('Select the font to use with the pagination.', 'wp-paginate'); ?></span></td>
776
  </tr>
777
  <tr valign="top">
778
- <th scope="row"><?php _e('Hide Ellipses:', 'wp-paginate'); ?></th>
779
  <td><label for="hide-ellipses">
780
  <?php
781
  if(isset($this->options['hide-ellipses']))
@@ -783,10 +790,10 @@ if (!class_exists('WPPaginate')) {
783
  else
784
  $hide_ellipses = 'none';
785
  ?>
786
- <input type="checkbox" id="hide-ellipses" name="hide-ellipses" <?php echo ($hide_ellipses === true) ? "checked='checked'" : ""; ?>/> <?php _e('Remove ellipses from the pagination links.', 'wp-paginate'); ?></label></td>
787
  </tr>
788
  <tr valign="top">
789
- <th scope="row"><?php _e('Button Style:', 'wp-paginate'); ?></th>
790
  <?php
791
  if(isset($this->options['preset'])) {
792
  $preset_option = $this->options['preset'];
@@ -794,20 +801,20 @@ if (!class_exists('WPPaginate')) {
794
  $preset_option = 'default';
795
  }
796
  ?>
797
- <input type='hidden' value='<?php echo $preset_option; ?>' name='preset' id='preset'>
798
  <td>
799
- <p><?php _e('Choose a preset style from the list below.', 'wp-paginate'); ?></p>
800
  <table class="button-styles">
801
  <?php foreach($this->presets as $preset ) { ?>
802
  <tr>
803
  <td>
804
- <?php echo $preset[1]; ?>
805
  </td>
806
  <td>
807
- <input type="radio" name="preset" id="preset" value="<?php echo $preset[0]; ?>" <?php echo ($preset_option === $preset[0]) ? 'checked' : ''; ?>>
808
  </td>
809
  <td>
810
- <img alt="<?php echo $preset[1]; ?> image" src="<?php echo $this->pluginurl . "images/" . $preset[2]; ?>" width="326" height="70">
811
  </td>
812
  </tr>
813
  <?php } ?>
@@ -816,71 +823,71 @@ if (!class_exists('WPPaginate')) {
816
  </tr>
817
  </table>
818
  <p>&nbsp;</p>
819
- <h3><?php _e('Advanced Settings', 'wp-paginate'); ?></h3>
820
  <table class="form-table">
821
  <tr valign="top">
822
- <th scope="row"><?php _e('Before Markup:', 'wp-paginate'); ?></th>
823
  <td><input name="before" type="text" id="before" size="40" value="<?php echo esc_attr(stripslashes(wp_kses_decode_entities($this->options['before']))); ?>"/>
824
- <span class="description"><?php _e('The HTML markup to display before the pagination code.', 'wp-paginate'); ?></span></td>
825
  </tr>
826
  <tr valign="top">
827
- <th scope="row"><?php _e('After Markup:', 'wp-paginate'); ?></th>
828
  <td><input name="after" type="text" id="after" size="40" value="<?php echo esc_attr(stripslashes(wp_kses_decode_entities($this->options['after']))); ?>"/>
829
- <span class="description"><?php _e('The HTML markup to display after the pagination code.', 'wp-paginate'); ?></span></td>
830
  </tr>
831
  <tr valign="top">
832
- <th scope="row"><?php _e('Markup Display:', 'wp-paginate'); ?></th>
833
  <td><label for="empty">
834
- <input type="checkbox" id="empty" name="empty" <?php echo ($this->options['empty'] === true) ? "checked='checked'" : ""; ?>/> <?php _e('Show Before Markup and After Markup, even if the page list is empty?', 'wp-paginate'); ?></label></td>
835
  </tr>
836
  <tr valign="top">
837
- <th scope="row"><?php _e('WP-Paginate CSS File:', 'wp-paginate'); ?></th>
838
  <td><label for="css">
839
- <input type="checkbox" id="css" name="css" <?php echo ($this->options['css'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for <code>wp-paginate.css</code> in your theme directory (<code>themes/%s</code>).', 'wp-paginate'), get_template()); ?></label></td>
840
  </tr>
841
  <?php
842
  if(!isset($this->options['slash']))
843
  $this->options['slash'] = false;
844
  ?>
845
  <tr valign="top">
846
- <th scope="row"><?php _e('Add trailing slash:', 'wp-paginate'); ?></th>
847
  <td><label for="slash">
848
- <input type="checkbox" id="css" name="slash" <?php echo ($this->options['slash'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Adds a trailing slash to the end of pagination links.', 'wp-paginate'), get_template()); ?></label></td>
849
  </tr>
850
 
851
  <tr valign="top">
852
- <th scope="row"><?php _e('Page Range:', 'wp-paginate'); ?></th>
853
  <td>
854
  <select name="range" id="range">
855
  <?php for ($i=1; $i<=10; $i++) : ?>
856
- <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['range']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
857
  <?php endfor; ?>
858
  </select>
859
- <span class="description"><?php _e('The number of page links to show before and after the current page. Recommended value: 3', 'wp-paginate'); ?></span></td>
860
  </tr>
861
  <tr valign="top">
862
- <th scope="row"><?php _e('Page Anchors:', 'wp-paginate'); ?></th>
863
  <td>
864
  <select name="anchor" id="anchor">
865
  <?php for ($i=0; $i<=10; $i++) : ?>
866
- <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['anchor']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
867
  <?php endfor; ?>
868
  </select>
869
- <span class="description"><?php _e('The number of links to always show at beginning and end of pagination. Recommended value: 1', 'wp-paginate'); ?></span></td>
870
  </tr>
871
  <tr valign="top">
872
- <th scope="row"><?php _e('Page Gap:', 'wp-paginate'); ?></th>
873
  <td>
874
  <select name="gap" id="gap">
875
  <?php for ($i=1; $i<=10; $i++) : ?>
876
- <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['gap']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
877
  <?php endfor; ?>
878
  </select>
879
- <span class="description"><?php _e('The minimum number of pages in a gap before an ellipsis (...) is added. Recommended value: 3', 'wp-paginate'); ?></span></td>
880
  </tr>
881
  </table>
882
  <p class="submit">
883
- <input type="submit" id="wpp-save-changes" value="<?php _e('Save Changes', 'wp-paginate'); ?>" name="wp_paginate_save" class="button-primary" />
884
  </p>
885
  </form>
886
  <p>&nbsp;</p>
@@ -921,37 +928,37 @@ if (!class_exists('WPPaginate')) {
921
  <hr>
922
  <?php } ?>
923
 
924
- <h2><?php _e('Need Support?', 'wp-paginate'); ?></h2>
925
- <p><?php printf(__('For questions, issues or feature requests, please post them in the %s and make sure to tag the post with wp-paginate.', 'wp-paginate'), '<a href="https://wordpress.org/support/plugin/wp-paginate">WordPress Forum</a>'); ?></p>
926
  <p>&nbsp;</p>
927
  <div id="wpp-plugins">
928
 
929
- <div class="paginate-info"><?php _e( 'WP Paginate is Maintained and Upgraded by Max Foundry', 'wp-paginate' ); ?></div>
930
- <div class="paginate-info"><?php _e( 'Developed Originally by Eric Martin', 'wp-paginate' ); ?></div>
931
- <div class="mf-plugins"><?php _e( 'Max Foundry Produces These Other Fine Plugins', 'wp-paginate' ); ?></div>
932
 
933
  <div class="column-left">
934
- <a href="<?php echo WPP_MAXBUTTONS_LINK; ?>" target="_blank">
935
  <img alt="maxbuttons logo" src="<?php echo $this->pluginurl ?>images/MBP.png" width="283" height="142">
936
  </a>
937
- <a href="<?php echo WPP_MAXBUTTONS_LINK; ?>" target="_blank">
938
- <div class="wpp-plugin-title"><?php _e( 'WordPress Button Plugin', 'wp-paginate' ); ?></div>
939
  </a>
940
  </div>
941
  <div class="column-center">
942
- <a href="<?php echo WPP_MAXGALLERIA_LINK; ?>" target="_blank">
943
- <img alt="maxgalleria logo" src="<?php echo $this->pluginurl ?>images/MG_logo.png" width="283" height="142">
944
  </a>
945
- <a href="<?php echo WPP_MAXGALLERIA_LINK; ?>" target="_blank">
946
- <div class="wpp-plugin-title"><?php _e( 'WordPress Gallery Plugin', 'wp-paginate' ); ?></div>
947
  </a>
948
  </div>
949
  <div class="column-right">
950
- <a href="<?php echo WPP_MEDIA_LIBRARY_PLUS_PRO_LINK; ?>" target="_blank">
951
- <img alt="media library plus pro logo" src="<?php echo $this->pluginurl ?>images/MLPP-card-red.png" width="283" height="142">
952
  </a>
953
- <a href="<?php echo WPP_MEDIA_LIBRARY_PLUS_PRO_LINK; ?>" target="_blank">
954
- <div class="wpp-plugin-title"><?php _e( 'WordPress Media Library Folders', 'wp-paginate' ); ?></div>
955
  </a>
956
  </div>
957
  </div>
@@ -968,7 +975,7 @@ if (!class_exists('WPPaginate')) {
968
 
969
  function wpp_custom_code_tab() {
970
  if ( ! current_user_can( 'edit_plugins' ) )
971
- wp_die( __( 'You do not have sufficient permissions to edit plugins for this site.', 'wp-paginate' ) );
972
 
973
  $message = $content = '';
974
  $extension = 'css';
@@ -997,9 +1004,9 @@ if (!class_exists('WPPaginate')) {
997
  if ( $f = fopen( $real_css_file, 'w+' ) ) {
998
  fwrite( $f, $newcontent_css );
999
  fclose( $f );
1000
- $message .= sprintf( __( 'File %s edited successfully.', 'wp-paginate' ), '<i>' . $css_file . '</i>' ) . ' ';
1001
  } else {
1002
- $error .= __( 'Not enough permissions to create or update the file', 'wp-paginate' ) . ' ' . $real_css_file . '. ';
1003
  }
1004
 
1005
  if(isset($_REQUEST['wpp_custom_css_active']))
@@ -1010,7 +1017,7 @@ if (!class_exists('WPPaginate')) {
1010
  update_option('wpp_custom_css_active', $wpp_custom_css_active, true );
1011
 
1012
  if ( ! empty( $error ) )
1013
- $error .= ' <a href="https://codex.wordpress.org/Changing_File_Permissions" target="_blank">' . __( 'Learn more', 'wp-paginate' ) . '</a>';
1014
  }
1015
 
1016
  if ( file_exists( $real_css_file ) ) {
@@ -1022,17 +1029,17 @@ if (!class_exists('WPPaginate')) {
1022
  $content_css = "";
1023
 
1024
  if ( ! empty( $message ) ) { ?>
1025
- <div id="message" class="below-h2 updated notice is-dismissible"><p><?php echo $message; ?></p></div>
1026
  <?php } ?>
1027
  <form action="" method="post">
1028
  <p>
1029
- <?php _e( 'These styles will be added to the header on all pages of your site.', 'wp-paginate' ); ?>
1030
  </p>
1031
  <p><big>
1032
  <?php if ( ! file_exists( $real_css_file ) || ( is_writeable( $real_css_file ) ) ) {
1033
- echo __( 'Editing', 'wp-paginate' ) . ' <strong>' . $css_file . '</strong>';
1034
  } else {
1035
- echo __( 'Browsing', 'wp-paginate' ) . ' <strong>' . $css_file . '</strong>';
1036
  } ?>
1037
  </big></p>
1038
  <p><label><input type="checkbox" name="wpp_custom_css_active" value="1" <?php checked( $wpp_custom_css_active, 'on'); ?> /> <?php _e( 'Activate', 'wp-paginate' ); ?></label></p>
@@ -1040,11 +1047,11 @@ if (!class_exists('WPPaginate')) {
1040
  <?php if ( ! file_exists( $real_css_file ) || is_writeable( $real_css_file )) { ?>
1041
  <p class="submit">
1042
  <input type="hidden" name="wpp_update_custom_code" value="submit" />
1043
- <?php submit_button( __( 'Save Changes', 'wp-paginate' ), 'primary', 'submit', false );
1044
  wp_nonce_field( 'wpp_update_nonce' . $css_file ); ?>
1045
  </p>
1046
  <?php } else { ?>
1047
- <p><em><?php printf( __( 'You need to make this files writable before you can save your changes. See %s the Codex %s for more information.', 'wp-paginate' ),
1048
  '<a href="https://codex.wordpress.org/Changing_File_Permissions" target="_blank">',
1049
  '</a>' ); ?></em></p>
1050
  <?php } ?>
@@ -1150,13 +1157,13 @@ if (!class_exists('WPPaginate')) {
1150
  if( current_user_can( 'manage_options' ) ) { ?>
1151
  <div class="updated notice wpp-notice">
1152
  <div id='wp-paginate-logo'></div>
1153
- <div id='wpp-notice-1'><p id='wpp-notice-title'><?php _e( 'Love WP-Paginate?', 'wp-paginate' ); ?></p>
1154
- <p><?php _e( 'Your rating is a big help! We really appreciate it!', 'wp-paginate' ); ?></p>
1155
 
1156
  <ul id="wpp-review-notice-links">
1157
- <li> <span class="dashicons dashicons-smiley"></span><a id="wpp-review-already"><?php _e( "I've already left a review", 'wp-paginate' ); ?></a></li>
1158
- <li><span class="dashicons dashicons-calendar-alt"></span><a id="wpp-review-later"><?php _e( "Maybe Later", 'wp-paginate' ); ?></a></li>
1159
- <li><span class="dashicons dashicons-external"></span><a id="wpp-write-review" target="_blank" href="https://wordpress.org/support/plugin/wp-paginate/reviews/?filter=5"><?php _e( "Sure! I'd love to!", 'wp-paginate' ); ?></a></li>
1160
  </ul>
1161
  </div>
1162
  <a class="dashicons dashicons-dismiss close-wpp-notice" id="wpp-dismiss"></a>
@@ -1168,7 +1175,7 @@ if (!class_exists('WPPaginate')) {
1168
  public function wpp_dismiss_notice() {
1169
 
1170
  if ( !wp_verify_nonce( $_POST['nonce'], WP_PAGINATE_NONCE)) {
1171
- exit(__('missing nonce! Please refresh the page.', 'wp-paginate'));
1172
  }
1173
 
1174
  $current_user_id = get_current_user_id();
@@ -1182,7 +1189,7 @@ if (!class_exists('WPPaginate')) {
1182
  public function wpp_set_review_later() {
1183
 
1184
  if ( !wp_verify_nonce( $_POST['nonce'], WP_PAGINATE_NONCE)) {
1185
- exit(__('missing nonce! Please refresh the page.', 'wp-paginate'));
1186
  }
1187
 
1188
  $current_user_id = get_current_user_id();
@@ -1200,37 +1207,37 @@ if (!class_exists('WPPaginate')) {
1200
  ?>
1201
  <div id="utp-content">
1202
  <div id="mf-logo">
1203
- <img alt="<?php _e('maxfoundry logo', 'wp-paginate'); ?>" src="<?php echo $this->pluginurl . '/images/max-foundry.png'; ?>" width="172" height="32">
1204
  </div>
1205
  <div style="clear:both"></div>
1206
  <div id="utp-banner">
1207
  <div id="utp-title-wrap">
1208
- <div id="utp-title"><?php _e('WP PAGINATE PRO', 'wp-paginate'); ?></div>
1209
  </div>
1210
- <a href="<?php echo WPP_WP_PAGINATE_PRO_LINK; ?>" target="_blank">
1211
- <img class="buy-now-button" alt="<?php _e('buy now button', 'wp-paginate'); ?>" src="<?php echo $this->pluginurl . "/images/buy-now-btn.png" ?>" width="205" height="68">
1212
  </a>
1213
  </div>
1214
- <img id='wppp-logo' alt="<?php _e('wp-pagination pro logo', 'wp-paginate'); ?>" src="<?php echo $this->pluginurl . '/images/wpp-pro-logo-2.png'; ?>" width="169" height="61">
1215
 
1216
  <div class="utp-text">
1217
- <?php _e('WP-Paginate Pro come with 11 Beautiful<br>Preset Layouts and Multi Site support!', 'wp-paginate'); ?>
1218
  </div>
1219
 
1220
  <div id="wppp-buttons">
1221
- <img alt="<?php _e('WP Pagination Pro buttons styles', 'wp-paginate'); ?>" src="<?php echo $this->pluginurl . '/images/wppp-buttons.png'; ?>" width="646" height="713">
1222
  </div>
1223
 
1224
  <div class="utp-text">
1225
- <?php _e('Use These Customizer Settings to Get the<br>Exact Look and Feel You Want', 'wp-paginate'); ?>
1226
  </div>
1227
 
1228
  <div id="wppp-customizer">
1229
- <img alt="<?php _e('WP Pagination Por button Style customizer', 'wp-paginate'); ?>" src="<?php echo $this->pluginurl . '/images/wppp-customizer.png'; ?>" width="650" height="380">
1230
  </div>
1231
 
1232
- <a href="<?php echo WPP_WP_PAGINATE_PRO_LINK; ?>" target="_blank">
1233
- <img class="buy-now-button" alt="<?php _e('buy now button', 'wp-paginate'); ?>" src="<?php echo $this->pluginurl . "/images/buy-now-btn.png" ?>" width="205" height="68">
1234
  </a>
1235
 
1236
  </div>
3
  Plugin Name: WP-Paginate
4
  Plugin URI: https://wordpress.org/plugins/wp-paginate/
5
  Description: A simple and flexible pagination plugin for WordPress posts and comments.
6
+ Version: 2.1.9
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: 'wp-paginate'
60
  /**
61
  * @var string The plugin version
62
  */
63
+ public $version = '2.1.9';
64
 
65
  /**
66
  * @var string The options string name for this plugin
127
  add_action('wp_ajax_wpp_set_review_later', array($this, 'wpp_set_review_later'));
128
 
129
  $this->positions = array(
130
+ 'none' => esc_html__('Function only', 'wp-paginate'),
131
+ 'below' => esc_html__('Below the Content', 'wp-paginate'),
132
+ 'above' => esc_html__('Above the Content', 'wp-paginate'),
133
+ 'both' => esc_html__('Above and Below the Content', 'wp-paginate')
134
  );
135
 
136
  $this->fonts = array(
137
+ 'font-inherit' => esc_html__('inherit', 'wp-paginate'),
138
+ 'font-initial' => esc_html__('initial', 'wp-paginate'),
139
+ 'font-arial' => esc_html__('Arial', 'wp-paginate'),
140
+ 'font-georgia' => esc_html__('Georgia', 'wp-paginate'),
141
+ 'font-tahoma' => esc_html__('Tahoma', 'wp-paginate'),
142
+ 'font-times' => esc_html__('Times New Roman', 'wp-paginate'),
143
+ 'font-trebuchet' => esc_html__('Trebuchet MS', 'wp-paginate'),
144
+ 'font-verdana' => esc_html__('Verdana', 'wp-paginate')
145
  );
146
 
147
  $this->presets = array(
148
+ array('default', esc_html__('Grey Buttons', 'wp-paginate'), 'default.jpg'),
149
+ array('wpp-blue-cta', esc_html__('Blue Buttons', 'wp-paginate'), 'blue-cta-buttons.jpg'),
150
+ array('wpp-modern-grey', esc_html__('Modern Grey Buttons', 'wp-paginate'), 'modern-grey-buttons.jpg'),
151
+ array('wpp-neon-pink', esc_html__('Neon Pink Buttons', 'wp-paginate'), 'neon-pink-buttons.png'),
152
  );
153
 
154
  if ($this->options['css'])
374
  $prevlink = rtrim($prevlink, '/');
375
  $contains_param = (strpos($prevlink, '?') !== false) ? true : false;
376
  if($slash_option && !$contains_param)
377
+ $output .= sprintf('<li><a href="%s/" class="prev" aria-label="' . esc_html__('Go to previous page', 'wp-paginate') . '">%s</a></li>', $prevlink, stripslashes($previouspage));
378
  else
379
+ $output .= sprintf('<li><a href="%s" class="prev" aria-label="' . esc_html__('Go to previous page', 'wp-paginate') . '">%s</a></li>', $prevlink, stripslashes($previouspage));
380
  }
381
 
382
  $min_links = $range * 2 + 1;
416
  $nextlink = rtrim($nextlink, '/');
417
  $contains_param = (strpos($nextlink, '?') !== false) ? true : false;
418
  if($slash_option && !$contains_param)
419
+ $output .= sprintf('<li><a href="%s/" class="next" aria-label="' . esc_html__('Go to next page', 'wp-paginate') . '">%s</a></li>', $nextlink, stripslashes($nextpage));
420
  else
421
+ $output .= sprintf('<li><a href="%s" class="next" aria-label="' . esc_html__('Go to next page', 'wp-paginate') . '">%s</a></li>', $nextlink, stripslashes($nextpage));
422
  }
423
  $output .= "</ol>";
424
  }
442
  $p = ($this->type === 'posts') ? rtrim(esc_url(get_pagenum_link($i)), '/') : get_comments_pagenum_link($i);
443
  $output .= ($page == intval($i))
444
  ? "<li><span class='page current'>$i</span></li>"
445
+ : "<li><a href='$p' title='$i' aria-label='" . esc_html__('Go to page', 'wp-paginate') . " $i' class='page'>$i</a></li>";
446
  //: "<li><a href='$p' title='$i' aria-label='Go to page $i' class='page'>$i</a></li>";
447
  }
448
  return $output;
533
  * @desc Adds the Settings link to the plugin activate/deactivate page
534
  */
535
  function filter_plugin_actions($links, $file) {
536
+ $settings_link = '<a href="options-general.php?page=' . basename(__FILE__) . '">' . esc_html__('Settings', 'wp-paginate') . '</a>';
537
  array_unshift($links, $settings_link); // before other links
538
 
539
  return $links;
556
  'em' => array(),
557
  'strong' => array()
558
  );
559
+
560
+ $allowed_presets = array('default', 'wpp-blue-cta', 'wpp-modern-grey', 'wpp-neon-pink');
561
 
562
  if (isset($_POST['wp_paginate_save'])) {
563
  if (wp_verify_nonce($_POST['_wpnonce'], 'wp-paginate-update-options')) {
566
  error_log("wp_paginate_save");
567
  }
568
 
569
+ $this->options['title'] = trim(sanitize_text_field($_POST['title']));
570
+ $this->options['previouspage'] = trim(sanitize_text_field($_POST['previouspage']));
571
+ $this->options['nextpage'] = trim(sanitize_text_field($_POST['nextpage']));
572
  $this->options['before'] = wp_kses($_POST['before'], $allowed_html);
573
  $this->options['after'] = wp_kses($_POST['after'], $allowed_html);
574
  $this->options['empty'] = (isset($_POST['empty']) && $_POST['empty'] === 'on') ? true : false;
584
  $this->options['category-page'] = (isset($_POST['category-page']) && $_POST['category-page'] === 'on') ? true : false;
585
  $this->options['archive-page'] = (isset($_POST['archive-page']) && $_POST['archive-page'] === 'on') ? true : false;
586
  if(isset($_POST['position']))
587
+ $this->options['position'] = sanitize_text_field($_POST['position']);
588
  $this->options['hide-standard-pagination'] = (isset($_POST['hide-standard-pagination']) && $_POST['hide-standard-pagination'] === 'on') ? true : false;
589
  $this->options['hide-ellipses'] = (isset($_POST['hide-ellipses']) && $_POST['hide-ellipses'] === 'on') ? true : false;
590
  if(isset($_POST['font']))
591
+ $this->options['font'] = sanitize_text_field($_POST['font']);
592
+ if(isset($_POST['preset'])) {
593
+ $preset_value = trim(sanitize_text_field($_POST['preset']));
594
+ // only allow predefined values
595
+ if(in_array($preset_value, $allowed_presets))
596
+ $this->options['preset'] = $preset_value;
597
+ else
598
+ $this->options['preset'] = 'default';
599
+ }
600
 
601
  $this->save_admin_options();
602
 
603
+ echo '<div class="updated"><p>' . esc_html__('Success! Your changes were successfully saved!', 'wp-paginate') . '</p></div>';
604
  }
605
  else {
606
+ echo '<div class="error"><p>' . esc_html__('Whoops! There was a problem with the data you posted. Please try again.', 'wp-paginate') . '</p></div>';
607
  }
608
  }
609
 
613
  <div class="icon32" id="icon-options-general"><br/></div>
614
  <h1>WP-Paginate</h1>
615
  <h2 class="nav-tab-wrapper">
616
+ <a class="nav-tab<?php if ( ! isset( $_GET['action'] ) ) echo ' nav-tab-active'; ?>" href="options-general.php?page=wp-paginate.php"><?php esc_html_e( 'Settings', 'wp-paginate' ); ?></a>
617
+ <a class="nav-tab <?php if ( isset( $_GET['action'] ) && 'custom_css' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="options-general.php?page=wp-paginate.php&amp;action=custom_css"><?php esc_html_e( 'Custom CSS', 'wp-paginate' ); ?></a>
618
+ <a class="nav-tab <?php if ( isset( $_GET['action'] ) && 'upgrade_to_pro' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="options-general.php?page=wp-paginate.php&amp;action=upgrade_to_pro"><?php esc_html_e( 'Upgrade to Pro', 'wp-paginate' ); ?></a>
619
  </h2>
620
 
621
  <?php if ( ! isset( $_GET['action'] ) || $_GET['action'] == 'appearance' ) { ?>
623
  <form method="post" id="wp_paginate_options">
624
  <?php wp_nonce_field('wp-paginate-update-options'); ?>
625
 
626
+ <h3><?php esc_html_e('General', 'wp-paginate'); ?></h3>
627
  <table class="form-table">
628
  <tr valign="top">
629
+ <th scope="row"><?php esc_html_e('Pagination Label:', 'wp-paginate'); ?></th>
630
+ <td><input name="title" type="text" id="title" size="40" value="<?php echo esc_attr(stripslashes(htmlspecialchars($this->options['title']))) ?>"/>
631
+ <span class="description"><?php esc_html_e('The optional text/HTML to display before the list of pages.', 'wp-paginate'); ?></span></td>
632
  </tr>
633
  <tr valign="top">
634
+ <th scope="row"><?php esc_html_e('Previous Page:', 'wp-paginate'); ?></th>
635
+ <td><input name="previouspage" type="text" id="previouspage" size="40" value="<?php echo esc_attr(stripslashes(htmlspecialchars($this->options['previouspage']))) ?>"/>
636
+ <span class="description"><?php esc_html_e('The text/HTML to display for the previous page link.', 'wp-paginate'); ?></span></td>
637
  </tr>
638
  <tr valign="top">
639
+ <th scope="row"><?php esc_html_e('Next Page:', 'wp-paginate'); ?></th>
640
+ <td><input name="nextpage" type="text" id="nextpage" size="40" value="<?php echo esc_attr(stripslashes(htmlspecialchars($this->options['nextpage']))) ?>"/>
641
+ <span class="description"><?php esc_html_e('The text/HTML to display for the next page link.', 'wp-paginate'); ?></span></td>
642
  </tr>
643
  </table>
644
  <p>&nbsp;</p>
645
+ <h3><?php esc_html_e('Location &amp; Position', 'wp-paginate'); ?></h3>
646
  <table class="form-table">
647
  <tr valign="top">
648
+ <th scope="row"><?php esc_html_e('Everywhere:', 'wp-paginate'); ?></th>
649
  <td><label for="everywhere">
650
  <?php
651
  if(isset($this->options['everywhere']))
653
  else
654
  $everywhere = false;
655
  ?>
656
+ <input class="everywhere-cb" type="checkbox" id="everywhere" name="everywhere" <?php echo esc_attr(($everywhere === true) ? "checked='checked'" : ""); ?>/> <?php esc_html_e('Display pagination everywhere. (Comments pagination not included.)', 'wp-paginate') ?></label></td>
657
  </tr>
658
  <tr valign="top">
659
+ <th scope="row"><?php esc_html_e('Home Page:', 'wp-paginate'); ?></th>
660
  <td><label for="home-page">
661
  <?php
662
  if(isset($this->options['home-page']))
664
  else
665
  $home_page = false;
666
  ?>
667
+ <input class="not-everywhere-cb" type="checkbox" id="home-page" name="home-page" <?php echo esc_attr(($home_page === true) ? "checked='checked'" : "") ?>/> <?php esc_html_e('Display pagination on the home page.', 'wp-paginate') ?></label></td>
668
  </tr>
669
  <tr valign="top">
670
+ <th scope="row"><?php esc_html_e('Blog Page:', 'wp-paginate'); ?></th>
671
  <td><label for="blog-page">
672
  <?php
673
  if(isset($this->options['blog-page']))
675
  else
676
  $blog_page = false;
677
  ?>
678
+ <input class="not-everywhere-cb" type="checkbox" id="blog-page" name="blog-page" <?php echo esc_attr(($blog_page === true)) ? "checked='checked'" : ""; ?>/> <?php esc_html_e('Display pagination on the blog page.', 'wp-paginate') ?></label></td>
679
  </tr>
680
  <tr valign="top">
681
+ <th scope="row"><?php esc_html_e('Search Page:', 'wp-paginate'); ?></th>
682
  <td><label for="search-page">
683
  <?php
684
  if(isset($this->options['search-page']))
686
  else
687
  $search_page = false;
688
  ?>
689
+ <input class="not-everywhere-cb" type="checkbox" id="search-page" name="search-page" <?php echo esc_attr(($search_page === true) ? "checked='checked'" : "") ?>/> <?php esc_html_e('Display pagination on the search page.', 'wp-paginate') ?></label></td>
690
  </tr>
691
  <tr valign="top">
692
+ <th scope="row"><?php esc_html_e('Category Pages:', 'wp-paginate'); ?></th>
693
  <td><label for="category-page">
694
  <?php
695
  if(isset($this->options['category-page']))
697
  else
698
  $category_page = false;
699
  ?>
700
+ <input class="not-everywhere-cb" type="checkbox" id="search-page" name="category-page" <?php echo esc_attr(($category_page === true) ? "checked='checked'" : "") ?>/> <?php esc_html_e('Display pagination on category pages.', 'wp-paginate') ?></label></td>
701
  </tr>
702
  <tr valign="top">
703
+ <th scope="row"><?php esc_html_e('Archive Pages:', 'wp-paginate'); ?></th>
704
  <td><label for="archive-page">
705
  <?php
706
  if(isset($this->options['archive-page']))
708
  else
709
  $archive_page = false;
710
  ?>
711
+ <input class="not-everywhere-cb" type="checkbox" id="archive-page" name="archive-page" <?php echo esc_attr(($archive_page === true) ? "checked='checked'" : "") ?>/> <?php esc_html_e('Display pagination on archive pages.', 'wp-paginate') ?></label></td>
712
  </tr>
713
 
714
  <script>
733
  </script>
734
 
735
  <tr valign="top">
736
+ <th scope="row"><?php esc_html_e('Position:', 'wp-paginate'); ?></th>
737
  <td>
738
  <?php
739
  if(isset($this->options['position']))
744
  <select name="position" id="range">
745
  <?php foreach ($this->positions as $key => $name) { ?>
746
  <?php $selected = ($position == $key) ? 'selected="selected"' : ''; ?>
747
+ <option value="<?php echo esc_attr($key) ?>" <?php echo esc_attr($selected) ?>><?php echo esc_html($name) ?></option>
748
  <?php } ?>
749
  </select>
750
+ <span class="description"><?php esc_html_e('Where to display the pagination on the page.', 'wp-paginate'); ?></span></td>
751
  </tr>
752
  <tr valign="top">
753
+ <th scope="row"><?php esc_html_e('Hide Standard Pagination:', 'wp-paginate'); ?></th>
754
  <td><label for="hide-standard-pagination">
755
  <?php
756
  if(isset($this->options['hide-standard-pagination']))
758
  else
759
  $hide_standard_pagination = 'none';
760
  ?>
761
+ <input type="checkbox" id="hide-standard-pagination" name="hide-standard-pagination" <?php echo esc_attr(($hide_standard_pagination === true) ? "checked='checked'" : "") ?>/> <?php esc_html_e('Hide the standard theme default pagination.', 'wp-paginate'); ?></label></td>
762
  </tr>
763
  </table>
764
  <p>&nbsp;</p>
765
+ <h3><?php esc_html_e('Appearance', 'wp-paginate'); ?></h3>
766
  <table class="form-table">
767
  <tr valign="top">
768
+ <th scope="row"><?php esc_html_e('Pagination Font:', 'wp-paginate'); ?></th>
769
  <td>
770
  <?php
771
  if(isset($this->options['font']))
776
  <select name="font" id="font">
777
  <?php foreach ($this->fonts as $key => $name) { ?>
778
  <?php $selected = ($font == $key) ? 'selected="selected"' : ''; ?>
779
+ <option value="<?php echo esc_attr($key) ?>" <?php echo esc_attr($selected) ?>><?php echo esc_html($name) ?></option>
780
  <?php } ?>
781
  </select>
782
+ <span class="description"><?php esc_html_e('Select the font to use with the pagination.', 'wp-paginate'); ?></span></td>
783
  </tr>
784
  <tr valign="top">
785
+ <th scope="row"><?php esc_html_e('Hide Ellipses:', 'wp-paginate'); ?></th>
786
  <td><label for="hide-ellipses">
787
  <?php
788
  if(isset($this->options['hide-ellipses']))
790
  else
791
  $hide_ellipses = 'none';
792
  ?>
793
+ <input type="checkbox" id="hide-ellipses" name="hide-ellipses" <?php echo esc_attr(($hide_ellipses === true) ? "checked='checked'" : "") ?>/> <?php esc_html_e('Remove ellipses from the pagination links.', 'wp-paginate'); ?></label></td>
794
  </tr>
795
  <tr valign="top">
796
+ <th scope="row"><?php esc_html_e('Button Style:', 'wp-paginate'); ?></th>
797
  <?php
798
  if(isset($this->options['preset'])) {
799
  $preset_option = $this->options['preset'];
801
  $preset_option = 'default';
802
  }
803
  ?>
804
+ <input type='hidden' value='<?php echo esc_attr($preset_option) ?>' name='preset' id='preset'>
805
  <td>
806
+ <p><?php esc_html_e('Choose a preset style from the list below.', 'wp-paginate'); ?></p>
807
  <table class="button-styles">
808
  <?php foreach($this->presets as $preset ) { ?>
809
  <tr>
810
  <td>
811
+ <?php echo esc_html($preset[1]) ?>
812
  </td>
813
  <td>
814
+ <input type="radio" name="preset" id="preset" value="<?php echo esc_attr($preset[0]) ?>" <?php echo esc_attr(($preset_option === $preset[0]) ? 'checked' : '') ?>>
815
  </td>
816
  <td>
817
+ <img alt="<?php echo esc_attr($preset[1]) ?> image" src="<?php echo esc_url($this->pluginurl . "images/" . $preset[2]) ?>" width="326" height="70">
818
  </td>
819
  </tr>
820
  <?php } ?>
823
  </tr>
824
  </table>
825
  <p>&nbsp;</p>
826
+ <h3><?php esc_html_e('Advanced Settings', 'wp-paginate'); ?></h3>
827
  <table class="form-table">
828
  <tr valign="top">
829
+ <th scope="row"><?php esc_html_e('Before Markup:', 'wp-paginate'); ?></th>
830
  <td><input name="before" type="text" id="before" size="40" value="<?php echo esc_attr(stripslashes(wp_kses_decode_entities($this->options['before']))); ?>"/>
831
+ <span class="description"><?php esc_html_e('The HTML markup to display before the pagination code.', 'wp-paginate'); ?></span></td>
832
  </tr>
833
  <tr valign="top">
834
+ <th scope="row"><?php esc_html_e('After Markup:', 'wp-paginate'); ?></th>
835
  <td><input name="after" type="text" id="after" size="40" value="<?php echo esc_attr(stripslashes(wp_kses_decode_entities($this->options['after']))); ?>"/>
836
+ <span class="description"><?php esc_html_e('The HTML markup to display after the pagination code.', 'wp-paginate'); ?></span></td>
837
  </tr>
838
  <tr valign="top">
839
+ <th scope="row"><?php esc_html_e('Markup Display:', 'wp-paginate'); ?></th>
840
  <td><label for="empty">
841
+ <input type="checkbox" id="empty" name="empty" <?php echo esc_attr(($this->options['empty'] === true) ? "checked='checked'" : "") ?>/> <?php esc_html_e('Show Before Markup and After Markup, even if the page list is empty?', 'wp-paginate'); ?></label></td>
842
  </tr>
843
  <tr valign="top">
844
+ <th scope="row"><?php esc_html_e('WP-Paginate CSS File:', 'wp-paginate'); ?></th>
845
  <td><label for="css">
846
+ <input type="checkbox" id="css" name="css" <?php echo esc_attr(($this->options['css'] === true) ? "checked='checked'" : "") ?>/> <?php printf(esc_html__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for <code>wp-paginate.css</code> in your theme directory (<code>themes/%s</code>).', 'wp-paginate'), get_template()); ?></label></td>
847
  </tr>
848
  <?php
849
  if(!isset($this->options['slash']))
850
  $this->options['slash'] = false;
851
  ?>
852
  <tr valign="top">
853
+ <th scope="row"><?php esc_html_e('Add trailing slash:', 'wp-paginate'); ?></th>
854
  <td><label for="slash">
855
+ <input type="checkbox" id="css" name="slash" <?php echo esc_attr(($this->options['slash'] === true) ? "checked='checked'" : "") ?>/> <?php printf(esc_html__('Adds a trailing slash to the end of pagination links.', 'wp-paginate'), get_template()); ?></label></td>
856
  </tr>
857
 
858
  <tr valign="top">
859
+ <th scope="row"><?php esc_html_e('Page Range:', 'wp-paginate'); ?></th>
860
  <td>
861
  <select name="range" id="range">
862
  <?php for ($i=1; $i<=10; $i++) : ?>
863
+ <option value="<?php echo esc_attr($i) ?>" <?php echo esc_attr(($i == $this->options['range']) ? "selected='selected'" : "") ?>><?php echo esc_html($i) ?></option>
864
  <?php endfor; ?>
865
  </select>
866
+ <span class="description"><?php esc_html_e('The number of page links to show before and after the current page. Recommended value: 3', 'wp-paginate'); ?></span></td>
867
  </tr>
868
  <tr valign="top">
869
+ <th scope="row"><?php esc_html_e('Page Anchors:', 'wp-paginate'); ?></th>
870
  <td>
871
  <select name="anchor" id="anchor">
872
  <?php for ($i=0; $i<=10; $i++) : ?>
873
+ <option value="<?php echo esc_attr($i) ?>" <?php echo esc_attr(($i == $this->options['anchor']) ? "selected='selected'" : "") ?>><?php echo esc_html($i) ?></option>
874
  <?php endfor; ?>
875
  </select>
876
+ <span class="description"><?php esc_html_e('The number of links to always show at beginning and end of pagination. Recommended value: 1', 'wp-paginate'); ?></span></td>
877
  </tr>
878
  <tr valign="top">
879
+ <th scope="row"><?php esc_html_e('Page Gap:', 'wp-paginate'); ?></th>
880
  <td>
881
  <select name="gap" id="gap">
882
  <?php for ($i=1; $i<=10; $i++) : ?>
883
+ <option value="<?php echo esc_attr($i) ?>" <?php echo esc_attr(($i == $this->options['gap']) ? "selected='selected'" : "") ?>><?php echo esc_html($i) ?></option>
884
  <?php endfor; ?>
885
  </select>
886
+ <span class="description"><?php esc_html_e('The minimum number of pages in a gap before an ellipsis (...) is added. Recommended value: 3', 'wp-paginate'); ?></span></td>
887
  </tr>
888
  </table>
889
  <p class="submit">
890
+ <input type="submit" id="wpp-save-changes" value="<?php esc_html_e('Save Changes', 'wp-paginate'); ?>" name="wp_paginate_save" class="button-primary" />
891
  </p>
892
  </form>
893
  <p>&nbsp;</p>
928
  <hr>
929
  <?php } ?>
930
 
931
+ <h2><?php esc_html_e('Need Support?', 'wp-paginate'); ?></h2>
932
+ <p><?php printf(esc_html__('For questions, issues or feature requests, please post them in the %s and make sure to tag the post with wp-paginate.', 'wp-paginate'), '<a href="https://wordpress.org/support/plugin/wp-paginate">WordPress Forum</a>'); ?></p>
933
  <p>&nbsp;</p>
934
  <div id="wpp-plugins">
935
 
936
+ <div class="paginate-info"><?php esc_html_e( 'WP Paginate is Maintained and Upgraded by Max Foundry', 'wp-paginate' ); ?></div>
937
+ <div class="paginate-info"><?php esc_html_e( 'Developed Originally by Eric Martin', 'wp-paginate' ); ?></div>
938
+ <div class="mf-plugins"><?php esc_html_e( 'Max Foundry Produces These Other Fine Plugins', 'wp-paginate' ); ?></div>
939
 
940
  <div class="column-left">
941
+ <a href="<?php echo esc_url_raw(WPP_MAXBUTTONS_LINK) ?>" target="_blank">
942
  <img alt="maxbuttons logo" src="<?php echo $this->pluginurl ?>images/MBP.png" width="283" height="142">
943
  </a>
944
+ <a href="<?php echo esc_url_raw(WPP_MAXBUTTONS_LINK) ?>" target="_blank">
945
+ <div class="wpp-plugin-title"><?php esc_html_e( 'WordPress Button Plugin', 'wp-paginate' ); ?></div>
946
  </a>
947
  </div>
948
  <div class="column-center">
949
+ <a href="<?php echo esc_url_raw(WPP_MAXGALLERIA_LINK) ?>" target="_blank">
950
+ <img alt="maxgalleria logo" src="<?php echo esc_url($this->pluginurl . "images/MG_logo.png") ?>" width="283" height="142">
951
  </a>
952
+ <a href="<?php echo esc_url_raw(WPP_MAXGALLERIA_LINK) ?>" target="_blank">
953
+ <div class="wpp-plugin-title"><?php esc_html_e( 'WordPress Gallery Plugin', 'wp-paginate' ); ?></div>
954
  </a>
955
  </div>
956
  <div class="column-right">
957
+ <a href="<?php echo esc_url_raw(WPP_MEDIA_LIBRARY_PLUS_PRO_LINK) ?>" target="_blank">
958
+ <img alt="media library plus pro logo" src="<?php echo esc_url($this->pluginurl . "images/MLPP-card-red.png") ?>" width="283" height="142">
959
  </a>
960
+ <a href="<?php echo esc_url_raw(WPP_MEDIA_LIBRARY_PLUS_PRO_LINK) ?>" target="_blank">
961
+ <div class="wpp-plugin-title"><?php esc_html_e( 'WordPress Media Library Folders', 'wp-paginate' ); ?></div>
962
  </a>
963
  </div>
964
  </div>
975
 
976
  function wpp_custom_code_tab() {
977
  if ( ! current_user_can( 'edit_plugins' ) )
978
+ wp_die( esc_html__( 'You do not have sufficient permissions to edit plugins for this site.', 'wp-paginate' ) );
979
 
980
  $message = $content = '';
981
  $extension = 'css';
1004
  if ( $f = fopen( $real_css_file, 'w+' ) ) {
1005
  fwrite( $f, $newcontent_css );
1006
  fclose( $f );
1007
+ $message .= sprintf( esc_html__( 'File %s edited successfully.', 'wp-paginate' ), '<i>' . $css_file . '</i>' ) . ' ';
1008
  } else {
1009
+ $error .= esc_html__( 'Not enough permissions to create or update the file', 'wp-paginate' ) . ' ' . $real_css_file . '. ';
1010
  }
1011
 
1012
  if(isset($_REQUEST['wpp_custom_css_active']))
1017
  update_option('wpp_custom_css_active', $wpp_custom_css_active, true );
1018
 
1019
  if ( ! empty( $error ) )
1020
+ $error .= ' <a href="https://codex.wordpress.org/Changing_File_Permissions" target="_blank">' . esc_html__( 'Learn more', 'wp-paginate' ) . '</a>';
1021
  }
1022
 
1023
  if ( file_exists( $real_css_file ) ) {
1029
  $content_css = "";
1030
 
1031
  if ( ! empty( $message ) ) { ?>
1032
+ <div id="message" class="below-h2 updated notice is-dismissible"><p><?php echo esc_html($message) ?></p></div>
1033
  <?php } ?>
1034
  <form action="" method="post">
1035
  <p>
1036
+ <?php esc_html_e( 'These styles will be added to the header on all pages of your site.', 'wp-paginate' ); ?>
1037
  </p>
1038
  <p><big>
1039
  <?php if ( ! file_exists( $real_css_file ) || ( is_writeable( $real_css_file ) ) ) {
1040
+ echo esc_html__( 'Editing', 'wp-paginate' ) . ' <strong>' . $css_file . '</strong>';
1041
  } else {
1042
+ echo esc_html__( 'Browsing', 'wp-paginate' ) . ' <strong>' . $css_file . '</strong>';
1043
  } ?>
1044
  </big></p>
1045
  <p><label><input type="checkbox" name="wpp_custom_css_active" value="1" <?php checked( $wpp_custom_css_active, 'on'); ?> /> <?php _e( 'Activate', 'wp-paginate' ); ?></label></p>
1047
  <?php if ( ! file_exists( $real_css_file ) || is_writeable( $real_css_file )) { ?>
1048
  <p class="submit">
1049
  <input type="hidden" name="wpp_update_custom_code" value="submit" />
1050
+ <?php submit_button( esc_html__( 'Save Changes', 'wp-paginate' ), 'primary', 'submit', false );
1051
  wp_nonce_field( 'wpp_update_nonce' . $css_file ); ?>
1052
  </p>
1053
  <?php } else { ?>
1054
+ <p><em><?php printf( esc_html__( 'You need to make this files writable before you can save your changes. See %s the Codex %s for more information.', 'wp-paginate' ),
1055
  '<a href="https://codex.wordpress.org/Changing_File_Permissions" target="_blank">',
1056
  '</a>' ); ?></em></p>
1057
  <?php } ?>
1157
  if( current_user_can( 'manage_options' ) ) { ?>
1158
  <div class="updated notice wpp-notice">
1159
  <div id='wp-paginate-logo'></div>
1160
+ <div id='wpp-notice-1'><p id='wpp-notice-title'><?php esc_html_e( 'Love WP-Paginate?', 'wp-paginate' ); ?></p>
1161
+ <p><?php esc_html_e( 'Your rating is a big help! We really appreciate it!', 'wp-paginate' ); ?></p>
1162
 
1163
  <ul id="wpp-review-notice-links">
1164
+ <li> <span class="dashicons dashicons-smiley"></span><a id="wpp-review-already"><?php esc_html_e( "I've already left a review", 'wp-paginate' ); ?></a></li>
1165
+ <li><span class="dashicons dashicons-calendar-alt"></span><a id="wpp-review-later"><?php esc_html_e( "Maybe Later", 'wp-paginate' ); ?></a></li>
1166
+ <li><span class="dashicons dashicons-external"></span><a id="wpp-write-review" target="_blank" href="https://wordpress.org/support/plugin/wp-paginate/reviews/?filter=5"><?php esc_html_e( "Sure! I'd love to!", 'wp-paginate' ); ?></a></li>
1167
  </ul>
1168
  </div>
1169
  <a class="dashicons dashicons-dismiss close-wpp-notice" id="wpp-dismiss"></a>
1175
  public function wpp_dismiss_notice() {
1176
 
1177
  if ( !wp_verify_nonce( $_POST['nonce'], WP_PAGINATE_NONCE)) {
1178
+ exit(esc_html__('missing nonce! Please refresh the page.', 'wp-paginate'));
1179
  }
1180
 
1181
  $current_user_id = get_current_user_id();
1189
  public function wpp_set_review_later() {
1190
 
1191
  if ( !wp_verify_nonce( $_POST['nonce'], WP_PAGINATE_NONCE)) {
1192
+ exit(esc_html__('missing nonce! Please refresh the page.', 'wp-paginate'));
1193
  }
1194
 
1195
  $current_user_id = get_current_user_id();
1207
  ?>
1208
  <div id="utp-content">
1209
  <div id="mf-logo">
1210
+ <img alt="<?php esc_html_e('maxfoundry logo', 'wp-paginate'); ?>" src="<?php echo esc_url($this->pluginurl . '/images/max-foundry.png') ?>" width="172" height="32">
1211
  </div>
1212
  <div style="clear:both"></div>
1213
  <div id="utp-banner">
1214
  <div id="utp-title-wrap">
1215
+ <div id="utp-title"><?php esc_html_e('WP PAGINATE PRO', 'wp-paginate'); ?></div>
1216
  </div>
1217
+ <a href="<?php echo esc_url_raw(WPP_WP_PAGINATE_PRO_LINK) ?>" target="_blank">
1218
+ <img class="buy-now-button" alt="<?php esc_html_e('buy now button', 'wp-paginate'); ?>" src="<?php echo esc_url($this->pluginurl . "/images/buy-now-btn.png") ?>" width="205" height="68">
1219
  </a>
1220
  </div>
1221
+ <img id='wppp-logo' alt="<?php esc_html_e('wp-pagination pro logo', 'wp-paginate'); ?>" src="<?php echo esc_url($this->pluginurl . '/images/wpp-pro-logo-2.png') ?>" width="169" height="61">
1222
 
1223
  <div class="utp-text">
1224
+ <?php esc_html_e('WP-Paginate Pro come with 11 Beautiful<br>Preset Layouts and Multi Site support!', 'wp-paginate'); ?>
1225
  </div>
1226
 
1227
  <div id="wppp-buttons">
1228
+ <img alt="<?php esc_html_e('WP Pagination Pro buttons styles', 'wp-paginate'); ?>" src="<?php echo esc_url($this->pluginurl . '/images/wppp-buttons.png') ?>" width="646" height="713">
1229
  </div>
1230
 
1231
  <div class="utp-text">
1232
+ <?php esc_html_e('Use These Customizer Settings to Get the<br>Exact Look and Feel You Want', 'wp-paginate'); ?>
1233
  </div>
1234
 
1235
  <div id="wppp-customizer">
1236
+ <img alt="<?php esc_html_e('WP Pagination Por button Style customizer', 'wp-paginate'); ?>" src="<?php echo esc_url($this->pluginurl . '/images/wppp-customizer.png') ?>" width="650" height="380">
1237
  </div>
1238
 
1239
+ <a href="<?php echo esc_url_raw(WPP_WP_PAGINATE_PRO_LINK) ?>" target="_blank">
1240
+ <img class="buy-now-button" alt="<?php esc_html_e('buy now button', 'wp-paginate'); ?>" src="<?php echo esc_url($this->pluginurl . "/images/buy-now-btn.png") ?>" width="205" height="68">
1241
  </a>
1242
 
1243
  </div>