From a5ab4eaf6aa82d6e7622140ca5abd5ce7161ee28 Mon Sep 17 00:00:00 2001 From: andrestamayo Date: Thu, 16 Feb 2023 13:03:40 +0100 Subject: [PATCH] Remove goto from urls --- README.md | 4 ++-- documentation/CookiebotAPI.md | 2 +- src/lib/Cookiebot_WP.php | 16 ++++++++++++++++ src/settings/Network_Menu_Settings.php | 2 +- src/settings/pages/Settings_Page.php | 2 +- src/settings/pages/Support_Page.php | 7 ++++++- src/view/admin/settings/support-page.php | 4 ++-- 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a456617d..e2add86c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cookiebot CMP WordPress Plugin Cookiebot Wordpress plugin is a plugin that make other plugins compatible with Cookiebot. -The addons hook into the original plugin and render the cookie setting tags as advised by the Cookiebot guidelines at https://www.cookiebot.com/goto/help/. +The addons hook into the original plugin and render the cookie setting tags as advised by the Cookiebot guidelines at https://www.cookiebot.com/en/help/. Concurrently we are working with WP Core on what we believe is the real solution. A framework in WP Core that can signal the consent state to other plugins, so that they can handle their cookie setting code without explicit support for Cookiebot, or other cookie plugins. If and when this will be implemented is unknown. @@ -96,4 +96,4 @@ Way to go! There are several ways you can get in touch with us.
We are available on GitHub and [WordPress.org](https://wordpress.org/support/plugin/cookiebot/)
-You can also reach us through our helpdesk at www.cookiebot.com/goto/helpdesk/ +You can also reach us through our helpdesk at www.cookiebot.com/en/helpdesk/ diff --git a/documentation/CookiebotAPI.md b/documentation/CookiebotAPI.md index 90e54e11..f2b39aef 100644 --- a/documentation/CookiebotAPI.md +++ b/documentation/CookiebotAPI.md @@ -90,4 +90,4 @@ else //The user has not accepted cookies - set strictly necessary cookies only } ``` -More details are available at https://www.cookiebot.com/goto/developer/ \ No newline at end of file +More details are available at https://www.cookiebot.com/en/developer/ \ No newline at end of file diff --git a/src/lib/Cookiebot_WP.php b/src/lib/Cookiebot_WP.php index 0dda412f..946d2ff3 100644 --- a/src/lib/Cookiebot_WP.php +++ b/src/lib/Cookiebot_WP.php @@ -187,4 +187,20 @@ public function set_settings_action_link( $actions ) { $actions = array_merge( $actions, $cblinks ); return $actions; } + + /** + * @return string + */ + public static function get_manager_language(): string { + $locale = get_locale(); + $supported_langs = array( + 'de_DE' => 'de', + 'da_DK' => 'da', + 'fr_FR' => 'fr', + 'it_IT' => 'it', + 'es_ES' => 'es', + ); + + return array_key_exists( $locale, $supported_langs ) ? $supported_langs[ $locale ] : 'en'; + } } diff --git a/src/settings/Network_Menu_Settings.php b/src/settings/Network_Menu_Settings.php index dbcc2e1c..265aabbc 100644 --- a/src/settings/Network_Menu_Settings.php +++ b/src/settings/Network_Menu_Settings.php @@ -119,7 +119,7 @@ public function display() { include_view( 'admin/settings/network-settings-page.php', array( - 'cookiebot_gdpr_url' => 'https://www.cookiebot.com/goto/gdpr', + 'cookiebot_gdpr_url' => 'https://www.cookiebot.com/' . Cookiebot_WP::get_manager_language() . '/gdpr', 'logo' => CYBOT_COOKIEBOT_PLUGIN_URL . 'cookiebot-logo.png', 'cbm' => $cbm, ) diff --git a/src/settings/pages/Settings_Page.php b/src/settings/pages/Settings_Page.php index 7352d8d0..f8e94d86 100644 --- a/src/settings/pages/Settings_Page.php +++ b/src/settings/pages/Settings_Page.php @@ -40,7 +40,7 @@ public function display() { $args = array( 'cbid' => Cookiebot_WP::get_cbid(), 'is_ms' => false, - 'cookiebot_gdpr_url' => 'https://www.cookiebot.com/goto/gdpr', + 'cookiebot_gdpr_url' => 'https://www.cookiebot.com/' . Cookiebot_WP::get_manager_language() . '/gdpr', 'cookiebot_logo' => CYBOT_COOKIEBOT_PLUGIN_URL . 'cookiebot-logo.png', 'supported_languages' => Supported_Languages::get(), 'current_lang' => cookiebot_get_language_from_setting( true ), diff --git a/src/settings/pages/Support_Page.php b/src/settings/pages/Support_Page.php index 640bbbfe..7a9130f2 100644 --- a/src/settings/pages/Support_Page.php +++ b/src/settings/pages/Support_Page.php @@ -27,6 +27,11 @@ public function menu() { * @throws InvalidArgumentException */ public function display() { + + $args = array( + 'manager_language' => Cookiebot_WP::get_manager_language(), + ); + $scripts = array( array( 'cookiebot-support-page-js', 'js/backend/support-page.js' ), ); @@ -54,6 +59,6 @@ public function display() { ); } - include_view( 'admin/settings/support-page.php', array() ); + include_view( 'admin/settings/support-page.php', $args ); } } diff --git a/src/view/admin/settings/support-page.php b/src/view/admin/settings/support-page.php index fb983482..fabb67ed 100644 --- a/src/view/admin/settings/support-page.php +++ b/src/view/admin/settings/support-page.php @@ -1,6 +1,6 @@ ', + '', '' ); ?>