Repository navigation
Closed
Description
Replace the external "Activity Log ↗" sidebar item (currently registered in projects/packages/my-jetpack/src/class-activitylog.php, pointing at Cloud via Redirect::get_url( 'cloud-activity-log-wp-menu' )) with a native in-wp-admin page inside the Jetpack plugin. Source: Calypso Dashboard's client/dashboard/sites/logs-activity/. Architecture follows the projects/packages/backup/ package's pattern.
Plan
- Phase 0 — Package scaffold. Create
projects/packages/activity-log/mirroringprojects/packages/backup/. Main PHP class + menu registration (placeholder page),Initial_Statebootstrap, REST controller stub, React root with TanStack Query +@wordpress/data. - Phase 1 — Menu swap. Remove the Cloud redirect from
my-jetpack/src/class-activitylog.php; new package owns the Activity Log menu item. - Phase 2 — REST surface.
GET /jetpack/v4/activity-log+/count/group, user-signed WPCOM proxies. - Phase 3 — UI port. DataViews-based admin page ported from Calypso's
logs-activity/: search, activity-type filter, sort, pagination, Event/User cells with gridicon→WP-icon mapping. FormattedBlock resolves entity tokens (post, person, plugin, theme, comment) to their wp-admin screens via three fallbacks (typed range → section-tagged anchor → entry-levelobject). View state (columns, density, sort, perPage) persists across refresh via localStorage. Reset view button wired to DataViews' nativeonReset. SCSS colors migrated to--wpds-*design tokens. Deliberate scope simplifications documented in the PR body — no analytics, no URL params. - Phase 4 — Tier gating & upsell. Free tier sees the 20 most recent events with search, filters, sort and pagination disabled; paid (Backup-enabled) tier sees the full log. Access signal comes from WPCOM's
/sites/{id}/rewindendpoint (same sourceJetpack_Backup::has_backup_plan()uses), cached in a site transient for 5 minutes. Server-side clamp in the REST proxy forcesnumber≤20+page=1when gated so DevTools/wp.apiFetchcan't bypass. UI-side: DataViews' search/filters/sort/view-config hidden viachildren={<DataViews.Layout />}plusconfig.perPageSizes=[20].UpsellCalloutbelow the table ports Calypso's copy + illustration 1:1; CTA routes throughuseProductCheckoutWorkflowtojetpack_security_t1_yearlywithsource=activity-log-page-purchase. On return from checkout a nonce-protectedrefresh_accessquery arg drops the access cache immediately (pattern fromPublicize\Social_Admin_Page). - Date range picker. Full 1:1 port of Calypso's
components/date-range-picker/— Dropdown toggle, preset sidebar (Today, Yesterday, Last 7/30 days, Month/Year to date, Last 12 months, Last 3 years, Custom), dual-month calendar (collapses to one on mobile), start/end inputs. Threads into RESTafter/beforeparams for list + group-counts queries. Defaults to last-7-days anchored at the site's calendar today. Paid tier only. - Phase 5 — Cross-links to Backup (stubs). Blocked: waits for the Backup package port to land (Backup: New overview UI #48236). Activity-item actions for "restore to this point" / "download from this point" link into the Backup package's admin page. Stubbed with a disabled state.
Branch & PR
All work lands as commits on the try-jetpack-activity-log-page branch, tracked by a single PR: #48244. Phase checkboxes above are ticked manually as each phase's commit lands on the branch.
Deferred follow-ups
- Add phpunit scaffolding + full test coverage — in-flight at Activity Log: phpunit scaffolding + gating tests #48264 (scaffold + 5 gating tests landed; follow-up commits on that branch will cover
has_activity_logs_access()transient behavior, REST permission callback branches, and the free-tier clamp onget_activity_log()). - Swap localStorage-backed view persistence for user-meta-backed persistence once we want cross-device sync. Interface already encapsulated in
usePersistentView. - Link the User column (actor cell) to
user-edit.phpusingactor.external_user_id. Deferred to keep link treatment scoped to event-description entities for now.
Out of scope
- Agency / multi-site flows.
- Cross-site clone.
- Net-new features beyond Calypso parity.
- PHP errors / Web server log tabs (those data sources are WordPress.com Hosting–only).
Metadata
Metadata
Assignees
Labels
No labels
Activity
Activity Log: Phase 1 menu swap
Activity Log: Phase 2 REST surface
Activity Log: Sign REST proxies as the user, not the blog
Activity Log: Phase 3 — port the DataViews UI
Activity Log: Polish — AdminPage header, full-bleed table, 32px icons
Activity Log: Tweak event-icon fill, hide footer, tighten columns
Activity Log: Widen date and event minimum column widths
Activity Log: Let the Event column absorb remaining width
Activity Log: Use the real Jetpack logo for the "Jetpack" actor
Activity Log: wire Reset view + persist view options
Activity Log: document the UI primitives preference order
Activity Log: adopt --wpds-* design tokens in SCSS
Activity Log: link event-description entities to wp-admin screens
Activity Log: route entity tokens to wp-admin, not wordpress.com
17 remaining items
Activity Log: Port AL into wp-admin as a native page (#48244)