Quick Page/Post Redirect Plugin - Version 4.2

Version Description

  • Fix to menus pages always opening in New Window even when not selected.(05/08/2011)
  • Fix Categories/Archives automatically redirecting to the fist post with redirect set if any post on the page had a redirect set.(05/08/2011)
  • Fix Homepage redirecting to first post with redirect set if using posts as home and any post had a redirect.(05/08/2011)
  • Fix misrepresentation of new window global setting on options page. Should read that "all redirects WILL open in a new window" not "will NOT open in a new window". (05/08/2011)
  • Update description to note that the plugin requires PHP 5+ because some of the class calls will not work in php4 (plugin will not activate). (05/08/2011)
Download this release

Release Info

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

Code changes from version 4.0.1 to 4.2

Files changed (2) hide show
  1. page_post_redirect_plugin.php +14 -12
  2. readme.txt +19 -6
page_post_redirect_plugin.php CHANGED
@@ -6,10 +6,11 @@ Description: Redirect Pages, Posts or Custom Post Types to another location quic
6
Author: Don Fischer
7
Author URI: http://www.fischercreativemedia.com/
8
Donate link: http://www.fischercreativemedia.com/wordpress-plugins/donate/
9
- Version: 4.1
10
11
Version info:
12
See change log in readme.txt file.
13
14
Copyright (C) 2009-2011 Donald J. Fischer
15
@@ -108,7 +109,6 @@ class quick_page_post_reds {
108
add_filter( 'post_type_link', array($this, 'ppr_filter_page_links'), 20, 2 );
109
add_filter( 'get_permalink', array($this, 'ppr_filter_links'), 20, 2 );
110
}
111
-
112
if (isset( $_POST['submit_301']) ) {$this->quickppr_redirects = $this->save_redirects($_POST['quickppr_redirects']);$this->updatemsg ='Quick Redirects Updated.';} //if submitted, process the data
113
if (isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated']=='true'){$this->updatemsg ='Settings Updated.';}
114
}
@@ -168,8 +168,10 @@ class quick_page_post_reds {
168
foreach($this->ppr_all_redir_array as $key=>$result){
169
$tempa['id']= $key;
170
$tempa['post_type'] = get_post_type( $key );
171
- foreach($result as $metakey => $metaval){
172
- $tempa[$metakey] = $metaval;
173
}
174
$tempReportArray[] = $tempa;
175
unset($tempa);
@@ -254,7 +256,7 @@ class quick_page_post_reds {
254
<td><label>Make ALL Rediects have <code>rel="nofollow"</code>? </label><input type="checkbox" name="ppr_override-nofollow" value="1"<?php if(get_option('ppr_override-nofollow')=='1'){echo ' checked="checked" ';} ?>/></td>
255
</tr>
256
<tr valign="top">
257
- <td><label>Make ALL Rediects open in a New Window? </label><input type="checkbox" name="ppr_override-newwindow" value="1"<?php if(get_option('ppr_override-newwindow')=='1'){echo ' checked="checked" ';} ?>/> <span>(Quick Redirect will not open in a new Window).</span></td>
258
</tr>
259
<tr valign="top">
260
<td><label>Make ALL Rediects this type: </label>
@@ -437,11 +439,11 @@ class quick_page_post_reds {
437
foreach($thetemp as $key){
438
// defaults
439
if(!isset($theArray[$key->post_id]['_pprredirect_rewritelink'])){$theArray[$key->post_id]['_pprredirect_rewritelink'] = 0;}
440
- if(!isset($theArray[$key->post_id]['_pprredirect_url'])){$theArray[$key->post_id]['_pprredirect_url'] = 'http://www.example.com';}
441
- if(!isset($theArray[$key->post_id]['_pprredirect_type'] )){$theArray[$key->post_id]['_pprredirect_type'] = 302;}
442
if(!isset($theArray[$key->post_id]['_pprredirect_relnofollow'])){$theArray[$key->post_id]['_pprredirect_relnofollow'] = 0;}
443
if(!isset($theArray[$key->post_id]['_pprredirect_newwindow'] )) {$theArray[$key->post_id]['_pprredirect_newwindow'] = 0;}
444
- if(!isset($theArray[$key->post_id]['_pprredirect_active'] )){$theArray[$key->post_id]['_pprredirect_active'] = 0;}
445
}
446
447
}
@@ -700,7 +702,7 @@ class quick_page_post_reds {
700
if($ppitems['_pprredirect_active'] == 1 && $this->pproverride_newwin =='1'){ // check override of NEW WINDOW
701
$ppr_newindow[] = $ppitems['post_id'];
702
}else{
703
- if($ppitems['_pprredirect_active'] == 1 && $ppitems['_pprredirect_newwindow'] == '_blank'){
704
$ppr_newindow[] = $ppitems['post_id'];
705
}
706
}
@@ -811,8 +813,8 @@ class quick_page_post_reds {
811
812
function ppr_do_redirect(){
813
// Read the list of redirects and if the current page is found in the list, send the visitor on her way
814
- global $post; //temp
815
- if (count($this->ppr_all_redir_array)>0) {
816
if(isset($this->ppr_all_redir_array[$post->ID])){
817
$isactive = $this->ppr_all_redir_array[$post->ID]['_pprredirect_active'];
818
$redrtype = $this->ppr_all_redir_array[$post->ID]['_pprredirect_type'];
@@ -879,7 +881,7 @@ class quick_page_post_reds {
879
880
if($this->pproverride_URL !=''){$theRedURL = $this->pproverride_URL;} // check override
881
882
- if($theIsActives == '1' && $theNewWindow == '_blank'){
883
$ppd->target = '_blank';
884
$ppd->classes[] = 'ppr-new-window';
885
}
6
Author: Don Fischer
7
Author URI: http://www.fischercreativemedia.com/
8
Donate link: http://www.fischercreativemedia.com/wordpress-plugins/donate/
9
+ Version: 4.2
10
11
Version info:
12
See change log in readme.txt file.
13
+ Version 3.2.4 to 4.0.1 are testing versions only
14
15
Copyright (C) 2009-2011 Donald J. Fischer
16
109
add_filter( 'post_type_link', array($this, 'ppr_filter_page_links'), 20, 2 );
110
add_filter( 'get_permalink', array($this, 'ppr_filter_links'), 20, 2 );
111
}
112
if (isset( $_POST['submit_301']) ) {$this->quickppr_redirects = $this->save_redirects($_POST['quickppr_redirects']);$this->updatemsg ='Quick Redirects Updated.';} //if submitted, process the data
113
if (isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated']=='true'){$this->updatemsg ='Settings Updated.';}
114
}
168
foreach($this->ppr_all_redir_array as $key=>$result){
169
$tempa['id']= $key;
170
$tempa['post_type'] = get_post_type( $key );
171
+ if(count($result)>0){
172
+ foreach($result as $metakey => $metaval){
173
+ $tempa[$metakey] = $metaval;
174
+ }
175
}
176
$tempReportArray[] = $tempa;
177
unset($tempa);
256
<td><label>Make ALL Rediects have <code>rel="nofollow"</code>? </label><input type="checkbox" name="ppr_override-nofollow" value="1"<?php if(get_option('ppr_override-nofollow')=='1'){echo ' checked="checked" ';} ?>/></td>
257
</tr>
258
<tr valign="top">
259
+ <td><label>Make ALL Redirects open in a New Window? </label><input type="checkbox" name="ppr_override-newwindow" value="1"<?php if(get_option('ppr_override-newwindow')=='1'){echo ' checked="checked" ';} ?>/> <span>(Quick Redirect will open in a new Window).</span></td>
260
</tr>
261
<tr valign="top">
262
<td><label>Make ALL Rediects this type: </label>
439
foreach($thetemp as $key){
440
// defaults
441
if(!isset($theArray[$key->post_id]['_pprredirect_rewritelink'])){$theArray[$key->post_id]['_pprredirect_rewritelink'] = 0;}
442
+ if(!isset($theArray[$key->post_id]['_pprredirect_url'])){$theArray[$key->post_id]['_pprredirect_url'] = 'http://www.example.com';}
443
+ if(!isset($theArray[$key->post_id]['_pprredirect_type'] )){$theArray[$key->post_id]['_pprredirect_type'] = 302;}
444
if(!isset($theArray[$key->post_id]['_pprredirect_relnofollow'])){$theArray[$key->post_id]['_pprredirect_relnofollow'] = 0;}
445
if(!isset($theArray[$key->post_id]['_pprredirect_newwindow'] )) {$theArray[$key->post_id]['_pprredirect_newwindow'] = 0;}
446
+ if(!isset($theArray[$key->post_id]['_pprredirect_active'] )){$theArray[$key->post_id]['_pprredirect_active'] = 0;}
447
}
448
449
}
702
if($ppitems['_pprredirect_active'] == 1 && $this->pproverride_newwin =='1'){ // check override of NEW WINDOW
703
$ppr_newindow[] = $ppitems['post_id'];
704
}else{
705
+ if($ppitems['_pprredirect_active'] == 1 && $ppitems['_pprredirect_newwindow'] === '_blank'){
706
$ppr_newindow[] = $ppitems['post_id'];
707
}
708
}
813
814
function ppr_do_redirect(){
815
// Read the list of redirects and if the current page is found in the list, send the visitor on her way
816
+ global $post;
817
+ if (count($this->ppr_all_redir_array)>0 && (is_single() || is_singular() || is_page())) {
818
if(isset($this->ppr_all_redir_array[$post->ID])){
819
$isactive = $this->ppr_all_redir_array[$post->ID]['_pprredirect_active'];
820
$redrtype = $this->ppr_all_redir_array[$post->ID]['_pprredirect_type'];
881
882
if($this->pproverride_URL !=''){$theRedURL = $this->pproverride_URL;} // check override
883
884
+ if($theIsActives == '1' && $theNewWindow === '_blank'){
885
$ppd->target = '_blank';
886
$ppd->classes[] = 'ppr-new-window';
887
}
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
- === Quick Page/Post Redirect ===
2
Contributors: Don Fischer
3
Donate link: http://www.fischercreativemedia.com/wordpress-plugins/donate/
4
Tags: redirect, 301, 302, meta, post, plugin, page, forward, re-direct, nofollow, menu links, posts, pages, admin, 404, custom post types, nav menu
5
Requires at least: 2.5
6
- Tested up to: 3.2
7
- Stable tag: 4.1
8
9
- Redirect Pages/Posts to another page/post or external URL. Has edit box as well as global options. Specify the redirect Location and type.
10
11
== Description ==
12
@@ -24,9 +24,9 @@ It adds an option box to the edit section where you can specify the redirect loc
24
* Option Screen to set global overrides like turning off all redirects at once, setting a global destination link, make all redirect open in a new window, etc.
25
* View a summary of all individual redirected pages/posts or custom post types that are currently set up.
26
27
- This plugin is not compatible with WordPress versions less than 2.5.
28
29
- =PLEASE NOTE:= 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.
30
31
= TROUBLESHOOTING: =
32
* To include custom post types, check the setting on the main plugin option page.
@@ -117,6 +117,16 @@ Yes, you can, but you do not always need to. If you are redirecting to an extern
117
4. Summary of redirects page (new in version 4.0)
118
119
== Changelog ==
120
= 4.0 =
121
* Rewrite of all functions for better optimization.(05/01/2011)
122
* Added consolidated DB call at class setup to reduce DB calls to one call per page load.(05/01/2011)
@@ -182,5 +192,8 @@ Yes, you can, but you do not always need to. If you are redirecting to an extern
182
183
== Upgrade Notice ==
184
185
= 4.1 =
186
This upgrade contains new features and drastically reduces the plugin overhead on your site. It is strongly recommended that you updgrade.
1
+ === Quick Page/Post Redirect Plugin ===
2
Contributors: Don Fischer
3
Donate link: http://www.fischercreativemedia.com/wordpress-plugins/donate/
4
Tags: redirect, 301, 302, meta, post, plugin, page, forward, re-direct, nofollow, menu links, posts, pages, admin, 404, custom post types, nav menu
5
Requires at least: 2.5
6
+ Tested up to: 3.1.2
7
+ Stable tag: trunk
8
9
+ Redirect Pages/Posts to another page/post or external URL. Has edit box as well as global options. Specify the redirect Location and type. For PHP5+
10
11
== Description ==
12
24
* Option Screen to set global overrides like turning off all redirects at once, setting a global destination link, make all redirect open in a new window, etc.
25
* View a summary of all individual redirected pages/posts or custom post types that are currently set up.
26
27
+ This plugin is not compatible with WordPress versions less than 2.5. Requires PHP 5+.
28
29
+ *PLEASE NOTE:* 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.
30
31
= TROUBLESHOOTING: =
32
* To include custom post types, check the setting on the main plugin option page.
117
4. Summary of redirects page (new in version 4.0)
118
119
== Changelog ==
120
+ = 4.2 =
121
+ * Fix to menus pages always opening in New Window even when not selected.(05/08/2011)
122
+ * Fix Categories/Archives automatically redirecting to the fist post with redirect set if any post on the page had a redirect set.(05/08/2011)
123
+ * Fix Homepage redirecting to first post with redirect set if using posts as home and any post had a redirect.(05/08/2011)
124
+ * Fix misrepresentation of new window global setting on options page. Should read that "all redirects WILL open in a new window" not "will NOT open in a new window". (05/08/2011)
125
+ * Update description to note that the plugin requires PHP 5+ because some of the class calls will not work in php4 (plugin will not activate). (05/08/2011)
126
+
127
+ = 4.1 =
128
+ * Fix Minor spelling issues and code typos.(05/05/2011)
129
+
130
= 4.0 =
131
* Rewrite of all functions for better optimization.(05/01/2011)
132
* Added consolidated DB call at class setup to reduce DB calls to one call per page load.(05/01/2011)
192
193
== Upgrade Notice ==
194
195
+ = 4.2 =
196
+ This upgrade contains fixes bugs for category redirects not working, homepage redirect issue and always open in new window bug.
197
+
198
= 4.1 =
199
This upgrade contains new features and drastically reduces the plugin overhead on your site. It is strongly recommended that you updgrade.