WP Optimal State Logo WP Optimal State β–Ά PREVIEW ♛️ FREE/PRO VERSION HERE

Official Site

πŸ’Ύ Create New Backup

Best Practice: Always create a backup before running large cleanups or updates.
While these backups are stored on your server, we highly recommend downloading critical backups to your local computer for total safety.

Create a full database backup, compressed (GZIP) and verified for integrity.

Maximum Backups to Keep:
Oldest backups will be deleted automatically.
0%

πŸ“ Existing Backups

Backup Name Date Size Integrity Actions

Restore Database from File

πŸ“€ Restore your database by uploading a backup file (.sql or .sql.gz).
⚠️ Caution: Restoring a database will replace your current site content. This action cannot be undone.

Max upload size: 5GB
0%

πŸ’– Database Health Status

Your Health Score is calculated based on Table Overhead (wasted space), Autoloaded Data (site speed), and Clutter (spam/trash).
πŸ’‘ Tip: A score above 85/100 is considered healthy for most production sites.

75
Health Score

Quick Analysis

Performance 0/100
Efficiency 0/100
Cleanliness 0/100

Optimization Advice

  • Waiting for analysis...

🎯 Targeted Optimizations

πŸ“Š Database Statistics

Understanding Overhead: "Overhead" is temporary disk space used by the database. High overhead acts like a fragmented hard driveβ€”it slows down queries. If your Overhead is high (>20MB), run an optimization.

Performance Metrics (PageSpeed)

Measure how fast your pages load for real users. Google uses these Core Web Vitals as a key ranking factor for SEO.
Running an audit here sends a request to Google's servers to analyze your site remotely.

Good (90-100) Needs Improvement (50-89) Poor (0-49)
How to Fix "Poor" (Red) Scores:
  • ● LCP (Loading Speed): If high, go to the Performance tab and enable Server-Side Caching.
  • ● CLS (Visual Stability): If high, enable Lazy Load Images to prevent layout shifts.
  • ● TBT (Responsiveness): If high, try enabling Heartbeat Control to reduce server load.
Last checked: Never
--
Performance

(FCP) First Contentful Paint

--

(LCP) Largest Contentful Paint

--

(CLS) Cumulative Layout Shift

--

(TBT) Total Blocking Time

--

(SI) Speed Index

--

(TTI) Time to Interactive

--

🧹 Detailed Database Cleanup

Safe Cleaning

Items like Transients, Auto Drafts, and Spam are generally 100% safe to remove. They regenerate automatically or contain no value.
Caution: Always double-check "Trashed Posts" and "Trashed Comments" manually before emptying them here.

✨ Advanced Operations

Table Defragmentation

Database tables develop "gaps" after deleting data. This process compacts them (like defragging a hard drive) to reduce file size and improve query speed.

Repair Corrupted Tables

If your site is showing database connection errors or missing content, a table may be crashed. This tool scans the structure and attempts an automatic repair.

Optimize Autoloaded Data

"Autoloaded" data is loaded on every single page visit. Large autoloads are the #1 cause of slow Time To First Byte (TTFB). This tool identifies heavy items to trim.

Database Structure Analysis

πŸ’‘ Insight: Understand the architecture of your WordPress database better.
βœ“ Core WordPress tables are explained in detail.
⚠️ Third-party tables (from plugins/themes) are highlighted.

MySQL Index Manager

Performance Booster: Missing indexes are the #1 cause of slow queries. This tool analyzes your query patterns and suggests high-impact indexes to add, or redundant ones to drop.

Click below to analyze your database schema against WordPress best practices.

Referential Integrity Scanner

Detects "orphaned" dataβ€”rows that refer to a parent that no longer exists (e.g., meta data for a deleted post). This data is invisible to WordPress but slows down database operations.

Database Search & Replace

⚠️ Advanced Feature: This tool searches your database for specific text and replaces it (handling serialized data correctly). Always create a backup before running a replacement.

If checked, "Apple" will not match "apple". Recommended for specific code replacements.

If checked, searches for partial text anywhere in strings (e.g., "http://" in URLs). If unchecked, only matches complete words.

Hold Ctrl/Cmd to select multiple. Leave as "All Tables" for a full update.

πŸ—“οΈ Automation Schedule

