get_report( 'overview', $this->report_start_from, $this->report_end_to ); $mobile_traffic = isset( $report['data']['devices']['mobile'] ) ? $report['data']['devices']['mobile'] : 0; $tablet_traffic = isset( $report['data']['devices']['tablet'] ) ? $report['data']['devices']['tablet'] : 0; $total_mobile_traffic_percentage = $mobile_traffic + $tablet_traffic; if ( $total_mobile_traffic_percentage > 70 ) { // Translators: Mobile device notification title $notification['title'] = sprintf( __( 'Traffic From Mobile Devices is %s%%', 'google-analytics-for-wordpress' ), $total_mobile_traffic_percentage ); // Translators: Mobile device notification content $notification['content'] = sprintf( __( 'In the last 30 days, your site has received %s%% of traffic through a mobile or tablet device. Make sure your site is optimized for these visitors to maximize engagement.', 'google-analytics-for-wordpress' ), $total_mobile_traffic_percentage ); return $notification; } return false; } } // initialize the class new MonsterInsights_Notification_Mobile_Device_High_Traffic();