PHP Everywhere
I created this plugin because I have not found a Wordpress PHP plugin which is simple to use and provides a good user experience while being able to use PHP or HTML in Posts, Pages or Widgets. It is able to use multiple PHP instances and has built in role management. Since it’s start in 2014 more than 25.000 websites have installed the plugin and are happily using it to run their custom PHP code.
About this plugin
This plugin enables embedded PHP code in pages, posts and Widgets. You can use it to create any interactive media that is not supported by WordPress without overloading your WordPress installation with plugins.
I maintain this plugin in my limited free time. Therefore all support is appreciated. Feel free to buy me a coffee or contribute by answering support tickets on WordPress.org.
Features
Use PHP and HTML in
- Widgets
- Pages
- Posts
You can use the provided Gutenberg Block to easily put your PHP code anywhere.
Usage
Widgets
Simply activate the
PHP + HTML
Widget. in your sidebar and paste your PHP code including the PHP Tags like this:
<?php echo("Hello, World!"); ?>
You code may contain HTML Elements or have multiple lines.
Posts & Pages
Edit or create a new post or page and simply create a PHP Everywhere Gutenberg Block on the page. Now you can just put your PHP Code including the PHP tags into the box and it’s output will appear where you placed the Block.
Multiple PHP instances
You can have multiple PHP instances by placing multiple PHP Everywhere Blocks in your editor
Posts & Pages (By using a shortcode)
Edit or create a new post or page and simply put your PHP Code including the PHP tags into the side options_box, which is labeled „PHP Everywhere“. Then put the
[php_everywhere]
shortcode where you want the code to appear. Your code may contain multiple lines or HTML Tags.
Multiple PHP instances
If you want to use multiple PHP instances use the shortcode with the instance parameter like this:
[php_everywhere instance="1"]
Your PHP snippet should look like this:
<?php if($instance=="1") { echo("Number one!"); } if($instance=="2") { echo("Number two!"); } ?>
Changelog
2.0.0 – June 15, 2019
- New: Added Gutenberg Block
- New: Added option to disable Options box.
- New: Added option to disable Gutenberg Block.
1.4.5 – March 14, 2019
- Info: Clarified Gutenberg and WordPress 5.1 compatibility
1.4.3/4 – October 17, 2018
- Fix: Fixed deprecated warning on PHP 7.2
- Fix: Fixed error introduced in 1.4.3
1.4.2 – May 13, 2018:
- New: Addes italian translation
1.4.1 – December 01, 2017:
- Fix: Added Wordpress.org translation support
1.4 – November 26, 2017:
- New: Added Wordpress.org translation support
- Fix: Fixed security flaw where authenticated users were able to make themself administrators and execute php. Thanks @dandr3ss
1.3 – November 08, 2017:
- Fix: Fixed PHP7 deprecation notice
1.2.5:
- minor bugfix for translations
- lowered the plugins memmory footprint
1.2.4:
- added a portuguese translation
1.2.3:
- bug fix for WP 4.3.1, thanks thea2zbrand
1.2:
- added a german translation
- added a serbian translation
1.1.2:
- fixed some minor bugs when creating a menu
1.1:
- added multiple PHP instances
1.0:
- release