spatie/mixed-content-scanner
Scan a website for mixed content by crawling pages and flagging insecure http:// resources in common HTML tags (img, script, iframe, link, etc.). Use MixedContentScanner with a logger to report where mixed content is found or missing.
MixedContentLogger interface allows customization for logging/alerting (e.g., Slack, database, or monitoring tools). This fits Laravel’s event-driven patterns (e.g., MixedContentFound events).Http facade). Laravel’s Http client is preferred for consistency.MixedContentLogger.scan:mixed-content command for manual/automated runs.Deployed or HttpResponse events.Http facade for consistency:
$scanner = new MixedContentScanner(new MixedContentLogger());
$scanner->scan(url('/'));
ScanMixedContent::dispatch(url('/'))->onQueue('scans');
composer require spatie/mixed-content-scanner)./home, /products).MixedContentLogger to integrate with existing logging (e.g., Laravel Log, Sentry).schedule->command('scan:mixed-content')->daily()).MixedContentLogger if business rules change (e.g., new whitelisted domains).spatie/mixed-content-scanner-cli) for manual testing.| Failure | Mitigation | Detection |
|---|---|---|
| Scanner hangs on slow site | Set HTTP client timeout (e.g., 10s). | Job fails after timeout. |
| False positives | Whitelist known HTTP resources. | Manual review of logged findings. |
| Alert fatigue | Tier alerts (e.g., critical vs. warning). | Custom MixedContentLogger thresholds. |
| Queue backlog | Monitor queue length; adjust workers. | Laravel Horizon or Supervisor metrics. |
How can I help you explore Laravel packages today?