Skip to content

Activity Log: make it a toggleable Jetpack module#49591

Draft
enejb wants to merge 1 commit into
trunkfrom
add/activity-log-module
Draft

Activity Log: make it a toggleable Jetpack module#49591
enejb wants to merge 1 commit into
trunkfrom
add/activity-log-module

Conversation

@enejb

@enejb enejb commented Jun 12, 2026

Copy link
Copy Markdown
Member

Fixes #

Proposed changes

Activity Log is currently always on for every connected site, with no way to turn it off. This makes it a standard Jetpack module so it can be activated/deactivated like Stats, Monitor, etc. When deactivated, its sidebar entry disappears.

  • Add a new activity-log module (projects/plugins/jetpack/modules/activity-log.php) that bootstraps the existing jetpack-activity-log package. Header is Auto Activate: Yes / Requires (User) Connection: Yes / Feature: Security, so it stays on by default.
  • Remove the unconditional Activity_Log_Init::initialize() call (and its now-unused use alias) from Jetpack::late_initialization() in class.jetpack.php. The module file is now the single entry point, so the package only initializes — and the sidebar item is only registered — while the module is active.
  • Add a changelog entry.

Backwards compatibility: Auto Activate: Yes makes this a default module, so existing connected sites auto-activate it via the normal version-upgrade routine (activate_default_modules) and new sites get it on connection. No behavior change for anyone who does nothing — they just gain the ability to turn it off.

Scope note: this gates the native (self-hosted) Activity Log menu + init only. The WPCOM/Atomic wpcom-admin-menu.php override (which links to wordpress.com/activity-log/) is intentionally left untouched.

Minor pre-existing follow-up (not addressed here): the Jetpack AI page links to admin.php?page=jetpack-activity-log; with the module off that link points at a disabled page. Worth gating in a follow-up.

Related product discussion/links

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

No. This only changes whether the existing Activity Log feature is loaded; it adds no new tracking.

Testing instructions

On a connected, non-multisite, self-hosted site (the native path — a non-WoA Jurassic Ninja site works):

  1. Update to this build. Confirm Jetpack → Activity Log appears in the sidebar by default (module is auto-activated).
  2. Deactivate the module: wp jetpack module deactivate activity-log (or via the modules admin page).
  3. Reload wp-admin — the Activity Log sidebar item is gone, and admin.php?page=jetpack-activity-log is no longer registered. No PHP errors.
  4. Reactivate: wp jetpack module activate activity-log — the sidebar item returns.

Headless verification (no browser needed): with the module active, has_action( 'admin_menu', [ Automattic\Jetpack\Activity_Log\Jetpack_Activity_Log::class, 'add_wp_admin_submenu' ] ) returns a priority; with it inactive it returns false.

Note: if a freshly-added module shows as "not a valid module" via WP-CLI, clear the version-keyed cache with wp eval 'Jetpack_Options::delete_option("available_modules");' (WP-CLI runs non-admin and won't refresh it automatically; a normal admin page load does).

@enejb enejb self-assigned this Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/activity-log-module branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/activity-log-module

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: July 7, 2026
    • Code freeze: July 6, 2026

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

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/modules/module-headings.php 218/1066 (20.45%) -0.05% 18 💔
projects/plugins/jetpack/class.jetpack.php 758/2290 (33.10%) 0.01% -1 💚

1 file is newly checked for coverage.

File Coverage
projects/plugins/jetpack/modules/activity-log.php 0/3 (0.00%) 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@enejb enejb requested a review from keoshi June 12, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant