Quick Page/Post Redirect Plugin - Version 1.7

Version Description

  • fix to correct meta redirect - moved "exit" commant to "addtoheader_theme" function. Also fixed the problem woth some pages not redirecting. Made the plugin WordPress MU compatible. (9/8/2009)
Download this release

Release Info

Developer prophecy2040
Plugin Icon 128x128 Quick Page/Post Redirect Plugin
Version 1.7
Comparing to
See all releases

Code changes from version 1.6.1 to 1.7

Files changed (2) hide show
  1. page_post_redirect_plugin.php +4 -3
  2. readme.txt +17 -4
page_post_redirect_plugin.php CHANGED
@@ -5,9 +5,10 @@ Plugin URI: http://fischercreativemedia.com/wordpress-plugins/quick-pagepost-red
5
  Description: Redirect Pages or Posts to another location quickly. Adds a redirect box to the page or post edit page where you can specify the redirect Location and type. Location can be to another WordPress page/post or an external URL. UPDATE: Page or post NO LONGER needs to be published for this to work correctly - however you do need to publish it and then save it as a draft so WordPress creates the proper meta for it.
6
  Author: Don Fischer
7
  Author URI: http://www.fischercreativemedia.com/
8
- Version: 1.6.1
9
 
10
  Version info:
 
11
  1.6.1 - Small fix to correct the same problem as 1.6 for Category and Archive pages (9/1/2009)
12
  1.6 - Fix wrongful redirect when the first blog post on home page (main blog page) has a redirect set up - this was redirecting the
13
  entire page incorrectly. (9/1/2009)
@@ -53,11 +54,12 @@ Version info:
53
  global $ppr_url;
54
  $meta_code = '<meta http-equiv="refresh" content="0; URL='.$ppr_url.'" />';
55
  echo $meta_code;
 
56
  }
57
 
58
  function ppr_do_redirect(){
59
  global $post,$wp_query,$ppr_url,$ppr_active,$ppr_url,$ppr_type;
60
- if($wp_query->is_single):
61
  $thisidis_current= $post->ID;
62
  $ppr_active=get_post_meta($thisidis_current,'pprredirect_active',true);
63
  $ppr_url=get_post_meta($thisidis_current,'pprredirect_url',true);
@@ -69,7 +71,6 @@ Version info:
69
  if($ppr_type=='meta'):
70
  //metaredirect
71
  add_action('wp_head', "addmetatohead_theme",1);
72
- exit; //stop loading page so meta can do it's job without rest of page loading.
73
  elseif($ppr_url!=''):
74
  //check for http:// - as full url - then we can just redirect if it is //
75
  if( strpos($ppr_url, 'http://')=== 0 || strpos($ppr_url, 'https://')=== 0){
5
  Description: Redirect Pages or Posts to another location quickly. Adds a redirect box to the page or post edit page where you can specify the redirect Location and type. Location can be to another WordPress page/post or an external URL. UPDATE: Page or post NO LONGER needs to be published for this to work correctly - however you do need to publish it and then save it as a draft so WordPress creates the proper meta for it.
6
  Author: Don Fischer
7
  Author URI: http://www.fischercreativemedia.com/
8
+ Version: 1.7
9
 
10
  Version info:
11
+ 1.7 - Small fix to correct the Meta Redirect - moved "exit" command to end of "addmetatohead_theme" function. And also fix Page redirect. (9/8/2009)
12
  1.6.1 - Small fix to correct the same problem as 1.6 for Category and Archive pages (9/1/2009)
13
  1.6 - Fix wrongful redirect when the first blog post on home page (main blog page) has a redirect set up - this was redirecting the
14
  entire page incorrectly. (9/1/2009)
54
  global $ppr_url;
55
  $meta_code = '<meta http-equiv="refresh" content="0; URL='.$ppr_url.'" />';
56
  echo $meta_code;
57
+ exit;//stop loading page so meta can do it's job without rest of page loading.
58
  }
59
 
60
  function ppr_do_redirect(){
61
  global $post,$wp_query,$ppr_url,$ppr_active,$ppr_url,$ppr_type;
62
+ if($wp_query->is_single || $wp_query->is_page ):
63
  $thisidis_current= $post->ID;
64
  $ppr_active=get_post_meta($thisidis_current,'pprredirect_active',true);
65
  $ppr_url=get_post_meta($thisidis_current,'pprredirect_url',true);
71
  if($ppr_type=='meta'):
72
  //metaredirect
73
  add_action('wp_head', "addmetatohead_theme",1);
 
74
  elseif($ppr_url!=''):
75
  //check for http:// - as full url - then we can just redirect if it is //
76
  if( strpos($ppr_url, 'http://')=== 0 || strpos($ppr_url, 'https://')=== 0){
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Quick Page/Post Redirect ===
2
  Contributors: Don Fischer
3
  Donate link: http://fischercreativemedia.com/
4
- Tags: redirect, 301, 302, meta, post, plugin, page, forward, re-direct
5
  Requires at least: 2.5
6
- Tested up to: 2.8.4
7
- Stable tag: 1.6.1
8
 
9
  Redirect Pages/Posts to another page/post or external URL. Adds edit box to admin edit so user can specify the redirect Location and type.
10
 
@@ -17,7 +17,13 @@ The redirect Location can be to another WordPress page/post or any other website
17
 
18
  PLEASE NOTE: At this time, the a new page or post needs to be Published in order for the redirect to happen. It WILL work on a DRAFT Status Post/Page ONLY, and I mean ONLY, if the Post/Page has FIRST been Published and the re-saved as a Draft - WordPress does not set up the post meta for the permalink until after first publish for some reason - will hopefully fix this in the future.
19
 
20
- This plugin is also not compatible with WordPress versions less than 2.5, and has not been tested with WordPress MU. If anyone using WPMU has tested this plugin and would like to let me know, I would love to know your results.
 
 
 
 
 
 
21
 
22
  == Installation ==
23
 
@@ -33,6 +39,11 @@ This plugin is also not compatible with WordPress versions less than 2.5, and ha
33
 
34
  == Frequently Asked Questions ==
35
 
 
 
 
 
 
36
  = Does the Page/Post need to be Published to redirect? =
37
  YES... and NO... The redirect will always work on a Published Post/Page. For it to work correctly on a Post/Page in DRAFT status, you need to fist publish the page, then re-save it as a draft. If you don't follow that step, you will get a 404 error.
38
 
@@ -67,6 +78,8 @@ Yes, you can, but you do not always need to. If you are redirecting to an extern
67
 
68
 
69
  == Changelog ==
 
 
70
  = 1.6.1 =
71
  * Small fix to correct the same problem as 1.6 for Category and Archive pages (9/1/2009)
72
  = 1.6 =
1
  === Quick Page/Post Redirect ===
2
  Contributors: Don Fischer
3
  Donate link: http://fischercreativemedia.com/
4
+ Tags: redirect, 301, 302, meta, post, plugin, page, forward, re-direct, wpmu, WordPress MU
5
  Requires at least: 2.5
6
+ Tested up to: 2.9.1
7
+ Stable tag: 1.7
8
 
9
  Redirect Pages/Posts to another page/post or external URL. Adds edit box to admin edit so user can specify the redirect Location and type.
10
 
17
 
18
  PLEASE NOTE: At this time, the a new page or post needs to be Published in order for the redirect to happen. It WILL work on a DRAFT Status Post/Page ONLY, and I mean ONLY, if the Post/Page has FIRST been Published and the re-saved as a Draft - WordPress does not set up the post meta for the permalink until after first publish for some reason - will hopefully fix this in the future.
19
 
20
+ This plugin is also not compatible with WordPress versions less than 2.5.
21
+
22
+ Tested in MU 2.8.4a (9/8/2009)
23
+
24
+ TROUBLESHOOTING:
25
+ If your page or post is not redirecting, this is most likely because something else like the theme functions file or another plugin is outputting the header BEFORE the plugin can perform the redirect. This can be tested by turning off all plugins except the Quick Page/Post Redirect Plugin and testing if the redirect works. 9 out of 10 times, a plugin or bad code is the culprit.
26
+ We have tested the plugin in dozens of themes and alongside a whole lot more plugins. In our experience, (with exception to a few bugs) most of the time another plugin is the problem. If you do notice a problem, please let us know at plugins@fischercreativemedia.com - along with the WP version, theme you are using and plugins you have installed - and we will try to troubleshoot the problem.
27
 
28
  == Installation ==
29
 
39
 
40
  == Frequently Asked Questions ==
41
 
42
+ = Why is my Page/Post not redirecting? =
43
+ If your page or post is not redirecting, this is most likely because something else like the theme functions file or another plugin is outputting the header BEFORE the plugin can perform the redirect. This can be tested by turning off all plugins except the Quick Page/Post Redirect Plugin and testing if the redirect works. 9 out of 10 times, a plugin or bad code is the culprit.
44
+
45
+ We have tested the plugin in dozens of themes and a whole lot more plugins. In our experience, (with exception to a few bugs) most of the time another plugin is the problem. If you do notice a problem, please let us know at plugins@fischercreativemedia.com - along with the WP version, theme you are using and plugins you have installed - and we will try to troubleshoot the problem.
46
+
47
  = Does the Page/Post need to be Published to redirect? =
48
  YES... and NO... The redirect will always work on a Published Post/Page. For it to work correctly on a Post/Page in DRAFT status, you need to fist publish the page, then re-save it as a draft. If you don't follow that step, you will get a 404 error.
49
 
78
 
79
 
80
  == Changelog ==
81
+ = 1.7 =
82
+ * fix to correct meta redirect - moved "exit" commant to "addtoheader_theme" function. Also fixed the problem woth some pages not redirecting. Made the plugin WordPress MU compatible. (9/8/2009)
83
  = 1.6.1 =
84
  * Small fix to correct the same problem as 1.6 for Category and Archive pages (9/1/2009)
85
  = 1.6 =