Linux 软件免费装
Banner图

TryMode

开发者 som9663
更新时间 2026年10月1日 23:51
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

changes troubleshooting rollback experiment undo

下载

1.0.1 1.0.2

详情介绍:

TryMode gives you a safe way to try something on a WordPress site. Start an experiment. Install a plugin, change settings, redesign a page, switch a theme. TryMode records the supported WordPress database changes as you make them. When you are done, it shows you exactly what changed and you choose: keep everything, or discard the changes it can genuinely put back. TryMode is not a backup plugin, a reset plugin, a staging site or a migration tool. It is a short, bounded experiment with a review at the end. What makes it different Most tools sit at one of two extremes. Activity logs tell you what happened but cannot undo any of it. Backups can undo everything but tell you nothing about what changed, and restoring one throws away every other change made since. TryMode sits in between. It records the previous value of each thing the first time that thing is touched inside an experiment, so it can attribute every change and put it back, without copying your whole database. Honest about what it cannot do This matters more than any feature. Every recorded change carries one of four states, with the evidence for it: TryMode will never claim to undo an email that has been sent, a payment taken through a gateway, a webhook that has been delivered, or a change made on a remote service. Those are recorded as warnings and shown to you before you choose, so that "discard" is never mistaken for "none of that happened". The button says "Discard supported changes", not "Discard everything", for the same reason. What it can undo What it can undo, with side effects disclosed What it only observes Multisite An experiment runs on one site in a network and reverts that site. TryMode's tables are per-site, so site 3 records and reverts site 3 without ever touching site 4, and activating for the network installs into every site including ones created later. What the network shares between its sites is not per-site state and is not treated as though it were. Users, network settings and the list of sites are reported rather than reverted, because changing any of them from inside one site's experiment would change them for every site. Starting an experiment tells you this before you begin rather than afterwards. Prevention, not just undo An email that has reached a mail server is gone, and no plugin can bring it back. So TryMode stops it leaving instead. While an experiment runs, outgoing email is held rather than sent. Keep the experiment and it goes out; discard it and nothing ever left the site. Outbound POST, PUT, PATCH and DELETE requests to other servers can be blocked and listed the same way, though that is off by default: on a live site it will make a payment callback or a CRM sync fail while the experiment runs. A blocked request is never replayed afterwards, because TryMode cannot know whether the call was safe to repeat. Reads are always left alone. Email holding is the one side effect the plugin can genuinely prevent rather than report, so it is on by default. Request blocking is the same idea applied to a place where the remote end also has an opinion, so it is opt-in. File restore Switch it on and TryMode copies every watched file when an experiment starts, which is the only way it can put one back. A file added during the experiment is deleted, and a file changed or removed is written back from the copy. It is off by default because it costs database space. The copies are kept in TryMode's own table rather than written to disk: the files worth restoring are plugin and theme sources, which means executable PHP, and a plugin may not write that into the uploads directory. There is a per-file size limit and a storage budget per experiment, and anything past either is listed as detected-but-unrestorable rather than quietly skipped. Protected tables A plugin's own tables are normally report-only, because the writes never reach a WordPress hook. Nominate a table and TryMode copies every row at the start and can put them back. That is a snapshot restore, not a change-level revert, and the interface says so: the table is replaced with what it held when the experiment began, so a row written by anything else in the meantime goes too. Opt-in per table, capped by row count. Unattended updates WordPress installs automatic updates when nobody is watching. TryMode can wrap that run in an experiment, load a few pages of your choosing afterwards, and email you what it found. If the pages fail, nothing is undone: you get an email and the experiment waits for you. You can arm automatic revert instead, but it is deliberately a separate switch, because a failed health check is evidence rather than permission. Page comparison Loads a handful of pages before and after an experiment and shows what changed in the output. Forty reverted options tell you nothing about whether the homepage still looks right. It compares rendered content, not pixels — a screenshot diff needs a headless browser, which a plugin cannot assume exists. Nonces, cache-busting query strings and generated IDs are ignored so they do not show up as false differences. Approvals Optional. Keeping or discarding an experiment opens a request that a second administrator has to sign off, and the person who asked cannot approve their own. The sign-off lands on the experiment timeline. Checkpoints Mark a checkpoint partway through an experiment and you can come back to that exact point instead of unwinding everything. A checkpoint is not a bookmark in a list of changes. An object touched both before and after the mark still carries the experiment's original value as its baseline, so "undo everything after the mark" would overshoot it. Marking a checkpoint therefore reads the current state of everything the experiment has touched so far and stores that as a second baseline. Anything TryMode cannot capture a baseline for is counted and shown, because those objects will go back further than the mark. Selective keep and discard Changes are grouped into units that have to move together, and you choose units rather than individual changes. Ticking a unit that depends on another pulls that one in automatically: a comment comes back with its post, term meta with its term, a theme setting with its theme. Reverting half of a pair would leave the database inconsistent, so TryMode does not offer it. Update in TryMode Every available plugin and theme update gets an "Update in TryMode" button. It starts an experiment, runs the normal WordPress updater, and drops you on the review screen. Core updates are deliberately not offered: they run database migrations that TryMode records but never rewrites, so a "reverted" core update would only be partial. WP-CLI wp trymode status wp trymode start --name="WooCommerce update" wp trymode checkpoint --name="Before the theme switch" wp trymode changes wp trymode finish wp trymode discard --yes wp trymode discard --checkpoint=3 --yes wp trymode resume This is also the escape hatch. If an experiment breaks wp-admin, the button is unreachable but the journal, the plan and the recorded baselines are all still in the database, and every one of them can be driven from the shell. When something breaks If a fatal error happens while an experiment is recording, TryMode notes it in the timeline and the warnings, and — if the site drops into recovery mode — shows you how to revert, from the admin or from the command line. It never reverts on its own: an automatic revert triggered by a fatal error would be the plugin making the biggest decision on the site at the moment it understands least. File changes Optional, off by default. TryMode can compare a list of files at the start and end of an experiment and report what was added, changed or removed in your plugins, themes or uploads. Detection only. Putting a file back means having kept a copy of it, which is a separate problem with its own storage and failure modes, so TryMode reports file changes and points you at a backup rather than pretending it can undo them. Built for trust Performance When no experiment is running, TryMode registers no hooks at all. The entire cost is one already-cached option read.

