Plugin / bbPress2 shortcode whitelist

Anton Channing

Frequently Asked Questions (FAQ)

In admin settings. In addition to supported plugins, verified plugins and any self-declared plugins, you can also enable a custom list of shortcodes you want your forum users to be able to use.
If your shortcodes contain no calls to do_shortcode($content), then they are probably already safe as far as I’m aware. If they do contain calls to do_shortcode($content), then you can make them safe by creating a function or class method in your plugin similar to: function yourplugin_do_shortcode($content) { if(function_exists('bbp_whitelist_do_shortcode')) { return bbp_whitelist_do_shortcode($content); } else { return do_shortcode($content); } } And then replace calls to do_shortcode($content) inside your shortcode handlers with calls to this new function. What this means is that if the whitelist plugin is not active, your plugin will still work, but if it is active, it will parse the contents of your shortcodes to make sure they are also safe.
To self-declare your plugin to the shortcode whitelist plugin, include the following code somewhere in your plugin, changing the names, unique identifier and the array of safe to use in the forums shortcodes that your plugin provides: function yourplugin_get_shortcode_whitelist() { $plugin_name = 'Your Plugin Name'; $plugin_author = 'Plugin Author Name'; $shortcodes = array('test','test2'); //array of safe shortcodes the plugin provides. return array('name'=>$plugin_name,'tag'=>'your-plugin-unique-identifier','author'=>$plugin_author,'shortcodes'=>$shortcodes); } if(!isset($bbpscwl_selfdeclared_plugins)) $bbpscwl_selfdeclared_plugins = array(); $bbpscwl_selfdeclared_plugins[] = yourplugin_get_shortcode_whitelist();
Ask me to verify it. I’ll take a look at the code when I get a chance, will make sure it works and let you know if I find anything that needs fixing or if I can add it to the verified plugins list.
No, but any one can suggest plugins that have safe shortcodes that I should auto-detect and verify, I’ll take a look when I get a chance. Also, I’ll fix any bugs anyone finds. I may make the admin screen a bit more user friendly when I get a chance.

Ratings

5
4 reviews

Rating breakdown

Details Information

Version

2.2.1

First Released

18 Oct, 2011

Total Downloads

7,842

Wordpress Version

2.5 or higher

Tested up to:

4.5.13

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.