# SEO Validator MVP 1 SQLite SB Admin UI

PHP 8.0 / Apache / SQLite sitemap and internal-link SEO crawler.

This version uses an SB Admin inspired Bootstrap 5 layout for the dashboard, crawl reports and page audit screens.

## Install

```bash
sudo apt update
sudo apt install apache2 php8.0 php8.0-cli php8.0-curl php8.0-xml php8.0-sqlite3
```

Point Apache document root to `public/`, or create an alias/vhost.

Make sure the app can write to the `data/` directory:

```bash
sudo chown -R www-data:www-data data
sudo chmod -R 775 data
```

The SQLite database is created automatically on first load at:

```text
data/seo-validator.sqlite
```

## First run

Open the dashboard in your browser, then click **Start crawl** for Brimbank Bin Hire.

The first crawl starts from:

```text
https://brimbankbinhire.com.au/sitemap.xml
```

It also spiders discovered internal links so the report can highlight URLs found on the site but missing from the sitemap.

## UI notes

The admin interface uses CDN links for Bootstrap 5 and Font Awesome. This keeps the MVP lightweight. For production or offline/local-only use, download those assets and replace the CDN links in `lib/ui.php`.

The layout follows the SB Admin style:

- dark top navigation
- dark left sidebar
- dashboard cards
- Bootstrap tables
- status badges
- report summary cards

## MVP Features

- Multi-site table from day one
- Crawl history via `crawl_runs`
- Starts from sitemap.xml
- Spiders discovered internal links up to configured depth
- Marks URLs as `sitemap`, `spider`, or `both`
- Stores titles, meta descriptions, H1s, canonicals, robots meta, word count and JSON-LD count
- Stores internal/external links
- Stores CSS, JS and image assets
- Configurable checks in the `checks` table
- Traffic light page report
- Tabbed SEO report categories for Meta, Schema, Headings, Content, Images, Links, Socials, Rich Results and AI
- SB Admin inspired Bootstrap console and reports

## Next MVP 2 items

- Add a checks management screen
- Evaluate regex checks against HTML/body/fields
- Evaluate CSS selector checks fully
- Link validation queue and HTTP status checks
- robots.txt parsing
- header checks, including HSTS, X-Frame-Options and X-Content-Type-Options
- image file size checks
- export CSV

## MVP 1.2 additions

This package adds a few testing/reporting improvements:

- Add more test websites from the dashboard with site name, base URL and sitemap URL.
- Report tab badges now show red issue count first, followed by amber warning count.
- Headings are now stored as a full outline in `page_headings`, not only the first H1.
- Heading hierarchy checks now flag skipped levels, such as going from H2 to H4.
- Content checks now include HTTP 200 and a minimum visible word count.
- External links are reported as total links / unique domains, for example `9 / 4`.

Existing SQLite databases are migrated automatically on first load. If you want a completely fresh test database, stop Apache and delete:

```text
data/seo-validator.sqlite
```

Then reload the dashboard.

## MVP 1.2 update

- Severity badges now use icons instead of visible severity words: tick for green, exclamation mark for amber, and x for red.
- Report issue count pills now show the icon followed by the count.
