Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post migration tasklist: Add/ssl provisioned task #39776

Merged
merged 6 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

adding a WPCOM task
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,18 @@ function wpcom_launchpad_get_task_definitions() {
'is_complete_callback' => 'wpcom_launchpad_is_task_option_completed',
'is_visible_callback' => '__return_true',
),
'check_ssl_status' => array(
'get_title' => function () {
return __( 'Provision SSL certificate', 'jetpack-mu-wpcom' );
},
'is_complete_callback' => '__return_false',
'is_visible_callback' => '__return_true',
'is_disabled_callback' => 'wpcom_launchpad_is_primary_domain_wpcom',
'get_calypso_path' => function ( $task, $default, $data ) {
$domain = $data['site_slug_encoded'];
return '/domains/manage/' . $domain . '/edit/' . $domain;
},
),
);

$extended_task_definitions = apply_filters( 'wpcom_launchpad_extended_task_definitions', array() );
Expand Down Expand Up @@ -2803,3 +2815,18 @@ function wpcom_launchpad_get_latest_draft_id() {

return $cached_draft_id;
}

/**
* Checks if the current site primary domain is a WPCOM domain.
*
* @return bool Will return true if the primary domain is a WPCOM domain.
*/
function wpcom_launchpad_is_primary_domain_wpcom() {
if ( ! ( new Automattic\Jetpack\Status\Host() )->is_wpcom_platform() ) {
return false;
valterlorran marked this conversation as resolved.
Show resolved Hide resolved
}

$site_slug = wpcom_get_site_slug();
// If site_slug ends with .wpcomstaging.com return true
return str_ends_with( $site_slug, '.wpcomstaging.com' );
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ function wpcom_launchpad_get_task_list_definitions() {
'review_plugins',
'connect_migration_domain',
'domain_dns_mapped',
'check_ssl_status',
),
),
);
Expand Down