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/actions/indexing
File: abstract-link-indexing-action.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Actions\Indexing;
[2] Fix | Delete
[3] Fix | Delete
use wpdb;
[4] Fix | Delete
use Yoast\WP\SEO\Builders\Indexable_Link_Builder;
[5] Fix | Delete
use Yoast\WP\SEO\Helpers\Indexable_Helper;
[6] Fix | Delete
use Yoast\WP\SEO\Models\SEO_Links;
[7] Fix | Delete
use Yoast\WP\SEO\Repositories\Indexable_Repository;
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Reindexing action for link indexables.
[11] Fix | Delete
*/
[12] Fix | Delete
abstract class Abstract_Link_Indexing_Action extends Abstract_Indexing_Action {
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* The link builder.
[16] Fix | Delete
*
[17] Fix | Delete
* @var Indexable_Link_Builder
[18] Fix | Delete
*/
[19] Fix | Delete
protected $link_builder;
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* The indexable helper.
[23] Fix | Delete
*
[24] Fix | Delete
* @var Indexable_Helper
[25] Fix | Delete
*/
[26] Fix | Delete
protected $indexable_helper;
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* The indexable repository.
[30] Fix | Delete
*
[31] Fix | Delete
* @var Indexable_Repository
[32] Fix | Delete
*/
[33] Fix | Delete
protected $repository;
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* The WordPress database instance.
[37] Fix | Delete
*
[38] Fix | Delete
* @var wpdb
[39] Fix | Delete
*/
[40] Fix | Delete
protected $wpdb;
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* Indexable_Post_Indexing_Action constructor
[44] Fix | Delete
*
[45] Fix | Delete
* @param Indexable_Link_Builder $link_builder The indexable link builder.
[46] Fix | Delete
* @param Indexable_Helper $indexable_helper The indexable repository.
[47] Fix | Delete
* @param Indexable_Repository $repository The indexable repository.
[48] Fix | Delete
* @param wpdb $wpdb The WordPress database instance.
[49] Fix | Delete
*/
[50] Fix | Delete
public function __construct(
[51] Fix | Delete
Indexable_Link_Builder $link_builder,
[52] Fix | Delete
Indexable_Helper $indexable_helper,
[53] Fix | Delete
Indexable_Repository $repository,
[54] Fix | Delete
wpdb $wpdb
[55] Fix | Delete
) {
[56] Fix | Delete
$this->link_builder = $link_builder;
[57] Fix | Delete
$this->indexable_helper = $indexable_helper;
[58] Fix | Delete
$this->repository = $repository;
[59] Fix | Delete
$this->wpdb = $wpdb;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Builds links for indexables which haven't had their links indexed yet.
[64] Fix | Delete
*
[65] Fix | Delete
* @return SEO_Links[] The created SEO links.
[66] Fix | Delete
*/
[67] Fix | Delete
public function index() {
[68] Fix | Delete
$objects = $this->get_objects();
[69] Fix | Delete
[70] Fix | Delete
$indexables = [];
[71] Fix | Delete
foreach ( $objects as $object ) {
[72] Fix | Delete
$indexable = $this->repository->find_by_id_and_type( $object->id, $object->type );
[73] Fix | Delete
if ( $indexable ) {
[74] Fix | Delete
$this->link_builder->build( $indexable, $object->content );
[75] Fix | Delete
$this->indexable_helper->save_indexable( $indexable );
[76] Fix | Delete
[77] Fix | Delete
$indexables[] = $indexable;
[78] Fix | Delete
}
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
if ( \count( $indexables ) > 0 ) {
[82] Fix | Delete
\delete_transient( static::UNINDEXED_COUNT_TRANSIENT );
[83] Fix | Delete
\delete_transient( static::UNINDEXED_LIMITED_COUNT_TRANSIENT );
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
return $indexables;
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
/**
[90] Fix | Delete
* In the case of term-links and post-links we want to use the total unindexed count, because using
[91] Fix | Delete
* the limited unindexed count actually leads to worse performance.
[92] Fix | Delete
*
[93] Fix | Delete
* @param int|bool $limit Unused.
[94] Fix | Delete
*
[95] Fix | Delete
* @return int The total number of unindexed links.
[96] Fix | Delete
*/
[97] Fix | Delete
public function get_limited_unindexed_count( $limit = false ) {
[98] Fix | Delete
return $this->get_total_unindexed();
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
/**
[102] Fix | Delete
* Returns the number of texts that will be indexed in a single link indexing pass.
[103] Fix | Delete
*
[104] Fix | Delete
* @return int The limit.
[105] Fix | Delete
*/
[106] Fix | Delete
public function get_limit() {
[107] Fix | Delete
/**
[108] Fix | Delete
* Filter 'wpseo_link_indexing_limit' - Allow filtering the number of texts indexed during each link indexing pass.
[109] Fix | Delete
*
[110] Fix | Delete
* @param int $limit The maximum number of texts indexed.
[111] Fix | Delete
*/
[112] Fix | Delete
return \apply_filters( 'wpseo_link_indexing_limit', 5 );
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
/**
[116] Fix | Delete
* Returns objects to be indexed.
[117] Fix | Delete
*
[118] Fix | Delete
* @return array Objects to be indexed, should be an array of objects with object_id, object_type and content.
[119] Fix | Delete
*/
[120] Fix | Delete
abstract protected function get_objects();
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function