0, 'total_last_7_days' => 0, 'unique_visitors' => 0, 'total_published_cards' => 0, 'active_cards_tracked' => 0, 'top_countries' => array(), 'top_posts' => array(), ); $affistyle_total_all_time = absint( $affistyle_summary['total_all_time'] ); $affistyle_total_last_7_days = absint( $affistyle_summary['total_last_7_days'] ); $affistyle_unique_visitors = isset( $affistyle_summary['unique_visitors'] ) ? absint( $affistyle_summary['unique_visitors'] ) : 0; $affistyle_total_published_cards = absint( $affistyle_summary['total_published_cards'] ); $affistyle_active_cards_tracked = absint( $affistyle_summary['active_cards_tracked'] ); $affistyle_top_countries = is_array( $affistyle_summary['top_countries'] ) ? $affistyle_summary['top_countries'] : array(); $affistyle_top_posts = is_array( $affistyle_summary['top_posts'] ) ? $affistyle_summary['top_posts'] : array(); $affistyle_sticky_cta_clicks = isset( $affistyle_summary['sticky_cta_clicks'] ) ? absint( $affistyle_summary['sticky_cta_clicks'] ) : 0; $affistyle_range_label = __( 'Last 7 Days', 'affistyle' ); if ( '30' === $affistyle_date_range ) { $affistyle_range_label = __( 'Last 30 Days', 'affistyle' ); } elseif ( '60' === $affistyle_date_range ) { $affistyle_range_label = __( 'Last 60 Days', 'affistyle' ); } elseif ( '90' === $affistyle_date_range ) { $affistyle_range_label = __( 'Last 90 Days', 'affistyle' ); } elseif ( 'all' === $affistyle_date_range ) { $affistyle_range_label = __( 'All Time', 'affistyle' ); } elseif ( 'custom' === $affistyle_date_range ) { if ( ! empty( $affistyle_start_date ) && ! empty( $affistyle_end_date ) ) { /* translators: 1: start date, 2: end date */ $affistyle_range_label = sprintf( __( '%1$s – %2$s', 'affistyle' ), esc_html( $affistyle_start_date ), esc_html( $affistyle_end_date ) ); } elseif ( ! empty( $affistyle_start_date ) ) { /* translators: %s: start date */ $affistyle_range_label = sprintf( __( 'From %s', 'affistyle' ), esc_html( $affistyle_start_date ) ); } elseif ( ! empty( $affistyle_end_date ) ) { /* translators: %s: end date */ $affistyle_range_label = sprintf( __( 'Until %s', 'affistyle' ), esc_html( $affistyle_end_date ) ); } else { $affistyle_range_label = __( 'Custom Range', 'affistyle' ); } } $affistyle_financial = class_exists( 'AffiStyle_Click_Analytics' ) ? AffiStyle_Click_Analytics::get_financial_metrics( $affistyle_date_range, $affistyle_start_date, $affistyle_end_date ) : array( 'has_revenue_configured' => false, 'epc' => 0.00, 'currency' => '$', 'total_clicks' => $affistyle_total_last_7_days, 'prev_clicks' => 0, 'estimated_revenue' => 0.0, 'growth_pct' => 0.0, 'is_positive' => true, 'top_card_id' => 0, 'top_card_title' => __( 'None', 'affistyle' ), 'top_card_clicks' => 0, 'top_card_revenue' => 0.0, ); $affistyle_financial_settings = class_exists( 'AffiStyle_Click_Analytics' ) ? AffiStyle_Click_Analytics::get_financial_settings() : array( 'default_epc' => 0.00, 'default_aov' => 0.00, 'commission_rate' => 0.0, 'currency_symbol' => '$', ); ?>