recent_content_indexable_collector = $recent_content_indexable_collector; $this->indexable_helper = $indexable_helper; $this->enabled_analysis_features_repository = $enabled_analysis_features_repository; } /** * Returns the task's link. * * @return string|null */ public function get_link(): ?string { return null; } /** * Returns the task's call to action entry. * * @return Call_To_Action_Entry|null */ public function get_call_to_action(): ?Call_To_Action_Entry { return null; } /** * Returns the task's copy set. * * @return Copy_Set */ public function get_copy_set(): Copy_Set { $post_type = \get_post_type_object( $this->get_post_type() ); return new Copy_Set( /* translators: %1$s expands to the post type label this task is about */ \sprintf( \__( 'Improve the readability of your recent content: %1$s', 'wordpress-seo' ), $post_type->label ), \sprintf( /* translators: %1$s expands to an opening p tag, %2$s and %4$s expand to a closing p tag, %3$s expands to an opening p tag and opening strong tag, %5$s expands to a closing strong tag, %6$s expands to an opening strong tag, %7$s expands to a closing strong tag and closing p tag */ \__( '%1$sChecking your recent content\'s readability ensures it stays clear and easy to follow, improving your user experience. Follow the feedback to refine your sentence structure and word choice and maintain a high standard of engagement and comprehension.%2$s%3$sPro tip%5$s: Use %6$sAI Optimize%7$s to automatically simplify complex sentences and improve the flow of your writing.%4$s', 'wordpress-seo' ), '

', '

', '

', '

', '', '', '', ), ); } /** * Populates the child tasks by querying content modified in the last two months. * * @return Child_Task_Interface[] */ public function populate_child_tasks(): array { $post_type = $this->get_post_type(); if ( empty( $post_type ) ) { return []; } $two_months_ago = $this->get_recency_timestamp(); $recent_content_items = $this->recent_content_indexable_collector->get_recent_content_with_readability_scores( $post_type, $two_months_ago, self::DEFAULT_LIMIT, ); $child_tasks = []; foreach ( $recent_content_items as $content_item_score_data ) { $child_tasks[] = new Improve_Content_Readability_Child( $this, $content_item_score_data, ); } return $child_tasks; } /** * Returns whether the task is valid. * * @return bool */ public function is_valid(): bool { if ( ! $this->indexable_helper->should_index_indexables() ) { return false; } $enabled_features = $this->enabled_analysis_features_repository->get_enabled_features()->to_array(); if ( ! isset( $enabled_features[ Readability_Analysis::NAME ] ) || $enabled_features[ Readability_Analysis::NAME ] === false ) { return false; } return true; } }