{"id":55210,"date":"2017-03-21T13:14:07","date_gmt":"2017-03-21T13:14:07","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/page-guard-redirect\/"},"modified":"2022-08-22T16:34:08","modified_gmt":"2022-08-22T16:34:08","slug":"page-guard-redirect","status":"publish","type":"plugin","link":"https:\/\/eo.wordpress.org\/plugins\/page-guard-redirect\/","author":15348598,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1","stable_tag":"trunk","tested":"6.0.16","requires":"4.7","requires_php":"","requires_plugins":"","header_name":"Page Guard Redirect","header_author":"Frank Culross","header_description":"","assets_banners_color":"e9f2d1","last_updated":"2022-08-22 16:34:08","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/gitlab.com\/fculross\/wp-plugins\/wikis\/Donate","header_plugin_uri":"https:\/\/gitlab.com\/fculross\/wp-plugins\/wikis\/home","header_author_uri":"https:\/\/gitlab.com\/fculross\/wp-plugins\/wikis\/About-the-Developer","rating":0,"author_block_rating":0,"active_installs":0,"downloads":2120,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"fculross","date":"2017-03-25 16:50:39"},"1.1":{"tag":"1.1","author":"fculross","date":"2022-08-22 16:34:08"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1621898,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":1621894,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[20299,727,538,20300,62932],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-55210","plugin","type-plugin","status-publish","hentry","plugin_tags-query-string","plugin_tags-redirect","plugin_tags-url","plugin_tags-url-parameters","plugin_tags-urlparam","plugin_committers-fculross"],"banners":{"banner":"https:\/\/ps.w.org\/page-guard-redirect\/assets\/banner-772x250.png?rev=1621894","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/page-guard-redirect\/assets\/icon-128x128.png?rev=1621898","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Page Guard Redirect uses a single URL parameter or POST variable as a means of providing a token to guard access to any page on which this plugin's shortcode is placed - redirection can be made to occur when the token fails to match what is expected (the alternative, i.e. redirect when token DOES match - is also included for completeness.)<\/p>\n\n<p>The shortcode to use is 'pgredirect' - its attributes are:<\/p>\n\n<pre><code>tokenparam (required): a string value containing the name of the token URL param - e.g. 'mytoken'\ntokenvalue (required): a string value containing the expected value of the tokenparam - e.g. 'x34ggj45b'\nredirectURL (required): a string value containing the URL to redirect to (you can use an existing page as the target for the redirection - alternatively, for many configurations, setting this to a non existent page will make WordPress redirect to the default 404 \"not found\" page.)\nredirectWhen (optional): -&gt; when = \"1\", redirects when match is found, otherwise defaults to redirect on non-match\n<\/code><\/pre>\n\n<p>Syntax examples:<\/p>\n\n<pre><code>  redirect on non match (default) -\n    [pgredirect tokenparam=\"mytoken\" tokenvalue=\"1234abcd\" redirecturl=\"http:\/\/my.redirurl.com\/notfound\" \/]\n\n  redirect on match (add redirectwhen=\"1\" as an attribute) -\n    [pgredirect tokenparam=\"mytoken\" tokenvalue=\"1234abcd\" redirectwhen=\"1\" redirecturl=\"http:\/\/my.redirurl.com\/notfound\" \/]\n<\/code><\/pre>\n\n<h3>Usage<\/h3>\n\n<p>A typical use scenario might be to prevent access to a downloads page. Suppose you have a PayPal \"Buy Now\" button on your site which allows visitors to make a payment for say, an eBook or audio recording. When setting up the button in your PayPal account you specify a URL on your site to which the visitor is returned after they've made payment. On this return page you've added a link the visitor can use to download their purchase - however, you don't want any non paying visitors to find the return page by chance!<\/p>\n\n<p>Add a parameter to the end of the return URL (using any name and value you want) when you set up your button in PayPal e.g.<\/p>\n\n<pre><code>\"http:\/\/your.wordpress.site\/download\/?dltoken=Xc345Fd77\"\n<\/code><\/pre>\n\n<p>Next, add a pgredirect short code to your return page in WordPress -<\/p>\n\n<pre><code>[pgredirect tokenparam=\"dltoken\" tokenvalue=\"Xc345Fd77\" redirecturl=\"http:\/\/your.wordpress.site\/notfound\" \/]\n<\/code><\/pre>\n\n<p>This will cause a redirect if Page Guard Redirect detects either the lack of the expected token in the URL parameter, or a value which doesn't match the one in the short code's tokenvalue attribute.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>To install the plugin, download the zip file and upload via the plugin interface of your WordPress site or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='can%20i%20use%20any%20name%20for%20my%20url%20token%20parameter'><h3>Can I use any name for my URL token parameter<\/h3><\/dt>\n<dd><p>Yes you can! You might like to use somewhat obfuscated token names as well as values in order to further minimise the possibility of a visitor finding your protected page purely by chance e.g.<\/p>\n\n<pre><code>\"http:\/\/your.wordpress.site\/download\/?cck4634kep=spefe4639\"\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1<\/h4>\n\n<p>Added a filter to enforce use of classic editor when editing any page containing a pgredirect short code. The new block (Gutenberg) editor was found to run pgredirect's code rather than ignoring it, resulting in a redirect away from the page needing editing.<\/p>\n\n<h4>1.0<\/h4>\n\n<p>First implementation<\/p>","raw_excerpt":"Adds a short code which allows page redirection based on the value of a token passed as a URL parameter or POST variable","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/55210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=55210"}],"author":[{"embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/fculross"}],"wp:attachment":[{"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=55210"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=55210"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=55210"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=55210"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=55210"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/eo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=55210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}