How Scheduling Works: This plugin uses WordPress Cron. Tasks are triggered when someone visits your site.
If you have low traffic, the backup might run slightly later than the configured time. This is normal.
Run One-Click Optimization & Backup:
Preferred Time: Server Time
Operation Mode:

If checked, it will create a backup but NOT perform database cleaning.

Max Backups to Keep: Oldest backups will be deleted automatically.
Email Notifications: Send report to: admin@example.com

πŸ–‹οΈ Activity Log

πŸš€ Performance Features

Why isn't my site faster yet?

You are currently logged in. OptiState automatically bypasses the cache for administrators so you can edit your site safely. To see the actual performance boost, please test in an Incognito / Private window.

Server-Side Page Caching High Impact
Drastically improves site speed by storing fully rendered pages as static HTML files. Includes Smart Purge & Preload.
How long a cached page is considered fresh.
How to handle URLs with parameters like ?ref=123.
Smart Cookie Detection: Automatically detects consent from major plugins (CookieYes, Complianz, etc.) to serve cached pages safely.
Browser Caching (.htaccess) Medium Impact
Enables browser caching by adding optimized caching and security rules to your .htaccess file.
Database Query Caching High Impact
Caches frequent database queries using the WordPress Object Cache API. Significantly reduces database overhead on complex pages. Requires an active Redis or Memcached instance to persist data across page loads.
Lazy Load Images & Iframes Medium Impact
Enforces native browser lazy loading by injecting loading="lazy" and decoding="async" attributes into images and iframes. This improves Core Web Vitals by deferring off-screen media until needed.
Font Loading Optimization Medium Impact
Optimizes delivery of external fonts (Google Fonts) to eliminate render-blocking resources, improve FCP, and reduce CLS.
Bad Bot Blocker High Impact
Blocks resource-intensive SEO crawlers and scrapers (e.g., Ahrefs, Semrush) to save server CPU. Legitimate search engines like Google are safe.
These bots aggressively crawl sites for competitive data. Blocking them reduces server load.
Heartbeat API Control High Impact
Reduces server load by limiting the WordPress Heartbeat API frequency.
Limit Post Revisions Medium Impact
Limits the number of revisions WordPress saves per post to prevent database bloat.
Automatic Trash Emptying Medium Impact
Customize how often WordPress permanently deletes trashed items.
Disable Emojis
Removes the emoji detection JavaScript to save bandwidth.
Disable XML-RPC
Blocks XML-RPC requests to prevent DDoS and Brute Force attacks.
Disable Self Pingbacks
Stops WordPress from creating pingbacks when you link to your own posts.
Remove REST API Links
Removes the REST API link tag to prevent external discovery.
Remove Shortlink Tag
Removes the shortlink meta tag from page headers.
Remove RSD Link
Removes the RSD link used by external blog clients.
Remove Windows Live Writer
Removes the WLW manifest link.
Remove WP Version
Hides the WordPress version number from page headers.

User Access Control

Security Architecture

Database operations allow for permanent data deletion. To ensure enterprise-grade safety, limit access to 1 or 2 lead developers. This prevents accidental cleanups by team members who may not have a recent backup.

Enable only selected administrators to use the plugin. If no users are selected, all admins can use the plugin.
⚠️ Warning: Do not lock yourself out! Always include your own account in the list.

πŸ’‘ Tip: Leave all checkboxes unchecked to allow all administrators.

Login Page Protection

Brute Force Prevention

Protect your login page by blocking IPs after repeated failed attempts.
Note: During a lockout, users cannot access the wp-login.php page.

Enable Protection: Activate login limiting
Max Failed Attempts:

Number of failed attempts allowed before blocking.

Block Duration:

How long the user is banned from the login page.

Cloudflare Compatibility:

Enable if your site is behind Cloudflare to accurately detect visitor IPs.

🚫 Recently Blocked Users (Last 15)

IP Address Device / Agent Expires In Action

Settings Export & Import

Export: Download all your plugin settings as a JSON file for backup or migration.
Import: Restore settings from a previously exported file. This will overwrite your current configuration.

Export Settings

Creates a backup of all plugin settings including automation schedules, performance toggles, and user access controls.

Downloads as: optistate-settings-YYYY-MM-DD.json

Import Settings

Restore settings from a JSON file. Your current settings will be replaced with the imported configuration.

