diff --git a/composer.lock b/composer.lock index 519634c4..851e455d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,15 +4,15 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "34a68a86bd29cdeb4522a10dc43d58df", + "content-hash": "21f5af91e2ebc72c70629c9b12ea172e", "packages": [ { "name": "automattic/jetpack-mu-wpcom", - "version": "4.16.0-alpha.1698418407", + "version": "4.16.0-alpha.1698456072", "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom", - "reference": "9eda45c06b7bab7c0f29aa05cdcfc89fff0212a9" + "reference": "16bfb3a9b73953eaf5f35de276fd0b04f934490d" }, "require-dev": { "automattic/jetpack-changelogger": "^3.3.11", @@ -78,7 +78,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-changelogger", - "reference": "da973ef88deb4dbf32f56d33959dc3bfafca2f3b" + "reference": "48510f42af9dd42e7dfca02e5384c83b71c280db" }, "require": { "php": ">=5.6", diff --git a/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md b/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md index 19d3d98d..0e995c52 100644 --- a/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md +++ b/vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 This is an alpha version! The changes listed here are not final. +### Added +- Add launchpad checklist for host-site intent + ### Fixed - Disable fullscreen launchpad when completing the site_launched task diff --git a/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php b/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php index f881b414..9fd797c4 100644 --- a/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php +++ b/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad-task-definitions.php @@ -514,6 +514,44 @@ function wpcom_launchpad_get_task_definitions() { return '/earn/payments-plans/' . $data['site_slug_encoded']; }, ), + + // Hosting flow tasks + 'site_theme_selected' => array( + 'get_title' => function () { + return __( 'Choose a theme', 'jetpack-mu-wpcom' ); + }, + 'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed', + 'get_calypso_path' => function ( $task, $default, $data ) { + return '/themes/' . $data['site_slug_encoded']; + }, + ), + 'install_custom_plugin' => array( + 'get_title' => function () { + return __( 'Install a custom plugin', 'jetpack-mu-wpcom' ); + }, + 'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed', + 'get_calypso_path' => function ( $task, $default, $data ) { + return '/plugins/' . $data['site_slug_encoded']; + }, + ), + 'setup_ssh' => array( + 'get_title' => function () { + return __( 'Set up ssh', 'jetpack-mu-wpcom' ); + }, + 'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed', + 'get_calypso_path' => function ( $task, $default, $data ) { + return '/hosting-config/' . $data['site_slug_encoded'] . '#sftp-credentials'; + }, + ), + 'site_monitoring_page' => array( + 'get_title' => function () { + return __( 'View site metrics', 'jetpack-mu-wpcom' ); + }, + 'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed', + 'get_calypso_path' => function ( $task, $default, $data ) { + return '/site-monitoring/' . $data['site_slug_encoded']; + }, + ), ); $extended_task_definitions = apply_filters( 'wpcom_launchpad_extended_task_definitions', array() ); @@ -1829,3 +1867,31 @@ function wpcom_trigger_email_campaign() { ); } add_action( 'update_option_launchpad_checklist_tasks_statuses', 'wpcom_trigger_email_campaign', 10, 3 ); + +/** + * Mark task complete when plugin is installed. + */ +function wpcom_launchpad_mark_plugin_installed_complete() { + if ( wpcom_launchpad_is_task_option_completed( array( 'id' => 'install_custom_plugin' ) ) ) { + return; + } + wpcom_mark_launchpad_task_complete( 'install_custom_plugin' ); +} +add_action( 'jetpack_plugin_installed', 'wpcom_launchpad_mark_plugin_installed_complete', 10 ); + +/** + * Mark task complete when theme is selected. + * + * @param array $new_theme The new theme object. + * @param array $old_theme The old theme object. + */ +function wpcom_launchpad_mark_theme_selected_complete( $new_theme, $old_theme ) { + // This hook runs when site just gets setup, lets prevent checklist item from being complete + // when the theme is the same. + $is_same_theme = $new_theme['name'] === $old_theme['name']; + if ( wpcom_launchpad_is_task_option_completed( array( 'id' => 'site_theme_selected' ) ) || $is_same_theme ) { + return; + } + wpcom_mark_launchpad_task_complete( 'site_theme_selected' ); +} +add_action( 'jetpack_sync_current_theme_support', 'wpcom_launchpad_mark_theme_selected_complete', 10, 2 ); diff --git a/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad.php b/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad.php index 5a924a8d..f5cb74fc 100644 --- a/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad.php +++ b/vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad.php @@ -199,6 +199,18 @@ function wpcom_launchpad_get_task_list_definitions() { ), 'is_enabled_callback' => '__return_true', ), + 'host-site' => array( + 'title' => 'Hosting Flow', + 'task_ids' => array( + 'site_theme_selected', + 'install_custom_plugin', + 'setup_ssh', + 'verify_email', + 'site_monitoring_page', + 'site_launched', + ), + 'is_enabled_callback' => 'wpcom_launchpad_is_hosting_flow_enabled', + ), ); $extended_task_list_definitions = apply_filters( 'wpcom_launchpad_extended_task_list_definitions', array() ); @@ -886,6 +898,15 @@ function wpcom_launchpad_is_keep_building_enabled() { return false; } +/** + * Checks if the hosting flow task list is enabled. + * + * @return bool True if the task list is enabled, false otherwise. + */ +function wpcom_launchpad_is_hosting_flow_enabled() { + return apply_filters( 'is_launchpad_intent_hosting_enabled', false ); +} + /** * Checks if the Blog flow task list is enabled. * diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index a242242e..2d866e54 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2,12 +2,12 @@ "packages": [ { "name": "automattic/jetpack-mu-wpcom", - "version": "4.16.0-alpha.1698418407", - "version_normalized": "4.16.0.0-alpha1698418407", + "version": "4.16.0-alpha.1698456072", + "version_normalized": "4.16.0.0-alpha1698456072", "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom", - "reference": "9eda45c06b7bab7c0f29aa05cdcfc89fff0212a9" + "reference": "16bfb3a9b73953eaf5f35de276fd0b04f934490d" }, "require-dev": { "automattic/jetpack-changelogger": "^3.3.11", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 8eceaea1..ded110ba 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -11,9 +11,9 @@ ), 'versions' => array( 'automattic/jetpack-mu-wpcom' => array( - 'pretty_version' => '4.16.0-alpha.1698418407', - 'version' => '4.16.0.0-alpha1698418407', - 'reference' => '9eda45c06b7bab7c0f29aa05cdcfc89fff0212a9', + 'pretty_version' => '4.16.0-alpha.1698456072', + 'version' => '4.16.0.0-alpha1698456072', + 'reference' => '16bfb3a9b73953eaf5f35de276fd0b04f934490d', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../automattic/jetpack-mu-wpcom', 'aliases' => array(),