=== Link Status Scanner by Beplus ===
Contributors: rimbeplus
Tags: broken links, link checker, seo, link monitoring, broken link
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 1.0.0
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically detects broken and redirected links in your posts and pages, with scheduled background scanning and email notifications.

== Description ==

Link Status Scanner by Beplus scans all your published posts and pages for broken links, redirects, and unreachable URLs. It runs in the background using WordPress Cron so your site performance is never impacted.

= Key Features =

* Automatic background scanning — Uses WP-Cron to scan posts and check links on a schedule you control.
* Broken link report — A clean admin table listing every broken link: URL, HTTP status code, the post it was found in, and when it was last checked.
* Status filters — Quickly filter links by All, Broken, Redirect, OK, Unchecked, or Ignored.
* Bulk actions — Re-check, ignore, or delete multiple links at once.
* Email notifications — Get a digest email listing new broken links after each cron check run.
* Configurable settings — Set check frequency (daily/weekly/monthly), request timeout, links per cron run, and excluded URL patterns.
* Dashboard widget — A quick summary of total, broken, redirect, and OK links on your WordPress dashboard.
* Instant re-check — Re-check any single link immediately from the admin table.
* Scan on save — Newly published or updated posts are scanned immediately when saved.

= How It Works =

1. When a post is published or updated, Link Status Scanner by Beplus extracts all `<a href>` links from the content and stores them in the database.
2. A scheduled cron job checks each stored link by making an HTTP HEAD request and recording the response code.
3. Broken links (404, 410, connection errors) are flagged in the admin report.
4. If email notifications are enabled, you receive a digest email listing newly broken links after each scan.

= Privacy =

Link Status Scanner by Beplus sends HTTP requests to external URLs in order to check their status. No personal data is collected or shared.

== Installation ==

1. Upload the `beplus-link-status-scanner` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings > Link Status Scanner** to view the broken links report.
4. Click **Scan Posts Now** to run an immediate scan, then **Check Links Now** to check their HTTP status.

== Frequently Asked Questions ==

= Does this plugin slow down my site? =

No. All scanning and HTTP checking happens through WP-Cron, which runs in the background. The only admin-side actions are when you manually trigger a scan or re-check.

= What types of links are checked? =

Only `<a href>` links in post content are checked. `mailto:`, `tel:`, `javascript:`, and anchor-only `#` links are automatically skipped.

= Can I exclude certain domains or URLs? =

Yes. Go to the Settings tab and add URL patterns (one per line) to the Excluded URL Patterns field. Any link containing that pattern will be skipped.

= Why does WP-Cron not run on schedule? =

WP-Cron triggers on page loads. On low-traffic sites it may not run on time. For reliable scheduling, disable WP-Cron and add a real system cron job:
`*/5 * * * * curl -s https://yoursite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1`

= What does "Redirect" status mean? =

A redirect (301, 302, 307, 308) means the URL has moved. The link still works but you may want to update it to the final destination for SEO.

= Can I check links in custom fields or other content areas? =

Version 1.0 checks post content only. Support for custom fields and widget areas is planned for a future release.

== Screenshots ==

1. Admin report table showing broken and redirected links with status filters and bulk actions.

== Changelog ==

= 1.0.0 =
* Initial release.
* Automatic post scanning on save and via WP-Cron.
* Admin report with WP_List_Table, status filters, and bulk actions.
* Settings page (frequency, timeout, links per run, excluded patterns, email notifications).
* Dashboard widget.
* Email digest notification for new broken links.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade steps required.
