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/wordpres.../src/config/migratio...
File: 20200617122511_CreateSEOLinksTable.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Config\Migrations;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\Lib\Migrations\Migration;
[4] Fix | Delete
use Yoast\WP\Lib\Model;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* CreateSEOLinksTable class.
[8] Fix | Delete
*/
[9] Fix | Delete
class CreateSEOLinksTable extends Migration {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* The plugin this migration belongs to.
[13] Fix | Delete
*
[14] Fix | Delete
* @var string
[15] Fix | Delete
*/
[16] Fix | Delete
public static $plugin = 'free';
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Migration up.
[20] Fix | Delete
*
[21] Fix | Delete
* @return void
[22] Fix | Delete
*/
[23] Fix | Delete
public function up() {
[24] Fix | Delete
$table_name = $this->get_table_name();
[25] Fix | Delete
$adapter = $this->get_adapter();
[26] Fix | Delete
[27] Fix | Delete
// The table may already have been created by legacy code.
[28] Fix | Delete
// If not, create it exactly as it was.
[29] Fix | Delete
if ( ! $adapter->table_exists( $table_name ) ) {
[30] Fix | Delete
$table = $this->create_table( $table_name, [ 'id' => false ] );
[31] Fix | Delete
$table->column(
[32] Fix | Delete
'id',
[33] Fix | Delete
'biginteger',
[34] Fix | Delete
[
[35] Fix | Delete
'primary_key' => true,
[36] Fix | Delete
'limit' => 20,
[37] Fix | Delete
'unsigned' => true,
[38] Fix | Delete
'auto_increment' => true,
[39] Fix | Delete
]
[40] Fix | Delete
);
[41] Fix | Delete
$table->column( 'url', 'string', [ 'limit' => 255 ] );
[42] Fix | Delete
$table->column(
[43] Fix | Delete
'post_id',
[44] Fix | Delete
'biginteger',
[45] Fix | Delete
[
[46] Fix | Delete
'limit' => 20,
[47] Fix | Delete
'unsigned' => true,
[48] Fix | Delete
]
[49] Fix | Delete
);
[50] Fix | Delete
$table->column(
[51] Fix | Delete
'target_post_id',
[52] Fix | Delete
'biginteger',
[53] Fix | Delete
[
[54] Fix | Delete
'limit' => 20,
[55] Fix | Delete
'unsigned' => true,
[56] Fix | Delete
]
[57] Fix | Delete
);
[58] Fix | Delete
$table->column( 'type', 'string', [ 'limit' => 8 ] );
[59] Fix | Delete
$table->finish();
[60] Fix | Delete
}
[61] Fix | Delete
if ( ! $adapter->has_index( $table_name, [ 'post_id', 'type' ], [ 'name' => 'link_direction' ] ) ) {
[62] Fix | Delete
$this->add_index( $table_name, [ 'post_id', 'type' ], [ 'name' => 'link_direction' ] );
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
// Add these columns outside of the initial table creation as these did not exist on the legacy table.
[66] Fix | Delete
$this->add_column( $table_name, 'indexable_id', 'integer', [ 'unsigned' => true ] );
[67] Fix | Delete
$this->add_column( $table_name, 'target_indexable_id', 'integer', [ 'unsigned' => true ] );
[68] Fix | Delete
$this->add_column( $table_name, 'height', 'integer', [ 'unsigned' => true ] );
[69] Fix | Delete
$this->add_column( $table_name, 'width', 'integer', [ 'unsigned' => true ] );
[70] Fix | Delete
$this->add_column( $table_name, 'size', 'integer', [ 'unsigned' => true ] );
[71] Fix | Delete
$this->add_column( $table_name, 'language', 'string', [ 'limit' => 32 ] );
[72] Fix | Delete
$this->add_column( $table_name, 'region', 'string', [ 'limit' => 32 ] );
[73] Fix | Delete
[74] Fix | Delete
$this->add_index( $table_name, [ 'indexable_id', 'type' ], [ 'name' => 'indexable_link_direction' ] );
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Migration down.
[79] Fix | Delete
*
[80] Fix | Delete
* @return void
[81] Fix | Delete
*/
[82] Fix | Delete
public function down() {
[83] Fix | Delete
$this->drop_table( $this->get_table_name() );
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* Returns the SEO Links table name.
[88] Fix | Delete
*
[89] Fix | Delete
* @return string
[90] Fix | Delete
*/
[91] Fix | Delete
private function get_table_name() {
[92] Fix | Delete
return Model::get_table_name( 'SEO_Links' );
[93] Fix | Delete
}
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function