A comprehensive JavaScript tool for analyzing WordPress sites without admin access. Detects WordPress version, active theme, installed plugins, and checks for outdated components.
- WordPress Detection: Identifies if a site is running WordPress
- Version Detection: Determines WordPress core version using multiple methods
- Theme Analysis: Detects active theme name, version, and author
- Plugin Discovery: Finds installed plugins and their versions
- Outdated Component Detection: Checks if plugins are outdated compared to latest versions
- Comprehensive Reporting: Generates detailed analysis reports in multiple formats
- PDF Generation: Creates professional PDF reports using Puppeteer π
- Email Integration: Send analysis reports via email with PDF attachments π
- Performance Analysis: PageSpeed Insights integration with Core Web Vitals π
- Meta generator tags (High confidence)
- HTML structure analysis (High confidence) π
- WordPress-specific paths and files
- Admin bar and login form detection
- Core WordPress file references
- Asset path analysis (High confidence) π
- Script and stylesheet detection
- WordPress-specific asset identification
- JavaScript variable detection (High confidence) π
- WordPress JS objects and functions
- Inline script analysis
- CSS class and ID analysis (Medium confidence) π
- WordPress-specific body classes
- Theme and plugin class detection
- HTML comment analysis (Medium confidence) π
- WordPress-generated comments
- REST API endpoint detection (High confidence) π
- WordPress file detection (High confidence) π
- Core file accessibility testing
- Configuration file detection
- HTTP header analysis (High confidence) π
- WordPress-specific headers
- Server header analysis
- Sitemap analysis (Medium confidence) π
- Robots.txt analysis (Medium confidence) π
- Feed endpoint detection (Medium confidence) π
- Admin endpoint detection (High confidence) π
- Plugin/theme directory detection (High confidence) π
- Inline script analysis (Medium confidence) π
- Meta generator tags (High confidence) - Most reliable
- WordPress core files (High confidence) - Direct version.php access π
- REST API endpoints (High confidence) - Official WordPress API
- README.html file analysis (High confidence) - Standard WordPress file
- OPML file checking (Medium confidence) - WordPress-specific format
- RSS feed analysis (Medium confidence) - WordPress-generated feeds
- WordPress comments (Medium confidence) - WordPress-specific HTML comments π
Version Validation: All detected versions are validated against WordPress version patterns to prevent false positives from plugin/theme versions.
- CSS stylesheet links analysis (Most reliable)
- Theme header parsing from style.css
- Body class examination
- Asset path scanning
- Template hints in HTML
- Asset path scanning (Scripts/stylesheets) - High confidence
- Advanced asset introspection (High confidence) π
- HTTP range requests for efficient file analysis
- Source map following and analysis
- Plugin header extraction from asset files
- Version detection from compressed code
- Optimized parallel processing (60% faster) π
- Enhanced plugin version detection (High confidence) π
- Multi-method version extraction (plugin files, readme, assets, endpoints)
- Intelligent version validation and filtering
- False positive detection and removal
- REST API endpoint detection (High confidence) π
- JavaScript variable detection (High confidence) π
- CSS class and ID patterns (Medium confidence)
- Meta tag analysis (Medium confidence) π
- HTML comment analysis (Medium confidence)
- Content pattern matching (Medium confidence)
- Plugin header parsing (When accessible)
- SEO: Yoast SEO, Rank Math SEO
- Page Builders: Elementor, WPBakery, Visual Composer
- E-commerce: WooCommerce
- Forms: Contact Form 7, WPForms, Gravity Forms, Ninja Forms
- Caching: WP Rocket, WP Super Cache, W3 Total Cache, LiteSpeed Cache
- Security: Wordfence, Jetpack, Akismet
- Optimization: Autoptimize, WP-Optimize, Smush
- Sliders: Slider Revolution, LayerSlider
- Fields: Advanced Custom Fields
- Email: Mailchimp, Constant Contact
- And many more...
- Clone or download the project
- Install dependencies:
npm install# Basic usage (console output)
node cli.js example.com
# Generate HTML report
node cli.js https://wordpress-site.com --html
# Generate JSON report
node cli.js example.com --json
# Save to specific file
node cli.js example.com --output my-report.html
# Local development site
node cli.js http://localhost/wordpress --htmlconst WordPressAnalyzer = require('wordpress-site-analyzer');
async function analyzeWordPressSite() {
const analyzer = new WordPressAnalyzer();
try {
const results = await analyzer.analyzeSite('https://example.com');
console.log('WordPress detected:', results.wordpress.isWordPress);
console.log('Version:', results.version?.version);
console.log('Theme:', results.theme?.name);
console.log('Plugins found:', results.plugins.length);
// Generate formatted report
const report = analyzer.generateReport(results);
console.log(report);
// Generate JSON report
const jsonReport = analyzer.generateJsonReport(results);
console.log(JSON.stringify(jsonReport, null, 2));
// Generate HTML report
const htmlReport = analyzer.generateHtmlReport(results);
// Generate PDF report
const pdfBuffer = await analyzer.generatePdfReport(results);
const fs = require('fs');
const path = require('path');
// Create reports directory if it doesn't exist
const reportsDir = 'reports';
if (!fs.existsSync(reportsDir)) {
fs.mkdirSync(reportsDir);
}
const htmlFilename = path.join(reportsDir, 'analysis-report.html');
fs.writeFileSync(htmlFilename, htmlReport);
console.log(`HTML report saved to ${htmlFilename}`);
// Save PDF report
const pdfFilename = path.join(reportsDir, 'analysis-report.pdf');
fs.writeFileSync(pdfFilename, pdfBuffer);
console.log(`PDF report saved to ${pdfFilename}`);
} catch (error) {
console.error('Analysis failed:', error.message);
}
}
analyzeWordPressSite();Start the web server to access the API endpoints:
# Start the web server
npm run web
# Server will be available at http://localhost:3000POST /api/analyze - Standard analysis
curl -X POST http://localhost:3000/api/analyze \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'POST /api/analyze/pdf - Generate PDF report π
curl -X POST http://localhost:3000/api/analyze/pdf \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
--output report.pdfPOST /api/analyze/email - Send analysis report via email π
curl -X POST http://localhost:3000/api/analyze/email \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "email": "client@example.com"}'GET /api/health - Health check
curl http://localhost:3000/api/health# Print-optimized PDF
curl -X POST http://localhost:3000/api/analyze/pdf \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "format": "print"}' \
--output print-report.pdf
# Landscape PDF
curl -X POST http://localhost:3000/api/analyze/pdf \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "format": "landscape"}' \
--output landscape-report.pdf
# Custom filename
curl -X POST http://localhost:3000/api/analyze/pdf \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "format": "with-filename", "filename": "client-report.pdf"}' \
--output client-report.pdf# Send standard report via email
curl -X POST http://localhost:3000/api/analyze/email \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "email": "client@example.com"}'
# Send print-optimized report via email
curl -X POST http://localhost:3000/api/analyze/email \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "email": "client@example.com", "format": "print"}'
# Test email configuration
curl http://localhost:3000/api/email/config
# Send test email
curl -X POST http://localhost:3000/api/email/test \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com"}'All test scripts are organized in the tests/ directory for better maintainability:
npm run test-pdf # Run all PDF tests
npm run test-pdf-direct # Direct PDF generation only
npm run test-pdf-api # API endpoint tests onlynpm run test-email # Run all email tests
npm run test-email-service # Email service tests only
npm run test-email-api # Email API tests only
npm run test-email-workflow # End-to-end workflow test
npm run email-setup # Display setup instructionsnpm run test-api # Test all API endpointstests/
βββ pdf/ # PDF generation tests
βββ email/ # Email integration tests
βββ api/ # API endpoint tests
βββ README.md # Detailed testing guide
See tests/README.md for comprehensive testing documentation.
WordPress Site Analysis Report
=====================================
URL: https://example.com
Analysis Date: 12/1/2023, 10:30:00 AM
Is WordPress: Yes
WordPress Version:
Version: 6.4.1
Detection Method: meta_generator
Confidence: high
Active Theme:
Name: twentytwentythree
Version: 1.3
Author: WordPress Team
Path: /wp-content/themes/twentytwentythree/
Detected Plugins (3):
1. contact-form-7
Version: 5.8.4
Latest Version: 5.8.6
Outdated: Yes
Author: Takayuki Miyoshi
2. yoast-seo
Version: 21.5
Latest Version: 21.7
Outdated: Yes
Author: Team Yoast
3. elementor
Version: 3.17.3
Latest Version: 3.17.3
Outdated: No
Author: Elementor.com
{
"meta": {
"url": "https://example.com",
"analyzedAt": "2023-12-01T15:30:00.000Z",
"duration": 2340,
"analyzer": {
"name": "WordPress Site Analyzer",
"version": "2.0.0"
}
},
"wordpress": {
"detected": true,
"confidence": "high",
"score": 95,
"indicators": [
{
"type": "meta_generator",
"description": "WordPress 6.4.1",
"confidence": "high"
}
]
},
"version": {
"detected": true,
"version": "6.4.1",
"method": "meta_generator",
"confidence": "high"
},
"theme": {
"detected": true,
"name": "twentytwentythree",
"displayName": "Twenty Twenty-Three",
"version": "1.3",
"author": "WordPress Team"
},
"plugins": {
"statistics": {
"total": 3,
"outdated": 1,
"upToDate": 2
},
"list": [
{
"name": "contact-form-7",
"displayName": "Contact Form 7",
"version": "5.8.4",
"latestVersion": "5.8.6",
"isOutdated": true,
"confidence": "high",
"category": "forms"
}
]
}
}The analyzer can be customized by modifying the constructor options:
const analyzer = new WordPressAnalyzer({
timeout: 15000, // 15 seconds (default: 10000)
userAgent: 'Custom WordPress Analyzer 2.0',
includePlugins: true, // Include plugin detection (default: true)
includeTheme: true, // Include theme detection (default: true)
includeVersion: true, // Include version detection (default: true)
checkVersions: true, // Check for outdated versions (default: true)
maxConcurrentRequests: 3 // For multiple site analysis (default: 5)
});The tool includes comprehensive error handling for:
- Network timeouts
- Invalid URLs
- Non-WordPress sites
- Inaccessible resources
- Rate limiting
- The tool includes delays between requests to be respectful to target servers
- Uses standard web browser User-Agent strings
- Only accesses publicly available resources
- Does not attempt to exploit vulnerabilities
- Only detects publicly accessible information
- Some plugins may not be detectable if they don't leave public traces
- Premium/private plugins may not have version information available
- Heavily cached sites might show outdated information
- Some detection methods may be blocked by security plugins
- Security Auditing: Identify outdated components that may have vulnerabilities
- Competitive Analysis: Understand technology stack of competitor websites
- Migration Planning: Inventory existing WordPress installations
- Compliance Checking: Ensure sites meet version requirements
- Development Research: Analyze implementation patterns
The analyzer supports three output formats:
Beautiful, professional HTML reports with:
- Interactive Design: Clean, modern interface with responsive layout
- Plugin Management: Detailed plugin status with version comparisons
- Professional Styling: Print-ready format for documentation
- Mobile Friendly: Responsive design works on all devices
# Generate HTML report (saved to reports/ directory)
node cli.js example.com --html
# Save to custom file in reports directory
node cli.js example.com --output my-analysis.html
# Save to specific path (outside reports directory)
node cli.js example.com --output /path/to/custom/report.htmlDetailed terminal output with:
- Comprehensive analysis summary
- Plugin status overview
- Easy-to-read formatting
Structured data format with:
- Complete analysis data
- Performance insights
- API-friendly format
const analyzer = new WordPressAnalyzer();
const sites = ['site1.com', 'site2.com', 'site3.com'];
const results = await analyzer.analyzeMultipleSites(sites);const analyzer = new WordPressAnalyzer();
const result = await analyzer.quickDetect('example.com');
console.log(`${result.url}: ${result.isWordPress ? 'WordPress' : 'Not WordPress'}`);const { detectors, utils } = require('wordpress-site-analyzer');
const { HttpClient } = utils;
const httpClient = new HttpClient();
const versionDetector = new detectors.VersionDetector(httpClient);const analyzer = new WordPressAnalyzer();
const results = await analyzer.analyzeSite('example.com');
// Console report
console.log(analyzer.generateReport(results));
// Compact summary
console.log(analyzer.generateSummary(results));
// HTML report (automatically saved to reports/ directory)
const fs = require('fs');
const path = require('path');
if (!fs.existsSync('reports')) fs.mkdirSync('reports');
const htmlReport = analyzer.generateHtmlReport(results);
fs.writeFileSync(path.join('reports', 'report.html'), htmlReport);
// JSON report with options
const jsonReport = analyzer.generateJsonReport(results, {
includeRawData: false
});wordpress-site-analyzer/
βββ src/
β βββ config/ # Configuration and constants
β βββ detectors/ # WordPress detection modules
β βββ utils/ # Utility functions
β βββ reporters/ # Report generation
β βββ wordpress-analyzer.js # Main analyzer class
βββ reports/ # Generated analysis reports (auto-created)
βββ cli.js # Command-line interface
βββ index.js # Main entry point
βββ README.md # Documentation
Planned features for future versions:
- Security vulnerability database integration
- Performance metrics analysis
- SEO plugin detection
- Custom hook and filter detection
- Database analysis (if accessible)
- Multi-site network detection
- WordPress REST API analysis
- Security header analysis
Feel free to contribute by:
- Adding new detection methods
- Improving accuracy of existing detectors
- Adding support for more plugins/themes
- Enhancing error handling
- Improving documentation
MIT License - see LICENSE file for details
This tool is for educational and legitimate security assessment purposes only. Always ensure you have permission to analyze target websites. The authors are not responsible for any misuse of this tool.