=== Temper ===
Contributors: dcodeddev
Tags: theme editor, plugin editor, code editor, developer, mcp
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build and edit themes and plugins inside wp-admin. Edits go to a private working copy you can check, preview and publish in one step, with rollback.

== Description ==

Temper is a code editor for the themes and plugins your site runs, built so that editing never breaks the live site.

Every edit goes to a private **working copy**, never to the installed files. You can preview the working copy on the real site while visitors keep seeing the live version. When it's ready, **publish** swaps it in, and the version it replaced is kept as a snapshot you can roll back to in one click.

= Nothing goes live until you say so =

* **Working copies.** Opening a theme or plugin copies it to private storage. Every save goes there.
* **Checked on every save.** PHP syntax, JSON, theme.json, block.json, block markup in templates and the style.css header are checked before a file is saved. Errors point at the line and the file isn't saved.
* **Preview on the real site, just for you.** Browse the front end with your changes. Visitors, other users and wp-admin keep seeing the live version.
* **Publish with a safety net.** Publishing keeps the replaced version as a snapshot (the last 10 are kept). When you publish the active theme or an active plugin, Temper loads the home page before and after; if it worked before and shows an error after, the previous version goes back automatically.
* **Roll back** any theme or plugin to an earlier snapshot.

= Start anything =

* Themes: a blank block theme, a child theme, a copy of an installed theme, an uploaded zip, or any theme from WordPress.org.
* Plugins: a blank plugin, a block plugin, Elementor widgets, Bricks elements, an uploaded zip, or any plugin from WordPress.org. Single-file plugins work too.
* Starter templates for Gutenberg blocks, ACF blocks, patterns, page templates, template parts, style variations, custom post types, Elementor widgets and Bricks elements. Each is placed where it belongs: a theme or a plugin, your choice.

= A proper editor =

* Syntax highlighting and completion for PHP, CSS, JavaScript, JSON, HTML and Markdown, with WordPress function hints.
* Tabs for several themes and plugins at once, each with its own files and preview page.
* Search across files, a file tree, light and dark themes, and your choice of editor font.
* Site Editor sync: copy templates, template parts and global styles made in Appearance › Editor back into your theme's files.

= Your AI assistant, connected =

Temper includes an MCP server, so assistants such as Claude, Cursor and others can read, write and check files in a working copy, using the same save checks you do. Nothing they write goes live until a person publishes it. You create and revoke keys in Temper › Settings › AI tools.

= Temper Pro =

