From 993a91be99b42c9c5fd7ed397eb868ff637dbdc3 Mon Sep 17 00:00:00 2001
From: Jeremy Herve
Date: Thu, 25 Apr 2024 15:11:32 +0200
Subject: [PATCH] Janitorial: use wp_admin_notice function introduced in WP 6.4
(#37051)
* Janitorial: use wp_admin_notice function introduced in WP 6.4
Epic: #33615
* Handle possibility of no message
* Switch from string to array
* Add missing escaping
* Fix indenting
* Add missing escaping
---
jetpack.php | 10 +++-
.../changelog/update-use-wp-admin-notice | 4 ++
.../connection/docs/error-handling.md | 22 ++++---
.../connection/src/class-error-handler.php | 14 +++--
.../changelog/update-use-wp-admin-notice | 4 ++
.../forms/src/contact-form/class-admin.php | 17 +++++-
.../changelog/update-use-wp-admin-notice | 4 ++
.../import-customizations.php | 13 ++--
.../automattic-for-agencies-client.php | 43 +++++++-------
.../changelog/update-use-wp-admin-notice | 4 ++
.../changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/backup/jetpack-backup.php | 59 +++++++++----------
.../beta/changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/beta/jetpack-beta.php | 41 +++++++------
.../changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/boost/jetpack-boost.php | 41 +++++++------
projects/plugins/crm/ZeroBSCRM.php | 41 +++++++------
.../crm/changelog/update-use-wp-admin-notice | 4 ++
.../plugins/crm/includes/ZeroBSCRM.Core.php | 21 ++++++-
.../changelog/update-use-wp-admin-notice | 4 ++
.../modules/class-autoloader-debug-helper.php | 7 ++-
.../modules/class-broken-token.php | 14 ++++-
.../modules/class-idc-simulator.php | 50 ++++++++++------
.../modules/class-protect-helper.php | 31 ++++++----
.../class-broken-token-connection-errors.php | 27 +++++----
.../jetpack/3rd-party/creative-mail.php | 12 ++--
.../jetpack/3rd-party/jetpack-backup.php | 12 ++--
.../jetpack/3rd-party/jetpack-boost.php | 13 ++--
.../plugins/jetpack/3rd-party/vaultpress.php | 49 ++++++++-------
.../3rd-party/woocommerce-services.php | 12 ++--
.../changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/jetpack/jetpack.php | 55 ++++++++---------
.../admin-menu/class-atomic-admin-menu.php | 20 ++++---
.../videopress/class.jetpack-videopress.php | 34 ++++++-----
.../wordads/php/class-wordads-admin.php | 33 ++++++++---
.../changelog/update-use-wp-admin-notice | 4 ++
.../plugins/migration/wpcom-migration.php | 43 +++++++-------
.../changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/protect/jetpack-protect.php | 44 +++++++-------
.../changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/search/jetpack-search.php | 42 ++++++-------
.../changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/social/jetpack-social.php | 44 +++++++-------
.../changelog/update-use-wp-admin-notice | 4 ++
.../starter-plugin/jetpack-starter-plugin.php | 44 +++++++-------
.../changelog/update-use-wp-admin-notice | 4 ++
.../plugins/super-cache/partials/preload.php | 7 ++-
.../changelog/update-use-wp-admin-notice | 4 ++
projects/plugins/vaultpress/vaultpress.php | 24 ++++----
.../changelog/update-use-wp-admin-notice | 4 ++
.../plugins/videopress/jetpack-videopress.php | 44 +++++++-------
51 files changed, 628 insertions(+), 427 deletions(-)
create mode 100644 projects/packages/connection/changelog/update-use-wp-admin-notice
create mode 100644 projects/packages/forms/changelog/update-use-wp-admin-notice
create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/automattic-for-agencies-client/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/backup/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/beta/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/boost/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/crm/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/debug-helper/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/jetpack/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/migration/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/protect/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/search/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/social/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/starter-plugin/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/super-cache/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/vaultpress/changelog/update-use-wp-admin-notice
create mode 100644 projects/plugins/videopress/changelog/update-use-wp-admin-notice
diff --git a/jetpack.php b/jetpack.php
index d8f30aa712377..0a0a2c6af0b16 100644
--- a/jetpack.php
+++ b/jetpack.php
@@ -33,8 +33,7 @@
* if they tried to install it as one.
*/
function jetpack_monorepo_is_not_a_plugin() {
- echo '';
- printf(
+ $message = sprintf(
wp_kses(
/* translators: Link to Jetpack installation instructions. */
__( 'The Jetpack Monorepo is not a plugin, and should not be installed as one. See the Jetpack Monorepo documentation for instructions on correctly installing Jetpack.', 'jetpack' ),
@@ -44,7 +43,12 @@ function jetpack_monorepo_is_not_a_plugin() {
),
esc_url( 'https://github.com/Automattic/jetpack#jetpack-monorepo' )
);
- echo "
\n";
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ )
+ );
}
add_action( 'admin_notices', 'jetpack_monorepo_is_not_a_plugin' );
diff --git a/projects/packages/connection/changelog/update-use-wp-admin-notice b/projects/packages/connection/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/packages/connection/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/packages/connection/docs/error-handling.md b/projects/packages/connection/docs/error-handling.md
index c8699714e6def..8824c84fa0ef9 100644
--- a/projects/packages/connection/docs/error-handling.md
+++ b/projects/packages/connection/docs/error-handling.md
@@ -60,13 +60,21 @@ function my_function( $errors ) {
// do stuff with the errors array
// echo the error notice
- ?>
-
- %s
%s',
+ esc_html__( 'my message', 'my_plugin' ),
+ esc_html__( 'Fix it!', 'my_plugin' )
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ 'additional_classes' => array( 'jetpack-message', 'jp-connect' ),
+ 'paragraph_wrap' => false,
+ 'attributes' => array( 'style' => 'display:block !important;' ),
+ )
+ );
}
```
diff --git a/projects/packages/connection/src/class-error-handler.php b/projects/packages/connection/src/class-error-handler.php
index b06904385d202..9b38e4f4c6bf2 100644
--- a/projects/packages/connection/src/class-error-handler.php
+++ b/projects/packages/connection/src/class-error-handler.php
@@ -702,11 +702,15 @@ public function generic_admin_notice_error() {
return;
}
- ?>
-
- 'error',
+ 'dismissible' => true,
+ 'additional_classes' => array( 'jetpack-message', 'jp-connect' ),
+ 'attributes' => array( 'style' => 'display:block !important;' ),
+ )
+ );
}
/**
diff --git a/projects/packages/forms/changelog/update-use-wp-admin-notice b/projects/packages/forms/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/packages/forms/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/packages/forms/src/contact-form/class-admin.php b/projects/packages/forms/src/contact-form/class-admin.php
index e9c6301558153..7d8924aafdb4d 100644
--- a/projects/packages/forms/src/contact-form/class-admin.php
+++ b/projects/packages/forms/src/contact-form/class-admin.php
@@ -1518,10 +1518,23 @@ public function grunion_delete_spam_feedbacks() {
* Show an admin notice if the "Empty Spam" or "Check Spam" process was unable to complete, probably due to a permissions error.
*/
public function grunion_feedback_admin_notice() {
+ $message = '';
+
if ( isset( $_GET['jetpack_empty_feedback_spam_error'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
- echo '' . esc_html( __( 'An error occurred while trying to empty the Feedback spam folder.', 'jetpack-forms' ) ) . '
';
+ $message = esc_html__( 'An error occurred while trying to empty the Feedback spam folder.', 'jetpack-forms' );
} elseif ( isset( $_GET['jetpack_check_feedback_spam_error'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
- echo '' . esc_html( __( 'An error occurred while trying to check for spam among the feedback you received.', 'jetpack-forms' ) ) . '
';
+ $message = esc_html__( 'An error occurred while trying to check for spam among the feedback you received.', 'jetpack-forms' );
+ }
+
+ if ( empty( $message ) ) {
+ return;
}
+
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ )
+ );
}
}
diff --git a/projects/packages/jetpack-mu-wpcom/changelog/update-use-wp-admin-notice b/projects/packages/jetpack-mu-wpcom/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/packages/jetpack-mu-wpcom/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/packages/jetpack-mu-wpcom/src/features/import-customizations/import-customizations.php b/projects/packages/jetpack-mu-wpcom/src/features/import-customizations/import-customizations.php
index b7ea46ddd4794..c41c81463fd45 100644
--- a/projects/packages/jetpack-mu-wpcom/src/features/import-customizations/import-customizations.php
+++ b/projects/packages/jetpack-mu-wpcom/src/features/import-customizations/import-customizations.php
@@ -33,16 +33,19 @@ function import_admin_banner() {
$import_url = esc_url( "https://wordpress.com/setup/import-focused/import?siteSlug={$site_slug}&ref=wp-admin" );
$banner_content = sprintf(
- '',
+ '%s
%s',
esc_html__( 'Use WordPress.com’s guided importer to import posts and comments from Medium, Substack, Squarespace, Wix, and more.', 'jetpack-mu-wpcom' ),
$import_url,
esc_html__( 'Get started', 'jetpack-mu-wpcom' )
);
- echo wp_kses_post( $banner_content );
+ wp_admin_notice(
+ wp_kses_post( $banner_content ),
+ array(
+ 'paragraph_wrap' => false,
+ 'additional_classes' => array( 'wpcom-import-banner' ),
+ )
+ );
}
/**
diff --git a/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php b/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php
index 11c6ae2bd3d3c..d0f5ef7a5e769 100644
--- a/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php
+++ b/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php
@@ -58,28 +58,27 @@
add_action(
'admin_notices',
function () {
- ?>
-
-
- this document to set up your development environment. Automattic For Agencies Client must have Composer dependencies installed and built via the build command.', 'automattic-for-agencies-client' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- this document to set up your development environment. Automattic For Agencies Client must have Composer dependencies installed and built via the build command.', 'automattic-for-agencies-client' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
diff --git a/projects/plugins/automattic-for-agencies-client/changelog/update-use-wp-admin-notice b/projects/plugins/automattic-for-agencies-client/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/automattic-for-agencies-client/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/backup/changelog/update-use-wp-admin-notice b/projects/plugins/backup/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/backup/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/backup/jetpack-backup.php b/projects/plugins/backup/jetpack-backup.php
index 72d437699ce3c..7ca25cc6ed166 100644
--- a/projects/plugins/backup/jetpack-backup.php
+++ b/projects/plugins/backup/jetpack-backup.php
@@ -71,15 +71,13 @@ function jetpack_backup_requirements_check() {
add_action(
'admin_notices',
function () use ( $jetpack_backup_meets_requirements ) {
- ?>
-
-
- get_error_message() );
- ?>
-
-
- get_error_message() ),
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
@@ -120,28 +118,27 @@ function () {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack VaultPress Backup must have Composer dependencies installed and built via the build command.', 'jetpack-backup' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- this document to set up your development environment. Jetpack VaultPress Backup must have Composer dependencies installed and built via the build command.', 'jetpack-backup' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
diff --git a/projects/plugins/beta/changelog/update-use-wp-admin-notice b/projects/plugins/beta/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/beta/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/beta/jetpack-beta.php b/projects/plugins/beta/jetpack-beta.php
index 559b00a2da9e1..8ca6d17402463 100644
--- a/projects/plugins/beta/jetpack-beta.php
+++ b/projects/plugins/beta/jetpack-beta.php
@@ -86,28 +86,27 @@ function jetpack_beta_admin_missing_autoloader() {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment.', 'jetpack-beta' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
+ $message = sprintf(
+ wp_kses(
+ /* translators: Placeholder is a link to a support document. */
+ __( 'Your installation of Jetpack Beta is incomplete. If you installed Jetpack Beta from GitHub, please refer to this document to set up your development environment.', 'jetpack-beta' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md'
- );
- ?>
-
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
add_action( 'admin_notices', 'jetpack_beta_admin_missing_autoloader' );
diff --git a/projects/plugins/boost/changelog/update-use-wp-admin-notice b/projects/plugins/boost/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/boost/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/boost/jetpack-boost.php b/projects/plugins/boost/jetpack-boost.php
index 7dcc6cdf12860..0291efd0046b2 100644
--- a/projects/plugins/boost/jetpack-boost.php
+++ b/projects/plugins/boost/jetpack-boost.php
@@ -108,28 +108,27 @@ function jetpack_boost_admin_missing_files() {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack Boost must have Composer dependencies installed and built via the build command.', 'jetpack-boost' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
+ $message = sprintf(
+ wp_kses(
+ /* translators: Placeholder is a link to a support document. */
+ __( 'Your installation of Jetpack Boost is incomplete. If you installed Jetpack Boost from GitHub, please refer to this document to set up your development environment. Jetpack Boost must have Composer dependencies installed and built via the build command.', 'jetpack-boost' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
add_action( 'admin_notices', __NAMESPACE__ . '\\jetpack_boost_admin_missing_files' );
diff --git a/projects/plugins/crm/ZeroBSCRM.php b/projects/plugins/crm/ZeroBSCRM.php
index 831e210d14259..3e05b87caf6f5 100644
--- a/projects/plugins/crm/ZeroBSCRM.php
+++ b/projects/plugins/crm/ZeroBSCRM.php
@@ -72,28 +72,27 @@ function () {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack CRM must have Composer dependencies installed and built via the build command.', 'zero-bs-crm' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
+ $message = sprintf(
+ wp_kses(
+ /* translators: Placeholder is a link to a support document. */
+ __( 'Your installation of Jetpack CRM is incomplete. If you installed Jetpack CRM from GitHub, please refer to this document to set up your development environment. Jetpack CRM must have Composer dependencies installed and built via the build command.', 'zero-bs-crm' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
diff --git a/projects/plugins/crm/changelog/update-use-wp-admin-notice b/projects/plugins/crm/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/crm/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/crm/includes/ZeroBSCRM.Core.php b/projects/plugins/crm/includes/ZeroBSCRM.Core.php
index 04dc1f85d8da9..97c13359f19cb 100644
--- a/projects/plugins/crm/includes/ZeroBSCRM.Core.php
+++ b/projects/plugins/crm/includes/ZeroBSCRM.Core.php
@@ -738,9 +738,24 @@ public function wp_admin_notices() {
if ( $pagenow == $page || empty( $page ) ) {
foreach ( $notices as $notice ) {
-
- echo '' . $notice['html'] . '
';
-
+ wp_admin_notice(
+ wp_kses(
+ $notice['html'],
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'class' => array(),
+ ),
+ 'p' => array(),
+ )
+ ),
+ array(
+ 'type' => esc_attr( $notice['class'] ),
+ 'dismissible' => true,
+ 'paragraph_wrap' => false,
+ )
+ );
}
}
}
diff --git a/projects/plugins/debug-helper/changelog/update-use-wp-admin-notice b/projects/plugins/debug-helper/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/debug-helper/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/debug-helper/modules/class-autoloader-debug-helper.php b/projects/plugins/debug-helper/modules/class-autoloader-debug-helper.php
index 15844a18e4f9a..62610ba612f87 100644
--- a/projects/plugins/debug-helper/modules/class-autoloader-debug-helper.php
+++ b/projects/plugins/debug-helper/modules/class-autoloader-debug-helper.php
@@ -287,7 +287,12 @@ function register_autoloader_debug_helper() {
* Notice for if Jetpack is not active.
*/
function autoloader_debug_helper_jetpack_not_active() {
- echo 'Jetpack Debug tools: Jetpack_Options package must be present for the Autoloader Debug Helper to work.
';
+ wp_admin_notice(
+ 'Jetpack Debug tools: Jetpack_Options package must be present for the Autoloader Debug Helper to work.',
+ array(
+ 'type' => 'info',
+ )
+ );
}
// phpcs:enable
diff --git a/projects/plugins/debug-helper/modules/class-broken-token.php b/projects/plugins/debug-helper/modules/class-broken-token.php
index a7a3f611968b8..2348940e443df 100644
--- a/projects/plugins/debug-helper/modules/class-broken-token.php
+++ b/projects/plugins/debug-helper/modules/class-broken-token.php
@@ -636,7 +636,12 @@ public function render_admin_notice() {
break;
}
- printf( '', esc_html( $message ) );
+ wp_admin_notice(
+ esc_html( $message ),
+ array(
+ 'type' => 'success',
+ )
+ );
}
/**
@@ -680,7 +685,12 @@ function register_broken_token() {
* Notice for if Jetpack is not active.
*/
function broken_token_jetpack_not_active() {
- echo 'Jetpack Debug tools: Jetpack_Options package must be present for the Broken Token to work.
';
+ wp_admin_notice(
+ 'Jetpack Debug tools: Jetpack_Options package must be present for the Broken Token to work.',
+ array(
+ 'type' => 'info',
+ )
+ );
}
// phpcs:enable
diff --git a/projects/plugins/debug-helper/modules/class-idc-simulator.php b/projects/plugins/debug-helper/modules/class-idc-simulator.php
index f0e157078de13..dcf0f29c0f4a6 100644
--- a/projects/plugins/debug-helper/modules/class-idc-simulator.php
+++ b/projects/plugins/debug-helper/modules/class-idc-simulator.php
@@ -399,33 +399,39 @@ public function admin_post_idc_send_remote_request() {
* Shows a simple success notice.
*/
public function admin_notice__stored_success() {
- ?>
-
-
IDC simulation settings have been saved!
-
- 'success',
+ 'dismissible' => true,
+ )
+ );
}
/**
* Shows a simple success notice.
*/
public function admin_notice__request_success() {
- ?>
-
-
The remote request was successfully sent!
-
- 'success',
+ 'dismissible' => true,
+ )
+ );
}
/**
* Shows a simple error notice.
*/
public function admin_notice__unknown_error() {
- ?>
-
-
Something went wrong.
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
/**
@@ -451,7 +457,12 @@ public function display_notice() {
* Display a notice when Sync is disabled by this module.
*/
public function display_sync_disabled_notice() {
- echo 'Sync has been disabled by the Jetpack Debug Helper plugin\'s IDC Simulator module.
';
+ wp_admin_notice(
+ 'Sync has been disabled by the Jetpack Debug Helper plugin\'s IDC Simulator module.',
+ array(
+ 'type' => 'warning',
+ )
+ );
}
/**
@@ -533,7 +544,12 @@ function register_idc_simulator() {
* Notice for if Jetpack is not active.
*/
function idc_simulator_jetpack_not_active() {
- echo 'Jetpack Debug tools: Jetpack_Options package must be present for the IDC Simulator to work.
';
+ wp_admin_notice(
+ 'Jetpack Debug tools: Jetpack_Options package must be present for the IDC Simulator to work.',
+ array(
+ 'type' => 'info',
+ )
+ );
}
IDC_Simulator::early_init();
diff --git a/projects/plugins/debug-helper/modules/class-protect-helper.php b/projects/plugins/debug-helper/modules/class-protect-helper.php
index ba32b5596640b..c659b5bc8854f 100644
--- a/projects/plugins/debug-helper/modules/class-protect-helper.php
+++ b/projects/plugins/debug-helper/modules/class-protect-helper.php
@@ -188,18 +188,25 @@ public function admin_post_redirect_referrer() {
* Display a notice if necessary.
*/
public function display_notice() {
- ?>
-
-
Settings have been saved!
-
- 'success',
+ 'dismissible' => true,
+ )
+ );
}
/**
* Display a notice when Sync is disabled by this module.
*/
public function display_protect_overwritten_notice() {
- echo 'Jetpack Protect Status is being overwritten by the Jetpack Debug Helper plugin.
';
+ wp_admin_notice(
+ 'Jetpack Protect Status is being overwritten by the Jetpack Debug Helper plugin.',
+ array(
+ 'type' => 'warning',
+ )
+ );
}
/**
@@ -280,9 +287,9 @@ private static function get_mock_scan_api_threat( $id = 123, $type = null ) {
'id' => $id,
'signature' => 'Sample_Threat',
'title' => 'Sample Threat',
- 'description' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit.
- Pellentesque aliquet nibh nec urna. In nisi neque, aliquet vel, dapibus id, mattis
- vel, nisi. Sed pretium, ligula sollicitudin laoreet viverra, tortor libero sodales
+ 'description' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit.
+ Pellentesque aliquet nibh nec urna. In nisi neque, aliquet vel, dapibus id, mattis
+ vel, nisi. Sed pretium, ligula sollicitudin laoreet viverra, tortor libero sodales
leo, eget blandit nunc tortor eu nibh. Nullam mollis. Ut justo. Suspendisse potenti.',
'severity' => 3,
);
@@ -422,9 +429,9 @@ public function get_vulnerabilities( $type, $how_many = 2 ) {
$vuls[] = (object) array(
'id' => $id,
'title' => 'Sample Vulnerability number ' . $i . ' with a long title',
- 'description' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit.
- Pellentesque aliquet nibh nec urna. In nisi neque, aliquet vel, dapibus id, mattis
- vel, nisi. Sed pretium, ligula sollicitudin laoreet viverra, tortor libero sodales
+ 'description' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit.
+ Pellentesque aliquet nibh nec urna. In nisi neque, aliquet vel, dapibus id, mattis
+ vel, nisi. Sed pretium, ligula sollicitudin laoreet viverra, tortor libero sodales
leo, eget blandit nunc tortor eu nibh. Nullam mollis. Ut justo. Suspendisse potenti.',
'fixed_in' => '3.14.2',
);
diff --git a/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php b/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php
index ab82958496587..5b7f1dd505c76 100644
--- a/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php
+++ b/projects/plugins/debug-helper/modules/inc/class-broken-token-connection-errors.php
@@ -105,15 +105,23 @@ public function render_ui() {
This page helps you to trigger connection errors with invalid signatures.
- dev_debug_on ) : ?>
-
-
JETPACK_DEV_DEBUG constant is ON. This means every error will be reported. You're good to test.
-
-
-
-
JETPACK_DEV_DEBUG constant is OFF. This means an error will only be reported once evey hour. Set it to true so you can test it.
-
-
+ dev_debug_on ) {
+ wp_admin_notice(
+ 'JETPACK_DEV_DEBUG constant is ON. This means every error will be reported. You’re good to test.',
+ array(
+ 'type' => 'success',
+ )
+ );
+ } else {
+ wp_admin_notice(
+ 'JETPACK_DEV_DEBUG constant is OFF. This means an error will only be reported once evey hour. Set it to true so you can test it.',
+ array(
+ 'type' => 'warning',
+ )
+ );
+ }
+ ?>
Now head to Jetpack Debugger and trigger some requests!
@@ -283,7 +291,6 @@ public function admin_post_redirect_referrer() {
* @return \WP_Error
*/
public function get_sample_error( $error_code, $user_id, $error_type = 'xmlrpc' ) {
-
$signature_details = array(
'token' => 'dhj938djh938d:1:' . $user_id,
'timestamp' => time(),
diff --git a/projects/plugins/jetpack/3rd-party/creative-mail.php b/projects/plugins/jetpack/3rd-party/creative-mail.php
index 673571b21d44f..59f7db656b0f5 100644
--- a/projects/plugins/jetpack/3rd-party/creative-mail.php
+++ b/projects/plugins/jetpack/3rd-party/creative-mail.php
@@ -99,11 +99,13 @@ function activate() {
* Notify the user that the installation of Creative Mail failed.
*/
function error_notice() {
- ?>
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
/**
diff --git a/projects/plugins/jetpack/3rd-party/jetpack-backup.php b/projects/plugins/jetpack/3rd-party/jetpack-backup.php
index c7ab1fd43177e..8ba4428f29569 100644
--- a/projects/plugins/jetpack/3rd-party/jetpack-backup.php
+++ b/projects/plugins/jetpack/3rd-party/jetpack-backup.php
@@ -97,9 +97,11 @@ function activate() {
* Notify the user that the installation of Jetpack Backup failed.
*/
function error_notice() {
- ?>
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
diff --git a/projects/plugins/jetpack/3rd-party/jetpack-boost.php b/projects/plugins/jetpack/3rd-party/jetpack-boost.php
index c3d74917c5ee9..eb76da067a520 100644
--- a/projects/plugins/jetpack/3rd-party/jetpack-boost.php
+++ b/projects/plugins/jetpack/3rd-party/jetpack-boost.php
@@ -102,10 +102,11 @@ function error_notice() {
if ( empty( $_GET['jetpack-boost-install-error'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return;
}
-
- ?>
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
diff --git a/projects/plugins/jetpack/3rd-party/vaultpress.php b/projects/plugins/jetpack/3rd-party/vaultpress.php
index e2916ae4c3221..233258c3478d5 100644
--- a/projects/plugins/jetpack/3rd-party/vaultpress.php
+++ b/projects/plugins/jetpack/3rd-party/vaultpress.php
@@ -19,29 +19,34 @@ function jetpack_vaultpress_rewind_enabled_notice() {
// Remove WP core notice that says that the plugin was activated.
unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification
+ $message = sprintf(
+ wp_kses(
+ /* Translators: first variable is the full URL to the new dashboard */
+ __( 'Jetpack is now handling your backups.
VaultPress is no longer needed and has been deactivated. You can access your backups at this dashboard.
', 'jetpack' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ 'p' => array(
+ 'style' => array(),
+ ),
+ 'strong' => array(),
+ )
+ ),
+ esc_url( Redirect::get_url( 'calypso-backups' ) )
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'additional_classes' => array( 'vp-deactivated' ),
+ 'paragraph_wrap' => false,
+ )
+ );
?>
-
-
-
-
- this dashboard.', 'jetpack' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- esc_url( Redirect::get_url( 'calypso-backups' ) )
- );
- ?>
-
-
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
/**
diff --git a/projects/plugins/jetpack/changelog/update-use-wp-admin-notice b/projects/plugins/jetpack/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..55b25706a5dde
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: other
+
+Janitorial: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/jetpack/jetpack.php b/projects/plugins/jetpack/jetpack.php
index 2c28790c00a98..822d0996c5c45 100644
--- a/projects/plugins/jetpack/jetpack.php
+++ b/projects/plugins/jetpack/jetpack.php
@@ -116,11 +116,13 @@
* @since 7.2.0
*/
function jetpack_admin_unsupported_wp_notice() {
- ?>
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
add_action( 'admin_notices', 'jetpack_admin_unsupported_wp_notice' );
@@ -179,29 +181,28 @@ function jetpack_admin_missing_files() {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack must have Composer dependencies installed and built via the build command: jetpack build plugins/jetpack --with-deps
', 'jetpack' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'rel' => array(),
- 'target' => array(),
- ),
- 'code' => array(),
- )
+ $message = sprintf(
+ wp_kses(
+ /* translators: Placeholder is a link to a support document. */
+ __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to this document to set up your development environment. Jetpack must have Composer dependencies installed and built via the build command: jetpack build plugins/jetpack --with-deps
', 'jetpack' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'rel' => array(),
+ 'target' => array(),
),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- array(),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
add_action( 'admin_notices', 'jetpack_admin_missing_files' );
diff --git a/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php b/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php
index 4def4ea39cc23..694a888329782 100644
--- a/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php
+++ b/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php
@@ -547,13 +547,19 @@ public function add_settings_page_notice() {
// Close over the $switch_url variable.
$admin_notices = function () use ( $switch_url ) {
- // translators: %s is a link to the Calypso settings page.
- $notice = __( 'You are currently using the Classic view, which doesn\'t offer the same set of features as the Default view. To access additional settings and features, switch to the Default view. ', 'jetpack' );
- ?>
-
-
array( 'href' => array() ) ) ); ?>
-
- switch to the Default view. ', 'jetpack' ),
+ esc_url( $switch_url )
+ ),
+ array( 'a' => array( 'href' => array() ) )
+ ),
+ array(
+ 'type' => 'warning',
+ )
+ );
};
add_action( 'admin_notices', $admin_notices );
diff --git a/projects/plugins/jetpack/modules/videopress/class.jetpack-videopress.php b/projects/plugins/jetpack/modules/videopress/class.jetpack-videopress.php
index cc3ec8238b5ad..16aaf210242b6 100644
--- a/projects/plugins/jetpack/modules/videopress/class.jetpack-videopress.php
+++ b/projects/plugins/jetpack/modules/videopress/class.jetpack-videopress.php
@@ -73,23 +73,25 @@ public function enqueue_jwt_token_bridge() {
*/
public function media_new_page_admin_notice() {
global $pagenow;
-
- if ( 'media-new.php' === $pagenow ) {
- echo '' .
- '
' .
- wp_kses(
- sprintf(
- /* translators: %s is the url to the Media Library */
- __( 'VideoPress uploads are not supported here. To upload to VideoPress, add your videos from the Media Library or the block editor using the Video block.', 'jetpack' ),
- esc_url( admin_url( 'upload.php' ) )
- ),
- array(
- 'a' => array( 'href' => array() ),
- )
- ) .
- '
' .
- '
';
+ if ( 'media-new.php' !== $pagenow ) {
+ return;
}
+
+ $message = sprintf(
+ wp_kses(
+ /* translators: %s is the url to the Media Library */
+ __( 'VideoPress uploads are not supported here. To upload to VideoPress, add your videos from the Media Library or the block editor using the Video block.', 'jetpack' ),
+ array( 'a' => array( 'href' => array() ) )
+ ),
+ esc_url( admin_url( 'upload.php' ) )
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'warning',
+ 'dismissible' => true,
+ )
+ );
}
/**
diff --git a/projects/plugins/jetpack/modules/wordads/php/class-wordads-admin.php b/projects/plugins/jetpack/modules/wordads/php/class-wordads-admin.php
index fc1e3751127a2..f6a3b051167fa 100644
--- a/projects/plugins/jetpack/modules/wordads/php/class-wordads-admin.php
+++ b/projects/plugins/jetpack/modules/wordads/php/class-wordads-admin.php
@@ -46,13 +46,32 @@ public function debug_output() {
'approved' => 'No',
);
- $type = $wordads->option( 'wordads_approved' ) ? 'updated' : 'error';
- ?>
-
- option( 'wordads_approved' ) ? 'updated' : 'error';
+ $message = sprintf(
+ wp_kses(
+ /* Translators: %1$s is the status color, %2$s is the status, %3$s is the response */
+ __( 'Status: %2$s
%3$s
', 'jetpack' ),
+ array(
+ 'p' => array(),
+ 'span' => array(
+ 'style' => array(),
+ ),
+ 'pre' => array(),
+ )
+ ),
+ esc_attr( $status['color'] ),
+ esc_html( $status ),
+ esc_html( $response )
+ );
+
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => $type,
+ 'dismissible' => true,
+ 'paragraph_wrap' => false,
+ )
+ );
}
}
diff --git a/projects/plugins/migration/changelog/update-use-wp-admin-notice b/projects/plugins/migration/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/migration/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/migration/wpcom-migration.php b/projects/plugins/migration/wpcom-migration.php
index 1dd99a460f593..db4801d718ab9 100644
--- a/projects/plugins/migration/wpcom-migration.php
+++ b/projects/plugins/migration/wpcom-migration.php
@@ -75,28 +75,27 @@ function () {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Move to WordPress.com must have Composer dependencies installed and built via the build command.', 'wpcom-migration' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- this document to set up your development environment. Move to WordPress.com must have Composer dependencies installed and built via the build command.', 'wpcom-migration' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
diff --git a/projects/plugins/protect/changelog/update-use-wp-admin-notice b/projects/plugins/protect/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/protect/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/protect/jetpack-protect.php b/projects/plugins/protect/jetpack-protect.php
index dcb131e321d4e..1088e0400960a 100644
--- a/projects/plugins/protect/jetpack-protect.php
+++ b/projects/plugins/protect/jetpack-protect.php
@@ -76,28 +76,28 @@ function () {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack Protect must have Composer dependencies installed and built via the build command.', 'jetpack-protect' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- this document to set up your development environment. Jetpack Protect must have Composer dependencies installed and built via the build command.', 'jetpack-protect' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
diff --git a/projects/plugins/search/changelog/update-use-wp-admin-notice b/projects/plugins/search/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/search/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/search/jetpack-search.php b/projects/plugins/search/jetpack-search.php
index d57098d5ee120..08e4f1790be87 100644
--- a/projects/plugins/search/jetpack-search.php
+++ b/projects/plugins/search/jetpack-search.php
@@ -78,28 +78,28 @@ function jetpack_search_admin_missing_files() {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack Search must have Composer dependencies installed and built via the build command.', 'jetpack-search' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
+
+ $message = sprintf(
+ wp_kses(
+ /* translators: Placeholder is a link to a support document. */
+ __( 'Your installation of Jetpack Search is incomplete. If you installed Jetpack Search from GitHub, please refer to this document to set up your development environment. Jetpack Search must have Composer dependencies installed and built via the build command.', 'jetpack-search' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- 'error',
+ 'dismissible' => true,
+ )
+ );
}
add_action( 'admin_notices', __NAMESPACE__ . '\jetpack_search_admin_missing_files' );
diff --git a/projects/plugins/social/changelog/update-use-wp-admin-notice b/projects/plugins/social/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/social/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/social/jetpack-social.php b/projects/plugins/social/jetpack-social.php
index 5b979d5ca25c7..a4e4af9be43c8 100644
--- a/projects/plugins/social/jetpack-social.php
+++ b/projects/plugins/social/jetpack-social.php
@@ -75,28 +75,28 @@ function () {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack Social must have Composer dependencies installed and built via the build command.', 'jetpack-social' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- this document to set up your development environment. Jetpack Social must have Composer dependencies installed and built via the build command.', 'jetpack-social' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
diff --git a/projects/plugins/starter-plugin/changelog/update-use-wp-admin-notice b/projects/plugins/starter-plugin/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/starter-plugin/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/starter-plugin/jetpack-starter-plugin.php b/projects/plugins/starter-plugin/jetpack-starter-plugin.php
index f63b3939000e3..734602b997e48 100644
--- a/projects/plugins/starter-plugin/jetpack-starter-plugin.php
+++ b/projects/plugins/starter-plugin/jetpack-starter-plugin.php
@@ -75,28 +75,28 @@ function () {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack Starter Plugin must have Composer dependencies installed and built via the build command.', 'jetpack-starter-plugin' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- this document to set up your development environment. Jetpack Starter Plugin must have Composer dependencies installed and built via the build command.', 'jetpack-starter-plugin' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);
diff --git a/projects/plugins/super-cache/changelog/update-use-wp-admin-notice b/projects/plugins/super-cache/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/super-cache/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/super-cache/partials/preload.php b/projects/plugins/super-cache/partials/preload.php
index f78093132c640..6430997b20856 100644
--- a/projects/plugins/super-cache/partials/preload.php
+++ b/projects/plugins/super-cache/partials/preload.php
@@ -4,7 +4,12 @@
echo '';
if ( ! $cache_enabled || ! $super_cache_enabled || true === defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
- echo '' . __( 'Preloading of cache disabled. Please make sure simple or expert mode is enabled or talk to your host administrator.', 'wp-super-cache' ) . '
';
+ wp_admin_notice(
+ esc_html__( 'Preloading of cache disabled. Please make sure simple or expert mode is enabled or talk to your host administrator.', 'wp-super-cache' ),
+ array(
+ 'type' => 'warning',
+ )
+ );
return;
}
diff --git a/projects/plugins/vaultpress/changelog/update-use-wp-admin-notice b/projects/plugins/vaultpress/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/vaultpress/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/vaultpress/vaultpress.php b/projects/plugins/vaultpress/vaultpress.php
index fd91d1f9fa363..d3c98a5ea7a36 100644
--- a/projects/plugins/vaultpress/vaultpress.php
+++ b/projects/plugins/vaultpress/vaultpress.php
@@ -61,18 +61,18 @@ function vaultpress_admin_missing_autoloader() {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- composer install.', 'vaultpress' ),
- array( 'code' => true )
- );
- ?>
-
-
- composer install.', 'vaultpress' ),
+ array( 'code' => true )
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
add_action( 'admin_notices', 'vaultpress_admin_missing_autoloader' );
return;
diff --git a/projects/plugins/videopress/changelog/update-use-wp-admin-notice b/projects/plugins/videopress/changelog/update-use-wp-admin-notice
new file mode 100644
index 0000000000000..2988ba2249366
--- /dev/null
+++ b/projects/plugins/videopress/changelog/update-use-wp-admin-notice
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+General: use wp_admin_notice function introduced in WP 6.4 to display notices.
diff --git a/projects/plugins/videopress/jetpack-videopress.php b/projects/plugins/videopress/jetpack-videopress.php
index 0916b0867bb9e..54013b9066096 100644
--- a/projects/plugins/videopress/jetpack-videopress.php
+++ b/projects/plugins/videopress/jetpack-videopress.php
@@ -75,28 +75,28 @@ function () {
if ( get_current_screen()->id !== 'plugins' ) {
return;
}
- ?>
-
-
- this document to set up your development environment. Jetpack VideoPress must have Composer dependencies installed and built via the build command.', 'jetpack-videopress' ),
- array(
- 'a' => array(
- 'href' => array(),
- 'target' => array(),
- 'rel' => array(),
- ),
- )
- ),
- 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
- );
- ?>
-
-
- this document to set up your development environment. Jetpack VideoPress must have Composer dependencies installed and built via the build command.', 'jetpack-videopress' ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project'
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
}
);