A high-performance, zero-dependency, object-oriented Native PHP 8+ SEO Audit & Technical Analysis engine. Designed for developers, digital marketers, and agencies who need fast, comprehensive, and modular web page diagnostics via Web UI, CLI tool, or REST API.
- 🚀 Zero External Dependencies: Runs out-of-the-box using native PHP extensions (
curl,dom,libxml,mbstring,json). - 📐 Clean Modern Architecture: Built with modern PHP 8+ features (
declare(strict_types=1);, Typed Properties, Constructor Promotion, Match Expressions, Enums, PSR-4 Autoloading). - 📊 9 Comprehensive Diagnostic Modules:
- Meta Tags & HTML Head: Title/Description length, Canonical URLs, Robots meta, Charset, Favicon.
- Headings Structure: H1 count & presence, H2–H6 hierarchy completeness, empty heading detection.
- Content & Keywords: Word count, Text-to-HTML ratio, reading time estimation, top keyword density calculations & keyword stuffing prevention.
- Images Optimization: Missing & empty
altattributes count, nativeloading="lazy"usage. - Links & Anchor Text: Internal vs external ratio, nofollow counts, non-descriptive generic anchor text detector (
"click here","read more"). - Social & OpenGraph:
og:title,og:image,og:description, Twitter Card validation. - Security & HTTPS: SSL/HTTPS check, Security Headers (
HSTS,X-Frame-Options,X-Content-Type-Options,Content-Security-Policy,Referrer-Policy). - Performance & Speed: Time To First Byte (TTFB), total load time, HTTP response status codes, GZIP/Brotli compression check.
- Technical SEO:
robots.txtavailability,sitemap.xmllocation, mobile viewport tag, Schema.org JSON-LD microdata parsing.
- 🖥️ Multiple Interfaces:
- Web Dashboard: Interactive glassmorphism UI with animated SVG radial gauge score, category progress bars, and issue filter tabs.
- CLI Command Tool: Colorized terminal output for CLI environments (
php cli.php --url=...). - RESTful API: Programmatic JSON endpoint (
api/analyze.php). - HTML & JSON Exporters: Export printable standalone HTML reports or JSON audits.
seoanalyzer/
├── api/
│ └── analyze.php # REST API Endpoint
├── assets/
│ ├── css/style.css # Modern Glassmorphism Web UI Styles
│ └── js/app.js # Interactive Dashboard Logic & AJAX
├── src/
│ ├── Analyzers/ # Specialized Audit Modules
│ │ ├── AnalyzerInterface.php
│ │ ├── ContentAnalyzer.php
│ │ ├── HeadingsAnalyzer.php
│ │ ├── ImagesAnalyzer.php
│ │ ├── LinksAnalyzer.php
│ │ ├── MetaAnalyzer.php
│ │ ├── PerformanceAnalyzer.php
│ │ ├── SecurityAnalyzer.php
│ │ ├── SocialAnalyzer.php
│ │ └── TechnicalAnalyzer.php
│ ├── Core/ # Core Fetching & Parsing Infrastructure
│ │ ├── DomParser.php
│ │ ├── HttpFetcher.php
│ │ └── ScoreCalculator.php
│ ├── Enums/ # PHP 8 Enums
│ │ ├── Category.php
│ │ └── Severity.php
│ ├── Exporters/ # HTML & JSON Report Exporters
│ │ ├── HtmlReportExporter.php
│ │ └── JsonExporter.php
│ ├── Models/ # Domain Models
│ │ ├── AnalysisResult.php
│ │ └── Issue.php
│ ├── Autoloader.php # Native PSR-4 Autoloader
│ └── SEOAnalyzer.php # Main Facade Class
├── cli.php # CLI Audit Runner
├── index.php # Web Dashboard
├── composer.json # Composer Package Config
└── README.md
- PHP:
>= 8.1 - Extensions:
curl,dom,libxml,mbstring,json
- Clone or download the repository into your web root (e.g.
d:/WampServer/www/seoanalyzer). - Open your browser and navigate to
http://localhost/seoanalyzer/index.php.
<?php
require_once __DIR__ . '/src/Autoloader.php';
\SEOAnalyzer\Autoloader::register();
use SEOAnalyzer\SEOAnalyzer;
$analyzer = new SEOAnalyzer();
// Audit URL and retrieve raw AnalysisResult model
$result = $analyzer->analyze('https://example.com');
echo "Overall SEO Score: " . $result->getScore() . " / 100\n";
echo "Execution Time: " . $result->getExecutionTime() . " seconds\n";
// Access individual issues
foreach ($result->getIssues() as $issue) {
echo "[{$issue->severity->getLabel()}] {$issue->title}\n";
echo " Recommendation: {$issue->recommendation}\n";
}
// Export raw JSON
$json = $analyzer->analyzeAsJson('https://example.com');
// Export HTML report string
$htmlReport = $analyzer->analyzeAsHtml('https://example.com');Audit any website directly from your terminal:
# Display colorized audit in terminal
php cli.php --url=https://example.com
# Output JSON
php cli.php --url=https://example.com --format=json
# Generate & Save HTML Report file
php cli.php --url=https://example.com --format=html --export=report.htmlPOST or GET requests to api/analyze.php:
curl -X POST "http://localhost/seoanalyzer/api/analyze.php" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'{
"url": "https://example.com",
"score": 92,
"analyzed_at": "2026-07-30T15:20:00+03:00",
"execution_time": 0.412,
"counts": {
"critical": 0,
"warning": 2,
"good": 15
},
"category_scores": {
"meta": 100,
"headings": 100,
"content": 90,
"images": 100,
"links": 85,
"social": 90,
"security": 100,
"performance": 100,
"technical": 100
}
}Distributed under the MIT License. See LICENSE for more information.