Safe Redirect Manager - Version 1.4.2

Version Description

(Oct. 17, 2012) = * Disable redirect loop checking by default. You can filter srm_check_for_possible_redirect_loops to enable it. * Only return published redirects in update_redirect_cache. - bug fix

Download this release

Release Info

Developer tlovett1
Plugin Icon 128x128 Safe Redirect Manager
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

Files changed (2) hide show
  1. readme.txt +5 -1
  2. safe-redirect-manager.php +16 -8
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: tlovett1, tollmanz, taylorde, 10up, jakemgold, danielbachhuber, Ve
3
  Tags: http redirects, redirect manager, url redirection, safe http redirection
4
  Requires at least: 3.1
5
  Tested up to: 3.4.2
6
- Stable tag: 1.4.1
7
 
8
  Safely and easily manage your website's HTTP redirects.
9
 
@@ -24,6 +24,10 @@ Extract the zip file and just drop the contents in the wp-content/plugins/ direc
24
 
25
  == Changelog ==
26
 
 
 
 
 
27
  = 1.4.1 (Oct. 11, 2012) =
28
  * Refresh cache after create_redirect call - bug fix
29
  * Refresh cache after save_post is called - bug fix
3
  Tags: http redirects, redirect manager, url redirection, safe http redirection
4
  Requires at least: 3.1
5
  Tested up to: 3.4.2
6
+ Stable tag: 1.4.2
7
 
8
  Safely and easily manage your website's HTTP redirects.
9
 
24
 
25
  == Changelog ==
26
 
27
+ = 1.4.2 (Oct. 17, 2012) =
28
+ * Disable redirect loop checking by default. You can filter srm_check_for_possible_redirect_loops to enable it.
29
+ * Only return published redirects in update_redirect_cache. - bug fix
30
+
31
  = 1.4.1 (Oct. 11, 2012) =
32
  * Refresh cache after create_redirect call - bug fix
33
  * Refresh cache after save_post is called - bug fix
safe-redirect-manager.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Safe Redirect Manager
4
  Plugin URI: http://www.10up.com
5
  Description: Easily and safely manage HTTP redirects.
6
  Author: Taylor Lovett (10up LLC), VentureBeat
7
- Version: 1.4.1
8
  Author URI: http://www.10up.com
9
 
10
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
@@ -250,19 +250,26 @@ class SRM_Safe_Redirect_Manager {
250
  * Echoes admin message if redirect chains exist
251
  *
252
  * @since 1.0
253
- * @uses current_user_can
254
  * @return void
255
  */
256
  public function action_redirect_chain_alert() {
257
  global $hook_suffix;
258
  if ( $this->is_plugin_page() ) {
 
 
 
 
 
 
259
  if ( $this->check_for_possible_redirect_loops() ) {
260
- ?>
261
- <div class="updated">
262
- <p><?php _e( 'Safe Redirect Manager Warning: Possible redirect loops and/or chains have been created.', 'safe-redirect-manager' ); ?></p>
263
- </div>
264
- <?php
265
- } if ( $this->max_redirects_reached() ) {
 
266
  ?>
267
  <?php if ( 'post-new.php' == $hook_suffix ) : ?><style type="text/css">#post { display: none; }</style><?php endif; ?>
268
  <div class="error">
@@ -642,6 +649,7 @@ class SRM_Safe_Redirect_Manager {
642
  'post_type' => $this->redirect_post_type,
643
  'no_found_rows' => true,
644
  'update_term_cache' => false,
 
645
  );
646
  $redirect_query = new WP_Query( $args );
647
  $redirect_cache = array();
4
  Plugin URI: http://www.10up.com
5
  Description: Easily and safely manage HTTP redirects.
6
  Author: Taylor Lovett (10up LLC), VentureBeat
7
+ Version: 1.4.2
8
  Author URI: http://www.10up.com
9
 
10
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
250
  * Echoes admin message if redirect chains exist
251
  *
252
  * @since 1.0
253
+ * @uses apply_filters
254
  * @return void
255
  */
256
  public function action_redirect_chain_alert() {
257
  global $hook_suffix;
258
  if ( $this->is_plugin_page() ) {
259
+
260
+ /**
261
+ * check_for_possible_redirect_loops() runs in best case Theta(n^2) so if you have 100 redirects, this method
262
+ * will be running slow. Let's disable it by default.
263
+ */
264
+ if ( apply_filters( 'srm_check_for_possible_redirect_loops', false ) ) {
265
  if ( $this->check_for_possible_redirect_loops() ) {
266
+ ?>
267
+ <div class="updated">
268
+ <p><?php _e( 'Safe Redirect Manager Warning: Possible redirect loops and/or chains have been created.', 'safe-redirect-manager' ); ?></p>
269
+ </div>
270
+ <?php
271
+ }
272
+ } if ( $this->max_redirects_reached() ) {
273
  ?>
274
  <?php if ( 'post-new.php' == $hook_suffix ) : ?><style type="text/css">#post { display: none; }</style><?php endif; ?>
275
  <div class="error">
649
  'post_type' => $this->redirect_post_type,
650
  'no_found_rows' => true,
651
  'update_term_cache' => false,
652
+ 'post_status' => 'publish'
653
  );
654
  $redirect_query = new WP_Query( $args );
655
  $redirect_cache = array();