=== LiveDraft Search & Replace === Contributors: kasuga16 Donate link: https://www.paypal.me/kasuga16 Tags: search, replace, gutenberg, block editor, editor tools Requires at least: 6.3 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 1.4.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html High-performance Search and Replace for Block Editor. Features real-time scanning, regex support, and safe, zero-tag rendering. == Description == **LiveDraft Search & Replace** adds a powerful search and replace panel to **the WordPress Block Editor (Gutenberg)**. It allows you to quickly find, highlight, and replace text directly from the sidebar as soon as you open it. == Features == * **Live Highlighting**: Instantly visualize matches as you type with zero lag. * **Bulk Actions**: Replace a single targeted match or perform a "Replace All" across all blocks seamlessly. * **Advanced Search**: Full support for Regular Expressions (Regex) and Case-Sensitive matching. * **Performance First**: Optimized for large documents using virtual highlighting. * **Safe & Clean**: Your content is never polluted with temporary HTML tags. Highlighting is virtual and database-safe. == Flexible Navigation & Instant Replace == This tool provides a seamless way to navigate and edit your content with precision: 1. Precision Navigation (Keyboard & Buttons) Effortlessly cycle through matches using the "Next" (**Enter**) and "Previous" (**Shift + Enter**) keys. You can also use the "Current" (**◎**) and UI buttons to jump directly to the selection in the editor. 2. Smart "Click-to-Select" **Click any highlighted match** in the editor to instantly set it as your current position. This synchronizes the sidebar counter and focus without jumping the screen. 3. Instant "Double-Click" Replace For a faster workflow, you can **double-click any highlighted text** directly within the editor to replace it instantly. Additional Notes (Performance & Scope) Dynamic Highlighting Scope To maintain high performance, the editor highlights the 300 matches nearest to your current position (150 before and 150 after). As you move through the document, this highlight window shifts automatically. Unlimited "Replace All" The "Replace All" function is not affected by the highlight limit. It will accurately replace every single match throughout the entire document, regardless of whether it is currently highlighted in the editor. == Installation == = From your WordPress Dashboard = 1. Go to **Plugins** > **Add New**. 2. Search for "LiveDraft Search & Replace". 3. Click **Install Now** and then **Activate**. = Manual Installation = 1. Download the plugin zip file. 2. Upload the `livedraft-search-replace` folder to the `/wp-content/plugins/` directory. 3. Activate the plugin through the 'Plugins' menu in WordPress. = How to use = 1. Open any Post or Page in the Block Editor. 2. Click the **'Search' (magnifying glass) icon** in the top-right toolbar to open the sidebar. 3. Start searching and replacing without leaving your editing flow! == Frequently Asked Questions == = Does this plugin work with the Classic Editor? = No. This plugin is built specifically for the modern Block Editor (Gutenberg) environment. = Is my browser supported? = The search and replace functions work on all modern browsers. For **visual highlighting**, the following versions (or newer) are required: * Chrome / Edge 105+ * Safari 17.2+ * Firefox 128+ If your browser is older, you can still perform search and replace, but the visual highlighting will not be visible. == Screenshots == 1. Search & Replace sidebar panel 2. Live highlight of matches in the editor == Buy Me a Coffee == If this plugin helps you in your work, consider buying me a coffee. Your support helps keep this plugin maintained and improved. Donate via PayPal: https://www.paypal.me/kasuga16 == Changelog == = 1.4.0 = * Added: Dynamic proximity highlighting for improved performance in long documents. * Added: Click-to-Select, instantly setting any clicked match as the current position. * Improved: Unified click and double-click logic for smoother interaction. * Public Release. = 1.2.0 = * Added: Double-click to Replace, allowing instant replacement of any highlighted match by double-clicking it directly in the editor. * Added: Keyboard navigation support (Enter for Next / Shift + Enter for Previous). = 1.1.3 = * Fixed: Prevented browser freezing from infinite loops in regex. = 1.1.2 = * Fixed: Improved special character support (<, >, &, ", '). = 1.1.1 = * Restricted CSS Highlight API to Visual Editor for better stability. = 1.1.0 = * Added "Current" button to quickly jump back to the active match. * Enhanced search input behavior. = 1.0.0 = * Initial release. == Known Issues == * Regular expression searches using special characters like `&` and `<` may occasionally fail to replace correctly.