Skip to content

Commit

Permalink
Remove goto from urls
Browse files Browse the repository at this point in the history
  • Loading branch information
UCjatamayo committed Feb 16, 2023
1 parent ab8ed85 commit a5ab4ea
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -96,4 +96,4 @@ Way to go!

There are several ways you can get in touch with us. <br>
We are available on GitHub and [WordPress.org](https://wordpress.org/support/plugin/cookiebot/) <br>
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/
2 changes: 1 addition & 1 deletion documentation/CookiebotAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
More details are available at https://www.cookiebot.com/en/developer/
16 changes: 16 additions & 0 deletions src/lib/Cookiebot_WP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
2 changes: 1 addition & 1 deletion src/settings/Network_Menu_Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion src/settings/pages/Settings_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand Down
7 changes: 6 additions & 1 deletion src/settings/pages/Support_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
);
Expand Down Expand Up @@ -54,6 +59,6 @@ public function display() {
);
}

include_view( 'admin/settings/support-page.php', array() );
include_view( 'admin/settings/support-page.php', $args );
}
}
4 changes: 2 additions & 2 deletions src/view/admin/settings/support-page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @var string $debug_output
* @var string $manager_language
*/

use cybot\cookiebot\settings\templates\Header;
Expand Down Expand Up @@ -60,7 +60,7 @@
echo sprintf(
// translators: the first placeholder string will be replaced with a html anchor open tag and the second placeholder string will be replaced by the html anchor closing tag
esc_html__( 'Log in to your %1$sCookiebot CMP account%2$s.', 'cookiebot' ),
'<a href="https://www.cookiebot.com/goto/account" target="_blank">',
'<a href="https://www.cookiebot.com/' . $manager_language . '/account" target="_blank">',
'</a>'
);
?>
Expand Down

0 comments on commit a5ab4ea

Please sign in to comment.