| @@ -1643,30 +1643,18 @@ | ||
| 1643 | 1643 | return array(); |
| 1644 | 1644 | } |
| 1645 | 1645 | |
| 1646 | 1646 | /** |
| 1647 | - * Whether the AI Launchpad is enabled for this site, for the requesting user. | |
| 1647 | + * Whether the AI Launchpad is enabled for this site. Mirrors AI_Launchpad::is_enabled_for_site() in jetpack-mu-wpcom. | |
| 1648 | 1648 | * |
| 1649 | - * The launchpad-personalization assignment is user-scoped: every site of an | |
| 1650 | - * ai_launchpad user gets the AI Launchpad, however the site was created. Mirrors | |
| 1651 | - * AI_Launchpad::is_enabled_for_site() in jetpack-mu-wpcom, so wp-admin and the | |
| 1652 | - * Calypso-facing payload agree. Like the capabilities in this payload, the value | |
| 1653 | - * is relative to the current user. | |
| 1654 | - * | |
| 1655 | 1649 | * @return bool |
| 1656 | 1650 | */ |
| 1657 | 1651 | public function is_ai_launchpad_enabled() { |
| 1658 | - if ( (bool) get_option( 'wpcom_ai_launchpad_enabled' ) ) { | |
| 1659 | - return true; | |
| 1660 | - } | |
| 1661 | - | |
| 1662 | - return class_exists( '\Automattic\Jetpack\Jetpack_Mu_Wpcom\Launchpad_Personalization_Experiment' ) | |
| 1663 | - // @phan-suppress-next-line PhanUndeclaredClassMethod -- Lives in jetpack-mu-wpcom, outside this plugin's dependency graph; the class_exists guard above covers contexts where it isn't loaded. | |
| 1664 | - && 'ai_launchpad' === \Automattic\Jetpack\Jetpack_Mu_Wpcom\Launchpad_Personalization_Experiment::get_variation(); | |
| 1652 | + return (bool) get_option( 'wpcom_ai_launchpad_enabled' ) && ! $this->is_ai_launchpad_no_guidance(); | |
| 1665 | 1653 | } |
| 1666 | 1654 | |
| 1667 | 1655 | /** |
| 1668 | - * Whether the AI Launchpad was dismissed, reverting the site to the regular launchpad. | |
| 1656 | + * Whether the AI Launchpad was dismissed (skipped), which leaves the site with no setup guidance. | |
| 1669 | 1657 | * |
| 1670 | 1658 | * @return bool |
| 1671 | 1659 | */ |
| 1672 | 1660 | public function is_ai_launchpad_dismissed() { |
| @@ -1679,8 +1667,22 @@ | ||
| 1679 | 1667 | * @return bool |
| 1680 | 1668 | */ |
| 1681 | 1669 | public function is_ai_launchpad_completed() { |
| 1682 | 1670 | return (bool) get_option( 'wpcom_ai_launchpad_completed' ); |
| 1671 | + } | |
| 1672 | + | |
| 1673 | + /** | |
| 1674 | + * Whether the site gets no setup guidance: no My Home, Site Setup, or launchpad. Mirrors | |
| 1675 | + * wpcom_launchpad_is_no_guidance() in jetpack-mu-wpcom, which also counts a skipped AI Launchpad. | |
| 1676 | + * | |
| 1677 | + * @return bool | |
| 1678 | + */ | |
| 1679 | + public function is_ai_launchpad_no_guidance() { | |
| 1680 | + if ( get_option( 'wpcom_ai_launchpad_no_guidance' ) ) { | |
| 1681 | + return true; | |
| 1682 | + } | |
| 1683 | + | |
| 1684 | + return (bool) get_option( 'wpcom_ai_launchpad_enabled' ) && (bool) get_option( 'wpcom_ai_launchpad_dismissed' ); | |
| 1683 | 1685 | } |
| 1684 | 1686 | |
| 1685 | 1687 | /** |
| 1686 | 1688 | * Get site option for migration source site domain |