_x( 'Paid · Google Ads', 'traffic channel', 'ai-eshop-optimizer' ), 'paid_facebook' => _x( 'Paid · Facebook / Instagram', 'traffic channel', 'ai-eshop-optimizer' ), 'paid_tiktok' => _x( 'Paid · TikTok', 'traffic channel', 'ai-eshop-optimizer' ), 'paid_microsoft' => _x( 'Paid · Microsoft Ads', 'traffic channel', 'ai-eshop-optimizer' ), 'organic_search' => _x( 'Organic search', 'traffic channel', 'ai-eshop-optimizer' ), 'social' => _x( 'Social', 'traffic channel', 'ai-eshop-optimizer' ), 'newsletter' => _x( 'Newsletter / Email', 'traffic channel', 'ai-eshop-optimizer' ), 'web_push' => _x( 'Web push', 'traffic channel', 'ai-eshop-optimizer' ), 'referral' => _x( 'Referral', 'traffic channel', 'ai-eshop-optimizer' ), 'direct' => _x( 'Direct', 'traffic channel', 'ai-eshop-optimizer' ), 'internal' => _x( 'Internal', 'traffic channel', 'ai-eshop-optimizer' ), 'phone_orders' => _x( 'Phone Orders', 'traffic channel', 'ai-eshop-optimizer' ), ); if ( isset( $map[ $channel ] ) ) { return $map[ $channel ]; } return ucwords( str_replace( array( '_', '-' ), ' ', $channel ) ); } public static function render_html( $title, array $rows, $accent = '' ) { $frame = class_exists( 'AIEO_Email_Frame' ); $style = static function ( $recipe ) use ( $frame ) { $css = $frame ? AIEO_Email_Frame::style( $recipe ) : ''; return '' !== $css ? ' style="' . esc_attr( $css ) . '"' : ''; }; $h = ''; $h .= ''; foreach ( $rows as $k => $v ) { $h .= ''; } $h .= '
' . esc_html( $title ) . '
' . esc_html( $k ) . '' . esc_html( $v ) . '
'; return $h; } public static function render_plain( $title, array $rows ) { $out = '== ' . $title . " ==\n"; foreach ( $rows as $k => $v ) { $out .= $k . ': ' . $v . "\n"; } return $out; } }