: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php namespace flow\social;
if ( ! defined( 'WPINC' ) ) die;
* @author Looks Awesome <email@looks-awesome.com>
* @link http://looks-awesome.com
* @copyright 2014-2016 Looks Awesome
abstract class FFHttpRequestFeed extends FFBaseFeed{
function __construct( $type ) {
parent::__construct( $type );
protected function onePagePosts() {
$data = $this->getFeedData( $this->getUrl(), 200, $this->header );
if ( sizeof( $data['errors'] ) > 0 ) {
$message = $this->filterErrorMessage($data['errors']);
'type' => $this->getType(),
throw new \Exception($message);
foreach ( $this->items( $data['response'] ) as $item ) {
$item = $this->prepareItem($item);
if (is_object( $item ) && $this->isSuitableOriginalPost( $item )) {
$post = $this->prepare( $item );
$post->id = (string) $this->getId( $item );
$post->type = $this->getType();
if ($this->isNewPost($item)) {
$post->header = (string) $this->getHeader( $item );
$post->screenname = (string) $this->getScreenName( $item );
$post->userpic = $this->getProfileImage( $item );
$post->system_timestamp = $this->getSystemDate( $item );
$post->text = (string) $this->getContent( $item );
$post->userlink = (string) $this->getUserlink( $item );
$post->permalink = (string) $this->getPermalink( $item );
if ( $this->showImage( $item ) ) {
$post->img = $this->getImage( $item );
$post->media = $this->getMedia( $item );
$post->carousel = $this->getCarousel( $item );
$post->additional = $this->getAdditionalInfo( $item );
$post->comments = $this->getComments( $item );
$post = $this->customize( $post, $item );
if ( $this->isSuitablePost( $post ) ) {
$result[$post->id] = $post;
protected function getUrl() {
protected abstract function items($request);
protected abstract function getId($item);
protected abstract function getHeader($item);
protected abstract function getScreenName($item);
protected abstract function getProfileImage($item);
protected abstract function getSystemDate($item);
protected abstract function getContent($item);
protected abstract function getUserlink($item);
protected abstract function getPermalink($item);
protected abstract function showImage($item);
protected abstract function getImage($item);
protected abstract function getMedia($item);
protected function prepareItem($item){
protected function prepare($item){
$post->feed_id = $this->id();
protected function getAdditionalInfo( $item ){
protected function customize($post, $item){
protected function setHeader( $header ) {
protected function isSuitableOriginalPost( $post ) {
protected function isNewPost( $post ) {
protected function getCarousel( $item ){
protected function getComments( $item ){