# WP speed plugins field research replication package

This package accompanies the manuscript: **Do WordPress speed plugins work in the field?: A causal adoption-cohort design for WP Rocket, NitroPack, LiteSpeed Cache and delay-JavaScript features using HTTP Archive and CrUX**.

It is designed to answer whether WP Rocket, NitroPack, LiteSpeed Cache and WP Rocket delay-JavaScript improve CrUX field outcomes after adoption. It intentionally does **not** contain fabricated treatment-effect estimates. The estimates should be produced by running the SQL extraction against public BigQuery datasets and then the matching/event-study scripts.

## Recommended workflow

1. Run `sql/00_discover_tables.sql` to verify current HTTP Archive and CrUX schemas.
2. For each crawl month and client, run `sql/01_extract_http_archive_markers.sql` and union outputs into `PROJECT.DATASET.http_archive_wp_plugin_markers`.
3. Run `sql/02_extract_crux_outcomes.sql` to extract CrUX outcomes.
4. Run `sql/03_build_event_panel.sql` to create:
   - `PROJECT.DATASET.delay_js_analysis_panel`: the unique origin-device-month panel for estimation.
   - `PROJECT.DATASET.delay_js_riskset_baseline`: the exact adoption-month/device baseline table for matching.
5. Export both tables as CSV.
6. Run matching and balance diagnostics, for example:

```bash
python analysis/01_match_balance.py \
  --panel delay_js_analysis_panel.csv \
  --baseline delay_js_riskset_baseline.csv \
  --treatment treated_cohort \
  --exact_cols candidate_event_month,device \
  --output_prefix delay_js_matched
```

7. Run group-time ATT estimation, for example:

```bash
Rscript analysis/02_event_study_did.R \
  delay_js_matched_panel.csv fast_inp event_month delay_js_fast_inp
```

8. Run `analysis/03_reporting_checks.py` to summarize pretrend and decision labels.

## Primary study choices

- Mobile/phone outcomes are primary; desktop is secondary.
- Event month is treated as ambiguous because CrUX uses a trailing collection period and HTTP Archive crawl timing is not perfectly aligned with adoption.
- INP analyses are primary for event/outcome months from March 2024 onward.
- Naive two-way fixed effects are not the primary estimator.
- Marker precision must be manually validated and reported before final estimates are interpreted.

## Data files

- `data/source_registry.csv`: all major sources and their role in the design.
- `data/marker_ontology.csv`: feature/plugin marker definitions and validation status.
- `data/analysis_schema.csv`: intended origin-month panel schema.

Prepared 22 June 2026.
