Quick Page/Post Redirect Plugin - Version 4.2.2

Version Description

  • Fix some embarrasing spelling errors.(07/14/2011)
  • Fix Quick Redirects links from inside the redirect edit box and plugin page - they would give a "not authorized" warning because the page location changed in version 4.0 (07/14/11)
Download this release

Release Info

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

Code changes from version 4.2 to 4.2.2

Files changed (2) hide show
  1. page_post_redirect_plugin.php +16 -13
  2. readme.txt +12 -4
page_post_redirect_plugin.php CHANGED
@@ -1,12 +1,12 @@
1
<?php
2
/*
3
- Plugin Name: Quick Page/Post Redirect
4
Plugin URI: http://www.fischercreativemedia.com/wordpress-plugins/quick-pagepost-redirect-plugin/
5
Description: Redirect Pages, Posts or Custom Post Types to another location quickly (for internal or external URLs). Includes individual post/page options, redirects for Custom Post types, non-existant 301 Quick Redirects (helpful for sites converted to WordPress), New Window functionality, and rel=nofollow functionality.
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.
@@ -250,16 +250,16 @@ class quick_page_post_reds {
250
<td><h2 style="font-size:20px;">Master Override Options</h2><b>NOTE: </b>These will override all individual settings.</td>
251
</tr>
252
<tr valign="top">
253
- <td><label>Turn OFF all Redirects? </label><input type="checkbox" name="ppr_override-active" value="1"<?php if(get_option('ppr_override-active')=='1'){echo ' checked="checked" ';} ?>/></td>
254
</tr>
255
<tr valign="top">
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>
263
<select name="ppr_override-redirect-type">
264
<option value="0">Use Individual Settings</option>
265
<option value="301" <?php if( get_option('ppr_override-redirect-type')=='301') {echo ' selected="selected" ';} ?>/>301 Permanant Redirect</option>
@@ -267,13 +267,13 @@ class quick_page_post_reds {
267
<option value="307" <?php if( get_option('ppr_override-redirect-type')=='307') {echo ' selected="selected" ';} ?>/>307 Temporary Redirect</option>
268
<option value="meta" <?php if(get_option('ppr_override-redirect-type')=='meta'){echo ' selected="selected" ';} ?>/>Meta Refresh Redirect</option>
269
</select>
270
- </td>
271
</tr>
272
<tr valign="top">
273
- <td><label>Make ALL Rediects go to this URL: </label><input type="text" size="50" name="ppr_override-URL" value="<?php echo get_option('ppr_override-URL'); ?>"/> <span>(use full URL including <code>http://</code>).</span></td>
274
</tr>
275
<tr valign="top">
276
- <td><label>Rewrite ALL Rediects URLs to Show in LINK? </label><input type="checkbox" name="ppr_override-rewrite" value="1"<?php if(get_option('ppr_override-rewrite')=='1'){echo ' checked="checked" ';} ?>/> <span>(makes link show redirect URL instead of the original URL).</span></td>
277
</tr>
278
</table>
279
<p class="submit">
@@ -302,7 +302,8 @@ class quick_page_post_reds {
302
<ul>
303
<li style="color:#214070;margin-left:25px;list-style-type:disc;">The <b>Request</b> field MUST be relative to the ROOT directory and contain the <code>/</code> at the beginning.</li>
304
<li style="color:#214070;margin-left:25px;list-style-type:disc;">The <b>Destination</b> field can be any valid URL or relative path (from root).</li>
305
- <li style="color:#214070;margin-left:25px;list-style-type:disc;">Quick Redirects <b>WILL NOT open in a new window</b>. They are meant to be 'Quick' and since the user will not aculally be clicking anything, a new window cannot be opened.</li>
306
</ul>
307
<br/>
308
<form method="post" action="admin.php?page=redirect-updates">
@@ -579,7 +580,7 @@ class quick_page_post_reds {
579
580
function ppr_filter_plugin_links($links, $file){
581
if ( $file == plugin_basename(__FILE__) ){
582
- $links[] = '<a href="'.$this->adminlink.'options-general.php?page=redirect-updates">Quick Redirects</a>';
583
$links[] = '<a target="_blank" href="'.$this->fcmlink.'/quick-pagepost-redirect-plugin/">FAQ</a>';
584
$links[] = '<a target="_blank" href="'.$this->fcmlink.'/donate/">Donate</a>';
585
}
@@ -627,7 +628,7 @@ class quick_page_post_reds {
627
endswitch;
628
629
echo '<select style="margin-top:2px;margin-bottom:2px;width:40%;" name="pprredirect_type"><option value="301" '.$ppr_option1.'>301 Permanent</option><option value="302" '.$ppr_option2.'>302 Temporary</option><option value="307" '.$ppr_option3.'>307 Temporary</option><option value="meta" '.$ppr_option5.'>Meta Redirect</option></select> (Default is 302)<br /><br />';
630
- echo '<b>NOTE:</b> For This Option to work, the page or post needs to be published for the redirect to happen <i><b>UNLESS</b></i> you publish it first, then save it as a Draft. If you want to add a redirect without adding a page/post or having it published, use the <a href="./options-general.php?page=redirect-updates">Quick Redirects</a> method.';
631
}
632
633
function ppr_save_metadata($post_id, $post) {
@@ -780,7 +781,9 @@ class quick_page_post_reds {
780
// Read the list of redirects and if the current page is found in the list, send the visitor on her way
781
if (!empty($this->quickppr_redirects) && !is_admin()) {
782
$userrequest = str_replace(get_option('home'),'',$this->getAddress());
783
- if (array_key_exists($userrequest,$this->quickppr_redirects)) {
784
if($this->quickppr_redirects[$userrequest]!='') {
785
if($this->pproverride_URL!=''){$useURL = $this->pproverride_URL;}else{$useURL = $this->quickppr_redirects[$userrequest];}
786
switch($this->pproverride_type){
1
<?php
2
/*
3
+ Plugin Name: Quick Page/Post Redirect DEV
4
Plugin URI: http://www.fischercreativemedia.com/wordpress-plugins/quick-pagepost-redirect-plugin/
5
Description: Redirect Pages, Posts or Custom Post Types to another location quickly (for internal or external URLs). Includes individual post/page options, redirects for Custom Post types, non-existant 301 Quick Redirects (helpful for sites converted to WordPress), New Window functionality, and rel=nofollow functionality.
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.2
10
11
Version info:
12
See change log in readme.txt file.
250
<td><h2 style="font-size:20px;">Master Override Options</h2><b>NOTE: </b>These will override all individual settings.</td>
251
</tr>
252
<tr valign="top">
253
+ <td><label>Turn OFF all Redirects? </label><input type="checkbox" name="ppr_override-active" value="1"<?php if(get_option('ppr_override-active')=='1'){echo ' checked="checked" ';} ?>/> <span>excludes Quick 301 Redirects.</span></td>
254
</tr>
255
<tr valign="top">
256
+ <td><label>Make ALL Redirects 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" ';} ?>/> <span>excludes Quick 301 Redirects.</span></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>excludes Quick 301 Redirects.</span></td>
260
</tr>
261
<tr valign="top">
262
+ <td><label>Make ALL Redirects this type: </label>
263
<select name="ppr_override-redirect-type">
264
<option value="0">Use Individual Settings</option>
265
<option value="301" <?php if( get_option('ppr_override-redirect-type')=='301') {echo ' selected="selected" ';} ?>/>301 Permanant Redirect</option>
267
<option value="307" <?php if( get_option('ppr_override-redirect-type')=='307') {echo ' selected="selected" ';} ?>/>307 Temporary Redirect</option>
268
<option value="meta" <?php if(get_option('ppr_override-redirect-type')=='meta'){echo ' selected="selected" ';} ?>/>Meta Refresh Redirect</option>
269
</select>
270
+ <span> (Quick 301 Redirects will always be 301)</span></td>
271
</tr>
272
<tr valign="top">
273
+ <td><label>Make ALL Redirects go to this URL: </label><input type="text" size="50" name="ppr_override-URL" value="<?php echo get_option('ppr_override-URL'); ?>"/> <span>(use full URL including <code>http://</code>).</span></td>
274
</tr>
275
<tr valign="top">
276
+ <td><label>Rewrite ALL Redirects URLs to Show in LINK? </label><input type="checkbox" name="ppr_override-rewrite" value="1"<?php if(get_option('ppr_override-rewrite')=='1'){echo ' checked="checked" ';} ?>/> <span>(makes link show redirect URL instead of the original URL).</span></td>
277
</tr>
278
</table>
279
<p class="submit">
302
<ul>
303
<li style="color:#214070;margin-left:25px;list-style-type:disc;">The <b>Request</b> field MUST be relative to the ROOT directory and contain the <code>/</code> at the beginning.</li>
304
<li style="color:#214070;margin-left:25px;list-style-type:disc;">The <b>Destination</b> field can be any valid URL or relative path (from root).</li>
305
+ <li style="color:#214070;margin-left:25px;list-style-type:disc;">Quick Redirects <b>WILL NOT open in a new window</b>. They are meant to be 'Quick' and since the user will not
306
+ actually be clicking anything, a new window cannot be opened.</li>
307
</ul>
308
<br/>
309
<form method="post" action="admin.php?page=redirect-updates">
580
581
function ppr_filter_plugin_links($links, $file){
582
if ( $file == plugin_basename(__FILE__) ){
583
+ $links[] = '<a href="'.$this->adminlink.'admin.php?page=redirect-updates">Quick Redirects</a>';
584
$links[] = '<a target="_blank" href="'.$this->fcmlink.'/quick-pagepost-redirect-plugin/">FAQ</a>';
585
$links[] = '<a target="_blank" href="'.$this->fcmlink.'/donate/">Donate</a>';
586
}
628
endswitch;
629
630
echo '<select style="margin-top:2px;margin-bottom:2px;width:40%;" name="pprredirect_type"><option value="301" '.$ppr_option1.'>301 Permanent</option><option value="302" '.$ppr_option2.'>302 Temporary</option><option value="307" '.$ppr_option3.'>307 Temporary</option><option value="meta" '.$ppr_option5.'>Meta Redirect</option></select> (Default is 302)<br /><br />';
631
+ echo '<b>NOTE:</b> For This Option to work, the page or post needs to be published for the redirect to happen <i><b>UNLESS</b></i> you publish it first, then save it as a Draft. If you want to add a redirect without adding a page/post or having it published, use the <a href="./admin.php?page=redirect-updates">Quick Redirects</a> method.';
632
}
633
634
function ppr_save_metadata($post_id, $post) {
781
// Read the list of redirects and if the current page is found in the list, send the visitor on her way
782
if (!empty($this->quickppr_redirects) && !is_admin()) {
783
$userrequest = str_replace(get_option('home'),'',$this->getAddress());
784
+ if(strpos($userrequest,'/') === false) {$userrequesttest = '/'.$userrequest.'/';}else{$userrequesttest = $userrequest.'/';}
785
+ if (array_key_exists($userrequest,$this->quickppr_redirects) || array_key_exists($userrequesttest,$this->quickppr_redirects)) {
786
+ if(isset($this->quickppr_redirects[$userrequesttest]) && $this->quickppr_redirects[$userrequesttest]!=''){$userrequest = $userrequesttest;}
787
if($this->quickppr_redirects[$userrequest]!='') {
788
if($this->pproverride_URL!=''){$useURL = $this->pproverride_URL;}else{$useURL = $this->quickppr_redirects[$userrequest];}
789
switch($this->pproverride_type){
readme.txt CHANGED
@@ -2,8 +2,8 @@
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+
@@ -15,7 +15,7 @@ It adds an option box to the edit section where you can specify the redirect loc
15
= Features: =
16
* Works with new WordPress menus
17
* Works with new WordPress Custom Post Types (set option on settings page)
18
- * you set a redirect page or menu link to open in a new window (will not work on permalinks)
19
* You can add a *rel="nofollow"* attribute to the page or menu link of the redirect (will not work on permalinks)
20
* You can completely re-write the URL for the redirect so it takes the place of the default page URL (rewrite the href link)
21
* You can redirect without needing to create a Page or Post. This is very useful for sites that were converted to WordPress and have old links that create 404 errors (see FAQs for more information). This option does not allow for open in a new window or nofollow functions.
@@ -117,9 +117,17 @@ 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.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)
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: 3.1
6
+ Tested up to: 3.2.1
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+
15
= Features: =
16
* Works with new WordPress menus
17
* Works with new WordPress Custom Post Types (set option on settings page)
18
+ * You can set a redirect page or menu link to open in a new window (will not work on permalinks)
19
* You can add a *rel="nofollow"* attribute to the page or menu link of the redirect (will not work on permalinks)
20
* You can completely re-write the URL for the redirect so it takes the place of the default page URL (rewrite the href link)
21
* You can redirect without needing to create a Page or Post. This is very useful for sites that were converted to WordPress and have old links that create 404 errors (see FAQs for more information). This option does not allow for open in a new window or nofollow functions.
117
4. Summary of redirects page (new in version 4.0)
118
119
== Changelog ==
120
+ = 4.2.2 =
121
+ * Fix some embarrasing spelling errors.(07/14/2011)
122
+ * Fix Quick Redirects links from inside the redirect edit box and plugin page - they would give a "not authorized" warning because the page location changed in version 4.0 (07/14/11)
123
+
124
+ = 4.2.1 =
125
+ * Fix to trailing slash non-redirect for quick redirects.(06/28/2011)
126
+ * Note - this was not a public version fix, but a dev testing version - this fix is publicly included in 4.2.2.
127
+
128
= 4.2 =
129
* Fix to menus pages always opening in New Window even when not selected.(05/08/2011)
130
+ * Fix Categories/Archives automatically redirecting to the first post with redirect set if any post on the page had a redirect set.(05/08/2011)
131
* Fix Homepage redirecting to first post with redirect set if using posts as home and any post had a redirect.(05/08/2011)
132
* 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)
133
* 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)