Skip to content

Update general tab copy and move custom domain setting.#9

Open
paulber33 wants to merge 6 commits into
mainfrom
fix-issue-18-general-tab
Open

Update general tab copy and move custom domain setting.#9
paulber33 wants to merge 6 commits into
mainfrom
fix-issue-18-general-tab

Conversation

@paulber33

Copy link
Copy Markdown
Owner

This avoids confusion by keeping custom domain under Advanced, adds clearer onboarding content in General, and aligns browser tests with the updated tab behavior.

paulber33 and others added 4 commits June 18, 2026 14:06
## Summary

This PR further improves E2E workflow reliability and speed.

Fixes simpleanalytics#34

### 1. Playwright browser caching

E2E runs were repeatedly downloading Playwright browsers, which made CI
slower and more prone to transient download failures.

**Fix:** Added Playwright browser caching so repeated runs can reuse
downloaded browsers.

### 2. Azure archive mirror timeouts

Ubuntu package downloads from the Azure archive mirror sometimes time
out during Playwright dependency installation.

**Fix:** Switched CI package downloads to the main Ubuntu archive
mirror. This is a bit hacky, but it appears to be much faster and more
reliable.

### 3. WordPress readiness check

`wp-env start` does not always mean WordPress is fully ready before
tests continue.

**Fix:** Added a WordPress login page check before installing Playwright
and running tests.

---

## Security implications

- [x] No meaningful security impact. The cache only stores Playwright
browser binaries and is keyed by `pnpm-lock.yaml`.
- [ ] Has security impact - described as:

---

## Testing

- Verified workflow changes
- Triggered GitHub Actions E2E tests

---

## Checklist

- [x] Linked to an issue
- [x] Tested
- [x] Asked for a review
…mpleanalytics#32)

Expose explicit script prefix and exclusion reasons in rendered output,
and harden Playwright scenarios to avoid state leakage from excluded IP
settings across tests.

## Summary

Closes simpleanalytics#13

Clarifies script injection behavior by rendering explicit comments for
active and inactive tracking states. The inactive output now includes
the tracking rule that excluded the visitor, making the rendered page
easier to inspect and debug.

```html
<!-- Simple Analytics - 100% privacy-first analytics (official WordPress plugin) -->
<script src="https://scripts.simpleanalyticscdn.com/latest.js"></script>

<!-- Simple Analytics: Script not included because this visitor is excluded by tracking rule: Exclude User Role -->
<script src=".../resources/js/inactive.js"></script>

<!-- Simple Analytics: Script not included because this visitor is excluded by tracking rule: Exclude IP Address -->
<script src=".../resources/js/inactive.js"></script>
```

Also stabilizes browser coverage by isolating excluded IP settings
between Playwright scenarios.

## Security implications

- [x] No security impact
- [ ] Has security impact - described as:

## Testing

Covered by updated Playwright browser scenarios for active script
rendering, excluded user roles, and excluded IP addresses.

## Checklist

- [x] Linked to an issue
- [x] Tested
- [x] Asked for a review
Prevent undefined array key warnings by safely defaulting to null.

## Summary

Closes simpleanalytics#19

Updates the excluded IP tracking rule so `REMOTE_ADDR` safely falls back
to `null` when neither `HTTP_X_FORWARDED_FOR` nor `REMOTE_ADDR` is
available. This prevents PHP undefined array key warnings while
preserving the existing behavior of returning `false` when no IP address
is present.

## Security implications

- [x] No security impact
- [ ] Has security impact - described as:

## Testing

Manually reviewed and confirmed the fallback now avoids reading an
undefined `REMOTE_ADDR` key.

## Checklist

- [x] Linked to an issue
- [x] Tested
- [ ] Asked for a review

Co-authored-by: Cursor <cursoragent@cursor.com>
This reduces setup confusion by keeping custom domain under Advanced, adds clearer onboarding copy and dashboard links in General, hides Save Changes on that informational tab, and updates browser tests for the revised tab behavior.
@paulber33 paulber33 force-pushed the fix-issue-18-general-tab branch from 87aff0f to 5834a3f Compare June 18, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant