Safe Redirect Manager - Version 1.11.1

Version Description

  • 2022-09-26 =
  • Added: Indicate plugin as the source of redirects (props @peterwilsoncc, @Sidsector9 via #281).
Download this release

Release Info

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

Code changes from version 1.11.0 to 1.11.1

.travis.yml DELETED
@@ -1,22 +0,0 @@
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/classes/class-srm-redirect.php CHANGED
@@ -245,13 +245,12 @@ class SRM_Redirect {
245
  header( 'X-Safe-Redirect-Manager: true' );
246
  header( 'X-Safe-Redirect-ID: ' . esc_attr( $matched_redirect['redirect_id'] ) );
247
 
248
- // if we have a valid status code, then redirect with it
249
- if ( in_array( $matched_redirect['status_code'], srm_get_valid_status_codes(), true ) ) {
250
- wp_safe_redirect( $matched_redirect['redirect_to'], $matched_redirect['status_code'] );
251
- } else {
252
- wp_safe_redirect( $matched_redirect['redirect_to'] );
253
  }
254
 
 
255
  exit;
256
  }
257
 
245
  header( 'X-Safe-Redirect-Manager: true' );
246
  header( 'X-Safe-Redirect-ID: ' . esc_attr( $matched_redirect['redirect_id'] ) );
247
 
248
+ // Use default status code if an invalid value is set.
249
+ if ( ! in_array( $matched_redirect['status_code'], srm_get_valid_status_codes(), true ) ) {
250
+ $matched_redirect['status_code'] = apply_filters( 'srm_default_direct_status', 302 );
 
 
251
  }
252
 
253
+ wp_safe_redirect( $matched_redirect['redirect_to'], $matched_redirect['status_code'], 'Safe Redirect Manager' );
254
  exit;
255
  }
256
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: http redirects, redirect manager, url redirection, safe http
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
 
@@ -48,6 +48,9 @@ This should be a path (i.e. `/test`) or a URL (i.e. `http://example.com/wp/test`
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)).
4
  Requires at least: 4.6
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 1.11.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.11.1 - 2022-09-26 =
52
+ * **Added:** Indicate plugin as the source of redirects (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@Sidsector9](https://github.com/Sidsector9) via [#281](https://github.com/10up/safe-redirect-manager/pull/281)).
53
+
54
  = 1.11.0 - 2022-06-27 =
55
  * **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)).
56
  * **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)).
safe-redirect-manager.php CHANGED
@@ -3,7 +3,7 @@
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
@@ -20,7 +20,7 @@ require_once dirname( __FILE__ ) . '/inc/functions.php';
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';
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.1
7
  * Requires at least: 4.6
8
  * Requires PHP: 5.6
9
  * Author: 10up
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.1' );
24
 
25
  if ( defined( 'WP_CLI' ) && WP_CLI ) {
26
  require_once dirname( __FILE__ ) . '/inc/classes/class-srm-wp-cli.php';