=== Easy Search Replace – Find & Replace Text/HTML/URLs, Remove Footer Credit === Contributors: easywpstuff Tags: search replace, find replace, search and replace, find and replace, remove footer credit, url replace, text replace, html replace, css selector, content replace Requires at least: 5.0 Tested up to: 7.0 Requires PHP: 7.2 Stable tag: 1.1.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Real-time search & replace for text, HTML, and URLs. Target elements, post types, IDs, or URLs. Safely remove footer credit — no database changes. == Description == The **Easy Search Replace** plugin lets you **find and replace** any text, HTML, or URL across your WordPress site in real time — without editing files or the database. It’s the safest way to do **search and replace** on front-end output. Update branding, fix old links, or **remove footer credit** with a few clicks. Target replacements precisely with: - CSS selectors (e.g., `.footer`, `#site-title`, `h2`) - Post Types (Posts, Pages, CPTs) - Specific Post IDs (comma separated) - Exact URLs (one per line) **Why it’s safe:** All changes are applied dynamically at render time. Disable the plugin and your original content is unchanged. **Popular use cases** - Remove or replace theme footer credits. - Replace company names, links, or copyright lines. - Update outdated or HTTP → HTTPS URLs. - Find/replace only inside specific HTML elements. - Limit changes to selected posts/pages/URLs. == Features == - Real-time **search replace** and **find replace** for text, HTML, and URLs. - Remove footer credit or any unwanted text/link. - Optional **CSS selector** targeting (classes, IDs, tags). - Limit by **post type**, **post ID**, or **URL**. - Case-insensitive mode (Ignore Case). - Multiple rules, executed in order. - Lightweight: parses the DOM only when selector rules exist. - Clean, simple settings UI. == Installation == 1. Download the plugin ZIP. 2. In WP Admin, go to **Plugins → Add New → Upload Plugin**. 3. Upload the ZIP, click **Install Now**, then **Activate**. 4. Go to **Settings → Easy Search Replace** to add rules. == Usage == 1. Open **Settings → Easy Search Replace**. 2. **Find**: Enter the text/HTML/URL to search. 3. **Replace with**: Enter the replacement (leave empty to remove — great for footer credits). 4. *(Optional)* **CSS Selector** to restrict to specific elements (e.g., `.site-footer`, `#main`, `h1`). 5. *(Optional)* Limit by **Post Types**, **Post IDs**, or **URLs** (one per line). 6. Enable **Ignore case** if needed. 7. Add multiple rules and **Save Changes**. == Examples == **Replace text globally** Find: Old Company Replace: New Company **Remove footer credit (selector-based)** Find: Powered by MyTheme Replace: Selector: .site-footer **Replace URL site-wide** Find: http://oldsite.com Replace: https://newsite.com **Only on specific posts** Find: Coming Soon Replace: Launching Now Post IDs: 25,47,88 **Case-insensitive** Enable **Ignore case** to match “WordPress”, “wordpress”, etc. == Frequently Asked Questions == = Does this modify my database or theme files? = No. All replacements happen in the output buffer at runtime. = Can I remove theme footer credits? = Yes. Put the exact text in **Find**, leave **Replace** empty, and (optionally) set a footer **CSS Selector** (e.g., `.footer-credit`). = Will it work with page builders and caching? = Yes. It works on rendered HTML (Elementor, Divi, WPBakery, etc.). Clear your cache after adding or updating rules. = Performance impact? = Minimal. String replacements are fast; DOM parsing only happens if you use selector-based rules. = Regex support? = Not in this version — by design for speed and simplicity. == Screenshots == 1. Settings page – create multiple search & replace rules 2. Remove footer credit == Changelog == = 1.1.4 = * Minor issues fixed. = 1.1.3 = * Security: sanitize and unslash `$_SERVER['REQUEST_URI']` when resolving the current URL for rule matching. * Security: wrap every `$_POST` access in explicit `isset()` + `is_array()` checks and `wp_unslash()` calls; stop mutating the `$_POST` superglobal. * Security: validate post-ID input as integers instead of a regex strip, and validate URL lines via `esc_url_raw` for absolute URLs. * Security: use `get_current_screen()` hook-suffix matching instead of `$_GET['page']` to decide when to enqueue admin assets. * Security: explicit capability check with `wp_die` on the settings screen, in addition to the menu capability. * Bug fix: rules limited to specific post types no longer match on non-singular views (archives, search, 404). * Dev: introduced `ESRN_VERSION`, `ESRN_PLUGIN_DIR`, `ESRN_PLUGIN_URL`, `ESRN_PLUGIN_BASENAME`, and `ESRN_OPTION_KEY` constants; asset versions now track the plugin version. * Dev: `load_plugin_textdomain()` is now called on `plugins_loaded`. * UI: redesigned settings screen with a responsive two-column layout, rule cards, inline help, and a sticky "How it works" side panel. * UI: improved focus states, keyboard/Select2 accessibility, and visual consistency with WordPress core admin. = 1.1.2 = * Bug fixes. = 1.1.1 = * Fixed advanced options bug. = 1.1.0 = * Added targeting by Post Types, Post IDs, and URLs. * Added **Ignore Case** option. * Improved footer credit removal workflow. * Better performance: single-pass DOM parsing when needed. * UI polish and multiple-rule flow. = 1.0.2 = * Minor fixes. = 1.0.1 = * Fixed search function issues. = 1.0.0 = * Initial release: front-end search and replace with optional CSS selector. == Upgrade Notice == = 1.1.4 = Minor issues fixed.