=== Smart 404 Redirect Manager ===
Contributors: amandeepwebspero
Tags: 404 redirect, logs, broken links, seo, redirection
Requires at least: 5.0
Tested up to: 6.8
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Smart 404 Redirect & Log Manager fixes 404 errors, auto-redirects broken links, prevents loops, and boosts SEO with smart error management.

== Description ==

**Smart 404 Redirect & Log Manager** is a lightweight yet powerful plugin designed to handle 404 (Page Not Found) issues efficiently. It helps improve user experience and preserve SEO ranking by smartly redirecting missing pages to valid destinations — with detailed tracking, logging, and rule creation.

Perfect for site admins, SEO professionals, and developers who want complete control over redirects and 404 logs.

### 🌟 Features

**✅ Global Redirect Control**
- Enable or disable a global 404 redirect in one click.
- Automatically redirect all missing pages to a chosen URL (e.g., homepage, custom landing page).
- Select redirect type (301 – Permanent or 302 – Temporary).

**✅ Smart 404 Logging**
- Logs every 404 request with:
  - Requested URL
  - Hit count
  - First seen & last seen timestamps
  - Referrer
  - Visitor IP & User Agent
- Auto-prevents redirect loops with adjustable loop threshold.

**✅ Easy Redirect Rule Management**
- Create manual redirect rules directly from 404 logs.
- Define old path → new URL redirection.
- Select between 301 or 302 redirect type.
- Delete or manage rules with one click.

**✅ Exclusion Control**
- Exclude specific URLs or patterns (e.g., `/wp-login.php`, `/admin/`) from being redirected.
- Add multiple exclusions using line breaks or commas.

**✅ Export & Maintenance Tools**
- Export complete 404 logs in CSV format for SEO or audit review.
- Clear logs in one click for maintenance or after cleanup.

**✅ Lightweight & Secure**
- Built with WordPress standards and nonces for admin security.
- Uses native WordPress tables and options (no external dependencies).
- Optimized database queries for performance.

---

== Screenshots ==

1. **Global Redirect Settings** — Manage redirect rules and exclusions.
2. **404 Logs Overview** — View all logged 404 requests with referrers.
3. **Redirect Rules Table** — Manage manual redirections easily.

---

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/smart-404-redirect-manager` directory, or install through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Settings → Smart 404 Redirect** to configure.

---

== Frequently Asked Questions ==

= Will this plugin slow down my website? =
No. It’s lightweight and optimized for performance using direct database queries and minimal hooks.

= Can I exclude specific URLs from redirection? =
Yes. Add URLs or patterns to the exclusion list in settings. Each line or comma-separated value is treated as a “contains” match.

= Does this support automatic redirects like 404 to similar slugs? =
Not yet. This feature is planned in the next release.

= Can I export logs for SEO analysis? =
Yes. You can export all 404 logs as a CSV file directly from the plugin page.

---

== Changelog ==

= 1.0.1 =
* Global 404 redirect with settings
* Manual rule creation and deletion
* 404 logs tracking and export
* Excluded URLs and loop protection added

= 1.0 =
* Initial release

---