=== AddonLogic 404 Hits Logger ===
Contributors: snehalpancholi
Tags: 404, broken links, analytics, error log, not found
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Logs every 404 Not Found URL with hit counts, timestamps, and referring URLs so you can fix broken links fast.

== Description ==

**AddonLogic 404 Hits Logger** silently records every 404 Not Found request on your WordPress site. Every broken URL is stored with:

* **Hit count** — how many times the URL was visited
* **First & last seen** timestamps
* **Referring URL** — where the visitor came from

Use the built-in admin table (Tools → 404 Log) to sort by hits or date, search for specific URLs, and delete individual entries or clear the entire log.

**This plugin is analytics-only — it does not create redirects.** Use the data alongside a redirect plugin to fix broken links.

= Key Features =

* Zero-config setup — activate and it starts logging immediately
* Deduplication: each URL stored once, hits incremented on repeat visits
* 30-second throttle prevents duplicate rows from browser retries
* Admin-only pages, wp-cron, and REST API paths are excluded from logging
* Sortable columns: URL, Hits, First Seen, Last Seen
* Search log by URL fragment
* Paginated results (25 per page)
* Summary cards: Unique URLs, Total Hits, Today's Hits
* Full delete support: individual row or clear all
* Lightweight: no JavaScript on the frontend

= Usage =

1. Activate the plugin.
2. Go to **Tools → 404 Log**.
3. Review the top broken URLs sorted by hit count.
4. Fix them by creating redirects or correcting links.

== Installation ==

1. Upload the `404-hits-logger` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Tools → 404 Log** to view logged 404 hits.

== Frequently Asked Questions ==

= Does this plugin create redirects? =

No. It is a pure analytics tool. Use a redirect plugin (e.g., Redirection) alongside this one.

= Will logging slow down my site? =

Minimal impact. One lightweight `INSERT … ON DUPLICATE KEY UPDATE` query per unique 404 URL (not per request, due to the 30-second throttle transient).

= How do I clear old data? =

Use the **Clear All Entries** button at the bottom of the Tools → 404 Log page, or delete individual rows.

= What happens on uninstall? =

The custom database table is dropped and all plugin options are removed. Your WordPress content is untouched.

== Screenshots ==

1. Summary cards showing Unique 404 URLs, Total Hits, and Today's Hits.
2. Sortable log table with search, pagination, and per-row delete action.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
