A K8$ZA j^Rɍ8dA `1 H1 x1 1 1 @ v1 @ P71 1 @1 01 @ [1 @ 8G1 1 1 1 @ W21 @ F 1 1 @ 51 @ P1 P1 pG1 }aA @ Ч41 @ 1 1 @1 X1 @ @ 1 @ 1 1 @ @A=1 @ P >1 G1 1 1 H1 `1 H1 @ @ >1 1 1 1 (1 1 xA K8$ZA j^Rɍ8dA 8G1 33{{`LdA H1 үPKdA 0I1 jJxOdA H1 wdt2PdA J1 ur]U`QdA I1 ؤ8~QdA X1 1 @ `1 @1 p1 @ 01 @ 1 1 @ G1 1 1 1 P1 0I1 W9 A C ! 1 1 >1 1 1 @ 081 " @ " 1 " " H1 1 1 1 @ >1 " @ # " 8G1 ) 1 p1 1 `1 @ $ 41 * @ J1 * * h1 1 1 (1 @ p41 * @ % F * * P1 1 @ 4 A K8$ZA j^Rɍ8dA (1 @ `<1 , @ H1 , , ? 1 1 1 @1 @ 1 , , 1 1 @ @ 1 / / 1 2 2 ( ( 1 H1 2 x1 1 ) 1 p1 1 `1 1 81 M41 @ B C ) 3 1 1 >1 1 1 1 .\%bpxA @ 5 @1 4 4 1 (1 @1 1 @ >1 4 @ 5 4 4 1 1 @ 1 > @ 6 >eA > > 1 J1 @ 1 @ 7 >eA ? ? 01 ? H1 @ H1 ? ? X1 p1 @ 8 >eA @ @ 1 @ 1 C > A 1 b1 1 1 @1 K X1 D @ K 1 `"1 "1 @ xA L on; $this->post_link_indexing_action = $post_link_indexing_action; $this->term_link_indexing_action = $term_link_indexing_action; $this->indexing_helper = $indexing_helper; } /** * Register hooks. */ public function register_hooks() { \add_action( 'admin_init', [ $this, 'register_shutdown_indexing' ], 10 ); } /** * Enqueues the required scripts. * * @return void */ public function register_shutdown_indexing() { if ( $this->should_index_on_shutdown( $this->get_shutdown_limit() ) ) { \register_shutdown_function( [ $this, 'index' ] ); } } /** * Run a single indexing pass of each indexing action. Intended for use as a shutdown function. * * @return void */ public function index() { $this->post_indexation->index(); $this->term_indexation->index(); $this->general_indexation->index(); $this->post_type_archive_indexation->index(); $this->post_link_indexing_action->index(); $this->term_link_indexing_action->index(); $this->complete_indexation_action->complete(); } /** * Retrieves the shutdown limit. This limit is the amount of indexables that is generated in the background. * * @return int The shutdown limit. */ protected function get_shutdown_limit() { /** * Filter 'wpseo_shutdown_indexation_limit' - Allow filtering the number of objects that can be indexed during shutdown. * * @api int The maximum number of objects indexed. */ return \apply_filters( 'wpseo_shutdown_indexation_limit', 25 ); } /** * Determine whether background indexation should be performed. * * @param int $shutdown_limit The shutdown limit used to determine whether indexation should be run. * * @return bool Should background indexation be performed. */ public function should_index_on_shutdown( $shutdown_limit ) { $total = $this->indexing_helper->get_limited_filtered_unindexed_count( $shutdown_limit ); return ( $total > 0 && $total < $shutdown_limit ); } }