Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/add-activity-log-module
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: minor
Type: added

Modules: add new "Activity Log" module entry, enabling management and discovery from the Jetpack modules screen.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Modules: add new "Activity Log" module entry, enabling management and discovery from the Jetpack modules screen.
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,17 @@
}

// Jetpack > Activity Log.
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'cloud-activity-log-wp-menu', array( 'site' => $blog_id ) ) ) );
add_submenu_page(
'jetpack',
__( 'Activity Log', 'jetpack-mu-wpcom' ),
__( 'Activity Log', 'jetpack-mu-wpcom' ),
'manage_options',
'https://wordpress.com/activity-log/' . $domain,
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
);
if ( class_exists( '\\Jetpack' ) && \Jetpack::is_module_active( 'activity-log' ) ) {

Check failure on line 376 in projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-menu/wpcom-admin-menu.php

View workflow job for this annotation

GitHub Actions / Static analysis

UndefError PhanUndeclaredClassMethod Call to method is_module_active from undeclared class \Jetpack FAQ on Phan issues: pdWQjU-Jb-p2
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'cloud-activity-log-wp-menu', array( 'site' => $blog_id ) ) ) );
add_submenu_page(
'jetpack',
__( 'Activity Log', 'jetpack-mu-wpcom' ),
__( 'Activity Log', 'jetpack-mu-wpcom' ),
'manage_options',
'https://wordpress.com/activity-log/' . $domain,
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
);
}

wpcom_reorder_submenu(
'jetpack',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const PRODUCTS_MUST_HAVE_A_STANDALONE_PLUGIN = [ 'anti-spam', 'boost', 'c
*/
export const JETPACK_NON_PAID_MODULES = [
'account-protection',
'activity-log',
'blaze',
'blocks',
'carousel',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const CATEGORY_CARDS_AND_MODULES: {
modules: [
// No prettier please
'account-protection',
'activity-log',
'monitor',
'notes',
'sso',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Modules: add new "Activity Log" module entry, enabling management and discovery from the Jetpack modules screen.
5 changes: 5 additions & 0 deletions projects/packages/my-jetpack/src/class-activitylog.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public static function add_submenu_jetpack() {
return;
}

// Only display if the Activity Log module is active.
if ( ! ( class_exists( '\\Jetpack' ) && \Jetpack::is_module_active( 'activity-log' ) ) ) {
return;
}

$args = array();

$blog_id = Connection_Manager::get_site_id( true );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: enhancement

Modules: add new "Activity Log" module entry, enabling management and discovery from the Jetpack modules screen.
24 changes: 24 additions & 0 deletions projects/plugins/jetpack/modules/activity-log.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Activity Log module.
*
* @package automattic/jetpack
*/

/*
Module Name: Activity Log
Module Description: See every site change and who made it for easier coordination, debugging, maintenance, and troubleshooting.
Sort Order: 21
Recommendation Order: 11
First Introduced: $$next-version$$
Requires Connection: Yes
Requires User Connection: Yes
Auto Activate: Yes
Module Tags: Recommended
Feature: Security
Additional Search Queries: activity, log, audit, events, changes, history
Plans:
*/

// The Activity Log UI and functionality live in the Jetpack cloud.
// This module entry allows managing the feature from the Jetpack modules screen.
16 changes: 16 additions & 0 deletions projects/plugins/jetpack/modules/module-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,3 +879,19 @@ function jetpack_more_info_blaze() {
esc_html_e( 'Grow your audience by promoting your content across Tumblr and WordPress.com.', 'jetpack' );
}
add_action( 'jetpack_module_more_info_blaze', 'jetpack_more_info_blaze' );

/**
* Activity Log support link.
*/
function jetpack_activity_log_more_link() {
echo esc_url( Redirect::get_url( 'calypso-activity-log' ) );
}
add_filter( 'jetpack_learn_more_button_activity-log', 'jetpack_activity_log_more_link' );

/**
* Activity Log description.
*/
function jetpack_more_info_activity_log() {
esc_html_e( 'See every site change and who made it for easier coordination, debugging, maintenance, and troubleshooting.', 'jetpack' );
}
add_action( 'jetpack_module_more_info_activity-log', 'jetpack_more_info_activity_log' );
Loading