Remove insight first product and payment note (#35309)

* Remove InsightFirstProductAndPayment note

* Add changelog entry

* Remove obsolete note

* Fix yoda condition
This commit is contained in:
Joshua T Flowers 2022-11-01 11:46:36 -07:00 committed by GitHub
parent c7282de4ee
commit c2473da79b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 72 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Remove InsightFirstProductAndPayment note

View File

@ -822,6 +822,7 @@ class WC_Install {
global $wpdb;
$obsolete_notes_names = array(
'wc-admin-welcome-note',
'wc-admin-insight-first-product-and-payment',
'wc-admin-store-notice-setting-moved',
'wc-admin-store-notice-giving-feedback',
'wc-admin-learn-more-about-product-settings',

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\FirstDownlaodableProduct;
use \Automattic\WooCommerce\Internal\Admin\Notes\FirstProduct;
use \Automattic\WooCommerce\Internal\Admin\Notes\InsightFirstProductAndPayment;
use \Automattic\WooCommerce\Internal\Admin\Notes\InsightFirstSale;
use \Automattic\WooCommerce\Internal\Admin\Notes\InstallJPAndWCSPlugins;
use \Automattic\WooCommerce\Internal\Admin\Notes\LaunchChecklist;
@ -84,7 +83,6 @@ class Events {
EUVATNumber::class,
FirstDownlaodableProduct::class,
FirstProduct::class,
InsightFirstProductAndPayment::class,
InsightFirstSale::class,
LaunchChecklist::class,
MagentoMigration::class,
@ -129,7 +127,7 @@ class Events {
* @return object Instance.
*/
final public static function instance() {
if ( static::$instance === null ) {
if ( null === static::$instance ) {
static::$instance = new static();
}
return static::$instance;

View File

@ -1,69 +0,0 @@
<?php
/**
* WooCommerce Admin: Insight - First product and payment setup
*
* Adds a note to give insight about the first product and payment setup
*
* @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 InsightFirstProductAndPayment {
/**
* Note traits.
*/
use NoteTraits;
/**
* Name of the note for use in the database.
*/
const NOTE_NAME = 'wc-admin-insight-first-product-and-payment';
/**
* Get the note.
*
* @return Note
*/
public static function get_note() {
// We want to show the note after 1 day.
if ( ! self::is_wc_admin_active_in_date_range( 'week-1', DAY_IN_SECONDS ) ) {
return;
}
$note = new Note();
$note->set_title( __( 'Insight', 'woocommerce' ) );
$note->set_content( __( 'More than 80% of new merchants add the first product and have at least one payment method set up during the first week.<br><br>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->add_action(
'affirm-insight-first-product-and-payment',
__( 'Yes', 'woocommerce' ),
false,
Note::E_WC_ADMIN_NOTE_ACTIONED,
false,
__( 'Thanks for your feedback', 'woocommerce' )
);
$note->add_action(
'affirm-insight-first-product-and-payment',
__( 'No', 'woocommerce' ),
false,
Note::E_WC_ADMIN_NOTE_ACTIONED,
false,
__( 'Thanks for your feedback', 'woocommerce' )
);
return $note;
}
}