Commit 80e1824599d for woocommerce
commit 80e1824599df770d2ecf2d576dd3986050ec96aa
Author: Jill Q. <jill.quek@automattic.com>
Date: Wed Apr 29 11:11:41 2026 +0800
Stop rendering inbox note images and deprecate the API (#64443)
* Stop rendering inbox note images and deprecate the API
* Add changelog entries for inbox note image removal
* Fix CI: stop calling deprecated set_layout in SpecRunner; markdown + PHPCS alignment fixes
* Remove stale PHPStan baseline entry for SpecRunner set_layout call
* Skip image/layout in Note::__construct set_props dispatch
* Remove deprecated set_layout/set_image from activity-panel-inbox.md Example Plugin Two
* Centralize deprecated layout/image column defaults as DataStore constants
* Address Chi's review: wc_deprecated wrappers, restore deprecated fields on InboxNote type, drop stale comment
diff --git a/packages/js/experimental/changelog/fix-inbox-note-remove-image-rendering b/packages/js/experimental/changelog/fix-inbox-note-remove-image-rendering
new file mode 100644
index 00000000000..1904eeeaf36
--- /dev/null
+++ b/packages/js/experimental/changelog/fix-inbox-note-remove-image-rendering
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Stop rendering thumbnail images in inbox notes. Drop `image` and `layout` from the InboxNoteCard prop type and remove the `.thumbnail` and `.banner` styles.
diff --git a/packages/js/experimental/src/inbox-note/inbox-note.tsx b/packages/js/experimental/src/inbox-note/inbox-note.tsx
index 3a00d0ca9bc..49f58aaf738 100644
--- a/packages/js/experimental/src/inbox-note/inbox-note.tsx
+++ b/packages/js/experimental/src/inbox-note/inbox-note.tsx
@@ -33,11 +33,13 @@ type InboxNote = {
date_created: string;
date_created_gmt: string;
actions: InboxNoteAction[];
- layout: string;
- image: string;
is_deleted: boolean;
type: string;
is_read: boolean;
+ /** @deprecated No longer rendered. Will be removed in a future release. */
+ layout?: string;
+ /** @deprecated No longer rendered. Will be removed in a future release. */
+ image?: string;
};
type InboxNoteProps = {
@@ -134,9 +136,7 @@ const InboxNoteCard = ( {
const {
content,
date_created_gmt: dateCreatedGmt,
- image,
is_deleted: isDeleted,
- layout,
status,
title,
is_read,
@@ -147,15 +147,9 @@ const InboxNoteCard = ( {
}
const unread = is_read === false;
- const hasImage = layout === 'thumbnail';
- const cardClassName = clsx(
- 'woocommerce-inbox-message',
- className,
- layout,
- {
- 'message-is-unread': unread && status === 'unactioned',
- }
- );
+ const cardClassName = clsx( 'woocommerce-inbox-message', className, {
+ 'message-is-unread': unread && status === 'unactioned',
+ } );
const actionWrapperClassName = clsx( 'woocommerce-inbox-message__actions', {
'has-multiple-actions': note.actions?.length > 1,
@@ -163,11 +157,6 @@ const InboxNoteCard = ( {
return (
<section ref={ ref } className={ cardClassName }>
- { hasImage && (
- <div className="woocommerce-inbox-message__image">
- <img src={ image } alt="" />
- </div>
- ) }
<div className="woocommerce-inbox-message__wrapper">
<div className="woocommerce-inbox-message__content">
{ unread && (
diff --git a/packages/js/experimental/src/inbox-note/style.scss b/packages/js/experimental/src/inbox-note/style.scss
index a2d919f38d2..fd7122cfb5b 100644
--- a/packages/js/experimental/src/inbox-note/style.scss
+++ b/packages/js/experimental/src/inbox-note/style.scss
@@ -5,32 +5,6 @@
border-radius: 2px;
@include font-size( 13 );
margin: 0 0;
- -ms-box-orient: horizontal;
- &.banner {
- -webkit-flex-direction: column;
- flex-direction: column;
- img {
- width: 100%;
- }
- }
- &.thumbnail {
- display: flex;
- -webkit-flex-direction: row-reverse;
- flex-direction: row-reverse;
-
- .woocommerce-inbox-message__image {
- width: 40%;
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
-
- .woocommerce-inbox-message__wrapper {
- width: 60%;
- }
- }
&:hover {
background: $gray-100;
}
diff --git a/packages/js/experimental/src/inbox-note/test/inbox-note.tsx b/packages/js/experimental/src/inbox-note/test/inbox-note.tsx
index d3068df77fc..9e9b707c76b 100644
--- a/packages/js/experimental/src/inbox-note/test/inbox-note.tsx
+++ b/packages/js/experimental/src/inbox-note/test/inbox-note.tsx
@@ -59,8 +59,6 @@ describe( 'InboxNoteCard', () => {
url: 'http://test.com',
},
],
- layout: 'plain',
- image: '',
date_created_gmt: '2020-05-10T16:57:31',
is_deleted: false,
is_read: false,
@@ -152,15 +150,6 @@ describe( 'InboxNoteCard', () => {
expect( queryByText( 'Dismiss' ) ).toBeInTheDocument();
} );
- it( 'should render a notification type thumbnail', () => {
- const thumbnailNote = { ...note, layout: 'thumbnail' };
- const { container } = render(
- <InboxNoteCard key={ thumbnailNote.id } note={ thumbnailNote } />
- );
- const listNoteWithThumbnail = container.querySelector( '.thumbnail' );
- expect( listNoteWithThumbnail ).not.toBeNull();
- } );
-
it( 'should render a read notification', () => {
const noteWithoutActions = {
...{ ...note, is_read: true },
diff --git a/plugins/woocommerce-beta-tester/api/admin-notes/add-note.php b/plugins/woocommerce-beta-tester/api/admin-notes/add-note.php
index 41711630762..517d66b2da2 100644
--- a/plugins/woocommerce-beta-tester/api/admin-notes/add-note.php
+++ b/plugins/woocommerce-beta-tester/api/admin-notes/add-note.php
@@ -18,13 +18,10 @@ function admin_notes_add_note( $request ) {
$note = new Note();
$mock_note_data = get_mock_note_data();
$type = $request->get_param( 'type' );
- $layout = $request->get_param( 'layout' );
$note->set_name( $request->get_param( 'name' ) );
$note->set_title( $request->get_param( 'title' ) );
$note->set_content( $mock_note_data['content'] );
- $note->set_image( $mock_note_data[ $type ][ $layout ] );
- $note->set_layout( $layout );
$note->set_type( $type );
possibly_add_action( $note );
@@ -69,18 +66,7 @@ function possibly_add_action( $note ) {
* Gets mock note data.
*/
function get_mock_note_data() {
- $plugin_url = site_url() . '/wp-content/plugins/woocommerce-admin-test-helper/';
return array(
'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.',
- 'info' => array(
- 'thumbnail' => $plugin_url . 'images/admin-notes/thumbnail.jpg',
- 'plain' => '',
- ),
- 'email' => array(
- 'plain' => $plugin_url . 'images/admin-notes/woocommerce-logo-vector.png',
- ),
- 'update' => array(
- 'plain' => '',
- ),
);
}
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-add-note-drop-image-layout b/plugins/woocommerce-beta-tester/changelog/dev-add-note-drop-image-layout
new file mode 100644
index 00000000000..4371207cd8d
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/changelog/dev-add-note-drop-image-layout
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+Comment: Remove the image and layout fields from the test "Add admin note" tool now that inbox notes no longer render images.
+
diff --git a/plugins/woocommerce-beta-tester/src/admin-notes/add-note.js b/plugins/woocommerce-beta-tester/src/admin-notes/add-note.js
index c36aa160bf6..439a50e0c2d 100644
--- a/plugins/woocommerce-beta-tester/src/admin-notes/add-note.js
+++ b/plugins/woocommerce-beta-tester/src/admin-notes/add-note.js
@@ -10,7 +10,6 @@ export const AddNote = () => {
const [ hasAdded, setHasAdded ] = useState( false );
const [ errorMessage, setErrorMessage ] = useState( false );
const [ noteType, setNoteType ] = useState( 'info' );
- const [ noteLayout, setNoteLayout ] = useState( 'plain' );
async function triggerAddNote() {
setIsAdding( true );
@@ -36,7 +35,6 @@ export const AddNote = () => {
data: {
name,
type: noteType,
- layout: noteLayout,
title,
},
} );
@@ -50,13 +48,6 @@ export const AddNote = () => {
function onTypeChange( val ) {
setNoteType( val );
- if ( val !== 'info' ) {
- setNoteLayout( 'plain' );
- }
- }
-
- function onLayoutChange( val ) {
- setNoteLayout( val );
}
function getAddNoteDescription() {
@@ -109,17 +100,6 @@ export const AddNote = () => {
] }
value={ noteType }
/>
- <SelectControl
- label="Layout"
- onChange={ onLayoutChange }
- labelPosition="side"
- options={ [
- { label: 'Plain', value: 'plain' },
- { label: 'Thumbnail', value: 'thumbnail' },
- ] }
- disabled={ noteType !== 'info' }
- value={ noteLayout }
- />
</div>
<br />
<span className="woocommerce-admin-test-helper__action-status">
diff --git a/plugins/woocommerce/assets/images/admin_notes/marketing-jetpack-2x.png b/plugins/woocommerce/assets/images/admin_notes/marketing-jetpack-2x.png
deleted file mode 100644
index a81e5bfa199..00000000000
Binary files a/plugins/woocommerce/assets/images/admin_notes/marketing-jetpack-2x.png and /dev/null differ
diff --git a/plugins/woocommerce/changelog/fix-inbox-note-remove-image-thumbnail b/plugins/woocommerce/changelog/fix-inbox-note-remove-image-thumbnail
new file mode 100644
index 00000000000..6267bde0d9c
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-inbox-note-remove-image-thumbnail
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Stop rendering thumbnail images in inbox notes; deprecate `Note::set_image()`, `Note::get_image()`, `Note::set_layout()`, `Note::get_layout()` and the `'thumbnail'` layout value, all of which will be removed in a future release.
diff --git a/plugins/woocommerce/client/admin/docs/examples/activity-panel-inbox.md b/plugins/woocommerce/client/admin/docs/examples/activity-panel-inbox.md
index 2e90126890b..1f66593b6e1 100644
--- a/plugins/woocommerce/client/admin/docs/examples/activity-panel-inbox.md
+++ b/plugins/woocommerce/client/admin/docs/examples/activity-panel-inbox.md
@@ -39,7 +39,7 @@ There are some constraints extensions should follow when working with the inbox:
1. Notes can have 0, 1, or 2 action buttons. Action buttons have URLs. They can either be complete URLs (like in the case of an external link) or partial URLs (like in the case of an admin page on the site) - in the case of partial URLs you’ll want to give a string that is the same as what you’d supply to WordPress core’s admin_url function. You can even include query parameters in that string.
1. You should store your extension’s name (slug) in the source property of the note. WooCommerce will store ‘woocommerce’ there. For example, the “Panda Payments” extension could use a name like “panda-payments” - this makes it easier to use built in functions to get (or delete) all notes with a certain name.
1. You can use the name property of a note to store a sub-type of note. For example, if the Panda Payments extension generates notes for both connection problems AND for new features, they might both have ‘panda-payments’ in the source property but then use ‘connection-problem’ and ‘new-feature’ in the name property to distinguish between the two types of notes.
-1. Icons are Gridicons. You can find a gallery [here](https://automattic.github.io/gridicons/)
+1. Icons are Gridicons. You can find [the Gridicons gallery on the Automattic GitHub site](https://automattic.github.io/gridicons/).
1. As a best practice, have your extension remove its notes on deactivation or at least uninstall.
So, enough rules - let’s get into how to code this up. And surprise, no JavaScript is necessary - you can work with the inbox exclusively through PHP -- the inbox front-end is React based, sure, but it draws all its data from a couple of new database tables and the PHP based REST API (and that’s where you can work with notes).
@@ -110,8 +110,6 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_One {
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
$note->set_name( self::NOTE_NAME );
$note->set_source( 'wapi-example-plugin-one' );
- $note->set_layout('plain');
- $note->set_image('');
// This example has two actions. A note can have 0 or 1 as well.
$note->add_action(
'settings',
@@ -209,8 +207,6 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_Two {
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
$note->set_name( self::NOTE_NAME );
- $note->set_layout('plain');
- $note->set_image('');
$note->set_source( 'wapi-example-plugin-two' );
// This example has no actions. A note can have 1 or 2 as well.
$note->save();
diff --git a/plugins/woocommerce/client/admin/docs/examples/extensions/simple-inbox-note/class-simpleinboxnote.php b/plugins/woocommerce/client/admin/docs/examples/extensions/simple-inbox-note/class-simpleinboxnote.php
index 23cb3cf937d..4f09e18e375 100644
--- a/plugins/woocommerce/client/admin/docs/examples/extensions/simple-inbox-note/class-simpleinboxnote.php
+++ b/plugins/woocommerce/client/admin/docs/examples/extensions/simple-inbox-note/class-simpleinboxnote.php
@@ -82,14 +82,6 @@ class SimpleInboxNote {
// error, warning, update, info, marketing.
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
- // Set the type of layout the note uses. Supported layout types are:
- // 'plain', 'thumbnail'.
- $note->set_layout( 'plain' );
-
- // Set the image for the note. This property renders as the src
- // attribute for an img tag, so use a string here.
- $note->set_image( '' );
-
// Set the note name and source. You should store your extension's
// name (slug) in the source property of the note. You can use
// the name property of the note to support multiple sub-types of
diff --git a/plugins/woocommerce/phpstan-baseline.neon b/plugins/woocommerce/phpstan-baseline.neon
index 3600a214636..fbe3adb94ae 100644
--- a/plugins/woocommerce/phpstan-baseline.neon
+++ b/plugins/woocommerce/phpstan-baseline.neon
@@ -49431,12 +49431,6 @@ parameters:
count: 1
path: src/Admin/RemoteInboxNotifications/SpecRunner.php
- -
- message: '#^Cannot call method set_layout\(\) on Automattic\\WooCommerce\\Admin\\Notes\\Note\|true\.$#'
- identifier: method.nonObject
- count: 1
- path: src/Admin/RemoteInboxNotifications/SpecRunner.php
-
-
message: '#^Cannot call method set_name\(\) on Automattic\\WooCommerce\\Admin\\Notes\\Note\|true\.$#'
identifier: method.nonObject
diff --git a/plugins/woocommerce/src/Admin/API/Notes.php b/plugins/woocommerce/src/Admin/API/Notes.php
index c1d8a1cdc04..373e0701788 100644
--- a/plugins/woocommerce/src/Admin/API/Notes.php
+++ b/plugins/woocommerce/src/Admin/API/Notes.php
@@ -785,13 +785,13 @@ class Notes extends \WC_REST_CRUD_Controller {
'readonly' => true,
),
'layout' => array(
- 'description' => __( 'The layout of the note (e.g. banner, thumbnail, plain).', 'woocommerce' ),
+ 'description' => __( 'Deprecated. Always returns "plain". Inbox notes no longer support layout variants; this field will be removed in a future release.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'image' => array(
- 'description' => __( 'The image of the note, if any.', 'woocommerce' ),
+ 'description' => __( 'Deprecated. Always returns an empty string. Inbox notes no longer render images; this field will be removed in a future release.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
diff --git a/plugins/woocommerce/src/Admin/Notes/DataStore.php b/plugins/woocommerce/src/Admin/Notes/DataStore.php
index 470cb3f30d3..c7e5162c71c 100644
--- a/plugins/woocommerce/src/Admin/Notes/DataStore.php
+++ b/plugins/woocommerce/src/Admin/Notes/DataStore.php
@@ -14,6 +14,13 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
// Extensions should define their own contexts and use them to avoid applying woocommerce_note_where_clauses when not needed.
const WC_ADMIN_NOTE_OPER_GLOBAL = 'global';
+ /**
+ * Fixed values written to the deprecated `layout` and `image` columns. The columns and the
+ * values themselves will be removed in a follow-up release once the deprecation cycle ends.
+ */
+ const DEPRECATED_LAYOUT_VALUE = 'plain';
+ const DEPRECATED_IMAGE_VALUE = '';
+
/**
* Method to create a new note in the database.
*
@@ -34,8 +41,8 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
'status' => $note->get_status(),
'source' => $note->get_source(),
'is_snoozable' => (int) $note->get_is_snoozable(),
- 'layout' => $note->get_layout(),
- 'image' => $note->get_image(),
+ 'layout' => self::DEPRECATED_LAYOUT_VALUE,
+ 'image' => self::DEPRECATED_IMAGE_VALUE,
'is_deleted' => (int) $note->get_is_deleted(),
'is_read' => (int) $note->get_is_read(),
);
@@ -113,8 +120,6 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
$note->set_is_snoozable( (bool) $note_row->is_snoozable );
$note->set_is_deleted( (bool) $note_row->is_deleted );
isset( $note_row->is_read ) && $note->set_is_read( (bool) $note_row->is_read );
- $note->set_layout( $note_row->layout );
- $note->set_image( $note_row->image );
$this->read_actions( $note );
$note->set_object_read( true );
@@ -164,8 +169,8 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
'date_created' => $date_created_to_db,
'date_reminder' => $date_reminder_to_db,
'is_snoozable' => (int) $note->get_is_snoozable(),
- 'layout' => $note->get_layout(),
- 'image' => $note->get_image(),
+ 'layout' => self::DEPRECATED_LAYOUT_VALUE,
+ 'image' => self::DEPRECATED_IMAGE_VALUE,
'is_deleted' => (int) $note->get_is_deleted(),
'is_read' => (int) $note->get_is_read(),
),
diff --git a/plugins/woocommerce/src/Admin/Notes/Note.php b/plugins/woocommerce/src/Admin/Notes/Note.php
index d3074691fbf..acfd71be7a5 100644
--- a/plugins/woocommerce/src/Admin/Notes/Note.php
+++ b/plugins/woocommerce/src/Admin/Notes/Note.php
@@ -79,6 +79,8 @@ class Note extends \WC_Data {
} elseif ( is_object( $data ) && ! empty( $data->note_id ) ) {
$this->set_id( $data->note_id );
unset( $data->icon ); // Icons are deprecated.
+ // `image` and `layout` are deprecated — skip them so set_props doesn't dispatch to the deprecated setters.
+ unset( $data->image, $data->layout );
$this->set_props( (array) $data );
$this->set_object_read( true );
} else {
@@ -326,22 +328,28 @@ class Note extends \WC_Data {
}
/**
- * Get note layout (the old notes won't have one).
+ * Get note layout.
+ *
+ * @deprecated 10.8.0 Inbox notes no longer support layout variants; only 'plain' is valid and the field will be removed in a future release.
*
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
- * @return array
+ * @return string
*/
public function get_layout( $context = 'view' ) {
+ wc_deprecated_function( __METHOD__, '10.8.0' );
return $this->get_prop( 'layout', $context );
}
/**
- * Get note image (if any).
+ * Get note image.
+ *
+ * @deprecated 10.8.0 Inbox notes no longer render images; the field will be removed in a future release.
*
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
- * @return array
+ * @return string
*/
public function get_image( $context = 'view' ) {
+ wc_deprecated_function( __METHOD__, '10.8.0' );
return $this->get_prop( 'image', $context );
}
@@ -588,16 +596,25 @@ class Note extends \WC_Data {
/**
* Set note layout.
*
+ * @deprecated 10.8.0 Inbox notes no longer support layout variants; only 'plain' is valid and the field will be removed in a future release.
+ *
* @param string $layout Note layout.
*/
public function set_layout( $layout ) {
- // If we don't receive a layout we will set it by default as "plain".
+ wc_deprecated_function( __METHOD__, '10.8.0' );
+
+ // 'thumbnail' was previously a valid value but is no longer rendered. Coerce it to 'plain'
+ // so existing callers don't break, and surface a deprecation warning so they update.
+ if ( 'thumbnail' === $layout ) {
+ wc_deprecated_argument( __METHOD__, '10.8.0', "The 'thumbnail' layout is no longer supported; coerced to 'plain'." );
+ $layout = 'plain';
+ }
+
if ( empty( $layout ) ) {
$layout = 'plain';
}
- $valid_layouts = array( 'plain', 'thumbnail' );
- if ( in_array( $layout, $valid_layouts, true ) ) {
+ if ( 'plain' === $layout ) {
$this->set_prop( 'layout', $layout );
} else {
$this->error( 'admin_note_invalid_data', __( 'The admin note layout has a wrong prop value.', 'woocommerce' ) );
@@ -607,9 +624,12 @@ class Note extends \WC_Data {
/**
* Set note image.
*
+ * @deprecated 10.8.0 Inbox notes no longer render images; the field will be removed in a future release.
+ *
* @param string $image Note image.
*/
public function set_image( $image ) {
+ wc_deprecated_function( __METHOD__, '10.8.0' );
$this->set_prop( 'image', $image );
}
diff --git a/plugins/woocommerce/src/Admin/Notes/Notes.php b/plugins/woocommerce/src/Admin/Notes/Notes.php
index 7ec1903aa19..c790ba62083 100644
--- a/plugins/woocommerce/src/Admin/Notes/Notes.php
+++ b/plugins/woocommerce/src/Admin/Notes/Notes.php
@@ -63,8 +63,8 @@ class Notes {
$notes[ $note_id ]['date_created'] = $note->get_date_created( $context );
$notes[ $note_id ]['date_reminder'] = $note->get_date_reminder( $context );
$notes[ $note_id ]['actions'] = $note->get_actions( $context );
- $notes[ $note_id ]['layout'] = $note->get_layout( $context );
- $notes[ $note_id ]['image'] = $note->get_image( $context );
+ $notes[ $note_id ]['layout'] = 'plain';
+ $notes[ $note_id ]['image'] = '';
$notes[ $note_id ]['is_deleted'] = $note->get_is_deleted( $context );
} catch ( \Exception $e ) {
wc_caught_exception( $e, __CLASS__ . '::' . __FUNCTION__, array( $note_id ) );
diff --git a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/SpecRunner.php b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/SpecRunner.php
index fe01ad82607..846f3724e58 100644
--- a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/SpecRunner.php
+++ b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/SpecRunner.php
@@ -72,9 +72,7 @@ class SpecRunner {
if ( isset( $spec->source ) ) {
$note->set_source( $spec->source );
}
- if ( isset( $spec->layout ) ) {
- $note->set_layout( $spec->layout );
- }
+ // `$spec->layout` is intentionally ignored: inbox notes no longer support layout variants and the property is deprecated.
// Recreate actions.
$note->set_actions( self::get_actions( $spec ) );
diff --git a/plugins/woocommerce/src/Internal/Admin/Notes/MarketingJetpack.php b/plugins/woocommerce/src/Internal/Admin/Notes/MarketingJetpack.php
index 22f4693e6e3..662aaab9c85 100644
--- a/plugins/woocommerce/src/Internal/Admin/Notes/MarketingJetpack.php
+++ b/plugins/woocommerce/src/Internal/Admin/Notes/MarketingJetpack.php
@@ -105,10 +105,6 @@ class MarketingJetpack {
$note->set_content( __( 'Store downtime means lost sales. One-click restores get you back online quickly if something goes wrong.', 'woocommerce' ) );
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
$note->set_name( self::NOTE_NAME );
- $note->set_layout( 'thumbnail' );
- $note->set_image(
- WC_ADMIN_IMAGES_FOLDER_URL . '/admin_notes/marketing-jetpack-2x.png'
- );
$note->set_content_data( (object) array() );
$note->set_source( 'woocommerce-admin-notes' );
$note->add_action(
diff --git a/plugins/woocommerce/tests/legacy/framework/helpers/class-wc-helper-admin-notes.php b/plugins/woocommerce/tests/legacy/framework/helpers/class-wc-helper-admin-notes.php
index d6dca7d36dc..88428915f22 100644
--- a/plugins/woocommerce/tests/legacy/framework/helpers/class-wc-helper-admin-notes.php
+++ b/plugins/woocommerce/tests/legacy/framework/helpers/class-wc-helper-admin-notes.php
@@ -37,8 +37,6 @@ class WC_Helper_Admin_Notes {
$note_1->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
$note_1->set_source( 'PHPUNIT_TEST' );
$note_1->set_is_snoozable( false );
- $note_1->set_layout( 'plain' );
- $note_1->set_image( '' );
$note_1->add_action(
'PHPUNIT_TEST_NOTE_1_ACTION_1_SLUG',
'PHPUNIT_TEST_NOTE_1_ACTION_1_LABEL',
@@ -60,8 +58,6 @@ class WC_Helper_Admin_Notes {
$note_2->set_source( 'PHPUNIT_TEST' );
$note_2->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
$note_2->set_is_snoozable( true );
- $note_2->set_layout( 'thumbnail' );
- $note_2->set_image( 'https://an-image.jpg' );
// This note has no actions.
$note_2->save();
@@ -74,8 +70,6 @@ class WC_Helper_Admin_Notes {
$note_3->set_source( 'PHPUNIT_TEST' );
$note_3->set_status( Note::E_WC_ADMIN_NOTE_SNOOZED );
$note_3->set_date_reminder( time() - HOUR_IN_SECONDS );
- $note_3->set_layout( 'thumbnail' );
- $note_3->set_image( 'https://an-image.jpg' );
// This note has no actions.
$note_3->save();
@@ -87,8 +81,6 @@ class WC_Helper_Admin_Notes {
$note_4->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
$note_4->set_source( 'PHPUNIT_TEST' );
$note_4->set_is_snoozable( false );
- $note_4->set_layout( 'plain' );
- $note_4->set_image( '' );
$note_4->add_action(
'PHPUNIT_TEST_NOTE_4_ACTION_1_SLUG',
'PHPUNIT_TEST_NOTE_4_ACTION_1_LABEL',
@@ -118,8 +110,6 @@ class WC_Helper_Admin_Notes {
$note->set_name( $name );
$note->set_source( 'PHPUNIT_TEST' );
$note->set_is_snoozable( false );
- $note->set_layout( 'plain' );
- $note->set_image( '' );
$note->save();
}
}
diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/notes/class-wc-tests-notes-data-store.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/notes/class-wc-tests-notes-data-store.php
index 4f8ae24bc45..04ebbbfea54 100644
--- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/notes/class-wc-tests-notes-data-store.php
+++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/notes/class-wc-tests-notes-data-store.php
@@ -25,8 +25,6 @@ class WC_Admin_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
$note->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
$note->set_source( 'PHPUNIT_TEST' );
$note->set_is_snoozable( false );
- $note->set_layout( 'plain' );
- $note->set_image( '' );
$note->add_action(
'PHPUNIT_TEST_ACTION_SLUG',
'PHPUNIT_TEST_ACTION_LABEL',
@@ -46,8 +44,6 @@ class WC_Admin_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
$this->assertEquals( $note->get_name(), $read_note->get_name() );
$this->assertEquals( $note->get_source(), $read_note->get_source() );
$this->assertEquals( $note->get_is_snoozable(), false !== $read_note->get_is_snoozable() );
- $this->assertEquals( $note->get_layout(), $read_note->get_layout() );
- $this->assertEquals( $note->get_image(), $read_note->get_image() );
$this->assertEquals( $note->get_actions(), $read_note->get_actions() );
$this->assertEquals( $note->get_is_deleted(), $read_note->get_is_deleted() );
}
@@ -364,8 +360,6 @@ class WC_Admin_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
$note->set_name( 'PHPUNIT_PAGING_TEST_NOTE_NAME' );
$note->set_source( 'PHPUNIT_TEST' );
$note->set_is_snoozable( false );
- $note->set_layout( 'plain' );
- $note->set_image( '' );
$note->add_action(
'PHPUNIT_TEST_ACTION_SLUG',
'PHPUNIT_TEST_ACTION_LABEL',
@@ -437,8 +431,6 @@ class WC_Admin_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
$note->set_source( 'PHPUNIT_TEST' );
$note->set_is_snoozable( false );
- $note->set_layout( 'plain' );
- $note->set_image( '' );
$note->add_action(
'PHPUNIT_TEST_ACTION_SLUG',
'PHPUNIT_TEST_ACTION_LABEL',