get_notification_strings( $notification ) ) { $notification = $strings['label']; } $entry['description'] = sprintf( esc_html__( 'Sending %s', 'it-l10n-ithemes-security-pro' ), $notification ); break; case 'send_failed': list ( $notification ) = $data; if ( $strings = ITSEC_Core::get_notification_center()->get_notification_strings( $notification ) ) { $notification = $strings['label']; } $entry['description'] = sprintf( esc_html__( 'Sending %s Failed', 'it-l10n-ithemes-security-pro' ), $notification ); break; case 'send_scheduled': $entry['description'] = esc_html__( 'Sending scheduled notifications', 'it-l10n-ithemes-security-pro' ); break; } return $entry; } public function filter_entry_for_details_display( $details, $entry, $code, $code_data ) { $details['module']['content'] = esc_html__( 'Notification Center', 'it-l10n-ithemes-security-pro' ); switch ( $code ) { case 'send': list ( $notification ) = $code_data; if ( $strings = ITSEC_Core::get_notification_center()->get_notification_strings( $notification ) ) { $notification = $strings['label']; } $details['description']['content'] = esc_html__( 'Sending Notification', 'it-l10n-ithemes-security-pro' ); $details['notification'] = array( 'header' => esc_html__( 'Notification', 'it-l10n-ithemes-security-pro' ), 'content' => $notification, 'order' => 21, ); break; case 'send_failed': list ( $notification ) = $code_data; if ( $strings = ITSEC_Core::get_notification_center()->get_notification_strings( $notification ) ) { $notification = $strings['label']; } $details['description']['content'] = esc_html__( 'Sending Notification Failed', 'it-l10n-ithemes-security-pro' ); $details['notification'] = array( 'header' => esc_html__( 'Notification', 'it-l10n-ithemes-security-pro' ), 'content' => $notification, 'order' => 21, ); $details['error_message'] = array( 'header' => esc_html__( 'Error', 'it-l10n-ithemes-security-pro' ), 'content' => wp_sprintf( '%l', ITSEC_Response::get_error_strings( $entry['data']['error'] ) ), 'order' => 22, ); break; case 'send_scheduled': $details['description']['content'] = esc_html__( 'Sending Scheduled Notification', 'it-l10n-ithemes-security-pro' ); $details['notifications'] = array( 'header' => esc_html__( 'Notifications', 'it-l10n-ithemes-security-pro' ), 'content' => wp_sprintf( '%l', $entry['data']['notifications'] ), 'order' => 21, ); break; break; } return $details; } public function filter_highlight_title( $title, $entry ) { if ( false === strpos( $entry['code'], '::' ) ) { $data = array(); } else { list( , $data ) = explode( '::', $entry['code'], 2 ); $data = explode( ',', $data ); } if ( empty( $data ) ) { return esc_html__( 'Failed sending notification.', 'it-l10n-ithemes-security-pro' ); } list( $notification ) = $data; if ( $strings = ITSEC_Core::get_notification_center()->get_notification_strings( $notification ) ) { $notification = $strings['label']; } return sprintf( esc_html__( 'Failed sending %s notification.', 'it-l10n-ithemes-security-pro' ), $notification ); } public function filter_highlight_message( $message, $entry ) { return wp_sprintf( '%l', ITSEC_Response::get_error_strings( $entry['data']['error'] ) ); } } new ITSEC_Notification_Center_Logs();