=== Megop Link Nurse ===
Contributors: hamuo1372, mohammadghasemi
Tags: broken links, redirects, elementor, woocommerce, seo
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 5.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Finds and repairs broken (404) and redirected (301/302) links across your whole site - Elementor and WooCommerce aware, with backups and undo.

== Description ==

Megop Link Nurse scans your posts, pages, products, taxonomies and Elementor templates for problem links, then repairs them safely:

* **Broken links (404/410):** the anchor is unwrapped - the link is removed but its text is kept. Broken images can optionally be removed together with their Elementor placeholder widget.
* **Redirected links (301/302):** rewritten directly to their final 200 destination, so visitors and search engines skip the redirect hop.
* **Blacklisted domains:** the whole link including its anchor text is removed, with a preview before applying.

= Elementor & WooCommerce aware =

The scanner understands Elementor's JSON data format, including escaped URLs, non-Latin (Persian/Arabic) file names, HTML embedded inside widgets, srcset attributes and CSS url() references. It also scans WooCommerce short descriptions and active Elementor theme-builder templates (headers, footers, popups) - a broken link in a footer repeats on every page of the site.

= Only what visitors actually see =

With user-agent verification enabled (default), an issue is only reported when the URL really appears in the rendered front page - drafts, unused library templates and leftover builder data never pollute your report.

= Safe by design =

* Every fix keeps a backup; undo everything or one item at a time.
* Chunked batch fixing that survives slow servers.
* A built-in self-test runs 16 regression checks - in memory only, never touching your content.
* Clean uninstall: all options, transients and report files are removed.

= Reports & languages =

Export results to XLSX (source, anchor text, link, redirect target, status). The interface ships in English, Persian and Arabic with a one-click language switcher.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/megop-link-nurse`, or install through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen.
3. Open **Megop Link Nurse** in the admin menu and press **Scan**.
4. Review the results, select items and press **Run Batch Fix**. A backup is kept so you can undo.

== Frequently Asked Questions ==

= Does it change my content automatically? =

No. Scanning is read-only. Content changes only when you explicitly press Fix or Run Batch Fix, and every change is backed up and undoable.

= Does it work with Elementor? =

Yes - that is its specialty. It reads and safely edits Elementor's JSON data, including embedded HTML, srcset and CSS url() references, and scans active theme-builder templates and popups.

= Will it slow down or flood my server? =

No. Internal media files are verified on the filesystem with zero HTTP requests, remaining checks are paced and deduplicated, and batch sizes are configurable.

= What is the Self-test button? =

It runs 16 built-in regression checks on the plugin's own logic using in-memory test data. Your site content is never touched. 16/16 means all internal safety checks pass.

= Is the interface translated? =

English (default), Persian and Arabic are bundled. Switch instantly from the header - no site language change needed.

== Changelog ==

= 5.2.0 =
* Tested with WordPress 7.1.

= 5.1.1 =
* Fixed: saved Elementor library templates without display conditions (imported demos) were scanned even though they never render on the front.

= 5.1.0 =
* Removed the plugin-file backup/restore panel. Content fixes are still fully undoable.
* Renamed all internal functions, classes, options and AJAX actions to the megolinu_ prefix.
* Generated reports are stored in the uploads folder and protected from directory listing.

= 4.9.0 =
* New: Arabic translation - the plugin is now trilingual (EN/FA/AR) with an in-header language switcher.

= 4.8.0 =
* New: user-agent front verification - only links that actually appear on the rendered page are reported.
* New: Persian translation.

= 4.7.0 =
* New: built-in self-test with 16 regression checks.
* New: uninstall cleanup.
* Improved: anchor-text detection scoped to the link's own Elementor element.

= 4.6.0 =
* New: chunked batch fixing with live progress.
* New: scan concurrency lock.
* New: XLSX report housekeeping (keeps the 5 newest).

= 4.5.x =
* New: front-visibility rules (published content and active templates only).
* Fixed: srcset and CSS url() extraction and rewriting.
* Fixed: redirect prefix safety.

= 4.4.0 =
* New: Gutenberg media/src and block-attribute extraction.
* New: WooCommerce short-description scanning.
* New: Elementor theme-builder templates scanning.

= 4.0.0 - 4.3.0 =
* Elementor JSON-aware extraction and fixing (escaped URLs, Unicode file names, embedded HTML, entities).
* Relative redirect-target protection, Rank Math redirect map integration, SEO-noise filtering.
* Filesystem verification for internal media, per-item undo, clickable report links.

= 3.0.0 =
* Initial public version: scanning, batch fixing, stop, XLSX export.

== Upgrade Notice ==

= 5.2.0 =
Compatibility release for WordPress 7.1. Scanning and fixing behaviour is unchanged.

= 5.1.0 =
Internal prefixes updated and the plugin-file backup panel removed for WordPress.org compliance. Link fixes and undo are unchanged.

= 4.9.0 =
Trilingual interface (EN/FA/AR), user-agent front verification, self-test, and many Elementor-specific fixes. Recommended for all users.
