Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 56 additions & 4 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,35 @@ docs-api:
# Build documentation site
docs-build:
@echo "Building documentation..."
@echo "TODO: Implement docs site build"
@mkdir -p docs/_site
@# Convert AsciiDoc files to HTML
@for file in *.adoc docs/*.adoc; do \
if [ -f "$$file" ]; then \
echo "Converting $$file..."; \
asciidoctor -D docs/_site "$$file" 2>/dev/null || echo " (skipped - asciidoctor not installed)"; \
fi; \
done
@# Copy markdown files
@for file in docs/*.md; do \
if [ -f "$$file" ]; then \
cp "$$file" docs/_site/ 2>/dev/null || true; \
fi; \
done
@# Copy static assets
@cp -r docs/*.md docs/_site/ 2>/dev/null || true
@cp README.adoc docs/_site/index.adoc 2>/dev/null || true
@echo "✓ Documentation built in docs/_site/"

# Serve documentation locally
docs-serve:
@echo "Serving documentation..."
@echo "TODO: Implement docs site serve"
@just docs-build
@echo "Starting server at http://localhost:8000"
@echo "Press Ctrl+C to stop"
@cd docs/_site && python3 -m http.server 8000 2>/dev/null || \
(cd docs/_site && python -m SimpleHTTPServer 8000 2>/dev/null) || \
(cd docs/_site && deno run --allow-net --allow-read https://deno.land/std/http/file_server.ts) || \
echo "Error: No suitable HTTP server found (python3, python, or deno required)"

# === Cleanup ===

Expand Down Expand Up @@ -236,8 +259,37 @@ check-build-system:
# Check tests exist
check-tests:
@echo "Checking test infrastructure..."
@echo "⚠️ Tests need to be implemented"
@echo "TODO: Add comprehensive test suite"
@# Check for test directories
@test_dirs=0; \
for dir in tests test __tests__ spec; do \
if [ -d "$$dir" ] || [ -d "packages/*/$$dir" ] || [ -d "components/*/$$dir" ]; then \
test_dirs=$$((test_dirs + 1)); \
fi; \
done; \
if [ $$test_dirs -eq 0 ]; then \
echo "⚠️ No test directories found (tests/, test/, __tests__, spec/)"; \
else \
echo "✅ Found $$test_dirs test directories"; \
fi
@# Check for test files
@test_files=$$(find . -name "*.test.*" -o -name "*.spec.*" -o -name "test_*.py" -o -name "*_test.go" 2>/dev/null | grep -v node_modules | wc -l); \
if [ "$$test_files" -eq 0 ]; then \
echo "⚠️ No test files found"; \
else \
echo "✅ Found $$test_files test files"; \
fi
@# Check for test configuration
@if [ -f "jest.config.js" ] || [ -f "jest.config.ts" ] || [ -f "vitest.config.ts" ] || [ -f "pytest.ini" ] || [ -f "phpunit.xml" ]; then \
echo "✅ Test configuration found"; \
else \
echo "⚠️ No test configuration found"; \
fi
@# Check for test scripts in package.json
@if grep -q '"test"' package.json 2>/dev/null; then \
echo "✅ Test script configured in package.json"; \
else \
echo "⚠️ No test script in package.json"; \
fi

# === Utility ===

Expand Down
14 changes: 7 additions & 7 deletions docs/CAMPAIGN_MATERIALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ THE CASE:
- Machine-readable headers (proposed)

4. Proven Demand:
- [XXX,XXX] users of our tools (6 months)
- [XXX] companies actively monitoring
- [XXX] GitHub Action installs
- [INSERT_USER_COUNT] users of our tools (6 months)
- [INSERT_COMPANY_COUNT] companies actively monitoring
- [INSERT_INSTALL_COUNT] GitHub Action installs
- Growing developer awareness

PROPOSED IMPLEMENTATION:
Expand Down Expand Up @@ -301,10 +301,10 @@ WHAT WE OFFER:

DATA AVAILABLE:
After [6/12/18] months of operation:
- [XXX,XXX] sites scanned
- [XXX] paying API customers
- [XXX] developers using tools
- [XX]% average score improvement
- [INSERT_SCAN_COUNT] sites scanned
- [INSERT_CUSTOMER_COUNT] paying API customers
- [INSERT_DEVELOPER_COUNT] developers using tools
- [INSERT_IMPROVEMENT_PERCENT]% average score improvement

This demonstrates real demand for accessibility as a ranking factor.

Expand Down
109 changes: 106 additions & 3 deletions tools/wordpress-plugin/includes/class-a11y-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,113 @@ private function render_recent_scans() {
}

/**
* Render common violations
* Render common violations aggregated from all scanned posts.
*
* Displays a summary of the most frequent accessibility violations
* found across the site's content.
*/
private function render_common_violations() {
// This would aggregate violation data
echo '<p>' . __('Configure API key to track violations', 'accessibility-everywhere') . '</p>';
global $wpdb;

// Get all violation data from post meta
$violations_data = $wpdb->get_col(
"SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = '_a11y_violations' AND meta_value != ''"
);

if (empty($violations_data)) {
echo '<p>' . __('No violation data available yet. Scan some pages to see common issues.', 'accessibility-everywhere') . '</p>';
echo '<p class="description">' . __('Tip: Enable auto-scan in settings or use the Quick Scan feature.', 'accessibility-everywhere') . '</p>';
return;
}

// Aggregate violations by type
$violation_counts = [];
$violation_details = [];

foreach ($violations_data as $json_data) {
$violations = json_decode($json_data, true);
if (!is_array($violations)) {
continue;
}

foreach ($violations as $violation) {
$id = $violation['id'] ?? 'unknown';

if (!isset($violation_counts[$id])) {
$violation_counts[$id] = 0;
$violation_details[$id] = [
'description' => $violation['description'] ?? $id,
'impact' => $violation['impact'] ?? 'unknown',
'help' => $violation['help'] ?? '',
'helpUrl' => $violation['helpUrl'] ?? '',
];
}

// Count nodes/instances
$node_count = isset($violation['nodes']) ? count($violation['nodes']) : 1;
$violation_counts[$id] += $node_count;
}
}

if (empty($violation_counts)) {
echo '<p class="a11y-success">' . __('No violations found across scanned pages.', 'accessibility-everywhere') . '</p>';
return;
}

// Sort by count descending
arsort($violation_counts);

// Display top 10 violations
$top_violations = array_slice($violation_counts, 0, 10, true);

echo '<table class="widefat striped">';
echo '<thead><tr>';
echo '<th>' . esc_html__('Issue', 'accessibility-everywhere') . '</th>';
echo '<th>' . esc_html__('Impact', 'accessibility-everywhere') . '</th>';
echo '<th>' . esc_html__('Count', 'accessibility-everywhere') . '</th>';
echo '</tr></thead>';
echo '<tbody>';

foreach ($top_violations as $violation_id => $count) {
$details = $violation_details[$violation_id];
$impact_class = 'a11y-impact-' . sanitize_html_class($details['impact']);

echo '<tr>';
echo '<td>';

if (!empty($details['helpUrl'])) {
echo '<a href="' . esc_url($details['helpUrl']) . '" target="_blank" rel="noopener noreferrer">';
echo esc_html($details['description']);
echo ' <span class="dashicons dashicons-external" aria-hidden="true"></span>';
echo '<span class="screen-reader-text">' . esc_html__('(opens in new tab)', 'accessibility-everywhere') . '</span>';
echo '</a>';
} else {
echo esc_html($details['description']);
}

if (!empty($details['help'])) {
echo '<p class="description">' . esc_html($details['help']) . '</p>';
}

echo '</td>';
echo '<td><span class="a11y-impact-badge ' . esc_attr($impact_class) . '">' . esc_html(ucfirst($details['impact'])) . '</span></td>';
echo '<td><strong>' . esc_html(number_format_i18n($count)) . '</strong></td>';
echo '</tr>';
}

echo '</tbody></table>';

// Show total counts summary
$total_violations = array_sum($violation_counts);
$unique_issues = count($violation_counts);

echo '<p class="a11y-summary">';
printf(
/* translators: 1: total violation count, 2: unique issue count */
esc_html__('Total: %1$s violations across %2$s unique issue types.', 'accessibility-everywhere'),
'<strong>' . esc_html(number_format_i18n($total_violations)) . '</strong>',
'<strong>' . esc_html(number_format_i18n($unique_issues)) . '</strong>'
);
echo '</p>';
}
}
Loading
Loading