Plaintext: a WordPress plugin

Monday, 26 September 2005

When you click one of my PHP code download links (for example, the Less WordPress plugin), you see the PHP source code on your screen, even though the file is a .php file. How do I stop the server executing the PHP code? With a WordPress plugin, of course.

Plaintext is a WordPress plugin that helps you to distribute your Web source code to an admiring public, whether it’s PHP, HTML, ASP or anything else. I’ve been tweaking it for a while, and now I thought I’d make it public.

I would really appreciate comments on the implementation. While testing Plaintext, I learned a lot about two areas in particular. In mod_rewrite, I couldn’t use RewriteRule’s type flag, apparently because of differences in PHP setup; and I couldn’t find a good way of finding out the file path of the blog home directory.

For more details and the plugin download, see the main Plaintext WordPress plugin page.

Tags:

Leave a comment