Eggplant 301 Redirects - Version 2.51

Version Description

  • 2020/08/13
  • security fixes - thank you Erin
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Eggplant 301 Redirects
Version 2.51
Comparing to
See all releases

Code changes from version 2.50 to 2.51

css/eps_redirect.css CHANGED
@@ -64,6 +64,10 @@
64
  /*---------------------- notifications ---------------------*/
65
  /*----------------------------------------------------------*/
66
 
 
 
 
 
67
  .eps-notification-area {
68
  -webkit-border-radius: 4px;
69
  -moz-border-radius: 4px;
64
  /*---------------------- notifications ---------------------*/
65
  /*----------------------------------------------------------*/
66
 
67
+ .rating-box p {
68
+ font-size: 14px;
69
+ }
70
+
71
  .eps-notification-area {
72
  -webkit-border-radius: 4px;
73
  -moz-border-radius: 4px;
eps-301-redirects.php CHANGED
@@ -2,12 +2,12 @@
2
  /*
3
  Plugin Name: 301 Redirects
4
  Description: Easily create and manage 301 redirects.
5
- Version: 2.50
6
  Author: WebFactory Ltd
7
  Author URI: https://www.webfactoryltd.com/
8
  Text Domain: eps-301-redirects
9
 
10
- Copyright 2015 - 2019 Web factory Ltd (email: support@webfactoryltd.com)
11
 
12
  This program is free software; you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License, version 2, as
@@ -68,6 +68,8 @@ if (!defined('EPS_REDIRECT_PRO')) {
68
  add_action('admin_init', array($this, 'clear_cache'));
69
  }
70
 
 
 
71
  add_action('wp_ajax_eps_redirect_get_new_entry', array($this, 'ajax_get_entry'));
72
  add_action('wp_ajax_eps_redirect_delete_entry', array($this, 'ajax_eps_delete_entry'));
73
  add_action('wp_ajax_eps_redirect_get_inline_edit_entry', array($this, 'ajax_get_inline_edit_entry'));
@@ -98,7 +100,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
98
  *
99
  * This function will redirect the user if it can resolve that this url request has a redirect.
100
  *
101
- * @author epstudios
102
  *
103
  */
104
  public function do_redirect()
@@ -148,7 +150,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
148
  * Will construct and format the from url from what we have in storage.
149
  *
150
  * @return url string
151
- * @author epstudios
152
  *
153
  */
154
  private function format_from_url($string)
@@ -170,7 +172,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
170
  * This function returns the current url.
171
  *
172
  * @return URL string
173
- * @author epstudios
174
  *
175
  */
176
  public static function get_url()
@@ -180,10 +182,76 @@ if (!defined('EPS_REDIRECT_PRO')) {
180
  //return strtolower( urldecode( $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
181
  }
182
 
 
 
 
 
 
 
183
 
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
 
 
 
187
 
188
 
189
  /**
@@ -193,7 +261,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
193
  * A necessary data parser to change the POST arrays into save-able data.
194
  *
195
  * @return array of redirects
196
- * @author epstudios
197
  *
198
  */
199
  public static function _parse_serial_array($array)
@@ -206,8 +274,8 @@ if (!defined('EPS_REDIRECT_PRO')) {
206
  if (empty($array['url_to'][$i]) || empty($array['url_from'][$i])) continue;
207
  $new_redirects[] = array(
208
  'id' => isset($array['id'][$i]) ? $array['id'][$i] : null,
209
- 'url_from' => $array['url_from'][$i],
210
- 'url_to' => $array['url_to'][$i],
211
  'type' => (is_numeric($array['url_to'][$i])) ? 'post' : 'url',
212
  'status' => isset($array['status'][$i]) ? $array['status'][$i] : '301'
213
  );
@@ -224,7 +292,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
224
  * TODO: Maybe refactor this to reduce the number of queries.
225
  *
226
  * @return nothing
227
- * @author epstudios
228
  */
229
  public function ajax_save_redirect()
230
  {
@@ -237,8 +305,8 @@ if (!defined('EPS_REDIRECT_PRO')) {
237
 
238
  $update = array(
239
  'id' => ($_POST['id']) ? intval($_POST['id']) : false,
240
- 'url_from' => $_POST['url_from'], // remove the $root from the url if supplied, and a leading /
241
- 'url_to' => $_POST['url_to'],
242
  'type' => (is_numeric($_POST['url_to']) ? 'post' : 'url'),
243
  'status' => $_POST['status']
244
  );
@@ -292,7 +360,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
292
  * TODO: Maybe refactor this to reduce the number of queries.
293
  *
294
  * @return nothing
295
- * @author epstudios
296
  */
297
  public static function _save_redirects($array)
298
  {
@@ -356,7 +424,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
356
  * Gets the redirects. Can be switched to return Active Only redirects.
357
  *
358
  * @return array of redirects
359
- * @author epstudios
360
  *
361
  */
362
  public static function get_redirects($active_only = false)
@@ -407,7 +475,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
407
  * Add +1 to the specified field for a given id
408
  *
409
  * @return the result
410
- * @author epstudios
411
  *
412
  */
413
  public static function increment_field($id, $field)
@@ -425,7 +493,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
425
  * This function will list out all the current entries.
426
  *
427
  * @return html string
428
- * @author epstudios
429
  *
430
  */
431
  public static function list_redirects()
@@ -451,7 +519,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
451
  * This function will remove an entry.
452
  *
453
  * @return nothing
454
- * @author epstudios
455
  *
456
  */
457
  public static function ajax_eps_delete_entry()
@@ -486,7 +554,7 @@ if (!defined('EPS_REDIRECT_PRO')) {
486
  * This function will return a blank row ready for user input.
487
  *
488
  * @return html string
489
- * @author epstudios
490
  *
491
  */
492
  public static function get_entry($redirect_id = false)
@@ -557,7 +625,7 @@ public function clear_cache()
557
  *
558
  * This function will output a variable containing the admin ajax url for use in javascript.
559
  *
560
- * @author epstudios
561
  *
562
  */
563
  public static function set_ajax_url()
@@ -584,7 +652,7 @@ public static function check_404()
584
  *
585
  * @return void
586
  * @param $string = the object to prettify; Typically a string.
587
- * @author epstudios
588
  */
589
  if (!function_exists('eps_prettify')) {
590
  function eps_prettify($string)
2
  /*
3
  Plugin Name: 301 Redirects
4
  Description: Easily create and manage 301 redirects.
5
+ Version: 2.51
6
  Author: WebFactory Ltd
7
  Author URI: https://www.webfactoryltd.com/
8
  Text Domain: eps-301-redirects
9
 
10
+ Copyright 2015 - 2020 Web factory Ltd (email: support@webfactoryltd.com)
11
 
12
  This program is free software; you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License, version 2, as
68
  add_action('admin_init', array($this, 'clear_cache'));
69
  }
70
 
71
+ add_filter('install_plugins_table_api_args_featured', array($this, 'featured_plugins_tab'));
72
+ add_filter('install_plugins_table_api_args_popular', array($this, 'featured_plugins_tab'));
73
  add_action('wp_ajax_eps_redirect_get_new_entry', array($this, 'ajax_get_entry'));
74
  add_action('wp_ajax_eps_redirect_delete_entry', array($this, 'ajax_eps_delete_entry'));
75
  add_action('wp_ajax_eps_redirect_get_inline_edit_entry', array($this, 'ajax_get_inline_edit_entry'));
100
  *
101
  * This function will redirect the user if it can resolve that this url request has a redirect.
102
  *
103
+ * @author WebFactory Ltd
104
  *
105
  */
106
  public function do_redirect()
150
  * Will construct and format the from url from what we have in storage.
151
  *
152
  * @return url string
153
+ * @author WebFactory Ltd
154
  *
155
  */
156
  private function format_from_url($string)
172
  * This function returns the current url.
173
  *
174
  * @return URL string
175
+ * @author WebFactory Ltd
176
  *
177
  */
178
  public static function get_url()
182
  //return strtolower( urldecode( $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
183
  }
184
 
185
+ public function featured_plugins_tab($args)
186
+ {
187
+ add_filter('plugins_api_result', array($this, 'plugins_api_result'), 10);
188
+
189
+ return $args;
190
+ } // featured_plugins_tab
191
 
192
 
193
+ /**
194
+ * Append plugin favorites list with recommended addon plugins
195
+ *
196
+ * @since 1.5
197
+ *
198
+ * @return object API response
199
+ */
200
+ public function plugins_api_result($res)
201
+ {
202
+ remove_filter('plugins_api_result', array($this, 'plugins_api_result'), 10);
203
+ $res = $this->add_plugin_favs('wp-reset', $res);
204
+ $res = $this->add_plugin_favs('wp-external-links', $res);
205
+ $res = $this->add_plugin_favs('simple-author-box', $res);
206
+ return $res;
207
+ } // plugins_api_result
208
+
209
+
210
+ /**
211
+ * Create plugin favorites list plugin object
212
+ *
213
+ * @since 1.5
214
+ *
215
+ * @return object favorite plugins
216
+ */
217
+ public function add_plugin_favs($plugin_slug, $res)
218
+ {
219
+ if (!isset($res->plugins) || !is_array($res->plugins)) {
220
+ return $res;
221
+ }
222
 
223
+ if (!empty($res->plugins) && is_array($res->plugins)) {
224
+ foreach ($res->plugins as $plugin) {
225
+ if (is_object($plugin) && !empty($plugin->slug) && $plugin->slug == $plugin_slug) {
226
+ return $res;
227
+ }
228
+ } // foreach
229
+ }
230
+
231
+ $plugin_info = get_transient('wf-plugin-info-' . $plugin_slug);
232
+ if ($plugin_info && is_object($plugin_info)) {
233
+ array_unshift($res->plugins, $plugin_info);
234
+ } else {
235
+ $plugin_info = plugins_api('plugin_information', array(
236
+ 'slug' => $plugin_slug,
237
+ 'is_ssl' => is_ssl(),
238
+ 'fields' => array(
239
+ 'banners' => true,
240
+ 'reviews' => true,
241
+ 'downloaded' => true,
242
+ 'active_installs' => true,
243
+ 'icons' => true,
244
+ 'short_description' => true,
245
+ )
246
+ ));
247
+ if (!is_wp_error($plugin_info) && is_object($plugin_info) && $plugin_info) {
248
+ array_unshift($res->plugins, $plugin_info);
249
+ set_transient('wf-plugin-info-' . $plugin_slug, $plugin_info, DAY_IN_SECONDS * 7);
250
+ }
251
+ }
252
 
253
+ return $res;
254
+ } // add_plugin_favs
255
 
256
 
257
  /**
261
  * A necessary data parser to change the POST arrays into save-able data.
262
  *
263
  * @return array of redirects
264
+ * @author WebFactory Ltd
265
  *
266
  */
267
  public static function _parse_serial_array($array)
274
  if (empty($array['url_to'][$i]) || empty($array['url_from'][$i])) continue;
275
  $new_redirects[] = array(
276
  'id' => isset($array['id'][$i]) ? $array['id'][$i] : null,
277
+ 'url_from' => esc_attr(strip_tags($array['url_from'][$i])),
278
+ 'url_to' => esc_attr(strip_tags($array['url_to'][$i])),
279
  'type' => (is_numeric($array['url_to'][$i])) ? 'post' : 'url',
280
  'status' => isset($array['status'][$i]) ? $array['status'][$i] : '301'
281
  );
292
  * TODO: Maybe refactor this to reduce the number of queries.
293
  *
294
  * @return nothing
295
+ * @author WebFactory Ltd
296
  */
297
  public function ajax_save_redirect()
298
  {
305
 
306
  $update = array(
307
  'id' => ($_POST['id']) ? intval($_POST['id']) : false,
308
+ 'url_from' => esc_attr(strip_tags($_POST['url_from'])), // remove the $root from the url if supplied, and a leading /
309
+ 'url_to' => esc_attr(strip_tags($_POST['url_to'])),
310
  'type' => (is_numeric($_POST['url_to']) ? 'post' : 'url'),
311
  'status' => $_POST['status']
312
  );
360
  * TODO: Maybe refactor this to reduce the number of queries.
361
  *
362
  * @return nothing
363
+ * @author WebFactory Ltd
364
  */
365
  public static function _save_redirects($array)
366
  {
424
  * Gets the redirects. Can be switched to return Active Only redirects.
425
  *
426
  * @return array of redirects
427
+ * @author WebFactory Ltd
428
  *
429
  */
430
  public static function get_redirects($active_only = false)
475
  * Add +1 to the specified field for a given id
476
  *
477
  * @return the result
478
+ * @author WebFactory Ltd
479
  *
480
  */
481
  public static function increment_field($id, $field)
493
  * This function will list out all the current entries.
494
  *
495
  * @return html string
496
+ * @author WebFactory Ltd
497
  *
498
  */
499
  public static function list_redirects()
519
  * This function will remove an entry.
520
  *
521
  * @return nothing
522
+ * @author WebFactory Ltd
523
  *
524
  */
525
  public static function ajax_eps_delete_entry()
554
  * This function will return a blank row ready for user input.
555
  *
556
  * @return html string
557
+ * @author WebFactory Ltd
558
  *
559
  */
560
  public static function get_entry($redirect_id = false)
625
  *
626
  * This function will output a variable containing the admin ajax url for use in javascript.
627
  *
628
+ * @author WebFactory Ltd
629
  *
630
  */
631
  public static function set_ajax_url()
652
  *
653
  * @return void
654
  * @param $string = the object to prettify; Typically a string.
655
+ * @author WebFactory Ltd
656
  */
657
  if (!function_exists('eps_prettify')) {
658
  function eps_prettify($string)
eps-form-elements.php CHANGED
@@ -27,7 +27,7 @@ if (!defined('ABSPATH')) {
27
  * This function will initialze a series of html form elements so a user can narrow down their redirect destination.
28
  *
29
  * @return html string
30
- * @author epstudios
31
  *
32
  */
33
 
@@ -53,7 +53,7 @@ function eps_get_selector($redirect = false)
53
  $html .= '<input class="eps-url-input select-eps-url-input"
54
  type="text"
55
  name="redirect[url_to][]"
56
- value="' . (isset($redirect->url_to) ? $redirect->url_to : null) . '"
57
  placeholder="' . get_bloginfo('url') . '" ' . (!isset($redirect->type) || ((isset($redirect->type) && $redirect->type != 'post')) ? null : ' style="display:none;"') .
58
  '" />';
59
 
@@ -68,7 +68,7 @@ function eps_get_selector($redirect = false)
68
  * This function will output the formatted destination string.
69
  *
70
  * @return html string
71
- * @author epstudios
72
  *
73
  */
74
  function eps_get_destination($redirect = false)
@@ -96,9 +96,9 @@ function eps_get_destination($redirect = false)
96
  } else {
97
  // This is redirect points to a url
98
  ?>
99
- <a target="_blank" class="eps-url" href="<?php echo esc_attr($redirect->url_to); ?>" title="<?php echo esc_attr($redirect->url_to); ?>">
100
  <span class="eps-url-root eps-url-startcap">URL:</span><span
101
- class="eps-url-fragment eps-url-endcap "><?php echo esc_attr($redirect->url_to); ?></span>
102
  </a>
103
  <?php
104
 
@@ -117,7 +117,7 @@ function eps_get_destination($redirect = false)
117
  * This function will output the available destination types.
118
  *
119
  * @return html string
120
- * @author epstudios
121
  *
122
  */
123
  function eps_get_type_select($post_types, $current_post = false)
@@ -141,7 +141,7 @@ function eps_get_type_select($post_types, $current_post = false)
141
  * This function will output the available post types.
142
  *
143
  * @return html string
144
- * @author epstudios
145
  *
146
  */
147
  function eps_get_post_type_selects($post_type, $current_post = false)
@@ -171,7 +171,7 @@ function eps_get_post_type_selects($post_type, $current_post = false)
171
  * This function will output a select box with all the taxonomies and terms.
172
  *
173
  * @return html string
174
- * @author epstudios
175
  *
176
  */
177
  function eps_get_term_archive_select()
27
  * This function will initialze a series of html form elements so a user can narrow down their redirect destination.
28
  *
29
  * @return html string
30
+ * @author WebFactory Ltd
31
  *
32
  */
33
 
53
  $html .= '<input class="eps-url-input select-eps-url-input"
54
  type="text"
55
  name="redirect[url_to][]"
56
+ value="' . (isset($redirect->url_to) ? stripslashes(esc_attr($redirect->url_to)) : null) . '"
57
  placeholder="' . get_bloginfo('url') . '" ' . (!isset($redirect->type) || ((isset($redirect->type) && $redirect->type != 'post')) ? null : ' style="display:none;"') .
58
  '" />';
59
 
68
  * This function will output the formatted destination string.
69
  *
70
  * @return html string
71
+ * @author WebFactory Ltd
72
  *
73
  */
74
  function eps_get_destination($redirect = false)
96
  } else {
97
  // This is redirect points to a url
98
  ?>
99
+ <a target="_blank" class="eps-url" href="<?php echo stripslashes(esc_attr($redirect->url_to)); ?>" title="<?php echo stripslashes(esc_attr($redirect->url_to)); ?>">
100
  <span class="eps-url-root eps-url-startcap">URL:</span><span
101
+ class="eps-url-fragment eps-url-endcap "><?php echo stripslashes(esc_attr($redirect->url_to)); ?></span>
102
  </a>
103
  <?php
104
 
117
  * This function will output the available destination types.
118
  *
119
  * @return html string
120
+ * @author WebFactory Ltd
121
  *
122
  */
123
  function eps_get_type_select($post_types, $current_post = false)
141
  * This function will output the available post types.
142
  *
143
  * @return html string
144
+ * @author WebFactory Ltd
145
  *
146
  */
147
  function eps_get_post_type_selects($post_type, $current_post = false)
171
  * This function will output a select box with all the taxonomies and terms.
172
  *
173
  * @return html string
174
+ * @author WebFactory Ltd
175
  *
176
  */
177
  function eps_get_term_archive_select()
libs/eps-plugin-options.php CHANGED
@@ -240,7 +240,7 @@ if (!class_exists('EPS_Redirects_Plugin_Options')) {
240
  * This function initialize the plugin settings page.
241
  *
242
  * @return string
243
- * @author epstudios
244
  *
245
  */
246
  public function add_options_page()
@@ -261,7 +261,7 @@ if (!class_exists('EPS_Redirects_Plugin_Options')) {
261
  *
262
  * This function will create the admin page.
263
  *
264
- * @author epstudios
265
  *
266
  */
267
  public function do_admin_page()
240
  * This function initialize the plugin settings page.
241
  *
242
  * @return string
243
+ * @author WebFactory Ltd
244
  *
245
  */
246
  public function add_options_page()
261
  *
262
  * This function will create the admin page.
263
  *
264
+ * @author WebFactory Ltd
265
  *
266
  */
267
  public function do_admin_page()
plugin.php CHANGED
@@ -181,7 +181,7 @@ class EPS_Redirects_Plugin
181
  * This function will check the current version and do any fixes required
182
  *
183
  * @return string - version number.
184
- * @author epstudios
185
  *
186
  */
187
  public function update_self()
@@ -203,7 +203,7 @@ class EPS_Redirects_Plugin
203
  * Will migrate the old storage method to the new tables.
204
  *
205
  * @return nothing
206
- * @author epstudios
207
  *
208
  */
209
  public static function _migrate_to_v2()
@@ -234,7 +234,7 @@ class EPS_Redirects_Plugin
234
  * Creates the database architecture
235
  *
236
  * @return nothing
237
- * @author epstudios
238
  *
239
  */
240
  public static function _create_redirect_table()
@@ -268,7 +268,7 @@ class EPS_Redirects_Plugin
268
  * Enqueues the resources, and makes sure we have what we need to proceed.
269
  *
270
  * @return nothing
271
- * @author epstudios
272
  *
273
  */
274
  public static function plugin_resources()
@@ -309,7 +309,7 @@ class EPS_Redirects_Plugin
309
  * This function handles various POST requests.
310
  *
311
  * @return nothing
312
- * @author epstudios
313
  *
314
  */
315
  public function check_plugin_actions()
@@ -331,7 +331,7 @@ class EPS_Redirects_Plugin
331
  $options = eps_dropdown_pages(array('post_type' => $post_type->name));
332
  set_transient('post_type_cache_' . $post_type->name, $options, HOUR_IN_SECONDS);
333
  }
334
- $this->add_admin_message("SUCCCESS: Cache Refreshed.", "updated");
335
  }
336
 
337
  // Save Redirects
@@ -352,7 +352,7 @@ class EPS_Redirects_Plugin
352
  * export_csv
353
  *
354
  * @return nothing
355
- * @author epstudios
356
  *
357
  */
358
  public static function export_csv()
@@ -388,7 +388,7 @@ class EPS_Redirects_Plugin
388
  * This function handles the upload of CSV files, in accordance to the upload method specified.
389
  *
390
  * @return html string
391
- * @author epstudios
392
  *
393
  */
394
  private function _upload()
@@ -449,10 +449,10 @@ class EPS_Redirects_Plugin
449
  continue;
450
  }
451
 
452
- $status = (isset($redirect[0])) ? $redirect[0] : false;
453
- $url_from = (isset($redirect[1])) ? $redirect[1] : false;
454
- $url_to = (isset($redirect[2])) ? $redirect[2] : false;
455
- $count = (isset($redirect[3])) ? $redirect[3] : false;
456
 
457
  switch (strtolower($status)) {
458
  case '404':
@@ -531,7 +531,7 @@ class EPS_Redirects_Plugin
531
  }
532
 
533
  $this->add_admin_message(sprintf(
534
- "SUCCCESS: %d New Redirects, %d Updated, %d Skipped, %d Errors. (Attempted to import %d redirects).",
535
  $counter['new'],
536
  $counter['updated'],
537
  $counter['skipped'],
@@ -550,7 +550,7 @@ class EPS_Redirects_Plugin
550
  *
551
  * Template Hooks
552
  *
553
- * @author epstudios
554
  *
555
  */
556
  public static function admin_panel_cache()
@@ -591,7 +591,7 @@ class EPS_Redirects_Plugin
591
  * This function will check the current version and do any fixes required
592
  *
593
  * @return string - version number.
594
- * @author epstudios
595
  *
596
  */
597
 
@@ -606,7 +606,7 @@ class EPS_Redirects_Plugin
606
  * Activation and Deactivation Handlers.
607
  *
608
  * @return nothing
609
- * @author epstudios
610
  */
611
  public function activation_error()
612
  {
@@ -634,7 +634,7 @@ class EPS_Redirects_Plugin
634
  *
635
  * These functions will output a variable containing the admin ajax url for use in javascript.
636
  *
637
- * @author epstudios
638
  *
639
  */
640
  protected function add_admin_message($message, $code)
181
  * This function will check the current version and do any fixes required
182
  *
183
  * @return string - version number.
184
+ * @author WebFactory Ltd
185
  *
186
  */
187
  public function update_self()
203
  * Will migrate the old storage method to the new tables.
204
  *
205
  * @return nothing
206
+ * @author WebFactory Ltd
207
  *
208
  */
209
  public static function _migrate_to_v2()
234
  * Creates the database architecture
235
  *
236
  * @return nothing
237
+ * @author WebFactory Ltd
238
  *
239
  */
240
  public static function _create_redirect_table()
268
  * Enqueues the resources, and makes sure we have what we need to proceed.
269
  *
270
  * @return nothing
271
+ * @author WebFactory Ltd
272
  *
273
  */
274
  public static function plugin_resources()
309
  * This function handles various POST requests.
310
  *
311
  * @return nothing
312
+ * @author WebFactory Ltd
313
  *
314
  */
315
  public function check_plugin_actions()
331
  $options = eps_dropdown_pages(array('post_type' => $post_type->name));
332
  set_transient('post_type_cache_' . $post_type->name, $options, HOUR_IN_SECONDS);
333
  }
334
+ $this->add_admin_message("Success: Cache Refreshed.", "updated");
335
  }
336
 
337
  // Save Redirects
352
  * export_csv
353
  *
354
  * @return nothing
355
+ * @author WebFactory Ltd
356
  *
357
  */
358
  public static function export_csv()
388
  * This function handles the upload of CSV files, in accordance to the upload method specified.
389
  *
390
  * @return html string
391
+ * @author WebFactory Ltd
392
  *
393
  */
394
  private function _upload()
449
  continue;
450
  }
451
 
452
+ $status = (isset($redirect[0])) ? esc_attr(strip_tags($redirect[0])) : false;
453
+ $url_from = (isset($redirect[1])) ? esc_attr(strip_tags($redirect[1])) : false;
454
+ $url_to = (isset($redirect[2])) ? esc_attr(strip_tags($redirect[2])) : false;
455
+ $count = (isset($redirect[3])) ? esc_attr(strip_tags($redirect[3])) : false;
456
 
457
  switch (strtolower($status)) {
458
  case '404':
531
  }
532
 
533
  $this->add_admin_message(sprintf(
534
+ "Success: %d New Redirects, %d Updated, %d Skipped, %d Errors. (Attempted to import %d redirects).",
535
  $counter['new'],
536
  $counter['updated'],
537
  $counter['skipped'],
550
  *
551
  * Template Hooks
552
  *
553
+ * @author WebFactory Ltd
554
  *
555
  */
556
  public static function admin_panel_cache()
591
  * This function will check the current version and do any fixes required
592
  *
593
  * @return string - version number.
594
+ * @author WebFactory Ltd
595
  *
596
  */
597
 
606
  * Activation and Deactivation Handlers.
607
  *
608
  * @return nothing
609
+ * @author WebFactory Ltd
610
  */
611
  public function activation_error()
612
  {
634
  *
635
  * These functions will output a variable containing the admin ajax url for use in javascript.
636
  *
637
+ * @author WebFactory Ltd
638
  *
639
  */
640
  protected function add_admin_message($message, $code)
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: WebFactory, wpreset, googlemapswidget, underconstructionpage
3
  Tags: 301 redirect, redirects, redirect, 302 redirect, redirection, 302, seo, 302 redirect, 404, 404 redirect, 301, 307
4
  Requires at least: 4.0
5
  Tested up to: 5.5
6
- Stable tag: 2.50
7
  Requires PHP: 5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -56,6 +56,10 @@ A 301 redirect indicates that the page requested has been permanently moved to t
56
 
57
  == Changelog ==
58
 
 
 
 
 
59
  = 2.50 =
60
  * 2020/08/10
61
  * added support for 307 Temporary Redirect
3
  Tags: 301 redirect, redirects, redirect, 302 redirect, redirection, 302, seo, 302 redirect, 404, 404 redirect, 301, 307
4
  Requires at least: 4.0
5
  Tested up to: 5.5
6
+ Stable tag: 2.51
7
  Requires PHP: 5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
56
 
57
  == Changelog ==
58
 
59
+ = 2.51 =
60
+ * 2020/08/13
61
+ * security fixes - thank you <a href="http://eringerm.com/">Erin</a>
62
+
63
  = 2.50 =
64
  * 2020/08/10
65
  * added support for 307 Temporary Redirect
templates/admin-panel-cache.php CHANGED
@@ -15,7 +15,7 @@ if (!defined('ABSPATH')) {
15
  }
16
  ?>
17
 
18
- <div class="eps-panel eps-margin-top">
19
  <form method="post" action="">
20
  <?php wp_nonce_field('eps_redirect_nonce', 'eps_redirect_nonce_submit'); ?>
21
  <input type="submit" name="eps_redirect_refresh" id="submit" class="button button-secondary" value="Refresh Cache" />
15
  }
16
  ?>
17
 
18
+ <div class="eps-panel eps-margin-top rating-box">
19
  <form method="post" action="">
20
  <?php wp_nonce_field('eps_redirect_nonce', 'eps_redirect_nonce_submit'); ?>
21
  <input type="submit" name="eps_redirect_refresh" id="submit" class="button button-secondary" value="Refresh Cache" />
templates/template.redirect-entry-edit.php CHANGED
@@ -27,7 +27,7 @@ $redirect = self::get_redirect($redirect_id);
27
  </select>
28
 
29
  <div class="eps-url"><span class="eps-url-root"><?php bloginfo('url'); ?>/&nbsp;</span></div>
30
- <input class="eps-url-input" type="text" name="redirect[url_from][]" value="<?php echo ($redirect) ? $redirect->url_from : ''; ?>">
31
 
32
  </td>
33
  <td>
27
  </select>
28
 
29
  <div class="eps-url"><span class="eps-url-root"><?php bloginfo('url'); ?>/&nbsp;</span></div>
30
+ <input class="eps-url-input" type="text" name="redirect[url_from][]" value="<?php echo ($redirect) ? esc_attr(stripslashes($redirect->url_from)) : ''; ?>">
31
 
32
  </td>
33
  <td>
templates/template.redirect-entry.php CHANGED
@@ -23,10 +23,10 @@ $query_args = array('page' => $EPS_Redirects_Plugin->config('page_slug'), 'delet
23
  <p class="eps-grey-text eps-text-center eps-small"><?php echo $redirect->id; ?></p>
24
  </td>
25
  <td>
26
- <a target="_blank" class="eps-url" href="<?php bloginfo('url'); ?>/<?php echo esc_attr($dfrom); ?>"
27
- title="<?php bloginfo('url'); ?>/<?php echo esc_attr($dfrom); ?>">
28
  <span class="eps-url-root eps-url-startcap"><?php echo ($redirect->status == 'inactive') ? 'OFF' : esc_attr($redirect->status); ?></span><span
29
- class="eps-url-root"><?php bloginfo('url'); ?>/</span><span class="eps-url-fragment eps-url-endcap"><?php echo esc_attr($dfrom); ?></span>
30
  </a>
31
  </td>
32
  <td>
23
  <p class="eps-grey-text eps-text-center eps-small"><?php echo $redirect->id; ?></p>
24
  </td>
25
  <td>
26
+ <a target="_blank" class="eps-url" href="<?php bloginfo('url'); ?>/<?php echo stripslashes(esc_attr($dfrom)); ?>"
27
+ title="<?php bloginfo('url'); ?>/<?php echo stripslashes(esc_attr($dfrom)); ?>">
28
  <span class="eps-url-root eps-url-startcap"><?php echo ($redirect->status == 'inactive') ? 'OFF' : esc_attr($redirect->status); ?></span><span
29
+ class="eps-url-root"><?php bloginfo('url'); ?>/</span><span class="eps-url-fragment eps-url-endcap"><?php echo stripslashes($dfrom); ?></span>
30
  </a>
31
  </td>
32
  <td>