Add IP filtering and reorganize Website Management menu
IP Filtering enhancements to 500 error tracker: - Filter localhost/internal IPs (127.x, 10.x, 172.16-31.x, 192.168.x) - Detect cloud scanner IPs from AWS, GCP, Azure with user agent validation - Skip known bot network IP ranges to reduce noise - More aggressive filtering of non-relevant traffic Website Management menu reorganization: Reduced from 16 options to 7 logical categories: Main menu now has: 1. Website Error Analyzer 2. Fast 500 Error Tracker 3. Debug Log Analyzer 4. Health & Maintenance → (5 tools: health check, DB optimizer, cache, plugin/theme audit) 5. WP-Cron Management → (3 tools: status, mass fix, system cron setup) 6. Mass Updates → (3 tools: core, plugins, themes updates) 7. Security & Compliance → (3 tools: malware scanner, permissions, login audit) Benefits: - Cleaner, more organized menu structure - Related tools grouped together - Easier navigation with logical subcategories - Reduced cognitive load (7 vs 16 options) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -92,6 +92,29 @@ while IFS= read -r log; do
|
||||
fi
|
||||
fi
|
||||
|
||||
# Parse log line to get IP first
|
||||
read -r ip _ _ timestamp _ request _ _ <<< "$line"
|
||||
|
||||
# IP-based filtering - skip non-relevant IPs
|
||||
# Skip localhost/internal IPs
|
||||
if [[ "$ip" =~ ^(127\.|::1|10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.) ]]; then
|
||||
((filtered_bots++))
|
||||
continue
|
||||
fi
|
||||
|
||||
# Skip common cloud scanner IPs and known bot networks
|
||||
# AWS, GCP, Azure scanner ranges, security scanners
|
||||
if [[ "$ip" =~ ^(3\.|13\.|18\.|34\.|35\.|52\.|54\.) ]] || \
|
||||
[[ "$ip" =~ ^(104\.196\.|104\.154\.|130\.211\.|35\.184\.|35\.185\.|35\.186\.|35\.187\.|35\.188\.|35\.189\.|35\.19) ]] || \
|
||||
[[ "$ip" =~ ^(20\.|40\.|51\.|52\.|13\.64\.|13\.65\.|13\.66\.|13\.67\.|13\.68\.) ]]; then
|
||||
# Check if it's actually a bot by examining user agent
|
||||
line_lower="${line,,}"
|
||||
if [[ "$line_lower" =~ (bot|crawler|spider|scanner|monitor|cloud|amazon|google|microsoft|azure) ]]; then
|
||||
((filtered_bots++))
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# Bot/Scanner filtering - skip noise
|
||||
line_lower="${line,,}"
|
||||
if [[ "$line_lower" =~ (bot|crawler|spider|scraper|scanner|check|monitor|uptime|pingdom|newrelic|datadog|nagios|zabbix|prtg|gomez|keynote|catchpoint|dotcom-monitor|site24x7|uptimerobot|statuscake|nodequery|hetrixtools|freshping|uptrendscom|siteuptime|montastic|updown\.io|apex|alertsite|webmon|wormly) ]]; then
|
||||
@@ -106,9 +129,6 @@ while IFS= read -r log; do
|
||||
((filtered_bots++))
|
||||
continue
|
||||
fi
|
||||
|
||||
# Parse log line
|
||||
read -r ip _ _ timestamp _ request _ _ <<< "$line"
|
||||
|
||||
# Extract URL
|
||||
if [[ "$request" =~ '"'[A-Z]+[[:space:]]([^[:space:]]+) ]]; then
|
||||
|
||||
Reference in New Issue
Block a user