: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if (!defined('ABSPATH')) exit;
if (!class_exists('BVWPAPI')) :
public function __construct($settings) {
$this->settings = $settings;
public function pingbv($method, $body, $public = false) {
return $this->do_request($method, $body, $public);
$api_public_key = $this->settings->getOption('bvApiPublic');
if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
return $this->do_request($method, $body, $api_public_key);
public function do_request($method, $body, $pubkey) {
$account = BVAccount::find($this->settings, $pubkey);
$url = $account->authenticatedUrl($method);
return $this->http_request($url, $body);
public function http_request($url, $body, $headers = array()) {
$_body['headers'] = $headers;
return wp_remote_post($url, $_body);