# Single Tab Post Lock – Prevent Multiple Edit Tabs

**Contributors:** wpsqr 
**Plugin Name:** Single Tab Post Lock – Prevent Multiple Edit Tabs
**Author:** WP Square
**Tags:** post lock, editor, workflow, prevent overwrite  
**Requires at least:** 5.2  
**Tested up to:** 6.9  
**Requires PHP:** 7.2  
**Stable tag:** 1.0.2  
**License:** [GPLv2](https://www.gnu.org/licenses/gpl-2.0.html)  

---

## Description

**Single Tab Post Lock** is a lightweight WordPress plugin that ensures you **don’t accidentally edit the same post in multiple browser tabs**.

By default, WordPress prevents *different users* from editing the same post at the same time — but not the **same user** in multiple tabs. This can cause conflicts, overwrites, or lost content.

This plugin adds an elegant, **in-browser locking system** that prevents those issues entirely. When you open a post for editing, it becomes locked in that tab only. If you try to open it again elsewhere, you’ll see a warning and the editor will be blocked — ensuring safe, single-tab editing.

---

## Key Features

- **Single-Tab Editing** – Prevents the same user from editing the same post in multiple browser tabs.  
- **Smart Auto-Cleanup** – Automatically removes locks when you close or reload the editor.  
- **Safe Timeout** – Locks expire automatically after 30 minutes (to recover from crashes).  
- **Lightweight & Fast** – Runs purely in the browser using JavaScript — zero server load.  
- **Full Compatibility** – Works seamlessly with both Gutenberg and Classic Editor.  

---

## Installation

1. Upload the `single-tab-post-lock` folder to `/wp-content/plugins/`, or install via the **WordPress Plugin Installer**.  
2. Activate the plugin through the **Plugins** screen in WordPress.  
3. Access settings via **Settings → Single Tab Post Lock**.

---

## FAQ

### Does this plugin prevent multiple users from editing the same post?
No. WordPress already includes native post locking for multiple users.  
**Single Tab Post Lock** only prevents the *same user* from editing a post in multiple browser tabs.

### What if my browser crashes or I close a tab without saving?
The plugin automatically clears the lock when you close or leave the editor.  
If your browser crashes, the lock expires automatically after **30 minutes**.

### Will this affect performance?
No. It’s extremely lightweight and runs only a small JavaScript snippet on post edit screens.

### Is there documentation available?
Yes! Full documentation is available here:
[Single Tab Post Lock Documentation](https://www.wpsqr.com)

---

## Changelog

### 1.0.1
- Small bug fixes for improved stability  
- Minor code and performance improvements 

### 1.0.0
- Initial release  
- Added single-tab post locking  
- Automatic lock removal on tab close  
- 30-minute timeout fallback  

---

## Upgrade Notice

### 1.0.1
Includes bug fixes and minor improvements — **recommended for all users**.

### 1.0.0
Initial release — prevents duplicate post editing tabs for the same user.

---

## Troubleshooting

1. Make sure the plugin is activated.  
2. Verify your WordPress version is **5.2 or higher**.  
3. Clear your browser cache if the lock script doesn’t run.  
4. Still having issues?  
   Contact support at [https://www.wpsqr.com](https://www.wpsqr.com).

