|
Server IP : 10.131.40.8 / Your IP : 216.73.216.15 Web Server : Apache System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : ludmqhh ( 137773) PHP Version : 8.4.10 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/ludmqhh/www/hotel-forum/wp-content/plugins/revslider/admin/includes/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link https://www.themepunch.com/
* @copyright 2019 ThemePunch
* @version 1.0.0
*/
if(!defined('ABSPATH')) exit();
if(!class_exists('ThemePunch_Newsletter')) {
class ThemePunch_Newsletter {
protected static $remote_url = 'http://newsletter.themepunch.com/';
protected static $subscribe = 'subscribe.php';
protected static $unsubscribe = 'unsubscribe.php';
public function __construct(){
}
/**
* Subscribe to the ThemePunch Newsletter
* @since: 1.0.0
**/
public static function subscribe($email){
global $wp_version;
$request = wp_remote_post(self::$remote_url.self::$subscribe, array(
'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'),
'timeout' => 15,
'body' => array(
'email' => urlencode($email)
)
));
if(!is_wp_error($request)) {
if($response = json_decode($request['body'], true)) {
if(is_array($response)) {
$data = $response;
return $data;
}else{
return false;
}
}
}
}
/**
* Unsubscribe to the ThemePunch Newsletter
* @since: 1.0.0
**/
public static function unsubscribe($email){
global $wp_version;
$request = wp_remote_post(self::$remote_url.self::$unsubscribe, array(
'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'),
'timeout' => 15,
'body' => array(
'email' => urlencode($email)
)
));
if(!is_wp_error($request)) {
if($response = json_decode($request['body'], true)) {
if(is_array($response)) {
$data = $response;
return $data;
}else{
return false;
}
}
}
}
}
}