Skip to content

Document that third parties depend on data-platform="wordpress" - #63

Merged
adriaandotcom merged 1 commit into
mainfrom
docs/keep-data-platform-attribute
Nov 18, 2026
Merged

adriaandotcom merged 1 commit into
mainfrom
docs/keep-data-platform-attribute

Conversation

@simpleanalytics-agent

@simpleanalytics-agent simpleanalytics-agent commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #62

Third parties detect Simple Analytics by data-platform="wordpress", for example Cookie Rocks. This adds comments at the attribute and at its regression check, so nobody removes or renames it.

 // src/Scripts/AnalyticsScript.php
 return array_filter([
+    // Never remove or rename data-platform="wordpress". Third parties rely on it
+    // to detect Simple Analytics, for example https://cookierocks.com/.
     'data-platform'     => 'wordpress',
 // tests/Regression/script-attributes.php
+// Third parties such as https://cookierocks.com/ detect Simple Analytics by data-platform="wordpress".
 $tag = wp_get_script_tag(['src' => 'https://example.test/latest.js', 'id' => 'simpleanalytics-js']);
 sa_assert(strpos($tag, 'data-platform="wordpress"') !== false, ...);

Evidence

Comments only, with no behavior change. git diff --check passes. PHP isn't installed on the machine that made this change, so CI's lint and test matrix is the only PHP check.

Security implications

  • No security impact
  • Has security impact - described as:

Merge Danger

Door: two-way

Blast Radius: none

Adds comments only. The script tag output is unchanged.

Summary by CodeRabbit

  • Documentation
    • Clarified that the data-platform="wordpress" attribute should remain unchanged because third parties use it to detect Simple Analytics. No runtime behavior changed.

Third parties such as https://cookierocks.com/ detect Simple Analytics by
the data-platform="wordpress" attribute, so it must never be removed or
renamed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change documents that third parties use the script tag’s data-platform="wordpress" attribute to detect Simple Analytics. It adds comments in the attribute implementation and its regression test. Runtime output is unchanged.

Changes: Attribute documentation

Layer / File(s) Summary
Document third-party attribute use
src/Scripts/AnalyticsScript.php, tests/Regression/script-attributes.php
Comments note that third parties use data-platform="wordpress" to detect Simple Analytics. The script output is unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Suggested labels: change: routine

Suggested reviewers: jdevalk, adriaandotcom

Merge Risk: Minimal · up to b271b

This change only adds documentation comments explaining that third parties rely on the data-platform="wordpress" attribute. Script output is unchanged, so there is no user or production impact and the change is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: documenting that third parties depend on data-platform="wordpress". The changeset adds comments in AnalyticsScript.php and a regression test that say third parties us…
Linked Issues check Passed Issue #62 asks that the plugin document that third parties depend on data-platform="wordpress", so the attribute is not removed or renamed. The reviewed head of src/Scripts/AnalyticsScript.php contain…
Out of Scope Changes check Passed The changes are comments only. The comment in src/Scripts/AnalyticsScript.php documents the data-platform attribute named in #62. The comment in tests/Regression/script-attributes.php, as reported by …
Full details: Title check

Explanation

The title states the main change: documenting that third parties depend on data-platform="wordpress". The changeset adds comments in AnalyticsScript.php and a regression test that say third parties use this attribute to detect Simple Analytics. The PR is comments-only, and the title matches that. The title is specific and is not vague.

Full details: Linked Issues check

Explanation

Issue #62 asks that the plugin document that third parties depend on data-platform="wordpress", so the attribute is not removed or renamed. The reviewed head of src/Scripts/AnalyticsScript.php contains a comment above 'data-platform' => 'wordpress' that states the attribute must not be removed or renamed, because third parties such as Cookie Rocks rely on it for detection. The attribute value and the rest of attributes() are unchanged in that file. The regression test comment in tests/Regression/script-attributes.php is reported by the PR summary, but the diff and the test file at head could not be read, so that part is unverified. The test comment is not needed to meet the issue objective. The issue requires no runtime behavior change, and the PR summary reports none. PHP lint and tests were not run here; they are not needed for a comment-only change, but CI remains the only PHP check.

Full details: Out of Scope Changes check

Explanation

The changes are comments only. The comment in src/Scripts/AnalyticsScript.php documents the data-platform attribute named in #62. The comment in tests/Regression/script-attributes.php, as reported by the PR summary, documents the same dependency next to the regression check. Both changes support the #62 objective. No unrelated code, behavior, or configuration change was identified. The base diff could not be read, so the claim of no other changes rests on the PR summary.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Team
  • Run ID: 8db670fe-194b-4e41-83c8-56efb560d051
Commits

Reviewing files that changed from the base of the PR and between 61bdd48 and b271b04.

Files selected for processing: 2

  • src/Scripts/AnalyticsScript.php
  • tests/Regression/script-attributes.php

Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@github-actions github-actions Bot added the change: routine Routine or ordinary change that needs at most one human or AI-assisted review label Nov 17, 2026
@github-actions

Copy link
Copy Markdown

SDLC label: change: routine because The change only adds code comments and a test comment documenting that third parties rely on data-platform="wordpress", with no change to attribute values, visitor data, or access boundaries in this non-critical plugin.

@adriaandotcom
adriaandotcom merged commit 0a03430 into main Nov 18, 2026
13 checks passed
@adriaandotcom
adriaandotcom deleted the docs/keep-data-platform-attribute branch November 18, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change: routine Routine or ordinary change that needs at most one human or AI-assisted review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Third parties depend on data-platform="wordpress"

2 participants