Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move notices to new dashboard #380

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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