HEX
Server: Apache
System: Linux top 5.8.11-1.el7.elrepo.x86_64 #1 SMP Tue Sep 22 18:18:35 EDT 2020 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.018111.cn/wp-content/plugins/wp-twilio-core/hooks.php
<?php 
/**
 * Function to send new post notifications
 */
function twl_send_post_notification($new_status, $old_status, $post) {
	
	$options = get_option( TWL_CORE_NOTIFICATION_OPTION );
	$options = wp_parse_args($options,twl_get_notification_defaults());

	if( $new_status == 'publish' && $old_status != 'publish' && $options["new_post_published_cb"] ) {

		$message = $options[ 'new_post_published_message'];
		$message = twl_replace_post_message_variables( $message, $post );

		$contact_number = $options["notification_number"];
		if(!empty($contact_number))
		{
			$args = array(
				'number_to' => $contact_number,
				'message' => $message,
			);
			twl_send_sms( $args );
		}
		

	}
}

add_action('transition_post_status', 'twl_send_post_notification', 10, 3);

/**
 * Function to send new user registration notifications
 */
function twl_send_user_registered_notification($user_id) {
	
	$options = get_option( TWL_CORE_NOTIFICATION_OPTION );
	$options = wp_parse_args($options,twl_get_notification_defaults());

	if( $options["new_user_registered_cb"] ) {

		$message = $options[ 'new_user_registered_message'];
		$message = twl_replace_user_registered_variables( $message, $user_id );

		$contact_number = $options["notification_number"];
		if(!empty($contact_number))
		{
			$args = array(
				'number_to' => $contact_number,
				'message' => $message,
			);
			twl_send_sms( $args );
		}
		

	}
}

add_action('user_register','twl_send_user_registered_notification');

/**
 * Function to send comment post notification
 */
function twl_send_comment_post_notification($comment_ID, $comment_approved, $commentdata) {
	
	$options = get_option( TWL_CORE_NOTIFICATION_OPTION );
	$options = wp_parse_args($options,twl_get_notification_defaults());

	if( $options["new_comment_cb"] ) {

		$message = $options[ 'new_comment_message'];
		$message = twl_replace_comment_post_variables( $message, $commentdata);
	
		$contact_number = $options["notification_number"];
		if(!empty($contact_number))
		{
			$args = array(
				'number_to' => $contact_number,
				'message' => $message,
			);
			twl_send_sms( $args );
		}
		

	}
}

add_action('comment_post','twl_send_comment_post_notification', 10, 3);

/**
 * Function to send new user registration notifications
 */
function twl_send_user_login_notification($user_login, $user) {
	
	$options = get_option( TWL_CORE_NOTIFICATION_OPTION );
	$options = wp_parse_args($options,twl_get_notification_defaults());

	if( $options["new_login_cb"] ) {

		$message = $options[ 'new_login_message'];
		$message = twl_replace_new_login_variables( $message, $user);
	
		$contact_number = $options["notification_number"];
		if(!empty($contact_number))
		{
			$args = array(
				'number_to' => $contact_number,
				'message' => $message,
			);
			twl_send_sms( $args );
		}
		

	}
}

add_action('wp_login','twl_send_user_login_notification', 10, 2);

?>