Skip to content

Commit

Permalink
wpcomsh: COLOURlovers: Remove Temporary Patterns Tracking (#38568)
Browse files Browse the repository at this point in the history
  • Loading branch information
mreishus authored Jul 30, 2024
1 parent f509124 commit 61cdd72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: removed
Comment: Removed temporary internal colourlovers pattern tracking


32 changes: 0 additions & 32 deletions projects/plugins/wpcomsh/custom-colors/colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -1971,38 +1971,6 @@ function add_color_palette( $palette, $title = false ) {
return Colors_Manager::add_color_palette( $palette, $title );
}

/**
* This is a quick and easy function to track usage of COLOURlovers patterns across Dotcom.
* We intend to run it for a few weeks and then remove it.
*
* We also maintain a WPCOM version for Simple sites.
*
* @see pdKhl6-3qP-p2
*/
function wpcomsh_temporarily_maybe_track_colourlovers_pattern_usage() {
$cache_key = 'stats_tmp_colourlovers_pattern';
$found = false;
wp_cache_get( $cache_key, 'stats', false, $found );

// We don't need to track all page views, just once per site.
if ( $found ) {
return;
}

$bg = get_theme_mod( 'background_image' );
wp_cache_set( $cache_key, $bg, 'stats' );

if ( ! empty( $bg ) && str_contains( $bg, 'colourlovers' ) ) {
$event_properties = array(
'siteid' => (int) Jetpack_Options::get_option( 'id' ),
'pattern' => pathinfo( $bg, PATHINFO_FILENAME ),
'theme' => get_stylesheet(),
);
wpcomsh_record_tracks_event( 'wpcom_tmp_cl_pattern', $event_properties );
}
}
add_action( 'wp_footer', 'wpcomsh_temporarily_maybe_track_colourlovers_pattern_usage', 101 );

/**
* Gutenberg color manager.
*/
Expand Down

0 comments on commit 61cdd72

Please sign in to comment.