NXTEMHEADER; // phpcs:enable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet return $output; } public function footer(){ $facebook = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/facebook.png' ); $twitter = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/twitter.png' ); $youtube = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/youtube.png' ); $web = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/web.png' ); // phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16. $output = <<
NXTEMFOOTER; return $output; } public function body_header( $args = array(), $frequency = '' ){ $args = current( $args ); $logo = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/logo.png' ); $from_date = isset( $args['from_date'] ) ? gmdate( 'M j, Y', strtotime( $args['from_date'] ) ) : ''; $to_date = isset( $args['to_date'] ) ? gmdate( 'M j, Y', strtotime( $args['to_date'] ) ) : ''; if( empty( $from_date ) || empty( $to_date ) ) { return ''; } if( $frequency !== 'nx_daily' ) { $to_date = "- " . $to_date; } else { $to_date = ''; } // phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16. $output = <<
Your Analytics Report
$from_date $to_date
NXBODYHEADER; return $output; } public function body( $args = array(), $frequency = '' ){ if( empty( $args ) ) { return ''; } $body_header = $this->body_header( $args, $frequency ); $analytics_box = ''; if( is_array( $args ) ) { foreach( $args as $analytics_key => $analytics_value ) { $analytics_box .= $this->analytics_box( $analytics_value, $frequency ); } } $pro_msg = $this->pro_message(); $overall_promo_text = $this->promo( $args, $frequency ); // phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16. $output = <<header() . $this->body( $args, $frequency ) . $this->footer(); return $output; } public function promo( $args = array(), $frequency = '' ){ if( empty( $args ) ) { return false; } $views = array_reduce( $args, function( $carry, $item ) { $carry += $item['views']; return $carry; } ); // $last_wk_views = array_reduce( $args, function( $carry, $item ) { // $carry += $item['last_views']; // return $carry; // } ); $clicks = array_reduce( $args, function( $carry, $item ) { $carry += $item['clicks']; return $carry; } ); // $last_wk_clicks = array_reduce( $args, function( $carry, $item ) { // $carry += $item['last_clicks']; // return $carry; // } ); $ctr = array_reduce( $args, function( $carry, $item ) { $carry += $item['ctr']; return $carry; } ); $views = number_format( $views ); $clicks = number_format( $clicks ); $ctr = number_format( $ctr ); $text_lead = 'In the last 7 Days'; if( $frequency === 'nx_daily' ) { $text_lead = 'Yesterday'; } if( $frequency === 'nx_monthly' ) { $text_lead = 'In the last month'; } $text_lead = esc_html( $text_lead ); // phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16. $output = <<

$text_lead NotificationX helped you have site visits of $views, total Click of $clicks, and total CTR of $ctr

NXPROMO; return $output; } public static function analytics_box( $args = array(), $frequency = 'nx_weekly' ){ if( empty( $args ) ) { return false; } $type = $args['type']; $title = esc_html( $args['title'] ); $views = number_format( $args['views'] ); $percentage_views = esc_html( $args['percentage_views'] ); $clicks = number_format( $args['clicks'] ); $percentage_clicks = esc_html( $args['percentage_clicks'] ); $ctr = number_format( $args['ctr'] ); $percentage_ctr = esc_html( $args['percentage_ctr'] ); $up_arrow = $v_arrow = $c_arrow = $ctr_arrow = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/nx-template-up.png' ); $down_arrow = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/nx-template-down.png' ); $v_color = $c_color = $ctr_color = '#34cf8a'; if( $percentage_views < 0 ) { $v_color = '#ff616c'; $v_arrow = $down_arrow; } if( $percentage_clicks < 0 ) { $c_color = '#ff616c'; $c_arrow = $down_arrow; } if( $percentage_ctr < 0 ) { $ctr_color = '#ff616c'; $ctr_arrow = $down_arrow; } $percentage_views = NotificationX_Helper::nice_number( $args['percentage_views'] ); $percentage_clicks = NotificationX_Helper::nice_number( $args['percentage_clicks'] ); $percentage_ctr = NotificationX_Helper::nice_number( $args['percentage_ctr'] ); if( is_array( $type ) ) { $type_name = esc_html( $type['source'] ); } else { $type_name = esc_html( $type ); } switch( $frequency ) { case 'nx_weekly' : $days_ago = '7 days ago'; break; case 'nx_daily' : $days_ago = '1 days ago'; break; case 'nx_monthly' : $initial_timestamp = strtotime('first day of last month', current_time('timestamp')); $days_in_last_month = cal_days_in_month(CAL_GREGORIAN, gmdate( 'm', $initial_timestamp ), gmdate( 'Y', $initial_timestamp )); $days_ago = $days_in_last_month . ' days ago'; break; } $days_ago = esc_html( $days_ago ); $v_color = esc_attr( $v_color ); $c_color = esc_attr( $c_color ); $ctr_color = esc_attr( $ctr_color ); // phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16. $output = <<
$type_name > $title
Total Views
$views
$percentage_views%
$days_ago
Total Clicks
$clicks
$percentage_clicks%
$days_ago
Total CTR
$ctr
$percentage_ctr%
$days_ago
NXBOXTEM; return $output; } public static function pro_message(){ $is_pro = defined( 'NOTIFICATIONX_PRO_VERSION' ); $graph = esc_url( NOTIFICATIONX_PUBLIC_URL . 'image/reports/graph.png' ); $admin_analytics_url = admin_url( 'admin.php?page=nx-analytics' ); if( $is_pro ) { // phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16. $output = << Visit Dashboard Visit Dashboard NXPROMSG; return $output; } // phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16. $output = <<

Resolve doubts from the minds of your users using NotificaitonX- the best Social Proof and FOMO Plugin for WordPress.

Get everything NotificationX has to offer by upgrading to a PRO plan.

Get More Data NXPROMSG; return $output; } }