=== Shortcode Exec PHP === Contributors: M66B, dabelon Tags: admin, shortcode, run, php, eval, execute, exec, code, post, posts, page, pages, comment, comments, sidebar, widget, widgets, rss, feed, feeds, AJAX, wpmu, tinymce Requires at least: 3.1 Tested up to: 4.1.1 Stable tag: 1.52 Execute arbitrary, reusable PHP code in posts, pages, comments, widgets and RSS feeds using shortcodes in a safe and easy way == Description == Using this plugin you can execute arbitrary [PHP](http://www.php.net/ "PHP") code using [shortcodes](http://codex.wordpress.org/Shortcode_API "Shortcode API") in your posts, pages, comments, widgets and RSS feeds, just like manually defined shortcodes. The shortcodes and associated PHP code are defined using the settings of this plugin. It is possible to parse and use shortcode parameters and to use shortcode content. Defined shortcodes can be deleted and disabled. Advantages over other solutions: 1. Your texts do not have to contain PHP code 1. PHP code can be reused (by reusing the shortcode) 1. All PHP code is organized at one place 1. [Syntax highlighting](http://en.wikipedia.org/wiki/Syntax_highlighting "Syntax highlighting") 1. You can test your PHP code before using it 1. Import/export of shortcode definitions For those concerned about security (hopefully everybody): only administrators can define shortcodes and associated PHP code (see also the [FAQ](http://wordpress.org/extend/plugins/shortcode-exec-php/faq/ "FAQ")). See my [other plugins](http://wordpress.org/extend/plugins/profile/m66b "Marcel Bokhorst"). == Installation == *Using the WordPress dashboard* 1. Login to your weblog 1. Go to Plugins 1. Select Add New 1. Search for *Shortcode Exec PHP* 1. Select Install 1. Select Install Now 1. Select Activate Plugin *Manual* 1. Download and unzip the plugin 1. Upload the entire shortcode-exec-php/ directory to the /wp-content/plugins/ directory 1. Activate the plugin through the Plugins menu in WordPress == Frequently Asked Questions == = Where can I define shortcodes? = WordPress menu Tools > Shortcode Exec PHP = What happens when I disable a shortcode? = The shortcode will not be handled and will appear unprocessed. = Who can access the settings and the PHP code? = Users with *manage\_options* (single user) or *manage\_network* (multi user) capability (administrators). = Who can use the defined shortcodes? = Anyone who can create or modify posts, pages and/or widgets or can write comments. Shortcode execution in widgets, excerpts, comments and RSS feeds is disabled by default (unless another plugin or your theme does enable it). It is possible to restrict shortcode execution in posts and pages based on the capabilities of the post or page author (since version 1.18). = How are PHP errors handled? = Because the [PHP eval function](http://php.net/manual/en/function.eval.php "PHP eval function") is used, errors cannot be handled unfortunately, so test your code thoroughly. = How many shortcodes can I define? = Unlimited. = I get a blank page when I use a shortcode on a large post/page = This can happen if the [PCRE backtrack](http://php.net/manual/en/pcre.configuration.php "PCRE backtrack") value is too low. Try increasing it using the plugin settings. = Where are the shortcode definitions stored? = The shortcode name, options and PHP code are stored as WordPress options. = How can I change the styling of the settings? = 1. Copy *shortcode-exec-php.css* to your upload directory to prevent it from being overwritten by an update 2. Change the style sheet to your wishes; the style sheet contains documentation = How do I test a shortcode with parameters? = Indirectly, by using default values. = Should I use PHP opening and closing tags? = No, omit both *``*. = Can I embed HTML code? = Yes, if you enclose the HTML code with *`?>`* and *` Reading, normally UTF-8. = 1.0 = * Added Dutch (nl\_NL) and Flemish (nl\_BE) translations * No complaints so far, updating to version 1.0 = 0.6 = * Added Revert button, which will undo unsaved/untested changes * Better error handling = 0.5 = * Scrolling to top after loading EditArea´s * Disabling EditArea´s on test, save, etc. = 0.4.1 = * More compatible ajax handling = 0.4 = * Syntax highlighting * In-place add, update and delete of shortcodes (using AJAX) * Shortcodes can be tested in the administration backend = 0.3 = * Only administrators can see options and shortcode definitions now * Shortcodes are sorted alphabetically in the administration backend = 0.2 = * Added options to enable shortcodes in excerps, comments and RSS feeds * Added options to change width and height of PHP code textarea * Improved layout of options = 0.1 = * Initial version = 0.0 = * Development version == Upgrade Notice == = 1.52 = Fixed inserting shortcode = 1.51 = Made pro feature free = 1.50 = Tested with WordPress 3.8.1 = 1.49 = Tested with WordPress 3.8 = 1.48 = Tested with WordPress 3.7.x = 1.47 = Fixed a PHP warning = 1.46 = Updated SimpleModal = 1.45 = New translation = 1.44 = One bugfix, new translation = 1.43 = One bugfix = 1.42 Added link to Pro version = 1.41 = One bugfix = 1.39 = One bugfix = 1.38 = One new feature, translation updates = 1.37 = Compliance = 1.36 = Compatibility = 1.35 = One bugfix = 1.34 = One new feature, compatibility = 1.33 = Compatibility = 1.32 = Compatibility = 1.31 = Compatibility = 1.30 = One bugfix = 1.29 = One bugfix = 1.28 = One improvement, updated translations = 1.27 = One improvement = 1.26 = Bugfixes, improvement = 1.25 = Bugfix = 1.24 = Bugfix = 1.23 = Translation = 1.22 = Compatibility = 1.21 = Bugfix = 1.20 = Bugfix = 1.19 = Compatibility = 1.18 = New features, enhancements, bugfix, compatibility = 1.17 = Security, bug fixes = 1.16 = Select required capability for TinyMCE button = 1.15 = Security = 1.14 = TinyMCE editor insert shortcode button = 1.13 = New option, bug fix = 1.12 = Usability, bug fix = 1.11 = New feature: global shortcodes for multi user sites = 1.10 = Security = 1.9 = Compatibility = 1.8 = Better minimum PCRE configuration = 1.7 = Buffer output by default for new shortcodes = 1.6.1 = Farsi translation = 1.6 = New feature: PCRE configuration = 1.5 = Compatibility = 1.4 = New feature: remove donate button = 1.3.1 = Compatibility = 1.3 = Compatibility = 1.2.2 = Compatibility = 1.2.1 = Compatibility = 1.2 = Option to handle echoed output = 1.1 = Character encoding = 1.0 = Production release = 0.6 = Revert button = 0.5 = Better EditArea handling = 0.4.1 = Compatibility = 0.4 = Easier editing, syntax highlighting, shortcode testing = 0.3 = Better security, shortcode sorting = 0.2 = Added options to enable shortcodes in excerps, comments and RSS feeds and to set the size of the PHP code box = 0.1 = Initial version == Acknowledgments == This plugin uses: * [EditArea](http://www.cdolivet.com/index.php?page=editArea "EditArea") by *Christophe Dolivet* and published under the GNU Lesser General Public License * [jQuery JavaScript Library](http://jquery.com/ "jQuery") published under both the GNU General Public License and MIT License All licenses are [GPL-Compatible Free Software Licenses](http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses "GPL compatible").