I've upgraded EzStatic to fix a problem with the WordPress 1.5 Default template, and also to add PHP code execution to PHP embedded in posts/pages.

The new version (1.9) will execute PHP if you write it directly into the post editing box. You need to surround the code with the usual php tags. You can have several code sections in a single post.

To activate the code, you must check the checkbox that will appear (when EzStatic is activated as a plugin) underneath the post content editing box.

The code is more secure than other solutions because it will only execute the code if the author of the post is of a minimum user level. By default this is level 8, but you can change it easily in code.

You can use PHP code on either posts or "static" pages in WordPress 1.5.

EzStatic retains its ability to embed external static files that are specified in the querystring.

Check out the download on my hacks page, and the documentation in the wiki.

This version is only tested on WP 1.5. It may work on 1.2, but I make no guarantees. Try an older version of EzStatic if you're using WP 1.2.

Comments

Comment by Owen on .
Owen

It's for site authors, not commenters. Yes, it seems like a bad idea to me too, that's why I hadn't included it in the plugin until now.

But someone asked me about it last night, and rather than send them elsewhere I added some security measures (which other solutions don't have) and released it.

Not that I'm trying to challenge you or anything, but the way it's set up, you would have to be a site author of level 8 or better in order to come close to exploiting this. Presumably, if you're that high a level already, you may have FTP access to the site anyway. It's really just a way to throw together dynamic pages a little more quickly through the WordPress editing interface.

Comment by Owen on .
Owen

Um, EzStatic is very different from the innate static features of WordPress 1.5.

With EzStatic, it's easy to insert dynamic external PHP files (possibly with a little tweaking) into your WordPress layout. The alternative would be to copy the application code into a WordPress static page, and you'd need some kind of PHP-executing plugin, which might not work if the code uses includes, etc.

The new version of EzStatic will also let you execute PHP that's inserted into posts and static pages, which WordPress won't let you do. And unlike some other great plugin solutions (RunPHP, for example), EzStatic validates the user level of the author before executing code to make sure that guest-level posters aren't embedding potentially malicious code.

Potential applications for EzStatic that you simply can't do with the innate WP Pages feature include:
*Dynamic feed aggregator (I use a modified Feed On Feeds on this site)
*Guestbook
*Wiki (Try MicroWiki, which integrates with EzStatic into WordPress logins!)
*Shopping cart (Try MicroShop!)
*Dynamic "about" pages

Perhaps it would be better to call it "EzDynamic"?

Anyone can sign in to comment: Sign in with Twitter
This sign-in uses read-only access to your Twitter profile only to verify who you are and create an initial user profile.