安装:

  1. Upload the trymode folder to /wp-content/plugins/, or install the ZIP through Plugins → Add New → Upload.
  2. Activate TryMode.
  3. Go to TryMode in the admin menu (also linked from Tools).
  4. Start an experiment, make your changes, then finish and decide.

屏幕截图:

  • An experiment running: live counts of what has been recorded, checkpoint controls, and the timeline.
  • The decision point. What changed, what can actually be undone, what cannot, and any checkpoints to return to.
  • The change list, showing field-level differences rather than two walls of serialized text.
  • The confirmation screen. Both lists in full, and a revert that will not start until you type DISCARD.
  • The verification report after a revert: restored, could not restore, and anything needing a human.

升级注意事项:

1.0.2 Adds multisite support, and fixes a case where deleting a media item during an experiment was barely recorded and could not be undone. 1.0.1 Changes made in response to the WordPress.org plugin review. 1.0.0 First release.

常见问题:

Is this a backup?

No, and it should not be used as one. TryMode records changes made through WordPress APIs during a bounded experiment. It does not copy your database or your files. Keep taking real backups.

Can it undo an email or a payment?

No. Nothing installed on your site can. TryMode records that they happened and shows you before you decide, rather than pretending otherwise.

Will it slow my site down?

Not when no experiment is running: no tracking hooks are registered at all. While an experiment is running, TryMode records the previous value of each object the first time it is touched, which is one small write per distinct thing changed.

What if somebody else changes the same thing while my experiment is running?

They can. TryMode does not lock your site, and other people and background jobs keep working normally. It records the value it saw when the change happened. If something wrote to the same setting at almost the same moment, the value on the site may end up being a later one than the value TryMode recorded. When you discard, it compares the two first: if they no longer match it reports a conflict and leaves that one alone, rather than restoring a value it is not sure about. You can then look at it and overwrite it deliberately if you want to.

What happens if the revert is interrupted?

Every operation is journalled before it runs. On your next admin page load TryMode tells you the revert did not finish and offers to resume it from where it stopped, or to show you exactly what happened.

What if TryMode is deactivated while an experiment is running?

Nothing is destroyed. Recording stops, and the unfinished experiment is detected again when you reactivate the plugin.

Does it support multisite?

Not in version 1.0. Network-level state cannot be tracked or reverted safely yet, so TryMode detects multisite and refuses to start an experiment rather than half-working.

Does it work with WooCommerce?

Yes, with a deliberate restriction: orders, payments and refunds are recognised and never reverted. An order is a record of something that happened between a shop and a person, and rewriting the row would not reverse any of it.

Can other plugins extend it?

Yes. Register a tracker through the trymode_trackers filter and a matching rollback handler through trymode_rollback_handlers. There are also filters for redaction decisions, protected options, tracked post types and the directories watched for file changes.

Why can I not revert a single change on its own?

Because reverting half of something is how a plugin like this corrupts a site. A post and its meta, a term and the posts attached to it, a comment and the post it belongs to: each pair has to move together or the database ends up internally inconsistent. TryMode groups changes into units, shows you what each unit drags in with it, and lets you choose units.

更新日志:

1.0.2 1.0.1 1.0.0 First release.