No file selected
Important: Settings files only contain configuration data, not database backups. Always export your settings before major updates or when migrating to a new server.

πŸ“˜ Documentation

1. Installation & Updates

Installation (First Time Setup)

  1. Download the plugin.
  2. Navigate to your WordPress Admin Dashboard.
  3. Go to Plugins > Add New.
  4. Click Upload Plugin.
  5. Choose the WP_Optimal_State_PRO_X-X-X.zip file and click Install Now.
  6. Once installed, click Activate Plugin.
  7. The plugin will automatically create required directories and settings files.
  8. Look for "Optimal State" in your admin menu.


System Requirements: WordPress 5.5+, PHP 7.4+, MySQL 5.6+ or MariaDB 10.1+

Upgrading from FREE to PRO Version

  1. In the plugin interface, go to Section 1 and download your database backups (they download as .sql.gz files).
  2. Go to Section 9 (Settings Export & Import) and click Export Settings to download your .json settings file.
  3. Go to Plugins > Add Plugin, then Upload Plugin.
  4. Choose WP_Optimal_State_PRO_X-X-X.zip and click Install Now.
  5. Click Replace current with uploaded when prompted.
  6. Visit the plugin admin panel to confirm backups and settings are intact.
  7. If settings weren't preserved, go to Section 9 and import the .json file from step 2.

Updating the PRO Version

Option 1: Via Dashboard (Recommended)

  1. Download your database backups from Section 1.
  2. Export settings from Section 9 (.json file).
  3. Go to Plugins > Add Plugin > Upload Plugin.
  4. Choose the new version ZIP file and click Install Now.
  5. Click Replace current with uploaded.
  6. Verify backups and settings are intact. If not, import the .json file.

Option 2: Via FTP

  1. Unzip the new plugin ZIP file on your computer to get the optistate folder.
  2. Open your FTP client and navigate to wp-content/plugins/.
  3. Upload the optistate folder, choosing to replace/overwrite existing files.
  4. Go to Plugins > Installed Plugins and verify the new version number.
  5. Confirm backups and settings are intact in the plugin interface.
Important: You'll receive email notifications for new releases. Download updates from your Payhip account or contact support with your license key if needed.

2. Core Engine Architecture

WP Optimal State PRO utilizes a custom Asynchronous Process Manager to handle resource-intensive tasks without timing out.

  • Process Store: The plugin creates a custom table {prefix}optistate_processes to persist the state of long-running operations (like backups or restores). This allows tasks to span across multiple PHP requests.
  • Chunked Execution: Large tasks are broken down into small "chunks." The worker logic (e.g., run_manual_backup_chunk_worker) processes a batch of rows or tables, saves the state, and schedules the next chunk via WordPress Cron (wp_schedule_single_event).
  • Adaptive Resource Usage: The engine dynamically adjusts batch sizes based on PHP memory_limit and execution time to prevent server crashes.

3. Database Backup Logic

Backups are performed using a high-performance PHP streaming method that ensures compatibility across shared hosting environments where mysqldump or SELECT INTO OUTFILE might be restricted.

Backup Methodology:

  • Real-Time Gzip: Data is streamed directly through gzopen/gzwrite, creating .sql.gz files on the fly. This minimizes disk I/O and storage usage.
  • Metadata Tracking: File details (size, timestamp, database name) are stored in the {prefix}optistate_backup_metadata table to verify integrity later.
  • Retention Policy: The "Max Backups" setting is enforced automatically. When the limit is reached, the oldest files and their metadata are pruned.
  • Exclusions: The plugin automatically excludes its own process tables and temporary restore tables (optistate_old_...) to prevent backup bloat.
Storage Location: Backups are stored in /wp-content/uploads/optistate/db-backups/. This directory is protected from public access via .htaccess and index.php silencers.

4. Atomic Restore & Safety Protocol

Restoring a database is a critical operation. WP Optimal State PRO uses a "Verify, Import, Swap" methodology to ensure zero data loss if a failure occurs.

The Restoration Flow:

  1. Safety Backup: Before any changes are made, a "SAFETY-RESTORE" backup of the live site is automatically created.
  2. Shadow Import: The backup file is imported into temporary tables (prefixed with optistate_temp_). The live site remains fully functional during this phase.
  3. Validation: The engine verifies that critical tables (_posts, _users, _options) exist and contain data in the temporary set.
  4. Atomic Swap: Using the SQL RENAME TABLE command, live tables are instantly swapped with the temporary tables. The old live tables are renamed to optistate_old_....
  5. Instant Rollback: If an error occurs during the swap, the engine attempts to immediately rename the optistate_old_ tables back to live status.
Maintenance Mode: The site is placed in a temporary Maintenance Mode (503 Service Unavailable) only during the critical swap phase to prevent data inconsistency.

5. Database Optimization Engine

The optimization suite goes beyond simple cleanup, focusing on structural health and query performance.

Cleaning Operations:

Safe batch deletions are performed for:

  • Revisions & Drafts: Cleans old post revisions and auto-drafts.
  • Transient Options: Removes expired _transient_ entries from the options table.
  • Orphaned Data: Identifies and removes PostMeta, CommentMeta, and Term Relationships where the parent ID no longer exists.
  • Spam & Trash: Clears spam comments and trashed items.

Table & Autoload Optimization:

  • Defragmentation: Runs OPTIMIZE TABLE to reclaim "Data Free" (overhead) space in InnoDB/MyISAM tables.
  • Autoload Manager: Scans for large options loaded on every page (autoload='yes'). It intelligently disables autoload for heavy, non-essential data (like old plugin logs) to reduce Time To First Byte (TTFB).
  • WP-CLI Support: If detected, optimizations run via native MySQL commands for greater speed.

6. Server-Side Page Caching

The caching engine generates static HTML files stored in /wp-content/uploads/optistate/page-cache/. Requests are served via PHP bypass logic hooked into muplugins_loaded or early `plugins_loaded`.

Smart Features:

  • Cache Preloading: Parses your XML sitemap (from Yoast, RankMath, etc.) and warms up the cache in the background.
  • Cookie Banner Detection: Intelligently serves fresh pages to users who haven't accepted cookies, or serves cached pages if a known consent cookie (e.g., cookieyes-consent) is present.
  • Mobile Caching: Optionally creates separate cache files for mobile user agents to support mobile-specific themes.
  • Intelligent Purge: Automatically clears cache for:
    • The updated post/page.
    • The homepage and blog feed.
    • Associated category and tag archives.
Exclusions: Logged-in users, Cart/Checkout pages, and URLs with tracking parameters are automatically excluded from caching (utm_source, gclid).

7. Performance & Hardening Features

Fine-tune WordPress behavior to reduce server load and "noise".

Available Toggles:

  • Heartbeat API: Modify the interval to 120s or disable it entirely to reduce CPU usage on the admin dashboard.
  • Post Revisions: Limit the number of revisions stored (e.g., keep last 5) via dynamic WP_POST_REVISIONS definition handling.
  • Auto-Empty Trash: Change the default 30-day retention for trash items.
  • XML-RPC: Completely disable XML-RPC to prevent brute-force attacks and pingback spam.
  • Disable Emojis: Removes the wp-emoji-release.min.js script to save bandwidth.
  • Header Cleanup: Removes wlwmanifest, rsd_link, shortlink, and WP Version tags to reduce page weight and obscure WP version info.

8. Security Mechanisms

Security is built into every layer of the plugin's operation.

  • Restore Firewall: Uploaded SQL files are scanned for malicious patterns (e.g., eval(), base64_decode(), <?php) before processing. This prevents SQL injection via backup files.
  • File Protection: All storage directories (backups, logs, cache, temp) are secured with .htaccess rules blocking PHP execution and directory browsing.
  • User Access Control: You can restrict plugin access to specific Administrator accounts to prevent unauthorized usage.
  • Capability Checks: All AJAX actions are protected by Nonces and manage_options capability checks.

9. Troubleshooting

If you encounter issues during backup or restore operations:

  • Check Permissions: Ensure /wp-content/uploads/ is writable (chmod 755).
  • Loopback Requests: The background processor relies on WP Cron. Ensure your site can make HTTP requests to itself (check for Basic Auth or firewall blocks).
  • Memory Limit: For very large sites (>1GB DB), consider increasing PHP `memory_limit` to 256MB or higher in your wp-config.php.
  • Nginx Users: Since .htaccess is not supported, manual configuration is required for Browser Caching features.

10. Free vs. Pro Version

Detailed comparison of the free versus pro plugin versions.

Feature Free Version Pro Version
πŸ—„οΈ Database Backup & Restore
Create Database Backups βœ“ Yes βœ“ Yes
Maximum Backups to Keep 1 Up to 10
Download Backups βœ“ Yes βœ“ Yes
Restore from Existing Backups βœ“ Yes βœ“ Yes
Restore Database from Uploaded File βœ“ Yes (50MB) βœ“ Yes (5GB)
Backup Verification (Checksum) βœ“ Yes βœ“ Yes
🧹 Database Cleanup & Optimization
One-Click Optimization βœ“ Yes βœ“ Yes
Database Health Score βœ“ Yes βœ“ Yes
Database Statistics βœ“ Yes βœ“ Yes
Detailed Database Cleanup (18 cleanup types) βœ“ Yes βœ“ Yes
Optimize All Tables βœ“ Yes βœ“ Yes
Analyze & Repair Tables βœ— No βœ“ Yes
Optimize Autoloaded Options βœ— No βœ“ Yes
Database Structure Analysis βœ“ Yes βœ“ Yes
MySQL Index Manager βœ— No βœ“ Yes
Referential Integrity Scanner βœ“ Yes βœ“ Yes
Database Search & Replace βœ— No βœ“ Yes
Delete Unused Tables βœ— No βœ“ Yes
⏰ Automation Features
Automatic Backup and Cleaning (Scheduled Tasks) βœ— No βœ“ Yes
Email Notifications for Scheduled Tasks βœ— No βœ“ Yes
Customizable Schedule (Every X Days at Specific Time) βœ— No βœ“ Yes
πŸš€ Performance Features
Server-Side Page Caching βœ“ Yes βœ“ Yes
Browser Caching (.htaccess Rules) βœ“ Yes βœ“ Yes
Cache Purging βœ“ Yes βœ“ Yes
Cache Statistics βœ“ Yes βœ“ Yes
Automatic Cache Preload (Sitemap-Based) βœ— No βœ“ Yes
Mobile-Specific Cache βœ— No βœ“ Yes
Custom Consent Cookie Support βœ— No βœ“ Yes
Query String Handling Modes (3 Options) βœ“ Yes βœ“ Yes
Smart Cache Invalidation on Content Updates βœ“ Yes βœ“ Yes
Database Query Caching βœ— No βœ“ Yes
Lazy Load Images & Iframes βœ“ Yes βœ“ Yes
Bad Bot Blocker βœ“ Yes βœ“ Yes
Post Revisions Limit Control βœ“ Yes βœ“ Yes
Trash Auto-Empty Control βœ“ Yes βœ“ Yes
Heartbeat API Control βœ“ Yes βœ“ Yes
Disable XML-RPC βœ“ Yes βœ“ Yes
Remove Emoji Scripts βœ“ Yes βœ“ Yes
Remove Unused WordPress Headers βœ“ Yes βœ“ Yes
Integrated PageSpeed Metrics βœ“ Yes βœ“ Yes
πŸ”’ Security & Safety
Automatic Safety Backup Before Restore βœ“ Yes βœ“ Yes
Emergency Rollback on Restore Failure βœ“ Yes βœ“ Yes
Temporary Table Swap (Zero-Downtime Restore) βœ“ Yes βœ“ Yes
Database Validation Before Restore βœ“ Yes βœ“ Yes
Maintenance Mode During Restore βœ“ Yes βœ“ Yes
Protected Backup Directory (.htaccess) βœ“ Yes βœ“ Yes
User Management (Restrict Access) βœ— No βœ“ Yes
Settings Export & Import βœ“ Yes βœ“ Yes
πŸ“Š Logging & Monitoring
Optimization History Log (Last 80 Operations) βœ“ Yes βœ“ Yes
Detailed Operation Results βœ“ Yes βœ“ Yes
Real-Time Progress Tracking βœ“ Yes βœ“ Yes
πŸ’¬ Support & Documentation
Comprehensive Plugin Manual βœ“ Yes βœ“ Yes
Multi-Language Interface Support βœ“ Yes βœ“ Yes
In-Dashboard Help & Tooltips βœ“ Yes βœ“ Yes
Price βœ“ FREE $105 Lifetime βœ“
Terms & Conditions
Summary Core Features All Features