Skip to content

Commit

Permalink
RDV: Fix regressions for Duplicate views
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanUngureanu committed Dec 19, 2024
1 parent b3ee2c2 commit ac40a5b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public static function load_verbum_comments_admin() {
* Load Odyssey Stats in Simple sites.
*/
public static function load_wpcom_simple_odyssey_stats() {
if ( get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) {
if ( get_option( 'wpcom_admin_interface' ) === 'wp-admin' || wpcom_is_duplicate_views_experiment_enabled() ) {
require_once __DIR__ . '/features/wpcom-simple-odyssey-stats/wpcom-simple-odyssey-stats.php';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ function wpcom_replace_edit_profile_menu_to_me( $wp_admin_bar ) {
* @return string Name of the admin bar class.
*/
function wpcom_custom_wpcom_admin_bar_class( $wp_admin_bar_class ) {
if ( get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) {
remove_filter( 'pre_option_wpcom_admin_interface', 'wpcom_admin_interface_pre_get_option' );
$is_wp_admin = get_option( 'wpcom_admin_interface' ) === 'wp-admin';
add_filter( 'pre_option_wpcom_admin_interface', 'wpcom_admin_interface_pre_get_option', 10 );

if ( $is_wp_admin ) {
return $wp_admin_bar_class;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ function ( $location ) {

const WPCOM_DUPLICATED_VIEW = array(
'edit.php',
'admin.php?page=stats',
'tools.php?page=advertising',
'edit.php?post_type=jetpack-portfolio',
'edit.php?post_type=jetpack-testimonial',
'edit-comments.php',
Expand Down Expand Up @@ -548,3 +546,19 @@ function wpcom_dismiss_removed_calypso_screen_notice() {
wp_die();
}
add_action( 'wp_ajax_wpcom_dismiss_removed_calypso_screen_notice', 'wpcom_dismiss_removed_calypso_screen_notice' );

/**
* Enable the Blaze dashboard (WP-Admin) for users that have the RDV experiment enabled.
*
* @param $activation_status
* @return mixed|true
*/
function wpcom_enable_blaze_dashboard_for_experiment( $activation_status ) {
if ( ! wpcom_is_duplicate_views_experiment_enabled() ) {
return $activation_status;
}

return true;
}

add_filter( 'jetpack_blaze_dashboard_enable', 'wpcom_enable_blaze_dashboard_for_experiment' );

0 comments on commit ac40a5b

Please sign in to comment.