: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php namespace flow\social;
* @author Looks Awesome <email@looks-awesome.com>
* @link http://looks-awesome.com
* @copyright 2014-2020 Looks Awesome
class FFRemoteFeed implements FFFeed {
* @var array $remote_source
private $remote_source = null;
* FFRemoteFeed constructor.
public function __construct( FFFeed $object ) {
return $this->object->id();
public function init( $context, $feed ) {
$this->object->init($context, $feed);
public function posts( $is_empty_feed ) {
public function errors() {
$source = $this->getSource();
if (isset($source['errors'])){
return $source['errors'];
public function hasCriticalError() {
public function getType() {
return $this->object->getType();
private function getSource(){
if ($this->remote_source == null){
$this->remote_source = $this->proxyRequest();
return $this->remote_source;
private function proxyRequest(){
$domain = $_SERVER['HTTP_HOST'];
$url = FF_BOOST_SERVER . 'flow-flow/ff?shop=' . $domain . '&action=get_source&feed=' . $this->object->id();
$response = Request::post($url, [
'Content-Type: application/x-www-form-urlencoded'
], http_build_query($_POST));
if ($response->code != 200){
error_log(print_r($response, true));
throw new Exception('Problem: Remote get source doesnt work');
return json_decode($response->raw_body, true);