Skip to content

Commit

Permalink
Merge pull request #380 from Yoast/269-show-redesigned-admin-wide-not…
Browse files Browse the repository at this point in the history
…ices-in-the-new-general-page

Move notices to new dashboard
  • Loading branch information
igorschoester authored Oct 1, 2024
2 parents c9e2f5d + 88c6eb2 commit 7d48d1d
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 28 deletions.
33 changes: 25 additions & 8 deletions inc/dependencies/dependency-acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,31 @@ public function register_notifications() {
* @return void
*/
public function message_plugin_not_activated() {
$message = sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Advanced Custom Fields, %3$s resolves to the minimum required ACF version. */
__( '%1$s requires %2$s (free or pro) %3$s or higher to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO',
'Advanced Custom Fields',
self::MINIMAL_REQUIRED_ACF_VERSION
echo (
'<div class="error yoast-migrated-notice">'
. '<h4 class="yoast-notice-migrated-header">'
. sprintf(
/* translators: %1$s: Advanced Custom Fields */
esc_html__( 'Install latest %1$s', 'acf-content-analysis-for-yoast-seo' ),
'Advanced Custom Fields'
)
. '</h4>'
. '<div class="notice-yoast-content">'
. '<p>'
. sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Advanced Custom Fields, %3$s resolves to the minimum required ACF version. */
esc_html__(
'%1$s requires %2$s (free or pro) %3$s or higher to be installed and activated.',
'acf-content-analysis-for-yoast-seo'
),
'ACF Content Analysis for Yoast SEO',
'Advanced Custom Fields',
// phpcs:ignore WordPress.Security.EscapeOutput -- Reason: This is a hardcoded value.
self::MINIMAL_REQUIRED_ACF_VERSION
)
. '</p>'
. '</div>'
. '</div>'
);

printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );
}
}
60 changes: 46 additions & 14 deletions inc/dependencies/dependency-yoast-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,30 @@ public function register_notifications() {
* @return void
*/
public function message_plugin_not_activated() {
$message = sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Yoast SEO. */
__( '%1$s requires %2$s to be installed and activated.', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO',
'Yoast SEO'
echo (
'<div class="error yoast-migrated-notice">'
. '<h4 class="yoast-notice-migrated-header">'
. sprintf(
/* translators: %1$s: Yoast SEO */
esc_html__( 'Install %1$s', 'acf-content-analysis-for-yoast-seo' ),
'Yoast SEO'
)
. '</h4>'
. '<div class="notice-yoast-content">'
. '<p>'
. sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO, %2$s resolves to Yoast SEO. */
esc_html__(
'%1$s requires %2$s to be installed and activated.',
'acf-content-analysis-for-yoast-seo'
),
'ACF Content Analysis for Yoast SEO',
'Yoast SEO'
)
. '</p>'
. '</div>'
. '</div>'
);

printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );
}

/**
Expand All @@ -67,14 +83,30 @@ public function message_plugin_not_activated() {
* @return void
*/
public function message_minimum_version() {
$message = sprintf(
/* translators: %1$s resolves to Yoast SEO, %2$s resolves to ACF Content Analysis for Yoast SEO. */
__( 'Please upgrade the %1$s plugin to the latest version to allow the %2$s module to work.', 'acf-content-analysis-for-yoast-seo' ),
'Yoast SEO',
'ACF Content Analysis for Yoast SEO'
echo (
'<div class="error yoast-migrated-notice">'
. '<h4 class="yoast-notice-migrated-header">'
. sprintf(
/* translators: %1$s: Yoast SEO */
esc_html__( 'Update %1$s', 'acf-content-analysis-for-yoast-seo' ),
'Yoast SEO'
)
. '</h4>'
. '<div class="notice-yoast-content">'
. '<p>'
. sprintf(
/* translators: %1$s resolves to Yoast SEO, %2$s resolves to ACF Content Analysis for Yoast SEO */
esc_html__(
'Please upgrade the %1$s plugin to the latest version to allow the %2$s module to work.',
'acf-content-analysis-for-yoast-seo'
),
'Yoast SEO',
'ACF Content Analysis for Yoast SEO'
)
. '</p>'
. '</div>'
. '</div>'
);

printf( '<div class="error"><p>%s</p></div>', esc_html( $message ) );
}

/**
Expand Down
28 changes: 22 additions & 6 deletions yoast-acf-analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,29 @@
* @return void
*/
function yoast_acf_report_missing_acf() {
echo '<div class="error"><p>';
printf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO */
esc_html__( '%1$s could not be loaded because of missing files.', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO'
echo (
'<div class="error yoast-migrated-notice">'
. '<h4 class="yoast-notice-migrated-header">'
. sprintf(
/* translators: %1$s: ACF Content Analysis for Yoast SEO */
esc_html__( 'Unable to load %1$s', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO'
)
. '</h4>'
. '<div class="notice-yoast-content">'
. '<p>'
. sprintf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO */
esc_html__(
'%1$s could not be loaded because of missing files.',
'acf-content-analysis-for-yoast-seo'
),
'ACF Content Analysis for Yoast SEO'
)
. '</p>'
. '</div>'
. '</div>'
);
echo '</p></div>';
}

/* ********************* DEPRECATED FUNCTIONS ********************* */
Expand Down

0 comments on commit 7d48d1d

Please sign in to comment.