Plugin / Better Random Redirect

Robert Peake

Frequently Asked Questions (FAQ)

Yep, really. So many of the ones currently out there are not suitable for large websites with lots of traffic. This is because many random redirect plugins rely on the 'orderby' => 'rand' constraint in WordPress, or directly use 'ORDER BY RAND()' in their MySQL queries. This results in notoriously poor performance and can really cause problems with your MySQL server if this operation is heavily repeated on a website with lots of eligible posts. This plugin uses a more efficient approach, including transient caching of all eligible posts by category and their post counts to minimise the time it takes to pick a true random post.
Go to Settings > Better Random Redirect and change the URL slug from the default of “random” to whatever you want it to be.
Select the category you want to use in Settings > Better Random Redirect. This will become the default category used for all subsequent random requests. It can be overridden, however using the cat= shortcode attribute or query string as described below.
Select the post type you want to use in Settings > Better Random Redirect. This will become the default post type used for all subsequent random requests. It can be overridden, however using the posttype= shortcode attribute or query string as described below.
For random results in e.g. category ‘foo’, use the shortcode [random-url cat="foo"]. The generated link will select a random post from that category. Alternatively, use the URL you set up in the configuration above, and optionally append cat= as part of the URL query string.
For random results in e.g. post type ‘page’, use the shortcode [random-url posttype="page"]. The generated link will select a random post from that post type. Alternatively, use the URL you set up in the configuration above, and optionally append posttype= as part of the URL query string.
Use the shortcode [random-url] anywhere you want to place the URL for a link to the randomiser, such as in text links or buttons. You can also use the cat= attribute to create a link to a randomiser that will only select random posts from a specific category, or the posttype= attribute to create a link to a randomiser that will only select random posts from a specific post type. Alternatively, simply use the URL you set up in the configuration above as the link for the link or button, and optionally append cat= and/or posttype= as part of the URL query string.
You can use the URL you set up in the configuration, and optionally append cat= and/or posttype= as part of the URL query string. Alternatively, for sidebar items, you can use the PHP Widget along with some php code like to resolve the shortcode to a link that includes the r= attribute to defeat URL-based caching.
This is a random integer in the range of possible index values for the relevant category. It is appended to the generated URLs to defeat URL-based caching, and also to give deterministic routing of results (i.e. the same r value and category combination will lead to the same post each time). This helps with services like Facebook that cache the resulting 302 redirect, to make sure they are caching accurate metadata on a link-by-link basis.

Ratings

5
5 reviews

Rating breakdown

Details Information

Version

1.3.13

First Released

05 Dec, 2014

Total Downloads

13,710

Wordpress Version

3.0.0 or higher

Tested up to:

5.3

Require PHP Version:

-

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.