Skip to content

Add premium-analytics plugin#48087

Merged
retrofox merged 13 commits into
trunkfrom
update/premium-analytics-plugin
Apr 16, 2026
Merged

Add premium-analytics plugin#48087
retrofox merged 13 commits into
trunkfrom
update/premium-analytics-plugin

Conversation

@retrofox
Copy link
Copy Markdown
Contributor

@retrofox retrofox commented Apr 14, 2026

What?

Adds an internal WordPress plugin (projects/plugins/premium-analytics/) that activates the automattic/jetpack-premium-analytics package. Thin wrapper — loads the autoloader and calls Analytics::init().

⚠️ Depends on #48085.

Relates to WOOA7S-1344.

Why?

The premium-analytics package needs a consumer to verify it loads correctly in wp-admin. This plugin exists as a development and testing harness — not intended for publication (autotagger and autorelease set to false).

How?

  • jetpack-premium-analytics.php: defines constants, loads Jetpack autoloader, adds settings link
  • class-jetpack-premium-analytics.php: calls PremiumAnalytics\Analytics::init()
  • composer.json: requires automattic/jetpack-premium-analytics from monorepo path
  • .phpcs.dir.xml: text domain configuration for linting

Testing instructions

  1. Pull the branch and run pnpm install
  2. Run jetpack install plugins/premium-analytics to resolve Composer dependencies
  3. Run jetpack build packages/premium-analytics to build the package
  4. Run jetpack docker up and activate the Premium Analytics plugin
  5. Verify the Analytics menu appears in wp-admin and the SPA loads
Screen.Recording.2026-04-14.at.6.55.45.PM.mov

Does this pull request change what data or activity we track or use?

No. This plugin is a thin wrapper that loads the premium-analytics package. No new data collection or tracking is introduced.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Premium Analytics plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Apr 14, 2026
@retrofox retrofox force-pushed the update/premium-analytics-plugin branch from 96635b3 to 4b22a20 Compare April 14, 2026 10:05
@retrofox retrofox force-pushed the update/premium-analytics-package branch from 0d14ede to 1fc1e3b Compare April 14, 2026 10:12
@retrofox retrofox force-pushed the update/premium-analytics-plugin branch from 4b22a20 to d3476be Compare April 14, 2026 10:13
@retrofox retrofox changed the title Add premium-analytics plugin Add premium-analytics plugin Apr 14, 2026
@retrofox retrofox force-pushed the update/premium-analytics-plugin branch 3 times, most recently from 6e587fd to dcdb542 Compare April 14, 2026 11:22
@retrofox retrofox requested a review from a team April 14, 2026 11:22
@retrofox retrofox force-pushed the update/premium-analytics-plugin branch 3 times, most recently from a94f5ce to 6eaad7b Compare April 14, 2026 11:53
@retrofox retrofox requested a review from a team April 14, 2026 12:01
@retrofox retrofox force-pushed the update/premium-analytics-plugin branch 2 times, most recently from 52ed11e to 749e5d9 Compare April 14, 2026 12:20
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented Apr 14, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/src/class-analytics.php 0/26 (0.00%) 0.00% 2 ❤️‍🩹

Full summary · PHP report

Copy link
Copy Markdown
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a quick overview. Seems ok for its stated purpose; some suggestions inline.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this file if it's going to be empty.

"extra": {
"autotagger": false,
"autorelease": false,
"mirror-repo": "Automattic/jetpack-premium-analytics-plugin",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether a mirror repo is even necessary. If this is only going to be used within the monorepo (e.g. with jetpack docker, jetpack playground, or maybe jetpack rsync), you could probably skip it.

On the other hand, if you're wanting to use the plugin with Jetpack Beta Tester (including on Jurassic Ninja), that'll need a beta-plugin-slug key here and it'll need us to do some setup on betadownload.jetpack.me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, the plugin is just a dev harness to test the package locally (Jetpack Docker, Playground, Rsync).

No need for a mirror repo at this stage. If we need Beta Tester / Jurassic Ninja support later, we can set up the mirror and beta-plugin-slug in a follow-up.

Comment thread projects/plugins/premium-analytics/package.json Outdated
Comment thread projects/plugins/premium-analytics/.phan/baseline.php Outdated
Comment thread projects/plugins/premium-analytics/.gitattributes
@retrofox retrofox force-pushed the update/premium-analytics-package branch 2 times, most recently from 7fe1461 to fbacf85 Compare April 14, 2026 17:40
@retrofox retrofox force-pushed the update/premium-analytics-plugin branch from 6f55a70 to ae38a48 Compare April 14, 2026 17:58
kangzj
kangzj previously approved these changes Apr 15, 2026
Copy link
Copy Markdown
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Works as described 👍

@kangzj
Copy link
Copy Markdown
Contributor

kangzj commented Apr 15, 2026

One thing though - if WooCommerce is installed, Analytics would already be registered as a menu item, so we should probably use a different name like 'Premium Analytics' dunno..

Base automatically changed from update/premium-analytics-package to trunk April 15, 2026 13:42
@retrofox retrofox dismissed kangzj’s stale review April 15, 2026 13:42

The base branch was changed.

@retrofox retrofox force-pushed the update/premium-analytics-plugin branch from 2eafa61 to ecf8b90 Compare April 15, 2026 13:49
@retrofox
Copy link
Copy Markdown
Contributor Author

One thing though - if WooCommerce is installed, Analytics would already be registered as a menu item, so we should probably use a different name like 'Premium Analytics' dunno..

Good call. The menu title is now configurable via Analytics::init() options, so each consumer can set its own label:

Analytics::init( array( 'menu_title' => 'Premium Analytics' ) );

The plugin already passes 'Premium Analytics' as the title. The package default remains 'Analytics' for standalone use.

image

@retrofox retrofox force-pushed the update/premium-analytics-plugin branch from 0728e6a to 4e68e5a Compare April 15, 2026 14:38
@retrofox retrofox merged commit a794f45 into trunk Apr 16, 2026
68 checks passed
@retrofox retrofox deleted the update/premium-analytics-plugin branch April 16, 2026 07:07
@github-actions github-actions Bot removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants