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/wp-conte.../plugins/flow-flo.../includes/db/migratio...
File: FFMigration_2_0.php
<?php namespace flow\db\migrations;
[0] Fix | Delete
use Exception;
[1] Fix | Delete
use la\core\db\LADDLUtils;
[2] Fix | Delete
use la\core\db\migrations\ILADBMigration;
[3] Fix | Delete
[4] Fix | Delete
if ( ! defined( 'WPINC' ) ) die;
[5] Fix | Delete
/**
[6] Fix | Delete
* Insta-Flow.
[7] Fix | Delete
*
[8] Fix | Delete
* @package InstaFlow
[9] Fix | Delete
* @author Looks Awesome <email@looks-awesome.com>
[10] Fix | Delete
*
[11] Fix | Delete
* @link http://looks-awesome.com
[12] Fix | Delete
* @copyright 2017 Looks Awesome
[13] Fix | Delete
*/
[14] Fix | Delete
class FFMigration_2_0 implements ILADBMigration{
[15] Fix | Delete
[16] Fix | Delete
public function version() {
[17] Fix | Delete
return '2.0';
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
public function execute($conn, $manager) {
[21] Fix | Delete
if (FF_USE_WP) {
[22] Fix | Delete
LADDLUtils::addColumnIfNotExist($conn, $manager->streams_table_name, 'feeds', 'LONGBLOB');
[23] Fix | Delete
[24] Fix | Delete
global $wpdb;
[25] Fix | Delete
[26] Fix | Delete
$option_name = 'flow_flow_options';
[27] Fix | Delete
$sql = "INSERT INTO ?n (`id`, `value`) SELECT ?s, wp1.option_value as 'settings' FROM ?n wp1 WHERE wp1.option_name = ?s";
[28] Fix | Delete
$conn->query($sql, $manager->option_table_name, $option_name, $wpdb->prefix . 'options', $option_name);
[29] Fix | Delete
[30] Fix | Delete
$option_name = 'flow_flow_fb_auth_options';
[31] Fix | Delete
$sql = "INSERT INTO ?n (`id`, `value`) SELECT ?s, wp1.option_value as 'settings' FROM ?n wp1 WHERE wp1.option_name = ?s";
[32] Fix | Delete
$conn->query($sql, $manager->option_table_name, $option_name, $wpdb->prefix . 'options', $option_name);
[33] Fix | Delete
[34] Fix | Delete
$option_name = 'flow_flow_facebook_access_token';
[35] Fix | Delete
$sql = "INSERT INTO ?n (`id`, `value`) SELECT ?s, wp1.option_value as 'settings' FROM ?n wp1 WHERE wp1.option_name = ?s";
[36] Fix | Delete
$conn->query($sql, $manager->option_table_name, $option_name, $wpdb->prefix . 'options', '_transient_' . $option_name);
[37] Fix | Delete
[38] Fix | Delete
$option_name = 'flow_flow_facebook_access_token_expires';
[39] Fix | Delete
$sql = "INSERT INTO ?n (`id`, `value`) SELECT ?s, wp1.option_value as 'settings' FROM ?n wp1 WHERE wp1.option_name = ?s";
[40] Fix | Delete
$conn->query($sql, $manager->option_table_name, $option_name, $wpdb->prefix . 'options', '_transient_' . $option_name);
[41] Fix | Delete
[42] Fix | Delete
$options = $manager->getOption('options', true);
[43] Fix | Delete
if (isset($options['streams'])){
[44] Fix | Delete
$json = json_decode($options['streams']);
[45] Fix | Delete
foreach ( $json as $stream) {
[46] Fix | Delete
$obj = (object)$stream;
[47] Fix | Delete
$this->setStream($conn, $manager->streams_table_name, $obj->id, $obj);
[48] Fix | Delete
}
[49] Fix | Delete
unset($options['streams']);
[50] Fix | Delete
}
[51] Fix | Delete
unset($options['streams_count']);
[52] Fix | Delete
$manager->setOption('options', $options, true);
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
private function setStream($conn, $table_name, $id, $stream){
[57] Fix | Delete
$name = $stream->name;
[58] Fix | Delete
$layout = isset($stream->layout) ? $stream->layout : NULL;
[59] Fix | Delete
$feeds = (is_array($stream->feeds) || is_object($stream->feeds)) ? serialize($stream->feeds) : stripslashes($stream->feeds);
[60] Fix | Delete
unset($stream->feeds);
[61] Fix | Delete
$serialized = serialize($stream);
[62] Fix | Delete
$common = [
[63] Fix | Delete
'name' => $name,
[64] Fix | Delete
'layout' => $layout,
[65] Fix | Delete
'feeds' => $feeds,
[66] Fix | Delete
'value' => $serialized
[67] Fix | Delete
];
[68] Fix | Delete
if ( false === $conn->query( 'INSERT INTO ?n SET `id`=?s, ?u ON DUPLICATE KEY UPDATE ?u',
[69] Fix | Delete
$table_name, $id, $common, $common ) ) {
[70] Fix | Delete
throw new Exception();
[71] Fix | Delete
}
[72] Fix | Delete
$conn->commit();
[73] Fix | Delete
}
[74] Fix | Delete
}
[75] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function