Safe Redirect Manager - Version 1.11.0

Version Description

  • 2022-06-27 =
  • Added: Detect duplicate rules for the same 'redirect from' value (props @adamsilverstein, @dhanendran, @hrkhal, @jeffpaul, @lukaspawlik, @sanketio, @Sidsector9 via #171).
  • Added: PHP 8 compatibility (props @iamdharmesh, @dkotter via #264).
  • Added: E2E Tests with Cypress (props @iamdharmesh, @Sidsector9, @dkotter via #262, #273).
  • Added: Dependency security scanning (props @jeffpaul, @peterwilsoncc via #268).
  • Changed: Default number of redirects in readme files (props @grappler via #259).
  • Changed: Bump WordPress "tested up to" version 6.0 (props @jeffpaul, @sudip-10up, @peterwilsoncc via #260, #270).
  • Fixed: Unit tests by adding PHPUnit-Polyfills library (props @iamdharmesh, @Sidsector9 via #257).
  • Security: Bump minimist from 1.2.5 to 1.2.6 (props @dependabot via #265).
Download this release

Release Info

Developer 10up
Plugin Icon 128x128 Safe Redirect Manager
Version 1.11.0
Comparing to
See all releases

Code changes from version 1.10.1 to 1.11.0

.travis.yml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ sudo: false
2
+ dist: trusty
3
+
4
+ language: php
5
+
6
+ matrix:
7
+ include:
8
+ - php: 7.2
9
+ env: WP_VERSION=latest
10
+
11
+ before_script:
12
+ - composer install
13
+ - export PATH="$HOME/.composer/vendor/bin:$PATH"
14
+ - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
15
+
16
+ script:
17
+ - vendor/bin/phpunit
18
+ - vendor/bin/phpcs .
19
+ - bash run-wpacceptance.sh
20
+
21
+ services:
22
+ - mysql
assets/js/redirect.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ $( function() {
3
+ const publishBtn = $('#publish');
4
+ const fromRule = $('#srm_redirect_rule_from');
5
+
6
+ fromRule.change(function(el) {
7
+ publishBtn.prop('disabled', true);
8
+ $.get(
9
+ window.ajaxurl,
10
+ {
11
+ action: 'srm_validate_from_url',
12
+ from: fromRule.val(),
13
+ _wpnonce: $('#srm_redirect_nonce').val()
14
+ }
15
+ ).done(function( data ) {
16
+ if ( '1' === data ) {
17
+ $('#message').html( '' ).hide();
18
+ publishBtn.prop('disabled', false);
19
+ } else if ( '0' === data ) {
20
+ $('#message').html( `<p>${redirectValidation.urlError}</p>` ).show();
21
+ } else {
22
+ $('#message').html( `<p>${redirectValidation.fail.replace( '%s', data )}</p>` ).show();
23
+ }
24
+ });
25
+ });
26
+ } );
27
+ }( jQuery ) );
inc/classes/class-srm-post-type.php CHANGED
@@ -48,6 +48,8 @@ class SRM_Post_Type {
48
  add_action( 'admin_print_styles-post-new.php', array( $this, 'action_print_logo_css' ), 10, 1 );
49
  add_filter( 'post_type_link', array( $this, 'filter_post_type_link' ), 10, 2 );
50
  add_filter( 'default_hidden_columns', array( $this, 'filter_hidden_columns' ), 10, 1 );
 
 
51
  }
52
 
53
  /**
@@ -555,6 +557,7 @@ class SRM_Post_Type {
555
  $status_code = apply_filters( 'srm_default_direct_status', 302 );
556
  }
557
  ?>
 
558
  <p>
559
  <label for="srm_redirect_rule_from"><strong><?php esc_html_e( '* Redirect From:', 'safe-redirect-manager' ); ?></strong></label><br />
560
  <input type="text" name="srm_redirect_rule_from" id="srm_redirect_rule_from" value="<?php echo esc_attr( $redirect_from ); ?>" />
@@ -638,4 +641,72 @@ class SRM_Post_Type {
638
 
639
  return $instance;
640
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
641
  }
48
  add_action( 'admin_print_styles-post-new.php', array( $this, 'action_print_logo_css' ), 10, 1 );
49
  add_filter( 'post_type_link', array( $this, 'filter_post_type_link' ), 10, 2 );
50
  add_filter( 'default_hidden_columns', array( $this, 'filter_hidden_columns' ), 10, 1 );
51
+ add_action( 'admin_enqueue_scripts', array( $this, 'load_resources' ), 10, 0 );
52
+ add_action( 'wp_ajax_srm_validate_from_url', array( $this, 'srm_validate_from_url' ), 10, 0 );
53
  }
54
 
55
  /**
557
  $status_code = apply_filters( 'srm_default_direct_status', 302 );
558
  }
559
  ?>
560
+ <div class="notice notice-error" id="message" style="display: none;"></div>
561
  <p>
562
  <label for="srm_redirect_rule_from"><strong><?php esc_html_e( '* Redirect From:', 'safe-redirect-manager' ); ?></strong></label><br />
563
  <input type="text" name="srm_redirect_rule_from" id="srm_redirect_rule_from" value="<?php echo esc_attr( $redirect_from ); ?>" />
641
 
642
  return $instance;
643
  }
644
+
645
+ /**
646
+ * Load scripts.
647
+ *
648
+ * @return void
649
+ */
650
+ public function load_resources() {
651
+ if ( 'redirect_rule' === get_post_type() ) {
652
+ wp_enqueue_script( 'redirectjs', plugin_dir_url( 'safe-redirect-manager/safe-redirect-manager.php' ) . 'assets/js/redirect.js', array( 'jquery' ), SRM_VERSION );
653
+ wp_localize_script(
654
+ 'redirectjs',
655
+ 'redirectValidation',
656
+ array(
657
+ 'urlError' => __( 'There are some issues validating the URL. Please try again.', 'safe-redirect-manager' ),
658
+ 'fail' => __( 'There is an existing redirect with the same Redirect From URL. You may <a href="%s">Edit</a> the redirect or try other `from` URL.', 'safe-redirect-manager' ),
659
+ )
660
+ );
661
+ }
662
+ }
663
+
664
+ /**
665
+ * Validate whether the from URL already exists or not.
666
+ *
667
+ * @return void
668
+ */
669
+ public function srm_validate_from_url() {
670
+ $_wpnonce = filter_input( INPUT_GET, '_wpnonce', FILTER_SANITIZE_STRING );
671
+ if ( ! wp_verify_nonce( $_wpnonce, 'srm-save-redirect-meta' ) ) {
672
+ echo 0;
673
+ die();
674
+ }
675
+
676
+ $from = filter_input( INPUT_GET, 'from', FILTER_SANITIZE_STRING );
677
+
678
+ /**
679
+ * SRM treats '/sample-page' and 'sample-page' equally.
680
+ * If the $from value does not start with a forward slash,
681
+ * then we normalize it by adding one.
682
+ */
683
+ $from = '/' === substr( $from, 0, 1 ) ? $from : '/' . $from;
684
+
685
+ $existing_post_ids = new WP_Query(
686
+ [
687
+ 'meta_key' => '_redirect_rule_from',
688
+ 'meta_value' => $from,
689
+ 'fields' => 'ids',
690
+ 'posts_per_page' => 1,
691
+ 'no_found_rows' => true,
692
+ 'post_type' => 'redirect_rule',
693
+ 'post_status' => 'publish',
694
+ 'orderby' => 'ID',
695
+ 'order' => 'ASC',
696
+ 'update_post_meta_cache' => false,
697
+ 'update_post_term_cache' => false,
698
+ ]
699
+ );
700
+
701
+ // If no posts found, then bail out.
702
+ if ( empty( $existing_post_ids->posts ) ) {
703
+ echo 1;
704
+ die();
705
+ }
706
+
707
+ $existing_post_id = $existing_post_ids->posts[0];
708
+
709
+ echo esc_url( get_edit_post_link( $existing_post_id ) );
710
+ die();
711
+ }
712
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Safe Redirect Manager ===
2
- Contributors: tlovett1, tollmanz, taylorde, 10up, jakemgold, danielbachhuber, VentureBeat
3
  Tags: http redirects, redirect manager, url redirection, safe http redirection, multisite redirects, redirects
4
  Requires at least: 4.6
5
- Tested up to: 5.8
6
- Requires PHP:
7
- Stable tag: 1.10.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -42,13 +42,23 @@ This should be a path (i.e. `/test`) or a URL (i.e. `http://example.com/wp/test`
42
  *Note:*
43
 
44
  * Redirects are cached using the Transients API. Cache busts occur when redirects are added, updated, and deleted so you shouldn't be serving stale redirects.
45
- * By default the plugin only allows at most 250 redirects to prevent performance issues. There is a filter `srm_max_redirects` that you can utilize to up this number.
46
  * "Redirect From" and requested paths are case insensitive by default.
47
  * Developers can use `srm_additional_status_codes` filter to add status codes if needed.
48
 
49
  == Changelog ==
50
 
51
- = 1.10.1 =
 
 
 
 
 
 
 
 
 
 
52
  * **Added:** Formatting options to `wp safe-redirect-manager list` command (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@TheLastCicada](https://profiles.wordpress.org/thelastcicada/)).
53
  * **Changed:** Increased redirect limits from 250 to 1,000 (props [@sultann](https://profiles.wordpress.org/manikmist09/), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@jilltilt](https://github.com/jilltilt), [@yeevy](https://github.com/yeevy)).
54
  * **Changed:** Bump WordPress version "tested up to" 5.8 (props [@jeffpaul](https://profiles.wordpress.org/jeffpaul/), [@ankitguptaindia](https://profiles.wordpress.org/ankit-k-gupta/), [@phpbits](https://profiles.wordpress.org/phpbits/)).
@@ -58,7 +68,7 @@ This should be a path (i.e. `/test`) or a URL (i.e. `http://example.com/wp/test`
58
  * **Security:** Bump `minimist` from 0.0.8 to 1.2.5 (props [@dependabot](https://github.com/dependabot)).
59
  * **Security:** Bump `lodash` from 4.17.19 to 4.17.21 (props [@dependabot](https://github.com/dependabot)).
60
 
61
- = 1.10.0 =
62
  * **Added:** `410 Gone` status code to the list of HTTP status codes and `srm_additional_status_codes` to add additional status codes ([@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@helen](https://profiles.wordpress.org/helen), [@PopVeKind](https://profiles.wordpress.org/popvekind/)).
63
  * **Added:** Option to ignore query parameters, previous behaviour still available via the new `srm_match_query_params` filter (props [@bradleyt](https://profiles.wordpress.org/bradleyt/), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)).
64
  * **Added:** Extracts redirect matching logic from `maybe_redirect` to `match_redirect` method, plus `srm_match_redirect` function to expose matching redirect logic to themes and plugins (props [@nicholas_io](https://profiles.wordpress.org/nicholas_io/), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)).
@@ -70,7 +80,7 @@ This should be a path (i.e. `/test`) or a URL (i.e. `http://example.com/wp/test`
70
  * **Fixed:** Missing `order` column in CSV import WP-CLI command (props [@barryceelen](https://profiles.wordpress.org/barryceelen/)).
71
  * **Security:** Bump `lodash` from 4.17.15 to 4.17.19 (props [@dependabot](https://github.com/dependabot)).
72
 
73
- = 1.9.3 =
74
  * **Changed:** Allow for escaped values on `_redirect_rule_from`, useful when importing regex (props [@raymondware](https://profiles.wordpress.org/raymondware)).
75
  * **Changed:** Check `current_user_can` cap later to prevent the notice being thrown during Jetpack sitemap cron event runs (props [@rebeccahum](https://profiles.wordpress.org/rebasaurus)).
76
  * **Changed:** Updated tests and documentation (props [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein), [@jeffpaul](https://profiles.wordpress.org/jeffpaul), [@helen](https://profiles.wordpress.org/helen)).
@@ -79,98 +89,98 @@ This should be a path (i.e. `/test`) or a URL (i.e. `http://example.com/wp/test`
79
  * **Fixed:** Update the logic for wildcard matching to properly match URLs with query parameters (props [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein), [@mslinnea](https://profiles.wordpress.org/linsoftware).
80
  * **Security:** Bump lodash from 4.17.11 to 4.17.15 (props [@dependabot](https://github.com/dependabot)).
81
 
82
- = 1.9.2 =
83
  * Fix CLI list function name for PHP 5
84
 
85
- = 1.9.1 =
86
  * Fix SQL injection bug opened up by SQL search functionality.
87
 
88
- = 1.9 =
89
  * Add redirect notes feature.
90
  * Fix PHP 7.2 errors
91
  * Instantiate classes in main file instead of individual files for improved testability.
92
  * Add filters for request path and redirect path
93
  * Add filter to only apply redirects on 404
94
 
95
- = 1.8 =
96
  * Improved escaping
97
  * Custom redirect capability
98
  * Code refactor
99
  * Fix root redirect in sub directory bug
100
  * Fix broken html
101
 
102
- = 1.7.8 (Dec. 16, 2015) =
103
  * Fix SQL injection bug and no search terms warning
104
 
105
- = 1.7.7 (Jun. 18, 2015) =
106
  * Make default redirect status filterable
107
  * Add composer.json
108
  * Fix delete capability on redirect post type
109
 
110
- = 1.7.6 (Feb. 13, 2015) =
111
  * Use home_url() instead of site_url(). Props [swalkinshaw](https://github.com/swalkinshaw)
112
  * Don't redirect if redirect to location is invalid. Props [vaurdan](https://github.com/vaurdan)
113
  * Redirection plugin importer. Props [eugene-manuilov](https://github.com/eugene-manuilov)
114
 
115
- = 1.7.5 (Sept. 9, 2014) =
116
  * Don't always lowercase matched parts in redirect to replace. Props[francescolaffi](https://github.com/francescolaffi)
117
  * Plugin icon/banner
118
 
119
- = 1.7.4 (Sept. 5, 2014) =
120
  * Fix case sensitivity redirection bug.
121
  * Add more unit tests
122
 
123
- = 1.7.3 (Aug. 26, 2014) =
124
  * Check if the global $wp_query is null before using get_query_var. Props [cmmarslender](https://github.com/cmmarslender)
125
  * Unit tests
126
  * Making _x translatable text work. Props [lucspe](https://github.com/lucspe)
127
 
128
- = 1.7.2 (Feb. 10, 2014) =
129
  * Added French translation. Props [jcbrebion](https://github.com/jcbrebion).
130
  * Bug fix: Don't perform redirects in the admin. Props [joshbetz](https://github.com/joshbetz).
131
  * Bug fix: Prevent duplicate GUIDs. Props [danblaker](https://github.com/danblaker).
132
 
133
- = 1.7.1 (Dec. 12, 2013) =
134
  * Add 307 redirect status code. Thanks [lgedeon](https://github.com/lgedeon)
135
  * Plugin textdomain should be loaded on init
136
  * Add status code labels to creation dropdown. Thanks Chancey Mathews
137
 
138
- = 1.7 (Apr. 6, 2013) =
139
  * Return redirect_from on get_permalink. Thanks [simonwheatley](https://github.com/simonwheatley)
140
  * Allow for regex replacement in from/to redirects
141
  * Add Slovak translation. Thanks [Branco Radenovich](http://webhostinggeeks.com/blog)
142
  * Notice fixed in filter_admin_title
143
 
144
- = 1.6 (Dec. 11, 2012) =
145
  * Bulk delete redirects from the Manage Redirects screen
146
  * wp-cli coverage including subcommands for creating, deleting, and listing redirects, and importing .htaccess files
147
 
148
- = 1.5 (Nov. 7 2012) =
149
  * Regular expressions allowed in redirects
150
  * New filter 'srm_registered_redirects' allows you to conditionally unset redirects based on context, user permissions, etc. Thanks [jtsternberg](https://github.com/jtsternberg) for the pull request.
151
 
152
- = 1.4.2 (Oct. 17, 2012) =
153
  * Disable redirect loop checking by default. You can filter srm_check_for_possible_redirect_loops to enable it.
154
  * Only return published redirects in update_redirect_cache. - bug fix
155
 
156
- = 1.4.1 (Oct. 11, 2012) =
157
  * Refresh cache after create_redirect call - bug fix
158
  * Refresh cache after save_post is called - bug fix
159
  * Chop off "pre-WP" path from requested path. This allows the plugin to work on WP installations in sub-directories - bug fix
160
 
161
- = 1.4 (Oct. 9, 2012) =
162
  * Use the '*' wildcard at the end of your match value to configure a wildcard redirect. Use the same symbol at the end of your redirect to value in order to have the matched value be appended to the end of the redirect. Thanks [prettyboymp](https://github.com/prettyboymp) for the pull request
163
  * Change default request-matching behavior to be case-insensitive. This can be modified using the 'srm_case_insensitive_redirects' filter.
164
  * Include an informational 'X-Safe-Redirect-Manager' header when a redirect occurs. Thanks [simonwheatley](https://github.com/simonwheatley) for the pull request
165
 
166
- = 1.3 =
167
  * safe-redirect-manager.php - Globalize SRM class for use in themes/plugins/scripts. Added create_redirect method to make importing easier.
168
 
169
- = 1.2 =
170
  * safe-redirect-manager.php - manage_options capability required to use redirect manager, remove checkbox column, hide view switcher, fix search feature, hide privacy stuff for bulk edit
171
 
172
- = 1.1 =
173
  * safe-redirect-manager.php - plugin_url() used properly, is_plugin_page function
174
 
175
- = 1.0 =
176
  * Plugin released
1
  === Safe Redirect Manager ===
2
+ Contributors: 10up, tlovett1, tollmanz, taylorde, jakemgold, danielbachhuber, VentureBeat, jeffpaul
3
  Tags: http redirects, redirect manager, url redirection, safe http redirection, multisite redirects, redirects
4
  Requires at least: 4.6
5
+ Tested up to: 6.0
6
+ Requires PHP: 5.6
7
+ Stable tag: 1.11.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
42
  *Note:*
43
 
44
  * Redirects are cached using the Transients API. Cache busts occur when redirects are added, updated, and deleted so you shouldn't be serving stale redirects.
45
+ * By default the plugin only allows at most 1000 redirects to prevent performance issues. There is a filter `srm_max_redirects` that you can utilize to up this number.
46
  * "Redirect From" and requested paths are case insensitive by default.
47
  * Developers can use `srm_additional_status_codes` filter to add status codes if needed.
48
 
49
  == Changelog ==
50
 
51
+ = 1.11.0 - 2022-06-27 =
52
+ * **Added:** Detect duplicate rules for the same 'redirect from' value (props [@adamsilverstein](https://github.com/adamsilverstein), [@dhanendran](https://github.com/dhanendran), [@hrkhal](https://github.com/hrkhal), [@jeffpaul](https://github.com/jeffpaul), [@lukaspawlik](https://github.com/lukaspawlik), [@sanketio](https://github.com/sanketio), [@Sidsector9](https://github.com/Sidsector9) via [#171](https://github.com/10up/safe-redirect-manager/pull/171)).
53
+ * **Added:** PHP 8 compatibility (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#264](https://github.com/10up/safe-redirect-manager/pull/264)).
54
+ * **Added:** E2E Tests with Cypress (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#262](https://github.com/10up/safe-redirect-manager/pull/262), [#273](https://github.com/10up/safe-redirect-manager/pull/273)).
55
+ * **Added:** Dependency security scanning (props [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#268](https://github.com/10up/safe-redirect-manager/pull/268)).
56
+ * **Changed:** Default number of redirects in readme files (props [@grappler](https://github.com/grappler) via [#259](https://github.com/10up/safe-redirect-manager/pull/259)).
57
+ * **Changed:** Bump WordPress "tested up to" version 6.0 (props [@jeffpaul](https://github.com/jeffpaul), [@sudip-10up](https://github.com/sudip-10up), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#260](https://github.com/10up/safe-redirect-manager/pull/260), [#270](https://github.com/10up/safe-redirect-manager/pull/270)).
58
+ * **Fixed:** Unit tests by adding `PHPUnit-Polyfills` library (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#257](https://github.com/10up/safe-redirect-manager/pull/257)).
59
+ * **Security:** Bump `minimist` from 1.2.5 to 1.2.6 (props [@dependabot](https://github.com/apps/dependabot) via [#265](https://github.com/10up/safe-redirect-manager/pull/265)).
60
+
61
+ = 1.10.1 - 2021-12-16 =
62
  * **Added:** Formatting options to `wp safe-redirect-manager list` command (props [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@TheLastCicada](https://profiles.wordpress.org/thelastcicada/)).
63
  * **Changed:** Increased redirect limits from 250 to 1,000 (props [@sultann](https://profiles.wordpress.org/manikmist09/), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@jilltilt](https://github.com/jilltilt), [@yeevy](https://github.com/yeevy)).
64
  * **Changed:** Bump WordPress version "tested up to" 5.8 (props [@jeffpaul](https://profiles.wordpress.org/jeffpaul/), [@ankitguptaindia](https://profiles.wordpress.org/ankit-k-gupta/), [@phpbits](https://profiles.wordpress.org/phpbits/)).
68
  * **Security:** Bump `minimist` from 0.0.8 to 1.2.5 (props [@dependabot](https://github.com/dependabot)).
69
  * **Security:** Bump `lodash` from 4.17.19 to 4.17.21 (props [@dependabot](https://github.com/dependabot)).
70
 
71
+ = 1.10.0 - 2020-12-03 =
72
  * **Added:** `410 Gone` status code to the list of HTTP status codes and `srm_additional_status_codes` to add additional status codes ([@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/), [@helen](https://profiles.wordpress.org/helen), [@PopVeKind](https://profiles.wordpress.org/popvekind/)).
73
  * **Added:** Option to ignore query parameters, previous behaviour still available via the new `srm_match_query_params` filter (props [@bradleyt](https://profiles.wordpress.org/bradleyt/), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)).
74
  * **Added:** Extracts redirect matching logic from `maybe_redirect` to `match_redirect` method, plus `srm_match_redirect` function to expose matching redirect logic to themes and plugins (props [@nicholas_io](https://profiles.wordpress.org/nicholas_io/), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)).
80
  * **Fixed:** Missing `order` column in CSV import WP-CLI command (props [@barryceelen](https://profiles.wordpress.org/barryceelen/)).
81
  * **Security:** Bump `lodash` from 4.17.15 to 4.17.19 (props [@dependabot](https://github.com/dependabot)).
82
 
83
+ = 1.9.3 - 2019-11-20 =
84
  * **Changed:** Allow for escaped values on `_redirect_rule_from`, useful when importing regex (props [@raymondware](https://profiles.wordpress.org/raymondware)).
85
  * **Changed:** Check `current_user_can` cap later to prevent the notice being thrown during Jetpack sitemap cron event runs (props [@rebeccahum](https://profiles.wordpress.org/rebasaurus)).
86
  * **Changed:** Updated tests and documentation (props [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein), [@jeffpaul](https://profiles.wordpress.org/jeffpaul), [@helen](https://profiles.wordpress.org/helen)).
89
  * **Fixed:** Update the logic for wildcard matching to properly match URLs with query parameters (props [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein), [@mslinnea](https://profiles.wordpress.org/linsoftware).
90
  * **Security:** Bump lodash from 4.17.11 to 4.17.15 (props [@dependabot](https://github.com/dependabot)).
91
 
92
+ = 1.9.2 - 2018-11-27 =
93
  * Fix CLI list function name for PHP 5
94
 
95
+ = 1.9.1 - 2018-11-26 =
96
  * Fix SQL injection bug opened up by SQL search functionality.
97
 
98
+ = 1.9 - 2018-04-03 =
99
  * Add redirect notes feature.
100
  * Fix PHP 7.2 errors
101
  * Instantiate classes in main file instead of individual files for improved testability.
102
  * Add filters for request path and redirect path
103
  * Add filter to only apply redirects on 404
104
 
105
+ = 1.8 - 2017-12-08 =
106
  * Improved escaping
107
  * Custom redirect capability
108
  * Code refactor
109
  * Fix root redirect in sub directory bug
110
  * Fix broken html
111
 
112
+ = 1.7.8 - 2015-12-16 =
113
  * Fix SQL injection bug and no search terms warning
114
 
115
+ = 1.7.7 - 2015-06-18 =
116
  * Make default redirect status filterable
117
  * Add composer.json
118
  * Fix delete capability on redirect post type
119
 
120
+ = 1.7.6 - 2015-02-13 =
121
  * Use home_url() instead of site_url(). Props [swalkinshaw](https://github.com/swalkinshaw)
122
  * Don't redirect if redirect to location is invalid. Props [vaurdan](https://github.com/vaurdan)
123
  * Redirection plugin importer. Props [eugene-manuilov](https://github.com/eugene-manuilov)
124
 
125
+ = 1.7.5 - 2014-09-09 =
126
  * Don't always lowercase matched parts in redirect to replace. Props[francescolaffi](https://github.com/francescolaffi)
127
  * Plugin icon/banner
128
 
129
+ = 1.7.4 - 2014-09-05 =
130
  * Fix case sensitivity redirection bug.
131
  * Add more unit tests
132
 
133
+ = 1.7.3 - 2014-08-26 =
134
  * Check if the global $wp_query is null before using get_query_var. Props [cmmarslender](https://github.com/cmmarslender)
135
  * Unit tests
136
  * Making _x translatable text work. Props [lucspe](https://github.com/lucspe)
137
 
138
+ = 1.7.2 - 2014-02-10 =
139
  * Added French translation. Props [jcbrebion](https://github.com/jcbrebion).
140
  * Bug fix: Don't perform redirects in the admin. Props [joshbetz](https://github.com/joshbetz).
141
  * Bug fix: Prevent duplicate GUIDs. Props [danblaker](https://github.com/danblaker).
142
 
143
+ = 1.7.1 - 2013-12-12 =
144
  * Add 307 redirect status code. Thanks [lgedeon](https://github.com/lgedeon)
145
  * Plugin textdomain should be loaded on init
146
  * Add status code labels to creation dropdown. Thanks Chancey Mathews
147
 
148
+ = 1.7 - 2013-04-06 =
149
  * Return redirect_from on get_permalink. Thanks [simonwheatley](https://github.com/simonwheatley)
150
  * Allow for regex replacement in from/to redirects
151
  * Add Slovak translation. Thanks [Branco Radenovich](http://webhostinggeeks.com/blog)
152
  * Notice fixed in filter_admin_title
153
 
154
+ = 1.6 - 2012-12-11 =
155
  * Bulk delete redirects from the Manage Redirects screen
156
  * wp-cli coverage including subcommands for creating, deleting, and listing redirects, and importing .htaccess files
157
 
158
+ = 1.5 - 2012-11-07 =
159
  * Regular expressions allowed in redirects
160
  * New filter 'srm_registered_redirects' allows you to conditionally unset redirects based on context, user permissions, etc. Thanks [jtsternberg](https://github.com/jtsternberg) for the pull request.
161
 
162
+ = 1.4.2 - 2012-10-17 =
163
  * Disable redirect loop checking by default. You can filter srm_check_for_possible_redirect_loops to enable it.
164
  * Only return published redirects in update_redirect_cache. - bug fix
165
 
166
+ = 1.4.1 - 2012-10-11 =
167
  * Refresh cache after create_redirect call - bug fix
168
  * Refresh cache after save_post is called - bug fix
169
  * Chop off "pre-WP" path from requested path. This allows the plugin to work on WP installations in sub-directories - bug fix
170
 
171
+ = 1.4 - 2012-10-09 =
172
  * Use the '*' wildcard at the end of your match value to configure a wildcard redirect. Use the same symbol at the end of your redirect to value in order to have the matched value be appended to the end of the redirect. Thanks [prettyboymp](https://github.com/prettyboymp) for the pull request
173
  * Change default request-matching behavior to be case-insensitive. This can be modified using the 'srm_case_insensitive_redirects' filter.
174
  * Include an informational 'X-Safe-Redirect-Manager' header when a redirect occurs. Thanks [simonwheatley](https://github.com/simonwheatley) for the pull request
175
 
176
+ = 1.3 - 2012-09-19 =
177
  * safe-redirect-manager.php - Globalize SRM class for use in themes/plugins/scripts. Added create_redirect method to make importing easier.
178
 
179
+ = 1.2 - 2012-09-01 =
180
  * safe-redirect-manager.php - manage_options capability required to use redirect manager, remove checkbox column, hide view switcher, fix search feature, hide privacy stuff for bulk edit
181
 
182
+ = 1.1 - 2012-08-28 =
183
  * safe-redirect-manager.php - plugin_url() used properly, is_plugin_page function
184
 
185
+ = 1.0 - 2012-08-27 =
186
  * Plugin released
safe-redirect-manager.php CHANGED
@@ -1,14 +1,16 @@
1
  <?php
2
  /**
3
- * Plugin Name: Safe Redirect Manager
4
- * Plugin URI: https://wordpress.org/plugins/safe-redirect-manager
5
- * Description: Easily and safely manage HTTP redirects.
6
- * Author: 10up
7
- * Version: 1.10.1
8
- * Text Domain: safe-redirect-manager
9
- * Author URI: https://10up.com
10
- * License: GPLv2 or later
11
- * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
 
12
  *
13
  * @package safe-redirect-manager
14
  */
@@ -18,6 +20,7 @@ require_once dirname( __FILE__ ) . '/inc/functions.php';
18
  require_once dirname( __FILE__ ) . '/inc/classes/class-srm-post-type.php';
19
  require_once dirname( __FILE__ ) . '/inc/classes/class-srm-redirect.php';
20
 
 
21
 
22
  if ( defined( 'WP_CLI' ) && WP_CLI ) {
23
  require_once dirname( __FILE__ ) . '/inc/classes/class-srm-wp-cli.php';
1
  <?php
2
  /**
3
+ * Plugin Name: Safe Redirect Manager
4
+ * Plugin URI: https://wordpress.org/plugins/safe-redirect-manager
5
+ * Description: Easily and safely manage HTTP redirects.
6
+ * Version: 1.11.0
7
+ * Requires at least: 4.6
8
+ * Requires PHP: 5.6
9
+ * Author: 10up
10
+ * Author URI: https://10up.com
11
+ * License: GPLv2 or later
12
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
+ * Text Domain: safe-redirect-manager
14
  *
15
  * @package safe-redirect-manager
16
  */
20
  require_once dirname( __FILE__ ) . '/inc/classes/class-srm-post-type.php';
21
  require_once dirname( __FILE__ ) . '/inc/classes/class-srm-redirect.php';
22
 
23
+ define( 'SRM_VERSION', '1.11.0' );
24
 
25
  if ( defined( 'WP_CLI' ) && WP_CLI ) {
26
  require_once dirname( __FILE__ ) . '/inc/classes/class-srm-wp-cli.php';