Remove insight on first sale note (#35341)

* Remove insight on first sale note

* Add changelog entry
This commit is contained in:
Joshua T Flowers 2022-11-03 09:48:20 -07:00 committed by GitHub
parent a6ed0a0e36
commit e8db853ceb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 94 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Remove insight on first sale note

View File

@ -833,6 +833,7 @@ class WC_Install {
'wc-admin-update-store-details', 'wc-admin-update-store-details',
'wc-admin-effortless-payments-by-mollie', 'wc-admin-effortless-payments-by-mollie',
'wc-admin-google-ads-and-marketing', 'wc-admin-google-ads-and-marketing',
'wc-admin-insight-first-sale',
'wc-admin-marketing-intro', 'wc-admin-marketing-intro',
'wc-admin-draw-attention', 'wc-admin-draw-attention',
'wc-admin-need-some-inspiration', 'wc-admin-need-some-inspiration',

View File

@ -223,27 +223,6 @@ class WC_Admin_Notes_Giving_Feedback_Notes extends DeprecatedClassFacade {
protected static $deprecated_in_version = '4.8.0'; 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. * WC_Admin_Notes_Install_JP_And_WCS_Plugins.
* *

View File

@ -20,7 +20,6 @@ use \Automattic\WooCommerce\Internal\Admin\Notes\EditProductsOnTheMove;
use \Automattic\WooCommerce\Internal\Admin\Notes\EUVATNumber; use \Automattic\WooCommerce\Internal\Admin\Notes\EUVATNumber;
use \Automattic\WooCommerce\Internal\Admin\Notes\FirstDownloadableProduct; use \Automattic\WooCommerce\Internal\Admin\Notes\FirstDownloadableProduct;
use \Automattic\WooCommerce\Internal\Admin\Notes\FirstProduct; 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\InstallJPAndWCSPlugins;
use \Automattic\WooCommerce\Internal\Admin\Notes\LaunchChecklist; use \Automattic\WooCommerce\Internal\Admin\Notes\LaunchChecklist;
use \Automattic\WooCommerce\Internal\Admin\Notes\MagentoMigration; use \Automattic\WooCommerce\Internal\Admin\Notes\MagentoMigration;
@ -82,7 +81,6 @@ class Events {
EUVATNumber::class, EUVATNumber::class,
FirstDownloadableProduct::class, FirstDownloadableProduct::class,
FirstProduct::class, FirstProduct::class,
InsightFirstSale::class,
LaunchChecklist::class, LaunchChecklist::class,
MagentoMigration::class, MagentoMigration::class,
ManageOrdersOnTheGo::class, ManageOrdersOnTheGo::class,

View File

@ -1,71 +0,0 @@
<?php
/**
* WooCommerce Admin: Insight - First sale
*
* Adds a note to give insight about the first sale.
*
* @package WooCommerce\Admin
*/
namespace Automattic\WooCommerce\Internal\Admin\Notes;
defined( 'ABSPATH' ) || exit;
use \Automattic\WooCommerce\Admin\Notes\Note;
use \Automattic\WooCommerce\Admin\Notes\NoteTraits;
/**
* Insight_First_Sale.
*/
class InsightFirstSale {
/**
* Note traits.
*/
use NoteTraits;
/**
* Name of the note for use in the database.
*/
const NOTE_NAME = 'wc-admin-insight-first-sale';
/**
* Get the note.
*
* @return Note
*/
public static function get_note() {
if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4' ) ) {
return;
}
$note = new Note();
$note->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;
}
}