diff --git a/images/ai-brand-insights-pre-launch.jpg b/images/ai-brand-insights-pre-launch.jpg deleted file mode 100644 index 30f470ad510..00000000000 Binary files a/images/ai-brand-insights-pre-launch.jpg and /dev/null differ diff --git a/packages/js/src/introductions/components/modals/ai-brand-insights-free-trial.js b/packages/js/src/introductions/components/modals/ai-brand-insights-free-trial.js deleted file mode 100644 index 1c84b155000..00000000000 --- a/packages/js/src/introductions/components/modals/ai-brand-insights-free-trial.js +++ /dev/null @@ -1,113 +0,0 @@ -import { useSelect } from "@wordpress/data"; -import { createInterpolateElement, useMemo } from "@wordpress/element"; -import { __ } from "@wordpress/i18n"; -import ExternalLinkIcon from "@heroicons/react/outline/ExternalLinkIcon"; -import { Button, Modal as UiModal, useSvgAria, useModalContext } from "@yoast/ui-library"; -import { STORE_NAME_INTRODUCTIONS } from "../../constants"; -import { Modal } from "../modal"; - -/** - * @param {Object} thumbnail The thumbnail: img props. - * @param {string} buttonLink The button link. - * @returns {JSX.Element} The element. - */ -const AiBrandInsightsFreeTrialContent = ( { - thumbnail, - buttonLink, -} ) => { - const { onClose, initialFocus } = useModalContext(); - const svgAriaProps = useSvgAria(); - - return ( - <> -
- { -
- - - { "Yoast AI Brand Insights" } - -
-
-
-
- - { - __( "Your first brand analysis is free!", "wordpress-seo" ) - } - -
-

- { createInterpolateElement( - __( - "As a Yoast customer, you can run your first brand analysis for free. See how your brand shows up in AI responses.", - "wordpress-seo" - ), - { - strong: , - } - ) } -

-
-
-
- -
- -
- - ); -}; - -/** - * @returns {JSX.Element} The element. - */ -export const AiBrandInsightsFreeTrial = () => { - const imageLink = useSelect( select => select( STORE_NAME_INTRODUCTIONS ).selectImageLink( "ai-brand-insights-pre-launch.jpg" ), [] ); - const buttonLink = useSelect( select => select( STORE_NAME_INTRODUCTIONS ) - .selectLink( "https://yoa.st/aibi-introduction-free-trial" ), [] ); - const thumbnail = useMemo( () => ( { - src: imageLink, - width: "432", - height: "243", - } ), [ imageLink ] ); - - return ( - - - - ); -}; diff --git a/packages/js/src/introductions/components/modals/ai-brand-insights-post-launch.js b/packages/js/src/introductions/components/modals/ai-brand-insights-post-launch.js deleted file mode 100644 index 70c99a3684b..00000000000 --- a/packages/js/src/introductions/components/modals/ai-brand-insights-post-launch.js +++ /dev/null @@ -1,111 +0,0 @@ -import { useSelect } from "@wordpress/data"; -import { useMemo } from "@wordpress/element"; -import { __, sprintf } from "@wordpress/i18n"; -import { Button, useModalContext } from "@yoast/ui-library"; -import { STORE_NAME_INTRODUCTIONS } from "../../constants"; -import { Modal } from "../modal"; - -/** - * @param {Object} thumbnail The thumbnail: img props. - * @param {string} buttonLink The button link. - * @param {string} buttonLabel The button label. - * @param {string} productName The product name. - * @param {string} description The description for the introduction - * @param {string} ctbId The click to buy to register for this upsell instance. - * @returns {JSX.Element} The element. - */ -const AiBrandInsightsPostLaunchContent = ( { - thumbnail, - buttonLink, - buttonLabel = __( "Discover Brand Insights now", "wordpress-seo" ), - productName = sprintf( - /* translators: %1$s expands to Yoast SEO AI+. */ - __( "New - Upgrade to %1$s", "wordpress-seo" ), - "Yoast SEO AI+" - ), -} ) => { - const { onClose, initialFocus } = useModalContext(); - - const description = __( "Track visibility, control perception, and stay ahead - tools to manage your AI presence are now live!", "wordpress-seo" ); - - return ( - <> -
- { -
- - - { productName } - -
-
-
-
-

- { - __( "How does your brand show up in AI responses?", "wordpress-seo" ) - } -

-
-

{ description }

-
-
-
- -
- -
- - ); -}; - -/** - * @returns {JSX.Element} The element. - */ -export const AiBrandInsightsPostLaunch = () => { - const imageLink = useSelect( select => select( STORE_NAME_INTRODUCTIONS ).selectImageLink( "ai-brand-insights-pre-launch.jpg" ), [] ); - const joinWishlistLink = useSelect( select => select( STORE_NAME_INTRODUCTIONS ) - .selectLink( "https://yoa.st/ai-brand-insights-introduction-post-launch/" ), [] ); - const thumbnail = useMemo( () => ( { - src: imageLink, - width: "432", - height: "243", - } ), [ imageLink ] ); - - return ( - - - - ); -}; diff --git a/packages/js/src/introductions/components/modals/ai-brand-insights-pre-launch.js b/packages/js/src/introductions/components/modals/ai-brand-insights-pre-launch.js deleted file mode 100644 index 934dbfcc998..00000000000 --- a/packages/js/src/introductions/components/modals/ai-brand-insights-pre-launch.js +++ /dev/null @@ -1,110 +0,0 @@ -import { useSelect } from "@wordpress/data"; -import { useMemo } from "@wordpress/element"; -import { __, sprintf } from "@wordpress/i18n"; -import { Button, useModalContext } from "@yoast/ui-library"; -import { STORE_NAME_INTRODUCTIONS } from "../../constants"; -import { Modal } from "../modal"; - -/** - * @param {Object} thumbnail The thumbnail: img props. - * @param {string} buttonLink The button link. - * @param {string} buttonLabel The button label. - * @param {string} productName The product name. - * @param {string} description The description for the introduction - * @param {string} ctbId The click to buy to register for this upsell instance. - * @returns {JSX.Element} The element. - */ -const AiBrandInsightsPreLaunchContent = ( { - thumbnail, - buttonLink, - buttonLabel = __( "Join the waitlist", "wordpress-seo" ), - productName = sprintf( - /* translators: %1$s expands to Yoast AI brand insights. */ - __( "Introducing %1$s", "wordpress-seo" ), - "Yoast AI brand insights" - ), - description = __( "Track visibility, control perception, and stay ahead - tools to manage your AI presence are coming soon!", "wordpress-seo" ), -} ) => { - const { onClose, initialFocus } = useModalContext(); - - return ( - <> -
- { -
- - - { productName } - -
-
-
-
-

- { - __( "How does your brand show up in AI responses?", "wordpress-seo" ) - } -

-
-

{ description }

-
-
-
- -
- -
- - ); -}; - -/** - * @returns {JSX.Element} The element. - */ -export const AiBrandInsightsPreLaunch = () => { - const imageLink = useSelect( select => select( STORE_NAME_INTRODUCTIONS ).selectImageLink( "ai-brand-insights-pre-launch.jpg" ), [] ); - const joinWishlistLink = useSelect( select => select( STORE_NAME_INTRODUCTIONS ).selectLink( "https://yoa.st/ai-brand-insights-introduction-pre-launch/" ), [] ); - - const thumbnail = useMemo( () => ( { - src: imageLink, - width: "432", - height: "243", - } ), [ imageLink ] ); - - return ( - - - - ); -}; diff --git a/packages/js/src/introductions/initialize.js b/packages/js/src/introductions/initialize.js index d5d421d8583..658274be06d 100644 --- a/packages/js/src/introductions/initialize.js +++ b/packages/js/src/introductions/initialize.js @@ -7,8 +7,6 @@ import { Root } from "@yoast/ui-library"; import { get, isEmpty, find } from "lodash"; import { LINK_PARAMS_NAME, PLUGIN_URL_NAME, WISTIA_EMBED_PERMISSION_NAME } from "../shared-admin/store"; import { Introduction, IntroductionProvider } from "./components"; -import { AiBrandInsightsFreeTrial } from "./components/modals/ai-brand-insights-free-trial"; -import { AiBrandInsightsPostLaunch } from "./components/modals/ai-brand-insights-post-launch"; import { BlackFridayAnnouncement } from "./components/modals/black-friday-announcement"; import { DelayedPremiumUpsell } from "./components/modals/delayed-premium-upsell"; import { SchemaAggregatorAnnouncement } from "./components/modals/schema-aggregator-announcement"; @@ -24,8 +22,6 @@ domReady( () => { } const initialComponents = { - "ai-brand-insights-free-trial": AiBrandInsightsFreeTrial, - "ai-brand-insights-post-launch": AiBrandInsightsPostLaunch, "black-friday-announcement": BlackFridayAnnouncement, "delayed-premium-upsell": DelayedPremiumUpsell, "schema-aggregator-announcement": SchemaAggregatorAnnouncement, diff --git a/src/introductions/application/ai-brand-insights-free-trial.php b/src/introductions/application/ai-brand-insights-free-trial.php deleted file mode 100644 index c5a500bb6ff..00000000000 --- a/src/introductions/application/ai-brand-insights-free-trial.php +++ /dev/null @@ -1,72 +0,0 @@ -current_page_helper = $current_page_helper; - $this->product_helper = $product_helper; - } - - /** - * Returns the ID. - * - * @return string The ID. - */ - public function get_id() { - return self::ID; - } - - /** - * Returns the requested pagination priority. Lower means earlier. - * - * @return int The priority. - */ - public function get_priority() { - return 20; - } - - /** - * Returns whether this introduction should show. - * - * @return bool Whether this introduction should show. - */ - public function should_show() { - return $this->current_page_helper->is_yoast_seo_page() && $this->product_helper->is_premium(); - } -} diff --git a/src/introductions/application/ai-brand-insights-post-launch.php b/src/introductions/application/ai-brand-insights-post-launch.php deleted file mode 100644 index 667048c13e6..00000000000 --- a/src/introductions/application/ai-brand-insights-post-launch.php +++ /dev/null @@ -1,72 +0,0 @@ -current_page_helper = $current_page_helper; - $this->product_helper = $product_helper; - } - - /** - * Returns the ID. - * - * @return string The ID. - */ - public function get_id() { - return self::ID; - } - - /** - * Returns the requested pagination priority. Lower means earlier. - * - * @return int The priority. - */ - public function get_priority() { - return 20; - } - - /** - * Returns whether this introduction should show. - * - * @return bool Whether this introduction should show. - */ - public function should_show() { - return $this->current_page_helper->is_yoast_seo_page() && ! $this->product_helper->is_premium(); - } -} diff --git a/tests/Unit/Introductions/Application/AI_Brand_Insights_Free_Trial_Test.php b/tests/Unit/Introductions/Application/AI_Brand_Insights_Free_Trial_Test.php deleted file mode 100644 index bbf3f3d7718..00000000000 --- a/tests/Unit/Introductions/Application/AI_Brand_Insights_Free_Trial_Test.php +++ /dev/null @@ -1,165 +0,0 @@ -current_page_helper = Mockery::mock( Current_Page_Helper::class ); - $this->product_helper = Mockery::mock( Product_Helper::class ); - - $this->instance = new AI_Brand_Insights_Free_Trial( - $this->current_page_helper, - $this->product_helper, - ); - } - - /** - * Tests if the needed attributes are set correctly. - * - * @covers ::__construct - * - * @return void - */ - public function test_constructor() { - $this->assertInstanceOf( - Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ), - ); - $this->assertInstanceOf( - Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ), - ); - } - - /** - * Tests getting the ID. - * - * @covers ::get_id - * - * @return void - */ - public function test_get_name() { - $this->assertSame( 'ai-brand-insights-free-trial', $this->instance->get_id() ); - } - - /** - * Tests getting the priority. - * - * @covers ::get_priority - * - * @return void - */ - public function test_get_priority() { - $this->assertSame( 20, $this->instance->get_priority() ); - } - - /** - * Tests the conditional `should_show`. - * - * @covers ::should_show - * - * @dataProvider should_show_data - * - * @param bool $is_yoast_seo_page Whether on a Yoast SEO page. - * @param bool $is_premium Whether Premium is installed. - * @param int $is_premium_times How many times the `is_premium` method is expected to be called. - * @param bool $expected The expected result. - * - * @return void - */ - public function test_should_show( - $is_yoast_seo_page, - $is_premium, - $is_premium_times, - $expected - ) { - $this->current_page_helper->expects( 'is_yoast_seo_page' ) - ->once() - ->withNoArgs() - ->andReturn( $is_yoast_seo_page ); - $this->product_helper->expects( 'is_premium' ) - ->times( $is_premium_times ) - ->withNoArgs() - ->andReturn( $is_premium ); - - $this->assertSame( $expected, $this->instance->should_show() ); - } - - /** - * Provides the data for `test_should_show`. - * - * @return array> - */ - public static function should_show_data() { - return [ - 'on a Yoast admin page, with Premium enabled' => [ - 'is_yoast_seo_page' => true, - 'is_premium' => true, - 'is_premium_times' => 1, - 'expected' => true, - ], - 'on a Yoast admin page, with Premium disabled' => [ - 'is_yoast_seo_page' => true, - 'is_premium' => false, - 'is_premium_times' => 1, - 'expected' => false, - ], - 'not on a Yoast admin page, with Premium enabled' => [ - 'is_yoast_seo_page' => false, - 'is_premium' => true, - 'is_premium_times' => 0, - 'expected' => false, - ], - 'not on a Yoast admin page, with Premium disabled' => [ - 'is_yoast_seo_page' => false, - 'is_premium' => false, - 'is_premium_times' => 0, - 'expected' => false, - ], - ]; - } -} diff --git a/tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php b/tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php deleted file mode 100644 index 5be57f920fe..00000000000 --- a/tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php +++ /dev/null @@ -1,165 +0,0 @@ -current_page_helper = Mockery::mock( Current_Page_Helper::class ); - $this->product_helper = Mockery::mock( Product_Helper::class ); - - $this->instance = new AI_Brand_Insights_Post_Launch( - $this->current_page_helper, - $this->product_helper, - ); - } - - /** - * Tests if the needed attributes are set correctly. - * - * @covers ::__construct - * - * @return void - */ - public function test_constructor() { - $this->assertInstanceOf( - Current_Page_Helper::class, - $this->getPropertyValue( $this->instance, 'current_page_helper' ), - ); - $this->assertInstanceOf( - Product_Helper::class, - $this->getPropertyValue( $this->instance, 'product_helper' ), - ); - } - - /** - * Tests getting the ID. - * - * @covers ::get_id - * - * @return void - */ - public function test_get_name() { - $this->assertSame( 'ai-brand-insights-post-launch', $this->instance->get_id() ); - } - - /** - * Tests getting the priority. - * - * @covers ::get_priority - * - * @return void - */ - public function test_get_priority() { - $this->assertSame( 20, $this->instance->get_priority() ); - } - - /** - * Tests the conditional `should_show`. - * - * @covers ::should_show - * - * @dataProvider should_show_data - * - * @param bool $is_yoast_seo_page Whether on a Yoast SEO page. - * @param bool $is_premium Whether Premium is installed. - * @param int $is_premium_times How many times the `is_premium` method is expected to be called. - * @param bool $expected The expected result. - * - * @return void - */ - public function test_should_show( - $is_yoast_seo_page, - $is_premium, - $is_premium_times, - $expected - ) { - $this->current_page_helper->expects( 'is_yoast_seo_page' ) - ->once() - ->withNoArgs() - ->andReturn( $is_yoast_seo_page ); - $this->product_helper->expects( 'is_premium' ) - ->times( $is_premium_times ) - ->withNoArgs() - ->andReturn( $is_premium ); - - $this->assertSame( $expected, $this->instance->should_show() ); - } - - /** - * Provides the data for `test_should_show`. - * - * @return array> - */ - public static function should_show_data() { - return [ - 'on a Yoast admin page, with Premium disabled' => [ - 'is_yoast_seo_page' => true, - 'is_premium' => false, - 'is_premium_times' => 1, - 'expected' => true, - ], - 'on a Yoast admin page, with Premium enabled' => [ - 'is_yoast_seo_page' => true, - 'is_premium' => true, - 'is_premium_times' => 1, - 'expected' => false, - ], - 'not on a Yoast admin page, with Premium disabled' => [ - 'is_yoast_seo_page' => false, - 'is_premium' => false, - 'is_premium_times' => 0, - 'expected' => false, - ], - 'not on a Yoast admin page, with Premium enabled' => [ - 'is_yoast_seo_page' => false, - 'is_premium' => true, - 'is_premium_times' => 0, - 'expected' => false, - ], - ]; - } -}