Skip to content

Commit

Permalink
Remove manual cache deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidasmi committed Dec 7, 2023
1 parent f278c18 commit 5e5bc4a
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/builders/indexable-link-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Post_Helper;
use Yoast\WP\SEO\Helpers\Post_Type_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Models\SEO_Links;
Expand Down Expand Up @@ -62,34 +61,24 @@ class Indexable_Link_Builder {
*/
protected $indexable_repository;

/**
* The post type helper.
*
* @var Post_Type_Helper
*/
protected $post_type_helper;

/**
* Indexable_Link_Builder constructor.
*
* @param SEO_Links_Repository $seo_links_repository The SEO links repository.
* @param Url_Helper $url_helper The URL helper.
* @param Post_Helper $post_helper The post helper.
* @param Options_Helper $options_helper The options helper.
* @param Post_Type_Helper $post_type_helper The post type helper.
*/
public function __construct(
SEO_Links_Repository $seo_links_repository,
Url_Helper $url_helper,
Post_Helper $post_helper,
Options_Helper $options_helper,
Post_Type_Helper $post_type_helper
Options_Helper $options_helper
) {
$this->seo_links_repository = $seo_links_repository;
$this->url_helper = $url_helper;
$this->post_helper = $post_helper;
$this->options_helper = $options_helper;
$this->post_type_helper = $post_type_helper;
}

/**
Expand Down Expand Up @@ -720,12 +709,6 @@ protected function update_incoming_links_for_related_indexables( $related_indexa
if ( \wp_cache_supports( 'flush_group' ) ) {
\wp_cache_flush_group( 'orphaned_counts' );
}
else {
$indexable_post_types = $this->post_type_helper->get_indexable_post_types();
foreach ( $indexable_post_types as $post_type ) {
\wp_cache_delete( 'orphaned_count_' . $post_type );
}
}

foreach ( $counts as $count ) {
$this->indexable_repository->update_incoming_link_count( $count['target_indexable_id'], $count['incoming'] );
Expand Down

0 comments on commit 5e5bc4a

Please sign in to comment.