| Server IP : 172.67.159.97 / Your IP : 216.73.217.154 Web Server : nginx/1.24.0 System : Linux wordpress-sites 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/rebeccaone.com/wp-content/plugins/revslider/admin/includes/ |
Upload File : |
<?php
/**
* @author ThemePunch <[email protected]>
* @link https://www.themepunch.com/
* @copyright 2024 ThemePunch
*/
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';
/**
* Subscribe to the ThemePunch Newsletter
**/
public static function subscribe($email){
global $wp_version;
$request = wp_safe_remote_post(self::$remote_url.self::$subscribe, [
'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'),
'timeout' => 15,
'body' => [
'email' => urlencode($email)
]
]);
if(is_wp_error($request)) return false;
if($response = json_decode($request['body'], true)){
return (!is_array($response)) ? false : $response;
}
return false;
}
/**
* Unsubscribe to the ThemePunch Newsletter
**/
public static function unsubscribe($email){
global $wp_version;
$request = wp_safe_remote_post(self::$remote_url.self::$unsubscribe, [
'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'),
'timeout' => 15,
'body' => [
'email' => urlencode($email)
]
]);
if(is_wp_error($request)) return false;
if($response = json_decode($request['body'], true)){
return (!is_array($response)) ? false : $response;
}
return false;
}
}
}