HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34
System: Linux atalantini.com 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64
User: root (0)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: //opt/plugins/atalantini/data/notification.php
<?php
require_once('../../../../wp-load.php');
global $wpdb;

function sendMessage($title, $link, $postId){
	$content = array(
		"en" => $title
	);
		
	$fields = array(
		'app_id' => "10b06f3c-021f-446e-9878-7cd2547f4584",
		'included_segments' => array('All'),
		'url' => $link,
                'data' => array("postId" => ""),
      		'headings' => array("en" => "Atalantini.com"),
		'contents' => $content,
		'large_icon' => 'https://www.atalantini.online/wp-content/themes/atalantini/images/logo_blu.png',
		'small_icon' => 'https://www.atalantini.online/wp-content/themes/atalantini/images/logo_blu.png'
	);
		
	$fields = json_encode($fields);
    	//print("\nJSON sent:\n");
    	//print($fields);
		
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications");
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8', 'Authorization: Basic ZTUyNDk2ZTAtNGM1OS00MzMzLTllOWUtYjBiYTMxZDJiOTg5'));
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	curl_setopt($ch, CURLOPT_HEADER, FALSE);
	curl_setopt($ch, CURLOPT_POST, TRUE);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

	$response = curl_exec($ch);
	curl_close($ch);
	
	return $response;
}

echo sendMessage($_POST['notifica'], $_POST['link'], "");
?>
{"result":"ok"}