PHP Everywhere

PHP Everywhere
WordPress Plugin
PHP Everywhere enables the usage of PHP in Widgets, Posts and Pages.

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.

Download

Download it here.

Features

Use PHP and HTML in

  • Widgets
  • Pages
  • Posts

Changelog

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

Translation

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 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!");
}
?>