(Note: PHPExec2 is no longer being updated – see this post for details).
Although PHPExec is a handy plugin for easily adding PHP to posts and pages, it doesn’t seem to be updated anymore on the developer’s site, and doesn’t work for version 2 of WordPress.
So I’ve updated it here, and you can download PHPExec for WordPress 2 here. The same plugin works identically on WP 1.5.2 and 2.02.
One caveat – you need to turn off the WP2 HTML editor to edit code, and go back to the classic editor. Go to the User tab, and at the bottom of the current user’s page uncheck the ‘Use the visual rich editor when writing’ option and save.
To use, install like any other plugin, and add special code before and after PHP to execute:
<phpcode> <?php echo date("F j, Y, g:i a"); ?> </phpcode>
This code will display the server’s date and time (not yours), and is a quick way to check that the plugin is running properly.