From e8db853ceb10e1a21787a5f4171055ee214c6b47 Mon Sep 17 00:00:00 2001 From: Joshua T Flowers Date: Thu, 3 Nov 2022 09:48:20 -0700 Subject: [PATCH] Remove insight on first sale note (#35341) * Remove insight on first sale note * Add changelog entry --- .../changelog/remove-insight-first-sale-note | 4 ++ .../woocommerce/includes/class-wc-install.php | 1 + .../src/Admin/Notes/DeprecatedNotes.php | 21 ------ .../woocommerce/src/Internal/Admin/Events.php | 2 - .../Internal/Admin/Notes/InsightFirstSale.php | 71 ------------------- 5 files changed, 5 insertions(+), 94 deletions(-) create mode 100644 plugins/woocommerce/changelog/remove-insight-first-sale-note delete mode 100644 plugins/woocommerce/src/Internal/Admin/Notes/InsightFirstSale.php diff --git a/plugins/woocommerce/changelog/remove-insight-first-sale-note b/plugins/woocommerce/changelog/remove-insight-first-sale-note new file mode 100644 index 00000000000..91145d27806 --- /dev/null +++ b/plugins/woocommerce/changelog/remove-insight-first-sale-note @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Remove insight on first sale note diff --git a/plugins/woocommerce/includes/class-wc-install.php b/plugins/woocommerce/includes/class-wc-install.php index 54da7d2fd0e..8fe7066711f 100644 --- a/plugins/woocommerce/includes/class-wc-install.php +++ b/plugins/woocommerce/includes/class-wc-install.php @@ -833,6 +833,7 @@ class WC_Install { 'wc-admin-update-store-details', 'wc-admin-effortless-payments-by-mollie', 'wc-admin-google-ads-and-marketing', + 'wc-admin-insight-first-sale', 'wc-admin-marketing-intro', 'wc-admin-draw-attention', 'wc-admin-need-some-inspiration', diff --git a/plugins/woocommerce/src/Admin/Notes/DeprecatedNotes.php b/plugins/woocommerce/src/Admin/Notes/DeprecatedNotes.php index 2920f0880b0..baf2645ada9 100644 --- a/plugins/woocommerce/src/Admin/Notes/DeprecatedNotes.php +++ b/plugins/woocommerce/src/Admin/Notes/DeprecatedNotes.php @@ -223,27 +223,6 @@ class WC_Admin_Notes_Giving_Feedback_Notes extends DeprecatedClassFacade { protected static $deprecated_in_version = '4.8.0'; } -/** - * WC_Admin_Notes_Insight_First_Sale. - * - * @deprecated since 4.8.0, use InsightFirstSale - */ -class WC_Admin_Notes_Insight_First_Sale extends DeprecatedClassFacade { - /** - * The name of the non-deprecated class that this facade covers. - * - * @var string - */ - protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\InsightFirstSale'; - - /** - * The version that this class was deprecated in. - * - * @var string - */ - protected static $deprecated_in_version = '4.8.0'; -} - /** * WC_Admin_Notes_Install_JP_And_WCS_Plugins. * diff --git a/plugins/woocommerce/src/Internal/Admin/Events.php b/plugins/woocommerce/src/Internal/Admin/Events.php index f4815f4b4f9..1a1e57231ab 100644 --- a/plugins/woocommerce/src/Internal/Admin/Events.php +++ b/plugins/woocommerce/src/Internal/Admin/Events.php @@ -20,7 +20,6 @@ use \Automattic\WooCommerce\Internal\Admin\Notes\EditProductsOnTheMove; use \Automattic\WooCommerce\Internal\Admin\Notes\EUVATNumber; use \Automattic\WooCommerce\Internal\Admin\Notes\FirstDownloadableProduct; use \Automattic\WooCommerce\Internal\Admin\Notes\FirstProduct; -use \Automattic\WooCommerce\Internal\Admin\Notes\InsightFirstSale; use \Automattic\WooCommerce\Internal\Admin\Notes\InstallJPAndWCSPlugins; use \Automattic\WooCommerce\Internal\Admin\Notes\LaunchChecklist; use \Automattic\WooCommerce\Internal\Admin\Notes\MagentoMigration; @@ -82,7 +81,6 @@ class Events { EUVATNumber::class, FirstDownloadableProduct::class, FirstProduct::class, - InsightFirstSale::class, LaunchChecklist::class, MagentoMigration::class, ManageOrdersOnTheGo::class, diff --git a/plugins/woocommerce/src/Internal/Admin/Notes/InsightFirstSale.php b/plugins/woocommerce/src/Internal/Admin/Notes/InsightFirstSale.php deleted file mode 100644 index 1cc28010536..00000000000 --- a/plugins/woocommerce/src/Internal/Admin/Notes/InsightFirstSale.php +++ /dev/null @@ -1,71 +0,0 @@ -set_title( __( 'Did you know?', 'woocommerce' ) ); - $note->set_content( __( 'A WooCommerce powered store needs on average 31 days to get the first sale. You\'re on the right track! Do you find this type of insight useful?', 'woocommerce' ) ); - $note->set_type( Note::E_WC_ADMIN_NOTE_SURVEY ); - $note->set_name( self::NOTE_NAME ); - $note->set_content_data( (object) array() ); - $note->set_source( 'woocommerce-admin' ); - - // Note that there is no corresponding function called in response to - // this. Apart from setting the note to actioned a tracks event is - // sent in NoteActions. - $note->add_action( - 'affirm-insight-first-sale', - __( 'Yes', 'woocommerce' ), - false, - Note::E_WC_ADMIN_NOTE_ACTIONED, - false, - __( 'Thanks for your feedback', 'woocommerce' ) - ); - $note->add_action( - 'deny-insight-first-sale', - __( 'No', 'woocommerce' ), - false, - Note::E_WC_ADMIN_NOTE_ACTIONED, - false, - __( 'Thanks for your feedback', 'woocommerce' ) - ); - - return $note; - } -}