Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/flow-flo.../libs/flowflow/social/src/flow/social
File: FFHttpRequestFeed.php
<?php namespace flow\social;
[0] Fix | Delete
if ( ! defined( 'WPINC' ) ) die;
[1] Fix | Delete
/**
[2] Fix | Delete
* Flow-Flow.
[3] Fix | Delete
*
[4] Fix | Delete
* @package FlowFlow
[5] Fix | Delete
* @author Looks Awesome <email@looks-awesome.com>
[6] Fix | Delete
[7] Fix | Delete
* @link http://looks-awesome.com
[8] Fix | Delete
* @copyright 2014-2016 Looks Awesome
[9] Fix | Delete
*/
[10] Fix | Delete
abstract class FFHttpRequestFeed extends FFBaseFeed{
[11] Fix | Delete
private $header = false;
[12] Fix | Delete
protected $url;
[13] Fix | Delete
[14] Fix | Delete
function __construct( $type ) {
[15] Fix | Delete
parent::__construct( $type );
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* @return array
[20] Fix | Delete
* @throws \Exception
[21] Fix | Delete
*/
[22] Fix | Delete
protected function onePagePosts() {
[23] Fix | Delete
$result = array();
[24] Fix | Delete
$data = $this->getFeedData( $this->getUrl(), 200, $this->header );
[25] Fix | Delete
if ( sizeof( $data['errors'] ) > 0 ) {
[26] Fix | Delete
$message = $this->filterErrorMessage($data['errors']);
[27] Fix | Delete
$this->errors[] = array(
[28] Fix | Delete
'type' => $this->getType(),
[29] Fix | Delete
'message' => $message,
[30] Fix | Delete
'url' => $this->getUrl()
[31] Fix | Delete
);
[32] Fix | Delete
throw new \Exception($message);
[33] Fix | Delete
}
[34] Fix | Delete
foreach ( $this->items( $data['response'] ) as $item ) {
[35] Fix | Delete
$item = $this->prepareItem($item);
[36] Fix | Delete
if (is_object( $item ) && $this->isSuitableOriginalPost( $item )) {
[37] Fix | Delete
$post = $this->prepare( $item );
[38] Fix | Delete
$post->id = (string) $this->getId( $item );
[39] Fix | Delete
$post->type = $this->getType();
[40] Fix | Delete
if ($this->isNewPost($item)) {
[41] Fix | Delete
$post->header = (string) $this->getHeader( $item );
[42] Fix | Delete
$post->nickname = '';
[43] Fix | Delete
$post->screenname = (string) $this->getScreenName( $item );
[44] Fix | Delete
$post->userpic = $this->getProfileImage( $item );
[45] Fix | Delete
$post->system_timestamp = $this->getSystemDate( $item );
[46] Fix | Delete
$post->text = (string) $this->getContent( $item );
[47] Fix | Delete
$post->userlink = (string) $this->getUserlink( $item );
[48] Fix | Delete
$post->permalink = (string) $this->getPermalink( $item );
[49] Fix | Delete
if ( $this->showImage( $item ) ) {
[50] Fix | Delete
$post->img = $this->getImage( $item );
[51] Fix | Delete
$post->media = $this->getMedia( $item );
[52] Fix | Delete
$post->carousel = $this->getCarousel( $item );
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
$post->additional = $this->getAdditionalInfo( $item );
[56] Fix | Delete
$post->comments = $this->getComments( $item );
[57] Fix | Delete
[58] Fix | Delete
$post = $this->customize( $post, $item );
[59] Fix | Delete
if ( $this->isSuitablePost( $post ) ) {
[60] Fix | Delete
$result[$post->id] = $post;
[61] Fix | Delete
}
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
return $result;
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
protected function getUrl() {
[68] Fix | Delete
return $this->url;
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
protected abstract function items($request);
[72] Fix | Delete
protected abstract function getId($item);
[73] Fix | Delete
protected abstract function getHeader($item);
[74] Fix | Delete
protected abstract function getScreenName($item);
[75] Fix | Delete
protected abstract function getProfileImage($item);
[76] Fix | Delete
protected abstract function getSystemDate($item);
[77] Fix | Delete
protected abstract function getContent($item);
[78] Fix | Delete
protected abstract function getUserlink($item);
[79] Fix | Delete
protected abstract function getPermalink($item);
[80] Fix | Delete
[81] Fix | Delete
protected abstract function showImage($item);
[82] Fix | Delete
protected abstract function getImage($item);
[83] Fix | Delete
protected abstract function getMedia($item);
[84] Fix | Delete
[85] Fix | Delete
/**
[86] Fix | Delete
* @param $item
[87] Fix | Delete
* @return \stdClass
[88] Fix | Delete
*/
[89] Fix | Delete
protected function prepareItem($item){
[90] Fix | Delete
return $item;
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* @param $item
[95] Fix | Delete
* @return \stdClass
[96] Fix | Delete
*/
[97] Fix | Delete
protected function prepare($item){
[98] Fix | Delete
$post = new \stdClass();
[99] Fix | Delete
$post->feed_id = $this->id();
[100] Fix | Delete
$post->smart_order = 0;
[101] Fix | Delete
return $post;
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
/**
[105] Fix | Delete
* @param $item
[106] Fix | Delete
* @return array
[107] Fix | Delete
*/
[108] Fix | Delete
protected function getAdditionalInfo( $item ){
[109] Fix | Delete
return array();
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
/**
[113] Fix | Delete
* @param \stdClass $post
[114] Fix | Delete
* @param $item
[115] Fix | Delete
*
[116] Fix | Delete
* @return \stdClass
[117] Fix | Delete
*/
[118] Fix | Delete
protected function customize($post, $item){
[119] Fix | Delete
return $post;
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* @param boolean $header
[124] Fix | Delete
*/
[125] Fix | Delete
protected function setHeader( $header ) {
[126] Fix | Delete
$this->header = $header;
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* @param $post
[131] Fix | Delete
* @return bool
[132] Fix | Delete
*/
[133] Fix | Delete
protected function isSuitableOriginalPost( $post ) {
[134] Fix | Delete
return true;
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
/**
[138] Fix | Delete
* @param $post
[139] Fix | Delete
* @return bool
[140] Fix | Delete
*/
[141] Fix | Delete
protected function isNewPost( $post ) {
[142] Fix | Delete
return true;
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
protected function getCarousel( $item ){
[146] Fix | Delete
return array();
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
protected function getComments( $item ){
[150] Fix | Delete
return array();
[151] Fix | Delete
}
[152] Fix | Delete
}
[153] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function