| 开发者 | lukegarry |
|---|---|
| 更新时间 | 2026年7月23日 01:50 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPL v2 or later |
| 版权网址: | 版权信息 |
optistate.zip from WordPress.orgoptistate.zip fileYes. The plugin includes multiple safety mechanisms:
When you restore a backup, Optimal State first creates a safety backup of your current database. Then it uses a temporary table system: restored data goes into temporary tables first, validation is performed, and only after success are the tables atomically swapped (renamed) into place. If anything fails during the process – server crash, timeout, data corruption – the plugin automatically rolls back to the safety backup and puts your site back in maintenance‑free mode. This is handled by the OPTISTATE_Restore_Engine which uses MySQL atomic rename operations to ensure zero data loss. Even if the restore fails mid‑way, your original tables remain untouched with an optistate_old_ prefix, ready for manual recovery.
Optimal State uses a chunked restore system that processes large SQL files in manageable pieces. Each chunk runs within a set time limit and commits its changes. If a chunk times out, the system simply reschedules the next chunk to continue where it left off. The temporary table approach means that partial data never affects your live site. If the process gets completely stuck (e.g., server restarts), you can safely deactivate and reactivate the plugin – it will automatically detect the stalled restore and clean up any temporary tables. You'll also see a "Restore stuck?" notice with clear instructions on how to abort safely.
The system uses temporary table swap technology:
optistate_old_ prefixAbsolutely. Optimal State is built with large‑database scenarios in mind:
OPTISTATE_Backup_Engine::get_adaptive_batch_limit).DELETE ... LIMIT 2000) with transaction commits between batches, so they don't lock tables for long periods.OPTISTATE_Process_Store) manages long‑running tasks using advisory locks and expiration, ensuring that background workers don't collide and that stale jobs are cleaned up.Compatible: Redis/Memcached, Cloudflare, BunnyCDN May conflict: WP Rocket, WP Super Cache, W3 Total Cache, Swift Performance If you already use a caching plugin, simply disable Optimal State's caching features (Server‑Side Page Caching and Browser Caching) and use it for database optimization, backups, and security features.
Yes. Optimal State includes specialized WooCommerce optimization:
clean_woocommerce_bloat removes expired sessions and transients)Yes. Use the workflow:
20 types including: post revisions, auto‑drafts, spam comments, trashed comments, trashed posts, orphaned postmeta, orphaned commentmeta, orphaned usermeta, orphaned term relationships, duplicate postmeta, duplicate commentmeta, pingbacks, trackbacks, expired transients, all transients, action scheduler logs, oEmbed cache, WooCommerce sessions, empty taxonomies, and WooCommerce bloat.
Yes, with some platform‑specific notes: Full compatibility: SiteGround, Bluehost, HostGator, DreamHost, A2 Hosting, InMotion, most cPanel hosts Database features only (disable page caching): WP Engine, Kinsta, Flywheel (use platform caching)
Optimal State's server‑side caching automatically detects consent cookies from 20+ popular cookie plugins (CookieYes, Complianz, Cookie Notice, Borlabs, Real Cookie Banner, OneTrust, iubenda, etc.). Users with consent cookies see cached pages (fast). Users without consent cookies see fresh pages (privacy‑safe). You can also add custom consent cookie names if your site uses a less common solution. This is all handled by the OPTISTATE_Server_Caching class, which parses cookie headers and checks against known patterns.
Yes (Pro feature). You can schedule daily, weekly, or monthly optimization at any time (e.g., 2 AM). The system will create a backup, perform a full cleanup, and send you an email report. You can also choose "Backup Only" mode if you want to skip the cleanup part.
Autoloaded options are database entries that WordPress loads on every single page request. If these become too large (over 800KB), they significantly slow down your Time To First Byte (TTFB). Optimal State scans for large options that aren't essential and safely changes their autoload setting to "no". The feature automatically creates a backup of the original autoload status, so you can restore it instantly if anything breaks. The backup is stored in the optistate_core_data table and can be restored with a single click from the Advanced Tools panel.
Yes. Optimal State includes full TOTP‑based 2FA (time‑based one‑time passwords) compatible with Google Authenticator, Authy, and other apps. Each user can enable it from their profile page. The system generates backup codes that can be used if you lose access to your authenticator app. This is handled by the OPTISTATE_TwoFactor class, which uses secure encryption for secrets and hash‑based verification for backup codes.
The IP Blocker allows you to deny access to your entire site to specific IP addresses or CIDR ranges. Blocked IPs receive a 403 Forbidden response. You can block IPv4 and IPv6 addresses, as well as network ranges (e.g., 192.168.1.0/24). The block list is stored in the database and enforced via PHP (not just .htaccess), so it works on any server environment, including Nginx. The plugin also prevents you from accidentally blocking your own IP by warning you if your current IP is in the list.
Yes. In the Settings tab, you can select which administrator accounts are allowed to use Optimal State. If no users are selected, all administrators have access. This is useful for agencies or large teams where you want to limit who can perform database‑sensitive operations. The access control is enforced on every admin page and AJAX request.
Free version: WordPress.org forums, built‑in user manual Pro version: Priority email support, advanced troubleshooting, migration guidance
No. All operations run locally on your server. The only exceptions are: