Skip to content

Commit

Permalink
Merge pull request #8982 from google/issue/8247-change-graph-colors-o…
Browse files Browse the repository at this point in the history
…n-search-traffic-widget

Issue / 8247 Change Graph Colors on Search Traffic Widget
  • Loading branch information
eugene-manuilov authored Jul 9, 2024
2 parents 1c6364f + 9ab0412 commit 89aea1d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,26 +472,26 @@ SearchFunnelWidgetGA4.metrics = [
},
{
id: 'clicks',
color: '#bed4ff',
color: '#4bbbbb',
label: __( 'Clicks', 'google-site-kit' ),
metric: 'clicks',
service: 'search-console',
},
{
id: 'users',
color: '#5c9271',
color: '#3c7251',
label: __( 'Users', 'google-site-kit' ),
service: 'analytics-4',
},
{
id: 'coversions',
color: '#6e48ab',
label: __( 'Coversions', 'google-site-kit' ),
id: 'conversions',
color: '#8e68cb',
label: __( 'Conversions', 'google-site-kit' ),
service: 'analytics-4',
},
{
id: 'engagement-rate',
color: '#6e48ab',
color: '#8e68cb',
label: __( 'Engagement Rate', 'google-site-kit' ),
service: 'analytics-4',
},
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/config/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ $c-icon-notice-info: $c-denim;
$c-icon-notice-suggestion: $c-denim;

$c-chart-1: $c-cornflower-blue;
$c-chart-2: $c-scooter;
$c-chart-2: $c-teal-t-300;
$c-chart-3: $c-elm;
$c-chart-4: $c-purple-heart;

Expand Down
19 changes: 6 additions & 13 deletions includes/Core/Consent_Mode/REST_Consent_Mode_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,10 @@ protected function get_rest_routes() {
array(
'methods' => WP_REST_Server::READABLE,
'callback' => function () {
$is_active = function_exists( 'wp_set_consent' );
$installed = $is_active;
$plugin_uri = 'https://wordpress.org/plugins/wp-consent-api';
$slug = '';
$plugin = '';
$is_active = function_exists( 'wp_set_consent' );
$installed = $is_active;
$slug = 'wp-consent-api';
$plugin = "$slug/$slug.php";

$response = array(
'hasConsentAPI' => $is_active,
Expand All @@ -164,19 +163,13 @@ protected function get_rest_routes() {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
foreach ( get_plugins() as $plugin_file => $installed_plugin ) {
if ( $installed_plugin['PluginURI'] === $plugin_uri ) {
$slug = $installed_plugin['TextDomain'];
$plugin = $plugin_file;
foreach ( array_keys( get_plugins() ) as $installed_plugin ) {
if ( $installed_plugin === $plugin ) {
$installed = true;
break;
}
}

// If the plugin is not installed, set fallback slug and plugin objects.
$slug = ! empty( $slug ) ? $slug : 'wp-consent-api';
$plugin = ! empty( $plugin ) ? $plugin : "$slug/$slug.php";

// Alternate wp_nonce_url without esc_html breaking query parameters.
$nonce_url = function ( $action_url, $action ) {
return add_query_arg( '_wpnonce', wp_create_nonce( $action ), $action_url );
Expand Down

0 comments on commit 89aea1d

Please sign in to comment.