Permissions and security
Who can use Temper, how the file-editing constants affect it, and how it protects your site, keys and previews.
On this page
Who can use Temper#
A user can use Temper when all of these are true:
- They can
manage_optionsandswitch_themes. - They can
edit_themesandedit_plugins. WhenDISALLOW_FILE_EDITis set andTEMPER_IGNORE_FILE_EDIToverrides it, they needinstall_themesandinstall_pluginsinstead. - On multisite, they're a super admin. Themes and plugins are shared by every site in a network, so a sub-site admin publishing a plugin would run code across the network.
- Neither constant below turns Temper off.
Temper's REST routes refuse WordPress application passwords. Connect tools with an MCP key instead, so the review hold and the publish permission apply. Developers can allow application passwords with the temper_allow_application_passwords filter.
On a single site, administrators meet these by default. The same rule applies everywhere: the Temper menu, every REST route, previews, and AI assistants connected over MCP, which act as the user who created their key and are checked again on every request.
The file-editing constants#
In wp-config.php | Temper |
|---|---|
define( 'DISALLOW_FILE_MODS', true ); | Always off. |
define( 'DISALLOW_FILE_EDIT', true ); | Off, unless TEMPER_IGNORE_FILE_EDIT is also true. |
define( 'TEMPER_IGNORE_FILE_EDIT', true ); | Lets Temper run while DISALLOW_FILE_EDIT hides WordPress's own file editors. Users then need install_themes and install_plugins. |
Narrow it further#
The temper_can_use filter decides last. For example, to let only one administrator use Temper:
add_filter( 'temper_can_use', function ( $allowed ) {
return $allowed && 'alex' === wp_get_current_user()->user_login;
} );Put it in a must-use plugin, not in a theme you edit with Temper. See Hooks for developers.
Working copies#
- Paths are cleaned and can't leave the project folder or touch
.git. - Temper never writes
.htaccess,.user.ini,php.iniorweb.configinto a working copy, because they could turn PHP back on in its storage. - Working copies hold PHP nobody has reviewed yet, so their folder has a random, unguessable name, and on Apache an
.htaccessfile refuses to run PHP from it. On nginx, add a rule yourself. See Storage and uninstall.
Previews#
- Only signed-in users who can use Temper see a preview. Everyone else, and wp-admin, REST, AJAX and cron requests, get the live site.
- The editor's preview pane uses a signed address (a WordPress nonce), so a link someone sends an administrator can't make their browser run a working copy.
- A plugin preview token is tied to your login session, and expires after 2 hours in the pane or 12 hours in a View site tab.
- After an AI assistant changes a working copy, its preview waits until you've reviewed the changes. See Preview.
Secrets#
- Your AI key, and with Pro the GitHub token, GitLab token and licence key, are encrypted in the database with libsodium, using a key derived from the site's auth key and salt (
AUTH_KEYandAUTH_SALT). They're never sent to the browser. - MCP keys are stored only as HMAC-SHA256 hashes, keyed with the same key and salt. A key is shown once, when it's created. Pro
If you change your site's salts, Temper can no longer read the stored secrets or match MCP keys. Enter the AI key, GitHub or GitLab connection and licence key again, and create new MCP keys.
AI assistants Pro#
Let AI tools run code, publish and commit is off by default. While it's off, assistants can change working copies but can't publish, roll back, commit, create repositories, activate anything, or render blocks and patterns, which runs their PHP. See Permissions.
Publishing#
- Every changed file passes the save checks before a publish.
- The swap uses renames, so visitors never get half a theme.
- Publishing code the site runs is checked against the home page before and after, and undone at once if it broke the site.
Downloads#
- Updates and the free plugin installed by Switch to free Temper are installed only if they match the release temperwp.com signed.
- Pro Composer installs refuse private and internal network addresses, because the lock file comes from the working copy.