HEX
Server: nginx/1.18.0
System: Linux vcwordpress 5.15.0-174-generic #184-Ubuntu SMP Fri Mar 13 18:41:50 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/info.viitorcloud.in/wp-content/plugins/wp-user-login-notifier/functions.php
<?php

// Do not allow direct access over web.
defined( 'ABSPATH' ) || exit;

/**
 * Get all settings
 *
 * @return array
 */
function buddydev_wpuln_get_settings() {

	$default = array(
		'notify_admin_on_fail'    => 'yes',
		'notify_admin_on_success' => 'yes',
		'notify_user_on_fail'     => 'yes',
		'notify_user_on_success'  => 'yes',
		'notify_extra_users'      => '', // added in version 1.0.1.
	);

	return get_option( 'wp_user_login_notifier_settings', $default );

}

/**
 * Get individual setting
 *
 * @param string $key option name.
 *
 * @return string
 */
function buddydev_wpuln_get_setting( $key ) {

	$settings = buddydev_wpuln_get_settings();

	if ( isset( $settings[ $key ] ) ) {
		return $settings[ $key ];
	}

	return '';
}

/**
 * Get an array of emails that may need to be notified
 */
function buddydev_wpuln_get_extra_emails() {

	$emails = buddydev_wpuln_get_setting( 'notify_extra_users' );

	if ( ! empty( $emails ) ) {
		$emails = explode( ',', $emails );

		// now trim it.
		$emails = array_map( 'trim', $emails );

		// now filter the list for invalid email.
		$emails = array_filter( $emails, 'is_email' );

	}

	return $emails;
}

/**
 * Get bcc header.
 *
 * @return array
 */
function buddydev_wpuln_get_bcc_header() {

	$headers = array();
	$emails  = buddydev_wpuln_get_extra_emails();

	if ( empty( $emails ) ) {
		return $headers;
	}
	// Loop through users.
	foreach ( $emails as $email ) {
		// add all other users as bcc.
		$headers[] = 'Bcc:' . $email;
	}

	return $headers;
}