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.../public_h.../wp-conte.../plugins/wordpres.../src/models
File: indexable.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Models;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\Lib\Model;
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Indexable table definition.
[7] Fix | Delete
*
[8] Fix | Delete
* @property int $id
[9] Fix | Delete
* @property int $object_id
[10] Fix | Delete
* @property string $object_type
[11] Fix | Delete
* @property string $object_sub_type
[12] Fix | Delete
*
[13] Fix | Delete
* @property int $author_id
[14] Fix | Delete
* @property int $post_parent
[15] Fix | Delete
*
[16] Fix | Delete
* @property string $created_at
[17] Fix | Delete
* @property string $updated_at
[18] Fix | Delete
*
[19] Fix | Delete
* @property string $permalink
[20] Fix | Delete
* @property string $permalink_hash
[21] Fix | Delete
* @property string $canonical
[22] Fix | Delete
*
[23] Fix | Delete
* @property bool $is_robots_noindex
[24] Fix | Delete
* @property bool $is_robots_nofollow
[25] Fix | Delete
* @property bool $is_robots_noarchive
[26] Fix | Delete
* @property bool $is_robots_noimageindex
[27] Fix | Delete
* @property bool $is_robots_nosnippet
[28] Fix | Delete
*
[29] Fix | Delete
* @property string $title
[30] Fix | Delete
* @property string $description
[31] Fix | Delete
* @property string $breadcrumb_title
[32] Fix | Delete
*
[33] Fix | Delete
* @property bool $is_cornerstone
[34] Fix | Delete
*
[35] Fix | Delete
* @property string $primary_focus_keyword
[36] Fix | Delete
* @property int $primary_focus_keyword_score
[37] Fix | Delete
*
[38] Fix | Delete
* @property int $readability_score
[39] Fix | Delete
*
[40] Fix | Delete
* @property int $inclusive_language_score
[41] Fix | Delete
*
[42] Fix | Delete
* @property int $link_count
[43] Fix | Delete
* @property int $incoming_link_count
[44] Fix | Delete
* @property int $number_of_pages
[45] Fix | Delete
*
[46] Fix | Delete
* @property string $open_graph_title
[47] Fix | Delete
* @property string $open_graph_description
[48] Fix | Delete
* @property string $open_graph_image
[49] Fix | Delete
* @property string $open_graph_image_id
[50] Fix | Delete
* @property string $open_graph_image_source
[51] Fix | Delete
* @property string $open_graph_image_meta
[52] Fix | Delete
*
[53] Fix | Delete
* @property string $twitter_title
[54] Fix | Delete
* @property string $twitter_description
[55] Fix | Delete
* @property string $twitter_image
[56] Fix | Delete
* @property string $twitter_image_id
[57] Fix | Delete
* @property string $twitter_image_source
[58] Fix | Delete
* @property string $twitter_card
[59] Fix | Delete
*
[60] Fix | Delete
* @property int $prominent_words_version
[61] Fix | Delete
*
[62] Fix | Delete
* @property bool $is_public
[63] Fix | Delete
* @property bool $is_protected
[64] Fix | Delete
* @property string $post_status
[65] Fix | Delete
* @property bool $has_public_posts
[66] Fix | Delete
*
[67] Fix | Delete
* @property int $blog_id
[68] Fix | Delete
*
[69] Fix | Delete
* @property string $language
[70] Fix | Delete
* @property string $region
[71] Fix | Delete
*
[72] Fix | Delete
* @property string $schema_page_type
[73] Fix | Delete
* @property string $schema_article_type
[74] Fix | Delete
*
[75] Fix | Delete
* @property bool $has_ancestors
[76] Fix | Delete
*
[77] Fix | Delete
* @property int $estimated_reading_time_minutes
[78] Fix | Delete
*
[79] Fix | Delete
* @property string $object_last_modified
[80] Fix | Delete
* @property string $object_published_at
[81] Fix | Delete
*
[82] Fix | Delete
* @property int $version
[83] Fix | Delete
*/
[84] Fix | Delete
class Indexable extends Model {
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* Holds the ancestors.
[88] Fix | Delete
*
[89] Fix | Delete
* @var Indexable[]
[90] Fix | Delete
*/
[91] Fix | Delete
public $ancestors = [];
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Whether nor this model uses timestamps.
[95] Fix | Delete
*
[96] Fix | Delete
* @var bool
[97] Fix | Delete
*/
[98] Fix | Delete
protected $uses_timestamps = true;
[99] Fix | Delete
[100] Fix | Delete
/**
[101] Fix | Delete
* Which columns contain boolean values.
[102] Fix | Delete
*
[103] Fix | Delete
* @var array
[104] Fix | Delete
*/
[105] Fix | Delete
protected $boolean_columns = [
[106] Fix | Delete
'is_robots_noindex',
[107] Fix | Delete
'is_robots_nofollow',
[108] Fix | Delete
'is_robots_noarchive',
[109] Fix | Delete
'is_robots_noimageindex',
[110] Fix | Delete
'is_robots_nosnippet',
[111] Fix | Delete
'is_cornerstone',
[112] Fix | Delete
'is_public',
[113] Fix | Delete
'is_protected',
[114] Fix | Delete
'has_public_posts',
[115] Fix | Delete
'has_ancestors',
[116] Fix | Delete
];
[117] Fix | Delete
[118] Fix | Delete
/**
[119] Fix | Delete
* Which columns contain int values.
[120] Fix | Delete
*
[121] Fix | Delete
* @var array
[122] Fix | Delete
*/
[123] Fix | Delete
protected $int_columns = [
[124] Fix | Delete
'id',
[125] Fix | Delete
'object_id',
[126] Fix | Delete
'author_id',
[127] Fix | Delete
'post_parent',
[128] Fix | Delete
'primary_focus_keyword_score',
[129] Fix | Delete
'readability_score',
[130] Fix | Delete
'inclusive_language_score',
[131] Fix | Delete
'link_count',
[132] Fix | Delete
'incoming_link_count',
[133] Fix | Delete
'number_of_pages',
[134] Fix | Delete
'prominent_words_version',
[135] Fix | Delete
'blog_id',
[136] Fix | Delete
'estimated_reading_time_minutes',
[137] Fix | Delete
'version',
[138] Fix | Delete
];
[139] Fix | Delete
[140] Fix | Delete
/**
[141] Fix | Delete
* The loaded indexable extensions.
[142] Fix | Delete
*
[143] Fix | Delete
* @var Indexable_Extension[]
[144] Fix | Delete
*/
[145] Fix | Delete
protected $loaded_extensions = [];
[146] Fix | Delete
[147] Fix | Delete
/**
[148] Fix | Delete
* Returns an Indexable_Extension by its name.
[149] Fix | Delete
*
[150] Fix | Delete
* @param string $class_name The class name of the extension to load.
[151] Fix | Delete
*
[152] Fix | Delete
* @return Indexable_Extension|bool The extension.
[153] Fix | Delete
*/
[154] Fix | Delete
public function get_extension( $class_name ) {
[155] Fix | Delete
if ( ! $this->loaded_extensions[ $class_name ] ) {
[156] Fix | Delete
$this->loaded_extensions[ $class_name ] = $this->has_one( $class_name, 'indexable_id', 'id' )->find_one();
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
return $this->loaded_extensions[ $class_name ];
[160] Fix | Delete
}
[161] Fix | Delete
[162] Fix | Delete
/**
[163] Fix | Delete
* Enhances the save method.
[164] Fix | Delete
*
[165] Fix | Delete
* @return bool True on success.
[166] Fix | Delete
*/
[167] Fix | Delete
public function save() {
[168] Fix | Delete
if ( $this->permalink ) {
[169] Fix | Delete
$this->sanitize_permalink();
[170] Fix | Delete
$this->permalink_hash = \strlen( $this->permalink ) . ':' . \md5( $this->permalink );
[171] Fix | Delete
}
[172] Fix | Delete
if ( \is_string( $this->primary_focus_keyword ) && \mb_strlen( $this->primary_focus_keyword ) > 191 ) {
[173] Fix | Delete
$this->primary_focus_keyword = \mb_substr( $this->primary_focus_keyword, 0, 191, 'UTF-8' );
[174] Fix | Delete
}
[175] Fix | Delete
[176] Fix | Delete
return parent::save();
[177] Fix | Delete
}
[178] Fix | Delete
[179] Fix | Delete
/**
[180] Fix | Delete
* Sanitizes the permalink.
[181] Fix | Delete
*
[182] Fix | Delete
* @return void
[183] Fix | Delete
*/
[184] Fix | Delete
protected function sanitize_permalink() {
[185] Fix | Delete
if ( $this->permalink === 'unindexed' ) {
[186] Fix | Delete
return;
[187] Fix | Delete
}
[188] Fix | Delete
[189] Fix | Delete
$permalink_structure = \get_option( 'permalink_structure' );
[190] Fix | Delete
$permalink_parts = \wp_parse_url( $this->permalink );
[191] Fix | Delete
[192] Fix | Delete
if ( ! isset( $permalink_parts['path'] ) ) {
[193] Fix | Delete
$permalink_parts['path'] = '/';
[194] Fix | Delete
}
[195] Fix | Delete
if ( \substr( $permalink_structure, -1, 1 ) === '/' && \strpos( \substr( $permalink_parts['path'], -5 ), '.' ) === false ) {
[196] Fix | Delete
$permalink_parts['path'] = \trailingslashit( $permalink_parts['path'] );
[197] Fix | Delete
}
[198] Fix | Delete
[199] Fix | Delete
$permalink = '';
[200] Fix | Delete
if ( isset( $permalink_parts['scheme'] ) ) {
[201] Fix | Delete
$permalink .= $permalink_parts['scheme'] . '://';
[202] Fix | Delete
}
[203] Fix | Delete
if ( isset( $permalink_parts['host'] ) ) {
[204] Fix | Delete
$permalink .= $permalink_parts['host'];
[205] Fix | Delete
}
[206] Fix | Delete
if ( isset( $permalink_parts['port'] ) ) {
[207] Fix | Delete
$permalink .= ':' . $permalink_parts['port'];
[208] Fix | Delete
}
[209] Fix | Delete
if ( isset( $permalink_parts['path'] ) ) {
[210] Fix | Delete
$permalink .= $permalink_parts['path'];
[211] Fix | Delete
}
[212] Fix | Delete
if ( isset( $permalink_parts['query'] ) ) {
[213] Fix | Delete
$permalink .= '?' . $permalink_parts['query'];
[214] Fix | Delete
}
[215] Fix | Delete
// We never set the fragment as the fragment is intended to be client-only.
[216] Fix | Delete
$this->permalink = $permalink;
[217] Fix | Delete
}
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function