You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(fonts): preserve source stylesheet on Google Fonts cap overflow
Replace hard-fail with tagged-union return for resolve_google_font_faces()
and embed_font_sources(). On cap violation, emit assets/css/embedded-fonts.css
with original Google @import, surface font_materialization_partial_preserved
diagnostic with observed_bytes, limit_bytes, and url. Producer path unchanged.
Fixes#732
1. Restored `review lint` alongside `review test` in the Homeboy CI matrix.
6
-
2. Applied PHPCBF to current production PHP, resolving 4,021 mechanical findings introduced before the gate was restored.
7
-
3. Recorded the remaining 237 findings in Homeboy's repository baseline so unchanged debt passes and new findings fail the gate.
8
-
4. Removed the stale PHPStan baseline entry for the deleted transformer adapter.
9
-
5. Dropped the unsupported second argument to `ArtifactCompiler::compile()` while retaining `compiler_options` as an explicitly diagnosed compatibility no-op.
10
-
6. Preserved the resumable import and SVG font behavior merged after the contributor branch was opened.
5
+
A valid compiler font plan that exceeds SSI's fixed Google Fonts byte caps (CSS > 256 KiB or aggregate woff2 > 4 MiB) used to hard-abort the entire import. Now the import falls back to a preserved `@import` of the original Google stylesheet and continues, with a diagnostic that reports the exact cap reason and observed bytes.
11
6
12
-
## Verification
7
+
## Install
8
+
9
+
1. Back up your existing `wp-content/plugins/static-site-importer/` directory.
10
+
2. Unzip `static-site-importer-fix-732.zip` over your WordPress install so the new files land at `wp-content/plugins/static-site-importer/`.
11
+
3. Activate (or reactivate) **Static Site Importer** from **Plugins**.
12
+
4. Make sure the **Blocks Engine** PHP transformer dependency is installed (`composer install` from the plugin root if not already).
13
+
14
+
## Test 1: standalone smoke (headless)
15
+
16
+
From the plugin root:
17
+
18
+
```bash
19
+
php tests/smoke-google-fonts-cap-fallback.php
20
+
php tests/smoke-webfont-producer-consumer.php
21
+
```
22
+
23
+
The first new smoke covers CSS-too-large and aggregate-too-large fallbacks. The second is the producer-path regression sentinel and must still pass.
- The matrix output must NOT contain `static_site_importer_font_materialization_failed`.
45
+
- The static front page is created.
46
+
- Browser surfaces (Chrome/SVG parity surfaces) render text using the Noto Sans JP / Noto Naskh Arabic families.
47
+
- The Homeboy evidence run shows a `font_materialization_partial_preserved` diagnostic with one of these inner reasons: `google_fonts_stylesheet_preserved_due_to_size` (CSS > 256 KiB) or `google_fonts_payloads_partial_preserved` (aggregate woff2 > 4 MiB). The diagnostic's `details.observed_bytes`, `details.limit_bytes`, and `details.url` fields should be populated.
48
+
49
+
## Test 4: happy path regression
50
+
51
+
Run a small Google Fonts fixture (1 family, 1 weight) through any normal import path. Embedded font asset should still be downloaded and embedded as a `data:font/woff2;base64,…` URL inside `assets/css/embedded-fonts.css`. No `font_materialization_partial_preserved` diagnostic should appear.
52
+
53
+
## Rollback
54
+
55
+
If something goes wrong, deactivate the plugin and restore the backup from step 1 of Install.
21
56
22
-
- Homeboy lint passes with no drift from the 237-finding baseline.
23
-
- The test manifest passes 42 selected checks: 34 standalone PHP and eight Node lanes.
24
-
- Every production PHP file passes syntax validation.
57
+
## Files touched in this fix
25
58
26
-
## Ratcheting
59
+
-`includes/class-static-site-importer-font-materializer.php` — return shape change in `resolve_google_font_faces()` and `embed_font_sources()`; new preservation branch in `prepare_overlay()`; new `diagnostic_with_detail()` helper
60
+
-`tests/smoke-google-fonts-cap-fallback.php` — new standalone PHP smoke
61
+
-`test-manifest.json`, `homeboy-test-manifest.json` — registered the new smoke
27
62
28
-
When existing findings are repaired, run `homeboy review lint --ratchet` to remove resolved fingerprints from `homeboy.json`. New findings fail CI without requiring the existing debt to be repaired in the same change.
63
+
Producer path (`materialize_producer_faces`) is untouched.
0 commit comments