Safe Redirect Manager - Version 1.1

Version Description

  • safe-redirect-manager.php - plugin_url() used properly, is_plugin_page function
Download this release

Release Info

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

Code changes from version 1.0 to 1.1

Files changed (2) hide show
  1. readme.txt +11 -1
  2. safe-redirect-manager.php +16 -6
readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Safe Redirect Manager ===
2
- Contributors: tlovett1, tollmanz, tddewey, 10up, danielbachhuber, VentureBeat
3
  Tags: http redirects, redirect manager, url redirection, safe http redirection
4
  Requires at least: 3.1
5
  Tested up to: 3.4.1
@@ -11,6 +11,16 @@ Safely and easily manage your websites HTTP redirects.
11
 
12
  Safe Redirect Manager is a HTTP redirect manager for WordPress. An easy-to-use UI allows you to redirect locations to new URL's with the HTTP status codes of your chosing. The plugin uses the wp_safe_redirect function which only allows redirects to whitelisted hosts for security purposes. The plugin automatically handles whitelisting hosts for you.
13
 
 
 
14
  == Installation ==
15
 
16
  Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
 
 
 
 
 
 
 
 
1
  === Safe Redirect Manager ===
2
+ Contributors: tlovett1, tollmanz, taylorde, 10up, jakemgold, danielbachhuber, VentureBeat
3
  Tags: http redirects, redirect manager, url redirection, safe http redirection
4
  Requires at least: 3.1
5
  Tested up to: 3.4.1
11
 
12
  Safe Redirect Manager is a HTTP redirect manager for WordPress. An easy-to-use UI allows you to redirect locations to new URL's with the HTTP status codes of your chosing. The plugin uses the wp_safe_redirect function which only allows redirects to whitelisted hosts for security purposes. The plugin automatically handles whitelisting hosts for you.
13
 
14
+ [Fork the plugin on GitHub.](https://github.com/tlovett1/Safe-Redirect-Manager)
15
+
16
  == Installation ==
17
 
18
  Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
19
+
20
+ == Changelog ==
21
+
22
+ = 1.1 =
23
+ * safe-redirect-manager.php - plugin_url() used properly, is_plugin_page function
24
+
25
+ = 1.0 =
26
+ * Plugin released
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.0
8
  Author URI: http://www.10up.com
9
 
10
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
@@ -75,12 +75,11 @@ class SRM_Safe_Redirect_Manager {
75
  * @return void
76
  */
77
  public function action_print_logo_css() {
78
- global $post;
79
- if ( is_object( $post ) && $this->redirect_post_type == $post->post_type ) {
80
  ?>
81
  <style type="text/css">
82
  #icon-tools {
83
- background: url("<?php echo plugins_url(); ?>/safe-redirect-manager/images/icon32x32.png") no-repeat top left !important;
84
  margin-right: 0;
85
  }
86
  #visibility {
@@ -100,6 +99,17 @@ class SRM_Safe_Redirect_Manager {
100
  return array();
101
  }
102
 
 
 
 
 
 
 
 
 
 
 
 
103
  /**
104
  * Echoes admin message if redirect chains exist
105
  *
@@ -108,8 +118,8 @@ class SRM_Safe_Redirect_Manager {
108
  * @return void
109
  */
110
  public function action_redirect_chain_alert() {
111
- global $post, $hook_suffix;
112
- if ( is_object( $post ) && $this->redirect_post_type == $post->post_type ) {
113
  if ( $this->check_for_possible_redirect_loops() ) {
114
  ?>
115
  <div class="updated">
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.1
8
  Author URI: http://www.10up.com
9
 
10
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
75
  * @return void
76
  */
77
  public function action_print_logo_css() {
78
+ if ( $this->is_plugin_page() ) {
 
79
  ?>
80
  <style type="text/css">
81
  #icon-tools {
82
+ background: url("<?php echo plugins_url( 'images/icon32x32.png', __FILE__ ); ?>") no-repeat top left !important;
83
  margin-right: 0;
84
  }
85
  #visibility {
99
  return array();
100
  }
101
 
102
+ /**
103
+ * Whether or not this is an admin page specific to the plugin
104
+ *
105
+ * @since 1.1
106
+ * @uses get_post_type
107
+ * @return bool
108
+ */
109
+ private function is_plugin_page() {
110
+ return (bool) ( get_post_type() == $this->redirect_post_type || ( isset( $_GET['post_type'] ) && $this->redirect_post_type == $_GET['post_type'] ) );
111
+ }
112
+
113
  /**
114
  * Echoes admin message if redirect chains exist
115
  *
118
  * @return void
119
  */
120
  public function action_redirect_chain_alert() {
121
+ global $hook_suffix;
122
+ if ( $this->is_plugin_page() ) {
123
  if ( $this->check_for_possible_redirect_loops() ) {
124
  ?>
125
  <div class="updated">