Temper is complete on its own, on any number of sites. [Temper Pro](https://temperwp.com/pricing), the paid version, includes everything in Temper and adds what people who work from Git or compile assets need: GitHub and GitLab pull and commit, Tailwind CSS, Sass and JavaScript builds in the browser, Composer packages, and letting your AI assistant publish and roll back too.

== Installation ==

1. In WordPress, go to **Plugins › Add New**, search for "Temper", then install and activate it. Or upload the zip under **Plugins › Add New › Upload Plugin**.
2. Open **Temper** in the admin menu.
3. Pick a theme or plugin to work on, or start a new one.

Temper is for administrators. See "Who can use it?" below.

== Frequently Asked Questions ==

= Does Temper change my live site while I edit? =

No. Edits are saved to a private working copy. The live theme or plugin changes only when you click Publish, and the version it replaces is kept so you can roll back.

= Who can see the preview? =

Only you. Visitors, other users and wp-admin keep getting the live version, and preview responses are sent with no-store so caches don't keep them.

= Does it need git, Node or shell access on the server? =

No. Everything runs in PHP and in your browser.

= Can I edit a plugin I didn't write? =

Yes. Opening any installed plugin makes a working copy of it. Keep in mind that updating that plugin from WordPress.org replaces your changes.

= What happens if a publish breaks the site? =

For the active theme, its parent and active plugins, Temper loads the home page before and after publishing. If the page worked before and errors after, the previous version is put back at once and you see the error with its file and line.

= Who can use it? =

Administrators only (users who can manage options and switch themes). Temper turns itself off when `DISALLOW_FILE_MODS` is set, and when `DISALLOW_FILE_EDIT` is set unless you also define `TEMPER_IGNORE_FILE_EDIT`. Developers can narrow access further with the `temper_can_use` filter.

= Where are working copies stored? =

In wp-content/temper, inside a folder with a random name that is blocked from web access. Deleting Temper removes its settings but keeps working copies and snapshots, because they can hold unpublished work; reinstalling finds them again. To delete them too, add `define( 'TEMPER_UNINSTALL_FILES', true );` to wp-config.php before deleting the plugin.

== External services ==

Temper works without any outside service. It contacts the services below only when you use the feature that needs them.

* **WordPress.org** (api.wordpress.org, downloads.wordpress.org): when you start a working copy from a WordPress.org theme or plugin, Temper looks it up and downloads its zip. Sent: the theme or plugin name you entered. [Privacy policy](https://wordpress.org/about/privacy/).
* **Anthropic API** (api.anthropic.com): only if you enter your own Anthropic API key in Temper › Settings › AI, and only when you ask the built-in AI to write code: tailoring a new theme or plugin, filling in a starter template, or changing a file from an instruction. Sent: your instruction or description and the files involved. [Terms](https://www.anthropic.com/legal/commercial-terms) and [privacy policy](https://www.anthropic.com/legal/privacy).
* **OpenAI API, or another OpenAI-compatible service you set** (api.openai.com by default): only if you choose it and enter your own key in Temper › Settings › AI, for the same feature. Sent: the same as above. [Terms](https://openai.com/policies/terms-of-use) and [privacy policy](https://openai.com/policies/privacy-policy).
* **Google Fonts** (fonts.googleapis.com, fonts.gstatic.com): only if you choose one of the web fonts for the code editor in Temper › Settings › Editor. The default system font loads nothing. Sent: a standard request for the font, which includes your IP address. [Terms](https://developers.google.com/fonts/terms) and [privacy policy](https://policies.google.com/privacy).
* **Your own site**: after publishing the active theme or an active plugin, Temper requests your home page to check it still loads. Nothing leaves your server.

* **temperwp.com**: twice a day, WordPress's update check asks temperwp.com for the latest version of Temper, so updates appear in Dashboard › Updates. Sent: your site's address and the installed version. Updates are installed only if they match the release temperwp.com signed. [Privacy policy](https://temperwp.com/privacy).

Temper Pro, the paid version, also checks its licence with temperwp.com.

== Screenshots ==

1. The editor: file tree, code, and a live preview of the working copy.
2. Publish: checks before anything goes live, and a snapshot of the previous version is kept.
3. Plugins too: a theme and a plugin open side by side, with a block previewed on its own.
4. Starting something new: themes, plugins, blocks and widgets.
5. Snapshots and one-click rollback.

== Changelog ==

= 0.2.6 =
* Settings remembers the open tab, so reloading the page (for example after activating a licence) comes back to it.

= 0.2.5 =
* Security: previews load working-copy files through a signed address, snapshots are zips, and project state can't be read from the web.
* Site Health warns when PHP can run from Temper's storage. TEMPER_STORAGE_DIR keeps storage outside the web root.
* Publishes of the same project can't overlap; the theme preview cookie is signed; application passwords are refused on Temper's REST routes.
* AI: the review hold applies even when a tool fails, names in starters can't add code, and changing the AI address removes the saved key.

= 0.2.4 =
* Custom starters can be limited to themes or plugins with "kinds", and placeholder names can include digits.
* Clearer descriptions of which plugins Temper lists.

= 0.2.3 =
* Uninstalling removes every project list Temper keeps for each user, and its update cache.

= 0.2.2 =
* Plugin previews keep working wherever Temper's folder is installed.

= 0.2.1 =
* Temper updates itself from temperwp.com through Dashboard › Updates, and installs only releases that match their signed checksum.
* Translator notes on every translatable string with placeholders, and other WordPress coding-standard fixes.
* The Changes panel says "plugin" for plugins.

= 0.2.0 =
* On multisite, Temper is for super admins only, and everywhere it needs WordPress's code-editing permissions.
* Previews don't run code an AI tool wrote until you've reviewed it.
* A single-file plugin's working copy can only read and restore its own file.
* Uninstalling clears Temper's temporary data.

= 0.1.0 =
* First release.

== Upgrade Notice ==

= 0.2.5 =
Security release. Storage converts automatically; nginx sites should add the rule shown in Site Health.

= 0.2.3 =
Cleaner uninstall.

= 0.2.2 =
Plugin preview fixes.

= 0.2.1 =
Temper now updates automatically from temperwp.com.

= 0.2.0 =
Security hardening: tighter permissions on multisite, and previews wait for you to review AI-written code.
