# ๐ Webpage Quality Analyzer
> **High-performance webpage quality analysis with 115 comprehensive metrics across 8 built-in profiles**
>
> **Latest: v1.0.2** - Profile scoring improvements, stricter login page validation, enhanced baseline logic
[](https://crates.io/crates/webpage_quality_analyzer)
[](https://docs.rs/webpage_quality_analyzer)
[](https://www.npmjs.com/package/@webpage-quality-analyzer/core)
[](LICENSE)
[](https://github.com/NotGyashu/webpage-quality-analyser/actions)
A blazing-fast, multi-platform library for analyzing webpage quality with **115 metrics** (92 HTML-based + 23 network-based) organized across **7 categories**, with **8 professionally-tuned profiles** for different page types.
> **โ ๏ธ Breaking Change in v1.0.2**: Product profile reverted to e-commerce focus. Software/SaaS pages should use "general" or "homepage" profiles instead. See [CHANGELOG.md](CHANGELOG.md#breaking-changes) for migration guide.
---
## โจ Features
- **๐ High Performance**: Analyze typical webpages in <100ms, large pages in <1s
- **๐ 115 Comprehensive Metrics**: Content, SEO, Performance, Accessibility, and more
- **๐ฏ 8 Built-in Profiles**: Optimized for news, blogs, products, portfolios, etc.
- **๐ Multi-Platform**: Rust, WebAssembly (Browser/Node.js), C++, CLI tool
- **โก Parallel Batch Processing**: 180+ pages/second with concurrent analysis
- **๐จ Customizable Scoring**: Adjust weights, thresholds, penalties, bonuses
- **๐ฑ Mobile-Friendly**: Responsive design and mobile usability metrics
- **โฟ Accessibility**: WCAG 2.1 AA/AAA compliance checking
- **๐ Security**: HTTPS, CSP, HSTS, XSS protection validation
- **๐ Real-time Analysis**: No external API calls, runs entirely locally
---
## ๐ Quick Start
### Rust
```toml
[dependencies]
webpage_quality_analyzer = "1.0.0"
```
```rust
use webpage_quality_analyzer::analyze;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let report = analyze("https://example.com", None).await?;
println!("Score: {}/100, Quality: {}", report.score, report.verdict);
Ok(())
}
```
### JavaScript/TypeScript (WASM)
```bash
npm install @webpage-quality-analyzer/core
```
```javascript
import init, { WasmAnalyzer } from '@webpage-quality-analyzer/core';
await init();
const analyzer = new WasmAnalyzer();
const report = await analyzer.analyze('<html>...</html>');
console.log(`Score: ${report.score}/100`);
```
### C++
```bash
wget https://github.com/NotGyashu/webpage-quality-analyser/releases/download/v1.0.0/cpp-package-v1.0.0-linux-x64.tar.gz
tar -xzf cpp-package-v1.0.0-linux-x64.tar.gz
```
```cpp
#include "webpage_quality_analyzer/webpage_quality_analyzer.hpp"
int main() {
auto report = wqa::Analyzer::analyze("https://example.com");
std::cout << "Score: " << report.score() << "/100" << std::endl;
return 0;
}
```
### CLI Tool
```bash
# Linux/macOS
wget https://github.com/NotGyashu/webpage-quality-analyser/releases/download/v1.0.0/wqa-cli-v1.0.0-linux-x64.tar.gz
tar -xzf wqa-cli-v1.0.0-linux-x64.tar.gz
sudo mv wqa /usr/local/bin/
# Analyze a webpage
wqa analyze --url https://example.com --profile news --output report.json
```
---
## ๐ Documentation
| **[๐ Documentation Index](DOCUMENTATION_INDEX.md)** | Complete documentation hub |
| **[๐ Installation Guide](docs/getting-started/INSTALLATION.md)** | Platform-specific setup |
| **[๐ฏ First Analysis Tutorial](docs/getting-started/FIRST_ANALYSIS.md)** | 5-minute quick start |
| **[๐ Understanding Metrics](docs/getting-started/UNDERSTANDING_METRICS.md)** | All 115 metrics explained |
| **[๐๏ธ Build & Release Guide](docs/guides/BUILD_AND_RELEASE_GUIDE.md)** | Complete build workflows |
| **[๐ง API Reference](docs/api-reference/)** | Complete API documentation |
| **[๐ก Examples](examples/)** | 40+ working code examples |
---
## ๐ฏ Platform Support Matrix
| **Rust Library** | All 115 | โ
Tokio | โ
Yes | ๐ข Production |
| **WASM/Browser** | 92 HTML | โ
Promise | โ
Yes | ๐ข Production |
| **C++ FFI** | All 115 | โ Blocking | โ
Yes | ๐ข Production |
| **CLI Tool** | All 115 | โ
Tokio | โ
Yes | ๐ข Production |
| **Python** | All 115 | ๐ง Planned | ๐ง Planned | ๐ก Roadmap |
**Note**: WASM provides 92 HTML-based metrics (network metrics require server-side fetching).
---
## ๐ Metrics Overview
### 115 Total Metrics
```
HTML-Based Metrics (92) Network-Based Metrics (23)
โโโ Content (11) โโโ Performance (11)
โ โโโ Word count โ โโโ Largest Contentful Paint
โ โโโ Readability โ โโโ First Contentful Paint
โ โโโ Sentence count โ โโโ Time to Interactive
โ โโโ ... โ โโโ ...
โโโ Structure (5) โโโ Security (6)
โโโ Media (8) โ โโโ HTTPS enabled
โโโ SEO (9) โ โโโ CSP header
โโโ Links (8) โ โโโ ...
โโโ Technical (6) โโโ Analytics (3)
โโโ Accessibility (7) โโโ Error Handling (3)
โโโ Mobile (4)
โโโ Authority (3)
โโโ Forms (6)
โโโ Structured Data (4)
โโโ Branding (4)
โโโ User Experience (5)
โโโ Business (3)
โโโ Internationalization (2)
```
**See detailed breakdown**: [Metrics Reference โ](docs/getting-started/UNDERSTANDING_METRICS.md)
---
## ๐จ Built-in Profiles
Choose the right profile for your page type to get optimized scoring:
| **news** | News articles | 35% | 25% | Freshness, metadata, social sharing |
| **blog** | Blog posts | 30% | 25% | Readability, structure, engagement |
| **product** | E-commerce | 20% | 30% | Images, structured data, conversion |
| **portfolio** | Personal sites | 25% | 20% | Visual design, branding, projects |
| **content_article** | Long-form content | 40% | 20% | Word count, depth, citations |
| **login_page** | Authentication | 10% | 5% | Security, forms, usability |
| **homepage** | Site homepages | 20% | 30% | Navigation, branding, performance |
| **general** | Default | 30% | 25% | Balanced across all categories |
**Learn more**: [Choosing Profiles โ](docs/getting-started/CHOOSING_PROFILES.md)
---
## ๐ Key Features
### 3-Tier API Design
**Level 1: Simple** - One function call
```rust
let report = analyze("https://example.com", None).await?;
```
**Level 2: Builder** - Custom configuration
```rust
let analyzer = Analyzer::<DefaultRuntime>::builder()
.with_profile_name("news")?
.enable_linkcheck(true)
.build()?;
```
**Level 3: Config Files** - YAML/JSON/TOML
```rust
let analyzer = from_config_file("config.yaml")?;
```
### Advanced Customization
**Adjust Metric Weights**:
```rust
analyzer.with_metric_weight("word_count", 1.5)?
.with_metric_weight("readability_score", 2.0)?
```
**Custom Penalties & Bonuses**:
```rust
analyzer.add_penalty_below("word_count", 300.0, 10.0)?
.add_bonus_above("readability_score", 80.0, 5.0)?
```
**Output Filtering** (98.8% size reduction):
```rust
let compact_report = analyzer.run_compact(url, html).await?;
```
### Batch Processing
**Parallel Analysis** (up to 180+ pages/second):
```rust
let reports = analyze_batch_urls_parallel(urls, None).await?;
```
**High-Performance Mode**:
```rust
let reports = analyze_batch_high_performance(urls).await?;
```
---
## ๐ง Use Cases
- **๐ SEO Auditing**: Analyze title, meta tags, headings, structured data
- **๐ Content Quality**: Measure readability, word count, structure
- **โฟ Accessibility**: Check WCAG compliance, ARIA labels, contrast
- **โก Performance**: Track Core Web Vitals, page size, load times
- **๐ค CI/CD Integration**: Automated quality checks in build pipelines
- **๐ Competitive Analysis**: Compare your pages against competitors
- **๐จ Monitoring**: Track quality metrics over time
- **๐ฏ A/B Testing**: Measure quality impact of design changes
---
## ๐ Performance
Benchmarked on typical webpages:
| Small (<10KB) | 92 HTML | <100ms | <10MB | 200+ pages/s |
| Medium (50KB) | 115 Full | <500ms | <15MB | 150+ pages/s |
| Large (100KB+) | 115 Full | <1000ms | <20MB | 100+ pages/s |
**Optimizations**:
- โ
DOM caching (elements cached, reused 115 times)
- โ
Connection pooling (persistent HTTP connections)
- โ
Parallel batch processing (Arc<Semaphore>, max 10 concurrent)
- โ
Zero-copy metric scorers (Arc<dyn MetricScorer>)
- โ
Optimized JSON serialization (field selectors)
---
## ๐ ๏ธ Development
### Building from Source
```bash
# Clone repository
git clone https://github.com/NotGyashu/webpage-quality-analyser.git
cd webpage-quality-analyser
# Build Rust library
cargo build --release
# Build WASM
wasm-pack build --target bundler --no-default-features --features wasm
# Build C++ bindings
cargo build --release --features ffi
./scripts/build_ffi.sh
# Build CLI tool
cargo build --release --bin wqa --features cli
# Run tests
cargo test --all-features
# Run benchmarks
cargo bench
```
### Testing
```bash
# All tests (40+ test files)
cargo test
# Specific test suites
cargo test comprehensive_metrics # 115-metric validation
cargo test phase3 # Profile-aware scoring
cargo test output_customization # Field selectors
cargo test weight_customization # Metric weight adjustment
# WASM tests
wasm-pack test --headless --firefox
# C++ examples
cd build && ./bindings/cpp/examples/level1_simple
```
**See**: [Development Guide โ](docs/development/setup.md)
---
## ๐ค Contributing
We welcome contributions! See [CONTRIBUTING.md](docs/contributing.md) for guidelines.
### Areas for Contribution
- ๐ Bug fixes and issue reporting
- ๐ Documentation improvements
- ๐ New language bindings (Python, Go, etc.)
- ๐ Additional metrics and profiles
- โก Performance optimizations
- ๐งช Test coverage expansion
---
## ๐ License
Licensed under either of:
- **Apache License, Version 2.0** ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- **MIT License** ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
---
## ๐ Links
- **Documentation**: [docs.rs/webpage_quality_analyzer](https://docs.rs/webpage_quality_analyzer)
- **Crates.io**: [crates.io/crates/webpage_quality_analyzer](https://crates.io/crates/webpage_quality_analyzer)
- **npm**: [npmjs.com/package/@webpage-quality-analyzer/core](https://www.npmjs.com/package/@webpage-quality-analyzer/core)
- **GitHub**: [github.com/NotGyashu/webpage-quality-analyser](https://github.com/NotGyashu/webpage-quality-analyser)
- **Issues**: [github.com/NotGyashu/webpage-quality-analyser/issues](https://github.com/NotGyashu/webpage-quality-analyser/issues)
- **Discussions**: [github.com/NotGyashu/webpage-quality-analyser/discussions](https://github.com/NotGyashu/webpage-quality-analyser/discussions)
---
## ๐ Acknowledgments
Built with:
- [Rust](https://www.rust-lang.org/) - Systems programming language
- [Tokio](https://tokio.rs/) - Async runtime
- [wasm-bindgen](https://rustwasm.github.io/wasm-bindgen/) - WASM bindings
- [tl](https://crates.io/crates/tl) - HTML parsing
- [readability](https://crates.io/crates/readability) - Content extraction
Special thanks to the Rust community and all contributors!
---
## ๐ Project Stats
- **Lines of Code**: ~25,000+ (Rust)
- **Test Coverage**: 40+ test files, 279+ tests
- **Benchmarks**: 15+ performance benchmarks
- **Documentation**: 50+ markdown files
- **Examples**: 40+ working examples
- **Supported Platforms**: 4 (Rust, WASM, C++, CLI)
---
## ๐ฏ Roadmap
### v1.1.0 (Q1 2026)
- [ ] Python bindings (PyO3)
- [ ] Enhanced NLP features
- [ ] Real-time browser extension
- [ ] Cloud API service
### v1.2.0 (Q2 2026)
- [ ] Machine learning-based scoring
- [ ] Historical trend analysis
- [ ] Competitive benchmarking database
- [ ] Advanced visualization tools
**See complete roadmap**: [docs/ROADMAP.md](docs/ROADMAP.md)
---
## โญ Star History
If you find this project useful, please consider giving it a star! โญ
---
**Made with โค๏ธ by [@NotGyashu](https://github.com/NotGyashu) and [contributors](https://github.com/NotGyashu/webpage-quality-analyser/graphs/contributors)**
---
**Navigation**: [Documentation Index โ](DOCUMENTATION_INDEX.md) | [Installation Guide โ](docs/getting-started/INSTALLATION.md) | [Quick Start Tutorial โ](docs/getting-started/FIRST_ANALYSIS.md)