Skip to content

feat: site_audit.py β€” no-auth Tier-1 website audit#6

Merged
BenKalsky merged 2 commits into
mainfrom
feat/site-audit
Jun 2, 2026
Merged

feat: site_audit.py β€” no-auth Tier-1 website audit#6
BenKalsky merged 2 commits into
mainfrom
feat/site-audit

Conversation

@BenKalsky
Copy link
Copy Markdown
Member

Runnable, credential-free Tier-1 site audit β€” the studio's pre-sale quick scan, automated.

  • scripts/site_audit.py (stdlib-only): PageSpeed (mobile+desktop), SSL + days-to-expiry, security headers, WordPress/PHP detection, SEO basics (title, meta description, single H1, canonical, sitemap, robots) β†’ findings against the audit-engine thresholds. JSON or --summary.
  • Public probes only; no credentials β†’ run cold before any engagement.
  • Pure parsers unit-tested offline (tests/test_site_audit.py); wired into CI. PageSpeed degrades gracefully when unavailable.
  • Bumped to 3.7.0.

Verified live against digitizer.co.il (SSL/headers/WP/SEO all detected; PSI degrades cleanly without a key).

πŸ€– Generated with Claude Code

BenKalsky and others added 2 commits June 3, 2026 00:30
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47ada2c9d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +87 to +89
with urllib.request.urlopen(req, timeout=timeout) as r:
body = r.read().decode("utf-8", "replace") if method == "GET" else ""
return r.getcode(), dict(r.headers), r.geturl(), body
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat HTTP error pages as reachable responses

For sites whose homepage returns a 4xx/5xx response, urllib.request.urlopen raises HTTPError here instead of returning a response object, so audit() falls into the generic unreachable path and skips the intended status/header/SEO checks. In a quick audit, an HTTP 500 or 404 page is still a reachable site with a failing status; catch urllib.error.HTTPError and return its code, headers, URL, and body so line 132 can report it accurately.

Useful? React with πŸ‘Β / πŸ‘Ž.

Comment on lines +203 to +204
if result["reachable"] and any(f["status"] == "fail" for f in result["findings"]):
sys.exit(2)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exit nonzero when the target is unreachable

When the initial fetch fails due to DNS, timeout, or connection refusal, audit() returns reachable: false with a fail finding, but this guard suppresses the nonzero exit and the CLI exits 0. In automation or CI-style sales scans, completely unreachable targets therefore look successful; exit nonzero whenever there is a fail finding, or handle not result['reachable'] separately.

Useful? React with πŸ‘Β / πŸ‘Ž.

@BenKalsky BenKalsky merged commit 2c6657c into main Jun 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant