From 69585b681a938a4ae40b23cc33c12672b40f50e3 Mon Sep 17 00:00:00 2001 From: Leonidas Milosis Date: Wed, 25 Sep 2024 10:58:07 +0300 Subject: [PATCH 1/5] Move ACF dependency notice to new dashboard --- inc/dependencies/dependency-acf.php | 32 +++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/inc/dependencies/dependency-acf.php b/inc/dependencies/dependency-acf.php index b798995..25d5dba 100644 --- a/inc/dependencies/dependency-acf.php +++ b/inc/dependencies/dependency-acf.php @@ -44,14 +44,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 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 ( + '
' + . '

' + . sprintf( + /* translators: %1$s: Advanced Custom Fields */ + esc_html__( 'Install latest %1$s', 'wordpress-seo-news' ), + 'Advanced Custom Fields' + ) + . '

' + . '
' + . '

' + . 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', + self::MINIMAL_REQUIRED_ACF_VERSION + ) + . '

' + . '
' + . '
' ); - - printf( '

%s

', esc_html( $message ) ); } } From d3f4d0de0033e345e5c91e41849beb5816739960 Mon Sep 17 00:00:00 2001 From: Leonidas Milosis Date: Wed, 25 Sep 2024 11:15:42 +0300 Subject: [PATCH 2/5] Fix PHPCS --- inc/dependencies/dependency-acf.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/dependencies/dependency-acf.php b/inc/dependencies/dependency-acf.php index 25d5dba..4e4e699 100644 --- a/inc/dependencies/dependency-acf.php +++ b/inc/dependencies/dependency-acf.php @@ -49,7 +49,7 @@ public function message_plugin_not_activated() { . '

' . sprintf( /* translators: %1$s: Advanced Custom Fields */ - esc_html__( 'Install latest %1$s', 'wordpress-seo-news' ), + esc_html__( 'Install latest %1$s', 'acf-content-analysis-for-yoast-seo' ), 'Advanced Custom Fields' ) . '

' @@ -63,6 +63,7 @@ public function message_plugin_not_activated() { ), '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 ) . '

' From dcbb3efcaf90f383102fd9357529cfe58784f903 Mon Sep 17 00:00:00 2001 From: Leonidas Milosis Date: Wed, 25 Sep 2024 12:35:55 +0300 Subject: [PATCH 3/5] Move Yoast dependency notice to new dashboard --- inc/dependencies/dependency-yoast-seo.php | 60 +++++++++++++++++------ 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/inc/dependencies/dependency-yoast-seo.php b/inc/dependencies/dependency-yoast-seo.php index cd759c7..f76c8a9 100644 --- a/inc/dependencies/dependency-yoast-seo.php +++ b/inc/dependencies/dependency-yoast-seo.php @@ -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 ( + '
' + . '

' + . sprintf( + /* translators: %1$s: Yoast SEO */ + esc_html__( 'Install %1$s', 'acf-content-analysis-for-yoast-seo' ), + 'Yoast SEO' + ) + . '

' + . '
' + . '

' + . 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' + ) + . '

' + . '
' + . '
' ); - - printf( '

%s

', esc_html( $message ) ); } /** @@ -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 ( + '
' + . '

' + . sprintf( + /* translators: %1$s: Yoast SEO */ + esc_html__( 'Install latest %1$s', 'acf-content-analysis-for-yoast-seo' ), + 'Yoast SEO' + ) + . '

' + . '
' + . '

' + . 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' + ) + . '

' + . '
' + . '
' ); - - printf( '

%s

', esc_html( $message ) ); } /** From 067f56014ea38789dc8e1073c34930fe626ab41e Mon Sep 17 00:00:00 2001 From: Leonidas Milosis Date: Wed, 25 Sep 2024 12:42:52 +0300 Subject: [PATCH 4/5] Move ACF could not be loaded notice to new dashboard --- yoast-acf-analysis.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/yoast-acf-analysis.php b/yoast-acf-analysis.php index 39658fe..1d46d8d 100755 --- a/yoast-acf-analysis.php +++ b/yoast-acf-analysis.php @@ -53,13 +53,29 @@ * @return void */ function yoast_acf_report_missing_acf() { - echo '

'; - 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 ( + '

' + . '

' + . sprintf( + /* translators: %1$s: ACF Content Analysis for Yoast SEO */ + esc_html__( '%1$s could not loaded', 'acf-content-analysis-for-yoast-seo' ), + 'ACF Content Analysis for Yoast SEO' + ) + . '

' + . '
' + . '

' + . 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' + ) + . '

' + . '
' + . '
' ); - echo '

'; } /* ********************* DEPRECATED FUNCTIONS ********************* */ From 88c6eb2ac5146663a4ffc42bbbbeb29c8e186e6e Mon Sep 17 00:00:00 2001 From: Leonidas Milosis Date: Wed, 25 Sep 2024 16:30:21 +0300 Subject: [PATCH 5/5] Update copy of new notice titles --- inc/dependencies/dependency-yoast-seo.php | 2 +- yoast-acf-analysis.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/dependencies/dependency-yoast-seo.php b/inc/dependencies/dependency-yoast-seo.php index f76c8a9..f68e4aa 100644 --- a/inc/dependencies/dependency-yoast-seo.php +++ b/inc/dependencies/dependency-yoast-seo.php @@ -88,7 +88,7 @@ public function message_minimum_version() { . '

' . sprintf( /* translators: %1$s: Yoast SEO */ - esc_html__( 'Install latest %1$s', 'acf-content-analysis-for-yoast-seo' ), + esc_html__( 'Update %1$s', 'acf-content-analysis-for-yoast-seo' ), 'Yoast SEO' ) . '

' diff --git a/yoast-acf-analysis.php b/yoast-acf-analysis.php index 1d46d8d..583a89d 100755 --- a/yoast-acf-analysis.php +++ b/yoast-acf-analysis.php @@ -58,7 +58,7 @@ function yoast_acf_report_missing_acf() { . '

' . sprintf( /* translators: %1$s: ACF Content Analysis for Yoast SEO */ - esc_html__( '%1$s could not loaded', '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' ) . '

'