TellTuesday

 

Exec-PHP

Page history last edited by kevinchampion 6 mos ago

 

Summary

 

This plugin allows the ability to add PHP to posts and pages. Having PHP enabled in this way is unsecure and not suitable for ordinary accounts. However, it is a powerful tool so long as it is secured by limited access. For this reason, the plugin has strict permissions that must be enabled in order for a user to be able to put PHP inside posts. The Role Manager plugin can also be used to manage these permissions. Once it is enabled for a user, that user should not have the wysiwyg enabled as there is an issue with the two features in combination. This is important for InfoTech Tuesday because the homepage is driven from PHP in a page. Doing it this way allows the homepage to display database driven information but not be subject to the syncronization with the remainder of the site templates.

 

For instance, if in the general settings, the post limit is set to 15, each template page will display 15 posts before paginating (same for the admin backend). For InfoTech Tuesday, however, the homepage needs to display the number of articles written each week, not an arbitrary number set in the settings. This created a problem before Exec-PHP as the post limit would have to be changed each week depending on the number of articles to be published. With Exec-PHP, there is a page called Home that drives what displays on the homepage. It searches the database for any articles that have been published in the previous week and then displays them starting at 12:00 am Tuesday.

 

Use

 

Exec-PHP adds two roles to the Wordpress roles and capabilities list. This list shows up at the bottom of every user's profile page. These roles can only be seen and edited by admin accounts. The two roles that the plugin adds are called "Exec-PHP" and "Edit Others PHP". When checked, the first enables writing PHP for the user and the second allows the user to edit other user's written PHP (this is only valid for users who can edit other user's posts and pages). Note that when enabling PHP for a user, the wysiwyg for that user should be turned off at the same time as the two are not compatible. Exec-PHP should really only be enabled for one admin who is in charge of ensuring the pages using PHP within posts or pages are correct and functioning properly.

 

 

 

 

Upgrade

 

There are no modifications to this plugin, so upgrading it is as simple as deactivating, replacing the files with the upgrade, and reactivating.

Comments (0)

You don't have permission to comment on this page.