From 5e8fec9b8e2457a49470e9fa5d6911ba2af17a7a Mon Sep 17 00:00:00 2001 From: valterlorran Date: Thu, 10 Oct 2024 11:16:31 -0300 Subject: [PATCH] Post-migration Experience: Add the plugin review task (#39711) * Add the Review Plugins task * changelog * Add the calypso path for the task --------- Co-authored-by: Valter Lorran --- .../changelog/add-plugin-review-task | 4 ++++ .../launchpad/launchpad-task-definitions.php | 21 +++++++++++++++++++ .../src/features/launchpad/launchpad.php | 1 + 3 files changed, 26 insertions(+) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/add-plugin-review-task diff --git a/projects/packages/jetpack-mu-wpcom/changelog/add-plugin-review-task b/projects/packages/jetpack-mu-wpcom/changelog/add-plugin-review-task new file mode 100644 index 0000000000000..e53cb12e05fab --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/add-plugin-review-task @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Add the Plugin Review task for the Post-migration launchpad experience diff --git a/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php b/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php index 6e6f181dfd897..cc6d818019963 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php @@ -816,6 +816,19 @@ function wpcom_launchpad_get_task_definitions() { 'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed', 'is_visible_callback' => '__return_true', ), + 'review_plugins' => array( + 'get_title' => function () { + return __( 'Review the migrated plugins', 'jetpack-mu-wpcom' ); + }, + 'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed', + 'is_visible_callback' => '__return_true', + 'add_listener_callback' => function () { + add_action( 'pre_current_active_plugins', 'wpcom_launchpad_mark_review_plugins_complete' ); + }, + 'get_calypso_path' => function () { + return admin_url( 'plugins.php' ); + }, + ), ); $extended_task_definitions = apply_filters( 'wpcom_launchpad_extended_task_definitions', array() ); @@ -1774,6 +1787,14 @@ function wpcom_track_site_launch_task() { } } +/** + * Mark the plugins reviewed task as complete. + * + * @return void + */ +function wpcom_launchpad_mark_review_plugins_complete() { + wpcom_mark_launchpad_task_complete( 'review_plugins' ); +} /** * Callback that conditionally adds the site launch listener based on platform. * diff --git a/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad.php b/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad.php index e313808a59b9f..67ff55d2b44b5 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/launchpad/launchpad.php @@ -322,6 +322,7 @@ function wpcom_launchpad_get_task_list_definitions() { 'task_ids' => array( 'migrating_site', 'review_site', + 'review_plugins', ), ), );