diff --git a/packages/js/src/dashboard/scores/components/scores.js b/packages/js/src/dashboard/scores/components/scores.js index fb4d99157d6..683f8a8200f 100644 --- a/packages/js/src/dashboard/scores/components/scores.js +++ b/packages/js/src/dashboard/scores/components/scores.js @@ -94,6 +94,7 @@ export const Scores = ( { analysisType, contentTypes, endpoint, headers } ) => { }, }, fetchDelay: 0, + prepareData: ( data ) => data?.scores, } ); useEffect( () => { diff --git a/src/dashboard/application/score-results/abstract-score-results-repository.php b/src/dashboard/application/score-results/abstract-score-results-repository.php new file mode 100644 index 00000000000..ecd7055408a --- /dev/null +++ b/src/dashboard/application/score-results/abstract-score-results-repository.php @@ -0,0 +1,70 @@ +current_scores_repository = $current_scores_repository; + } + + /** + * Returns the score results for a content type. + * + * @param Content_Type $content_type The content type. + * @param Taxonomy|null $taxonomy The taxonomy of the term we're filtering for. + * @param int|null $term_id The ID of the term we're filtering for. + * + * @return array>> The scores. + */ + public function get_score_results( Content_Type $content_type, ?Taxonomy $taxonomy, ?int $term_id ): array { + $score_results = $this->score_results_collector->get_score_results( $this->score_groups, $content_type, $term_id ); + + $current_scores_list = $this->current_scores_repository->get_current_scores( $this->score_groups, $score_results, $content_type, $taxonomy, $term_id ); + $score_result_object = new Score_Result( $current_scores_list, $score_results['query_time'], $score_results['cache_used'] ); + + return $score_result_object->to_array(); + } +} diff --git a/src/dashboard/application/score-results/current-scores-repository.php b/src/dashboard/application/score-results/current-scores-repository.php new file mode 100644 index 00000000000..8475023ba42 --- /dev/null +++ b/src/dashboard/application/score-results/current-scores-repository.php @@ -0,0 +1,76 @@ +score_group_link_collector = $score_group_link_collector; + } + + /** + * Returns the current results. + * + * @param Score_Groups_Interface[] $score_groups The score groups. + * @param array $score_results The score results. + * @param Content_Type $content_type The content type. + * @param Taxonomy|null $taxonomy The taxonomy of the term we're filtering for. + * @param int|null $term_id The ID of the term we're filtering for. + * + * @return array>> The current results. + */ + public function get_current_scores( array $score_groups, array $score_results, Content_Type $content_type, ?Taxonomy $taxonomy, ?int $term_id ): Current_Scores_List { + $current_scores_list = new Current_Scores_List(); + + foreach ( $score_groups as $score_group ) { + $score_name = $score_group->get_name(); + $current_score_links = $this->get_current_score_links( $score_group, $content_type, $taxonomy, $term_id ); + + $current_score = new Current_Score( $score_name, (int) $score_results['scores']->$score_name, $current_score_links ); + $current_scores_list->add( $current_score, $score_group->get_position() ); + } + + return $current_scores_list; + } + + /** + * Returns the links for the current scores of a score group. + * + * @param Score_Groups_Interface $score_group The scoure group. + * @param Content_Type $content_type The content type. + * @param Taxonomy|null $taxonomy The taxonomy of the term we're filtering for. + * @param int|null $term_id The ID of the term we're filtering for. + * + * @return array The current score links. + */ + protected function get_current_score_links( Score_Groups_Interface $score_group, Content_Type $content_type, ?Taxonomy $taxonomy, ?int $term_id ): array { + return [ + 'view' => $this->score_group_link_collector->get_view_link( $score_group, $content_type, $taxonomy, $term_id ), + ]; + } +} diff --git a/src/dashboard/application/score-results/readability-score-results/readability-score-results-repository.php b/src/dashboard/application/score-results/readability-score-results/readability-score-results-repository.php new file mode 100644 index 00000000000..7b1d2f586ed --- /dev/null +++ b/src/dashboard/application/score-results/readability-score-results/readability-score-results-repository.php @@ -0,0 +1,28 @@ +score_results_collector = $readability_score_results_collector; + $this->score_groups = $readability_score_groups; + } +} diff --git a/src/dashboard/application/score-results/seo-score-results/seo-score-results-repository.php b/src/dashboard/application/score-results/seo-score-results/seo-score-results-repository.php new file mode 100644 index 00000000000..851c5ab59de --- /dev/null +++ b/src/dashboard/application/score-results/seo-score-results/seo-score-results-repository.php @@ -0,0 +1,28 @@ +score_results_collector = $seo_score_results_collector; + $this->score_groups = $seo_score_groups; + } +} diff --git a/src/dashboard/application/scores/abstract-scores-repository.php b/src/dashboard/application/scores/abstract-scores-repository.php deleted file mode 100644 index fb46e9d80d6..00000000000 --- a/src/dashboard/application/scores/abstract-scores-repository.php +++ /dev/null @@ -1,77 +0,0 @@ -score_link_collector = $score_link_collector; - } - - /** - * Returns the scores of a content type. - * - * @param Content_Type $content_type The content type. - * @param Taxonomy|null $taxonomy The taxonomy of the term we're filtering for. - * @param int|null $term_id The ID of the term we're filtering for. - * - * @return array>> The scores. - */ - public function get_scores( Content_Type $content_type, ?Taxonomy $taxonomy, ?int $term_id ): array { - $scores_list = new Scores_List(); - $current_scores = $this->scores_collector->get_current_scores( $this->scores, $content_type, $term_id ); - - foreach ( $this->scores as $score ) { - $score_name = $score->get_name(); - $score->set_amount( (int) $current_scores->$score_name ); - $score->set_view_link( $this->score_link_collector->get_view_link( $score, $content_type, $taxonomy, $term_id ) ); - - $scores_list->add( $score ); - } - - return $scores_list->to_array(); - } -} diff --git a/src/dashboard/application/scores/readability-scores/readability-scores-repository.php b/src/dashboard/application/scores/readability-scores/readability-scores-repository.php deleted file mode 100644 index cbd51810975..00000000000 --- a/src/dashboard/application/scores/readability-scores/readability-scores-repository.php +++ /dev/null @@ -1,28 +0,0 @@ -scores_collector = $readability_scores_collector; - $this->scores = $readability_scores; - } -} diff --git a/src/dashboard/application/scores/scores-repository-interface.php b/src/dashboard/application/scores/scores-repository-interface.php deleted file mode 100644 index 3dd84acab7c..00000000000 --- a/src/dashboard/application/scores/scores-repository-interface.php +++ /dev/null @@ -1,24 +0,0 @@ ->> The scores. - */ - public function get_scores( Content_Type $content_type, ?Taxonomy $taxonomy, ?int $term_id ): array; -} diff --git a/src/dashboard/application/scores/seo-scores/seo-scores-repository.php b/src/dashboard/application/scores/seo-scores/seo-scores-repository.php deleted file mode 100644 index 7fee6024d7c..00000000000 --- a/src/dashboard/application/scores/seo-scores/seo-scores-repository.php +++ /dev/null @@ -1,28 +0,0 @@ -scores_collector = $seo_scores_collector; - $this->scores = $seo_scores; - } -} diff --git a/src/dashboard/domain/score-groups/abstract-score-group.php b/src/dashboard/domain/score-groups/abstract-score-group.php new file mode 100644 index 00000000000..98e7dddac17 --- /dev/null +++ b/src/dashboard/domain/score-groups/abstract-score-group.php @@ -0,0 +1,51 @@ + + */ + private $links; + + /** + * The constructor. + * + * @param string $name The name of the current score. + * @param int $amount The amount of the current score. + * @param array $links The links of the current score. + */ + public function __construct( string $name, int $amount, ?array $links = null ) { + $this->name = $name; + $this->amount = $amount; + $this->links = $links; + } + + /** + * Gets name of the current score. + * + * @return string The name of the current score. + */ + public function get_name(): string { + return $this->name; + } + + /** + * Gets the amount of the current score. + * + * @return string The amount of the current score. + */ + public function get_amount(): int { + return $this->amount; + } + + /** + * Gets the links of the current score in the expected key value representation. + * + * @return array The links of the current score in the expected key value representation. + */ + public function get_links_to_array(): ?array { + $links = []; + + if ( $this->links === null ) { + return $links; + } + + foreach ( $this->links as $key => $link ) { + if ( $link === null ) { + continue; + } + $links[ $key ] = $link; + } + return $links; + } +} diff --git a/src/dashboard/domain/score-results/current-scores-list.php b/src/dashboard/domain/score-results/current-scores-list.php new file mode 100644 index 00000000000..a4fee60a515 --- /dev/null +++ b/src/dashboard/domain/score-results/current-scores-list.php @@ -0,0 +1,49 @@ +current_scores[ $position ] = $current_score; + } + + /** + * Parses the current score list to the expected key value representation. + * + * @return array>> The score list presented as the expected key value representation. + */ + public function to_array(): array { + $array = []; + + \ksort( $this->current_scores ); + + foreach ( $this->current_scores as $current_score ) { + $array[] = [ + 'name' => $current_score->get_name(), + 'amount' => $current_score->get_amount(), + 'links' => $current_score->get_links_to_array(), + ]; + } + + return $array; + } +} diff --git a/src/dashboard/domain/score-results/score-result.php b/src/dashboard/domain/score-results/score-result.php new file mode 100644 index 00000000000..1a87c6348c7 --- /dev/null +++ b/src/dashboard/domain/score-results/score-result.php @@ -0,0 +1,56 @@ +current_scores_list = $current_scores_list; + $this->query_time = $query_time; + $this->is_cached_used = $is_cached_used; + } + + /** + * Return this object represented by a key value array. + * + * @return array>>|float|bool> Returns the name and if the feature is enabled. + */ + public function to_array(): array { + return [ + 'scores' => $this->current_scores_list->to_array(), + 'queryTime' => $this->query_time, + 'cacheUsed' => $this->is_cached_used, + ]; + } +} diff --git a/src/dashboard/domain/scores/abstract-score.php b/src/dashboard/domain/scores/abstract-score.php deleted file mode 100644 index f30f13ac885..00000000000 --- a/src/dashboard/domain/scores/abstract-score.php +++ /dev/null @@ -1,105 +0,0 @@ -amount; - } - - /** - * Sets the amount of the score. - * - * @param int $amount The amount of the score. - * - * @return void - */ - public function set_amount( int $amount ): void { - $this->amount = $amount; - } - - /** - * Gets the view link of the score. - * - * @return string|null The view link of the score. - */ - public function get_view_link(): ?string { - return $this->view_link; - } - - /** - * Sets the view link of the score. - * - * @param string $view_link The view link of the score. - * - * @return void - */ - public function set_view_link( ?string $view_link ): void { - $this->view_link = $view_link; - } -} diff --git a/src/dashboard/domain/scores/readability-scores/abstract-readability-score.php b/src/dashboard/domain/scores/readability-scores/abstract-readability-score.php deleted file mode 100644 index 133623f9173..00000000000 --- a/src/dashboard/domain/scores/readability-scores/abstract-readability-score.php +++ /dev/null @@ -1,21 +0,0 @@ -scores[] = $score; - } - - /** - * Parses the score list to the expected key value representation. - * - * @return array>> The score list presented as the expected key value representation. - */ - public function to_array(): array { - $array = []; - foreach ( $this->scores as $score ) { - $array[ $score->get_position() ] = [ - 'name' => $score->get_name(), - 'amount' => $score->get_amount(), - 'links' => ( $score->get_view_link() === null ) ? [] : [ 'view' => $score->get_view_link() ], - ]; - } - - \ksort( $array ); - - return $array; - } -} diff --git a/src/dashboard/domain/scores/seo-scores/abstract-seo-score.php b/src/dashboard/domain/scores/seo-scores/abstract-seo-score.php deleted file mode 100644 index 52f5b3f0d0f..00000000000 --- a/src/dashboard/domain/scores/seo-scores/abstract-seo-score.php +++ /dev/null @@ -1,21 +0,0 @@ - 'publish', 'post_type' => $content_type->get_name(), - $score_name->get_filter_key() => $score_name->get_filter_value(), + $score_group->get_filter_key() => $score_group->get_filter_value(), ]; if ( $taxonomy === null || $term_id === null ) { diff --git a/src/dashboard/infrastructure/scores/readability-scores/readability-scores-collector.php b/src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php similarity index 63% rename from src/dashboard/infrastructure/scores/readability-scores/readability-scores-collector.php rename to src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php index 3314d847b44..b950e44cfc5 100644 --- a/src/dashboard/infrastructure/scores/readability-scores/readability-scores-collector.php +++ b/src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php @@ -1,42 +1,47 @@ The current readability scores for a content type. + * @return array The readability score results for a content type. */ - public function get_current_scores( array $readability_scores, Content_Type $content_type, ?int $term_id ) { + public function get_score_results( array $readability_score_groups, Content_Type $content_type, ?int $term_id ) { global $wpdb; + $results = []; $content_type_name = $content_type->get_name(); $transient_name = self::READABILITY_SCORES_TRANSIENT . '_' . $content_type_name . ( ( $term_id === null ) ? '' : '_' . $term_id ); $transient = \get_transient( $transient_name ); if ( $transient !== false ) { - return \json_decode( $transient, false ); + $results['scores'] = \json_decode( $transient, false ); + $results['cache_used'] = true; + $results['query_time'] = 0; + + return $results; } - $select = $this->build_select( $readability_scores ); + $select = $this->build_select( $readability_score_groups ); $replacements = \array_merge( \array_values( $select['replacements'] ), @@ -47,6 +52,7 @@ public function get_current_scores( array $readability_scores, Content_Type $con ); if ( $term_id === null ) { + $start_time = \microtime( true ); //phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $select['fields'] is an array of simple strings with placeholders. //phpcs:disable WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- $replacements is an array with the correct replacements. //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way. @@ -63,14 +69,21 @@ public function get_current_scores( array $readability_scores, Content_Type $con ) ); //phpcs:enable + $end_time = \microtime( true ); + \set_transient( $transient_name, WPSEO_Utils::format_json_encode( $current_scores ), \MINUTE_IN_SECONDS ); - return $current_scores; + + $results['scores'] = $current_scores; + $results['cache_used'] = false; + $results['query_time'] = ( $end_time - $start_time ); + return $results; } $replacements[] = $wpdb->term_relationships; $replacements[] = $term_id; + $start_time = \microtime( true ); //phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $select['fields'] is an array of simple strings with placeholders. //phpcs:disable WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- $replacements is an array with the correct replacements. //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way. @@ -92,25 +105,31 @@ public function get_current_scores( array $readability_scores, Content_Type $con ) ); //phpcs:enable + $end_time = \microtime( true ); + \set_transient( $transient_name, WPSEO_Utils::format_json_encode( $current_scores ), \MINUTE_IN_SECONDS ); - return $current_scores; + + $results['scores'] = $current_scores; + $results['cache_used'] = false; + $results['query_time'] = ( $end_time - $start_time ); + return $results; } /** * Builds the select statement for the readability scores query. * - * @param Readability_Scores_Interface[] $readability_scores All readability scores. + * @param Readability_Score_Groups_Interface[] $readability_score_groups All readability score groups. * * @return array The select statement for the readability scores query. */ - private function build_select( array $readability_scores ): array { + private function build_select( array $readability_score_groups ): array { $select_fields = []; $select_replacements = []; - foreach ( $readability_scores as $readability_score ) { - $min = $readability_score->get_min_score(); - $max = $readability_score->get_max_score(); - $name = $readability_score->get_name(); + foreach ( $readability_score_groups as $readability_score_group ) { + $min = $readability_score_group->get_min_score(); + $max = $readability_score_group->get_max_score(); + $name = $readability_score_group->get_name(); if ( $min === null || $max === null ) { $select_fields[] = 'COUNT(CASE WHEN I.readability_score = 0 AND I.estimated_reading_time_minutes IS NULL THEN 1 END) AS %i'; diff --git a/src/dashboard/infrastructure/score-results/score-results-collector-interface.php b/src/dashboard/infrastructure/score-results/score-results-collector-interface.php new file mode 100644 index 00000000000..8ac594168fc --- /dev/null +++ b/src/dashboard/infrastructure/score-results/score-results-collector-interface.php @@ -0,0 +1,24 @@ + The score results for a content type. + */ + public function get_score_results( array $score_groups, Content_Type $content_type, ?int $term_id ); +} diff --git a/src/dashboard/infrastructure/scores/seo-scores/seo-scores-collector.php b/src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php similarity index 65% rename from src/dashboard/infrastructure/scores/seo-scores/seo-scores-collector.php rename to src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php index b6920bc3a56..34411e44d10 100644 --- a/src/dashboard/infrastructure/scores/seo-scores/seo-scores-collector.php +++ b/src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php @@ -1,42 +1,47 @@ The current SEO scores for a content type. + * @return array The SEO score results for a content type. */ - public function get_current_scores( array $seo_scores, Content_Type $content_type, ?int $term_id ) { + public function get_score_results( array $seo_score_groups, Content_Type $content_type, ?int $term_id ) { global $wpdb; + $results = []; $content_type_name = $content_type->get_name(); $transient_name = self::SEO_SCORES_TRANSIENT . '_' . $content_type_name . ( ( $term_id === null ) ? '' : '_' . $term_id ); $transient = \get_transient( $transient_name ); if ( $transient !== false ) { - return \json_decode( $transient, false ); + $results['scores'] = \json_decode( $transient, false ); + $results['cache_used'] = true; + $results['query_time'] = 0; + + return $results; } - $select = $this->build_select( $seo_scores ); + $select = $this->build_select( $seo_score_groups ); $replacements = \array_merge( \array_values( $select['replacements'] ), @@ -47,6 +52,7 @@ public function get_current_scores( array $seo_scores, Content_Type $content_typ ); if ( $term_id === null ) { + $start_time = \microtime( true ); //phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $select['fields'] is an array of simple strings with placeholders. //phpcs:disable WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- $replacements is an array with the correct replacements. //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way. @@ -64,14 +70,21 @@ public function get_current_scores( array $seo_scores, Content_Type $content_typ ) ); //phpcs:enable + $end_time = \microtime( true ); + \set_transient( $transient_name, WPSEO_Utils::format_json_encode( $current_scores ), \MINUTE_IN_SECONDS ); - return $current_scores; + + $results['scores'] = $current_scores; + $results['cache_used'] = false; + $results['query_time'] = ( $end_time - $start_time ); + return $results; } $replacements[] = $wpdb->term_relationships; $replacements[] = $term_id; + $start_time = \microtime( true ); //phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $select['fields'] is an array of simple strings with placeholders. //phpcs:disable WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- $replacements is an array with the correct replacements. //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way. @@ -94,25 +107,31 @@ public function get_current_scores( array $seo_scores, Content_Type $content_typ ) ); //phpcs:enable + $end_time = \microtime( true ); + \set_transient( $transient_name, WPSEO_Utils::format_json_encode( $current_scores ), \MINUTE_IN_SECONDS ); - return $current_scores; + + $results['scores'] = $current_scores; + $results['cache_used'] = false; + $results['query_time'] = ( $end_time - $start_time ); + return $results; } /** * Builds the select statement for the SEO scores query. * - * @param SEO_Scores_Interface[] $seo_scores All SEO scores. + * @param SEO_Score_Groups_Interface[] $seo_score_groups All SEO score groups. * * @return array The select statement for the SEO scores query. */ - private function build_select( array $seo_scores ): array { + private function build_select( array $seo_score_groups ): array { $select_fields = []; $select_replacements = []; - foreach ( $seo_scores as $seo_score ) { - $min = $seo_score->get_min_score(); - $max = $seo_score->get_max_score(); - $name = $seo_score->get_name(); + foreach ( $seo_score_groups as $seo_score_group ) { + $min = $seo_score_group->get_min_score(); + $max = $seo_score_group->get_max_score(); + $name = $seo_score_group->get_name(); if ( $min === null || $max === null ) { $select_fields[] = 'COUNT(CASE WHEN I.primary_focus_keyword_score IS NULL THEN 1 END) AS %i'; diff --git a/src/dashboard/infrastructure/scores/scores-collector-interface.php b/src/dashboard/infrastructure/scores/scores-collector-interface.php deleted file mode 100644 index 06d398e84a7..00000000000 --- a/src/dashboard/infrastructure/scores/scores-collector-interface.php +++ /dev/null @@ -1,24 +0,0 @@ - The current scores for a content type. - */ - public function get_current_scores( array $scores, Content_Type $content_type, ?int $term_id ); -} diff --git a/src/dashboard/user-interface/scores/abstract-scores-route.php b/src/dashboard/user-interface/scores/abstract-scores-route.php index ee57c273c12..e711003bc93 100644 --- a/src/dashboard/user-interface/scores/abstract-scores-route.php +++ b/src/dashboard/user-interface/scores/abstract-scores-route.php @@ -7,7 +7,7 @@ use WP_REST_Response; use WPSEO_Capability_Utils; use Yoast\WP\SEO\Conditionals\No_Conditionals; -use Yoast\WP\SEO\Dashboard\Application\Scores\Scores_Repository_Interface; +use Yoast\WP\SEO\Dashboard\Application\Score_Results\Abstract_Score_Results_Repository; use Yoast\WP\SEO\Dashboard\Application\Taxonomies\Taxonomies_Repository; use Yoast\WP\SEO\Dashboard\Domain\Content_Types\Content_Type; use Yoast\WP\SEO\Dashboard\Domain\Taxonomies\Taxonomy; @@ -61,9 +61,9 @@ abstract class Abstract_Scores_Route implements Route_Interface { /** * The scores repository. * - * @var Scores_Repository_Interface + * @var Abstract_Score_Results_Repository */ - protected $scores_repository; + protected $score_results_repository; /** * Sets the collectors. @@ -178,7 +178,7 @@ public function get_scores( WP_REST_Request $request ) { } return new WP_REST_Response( - $this->scores_repository->get_scores( $content_type, $taxonomy, $term_id ), + $this->score_results_repository->get_score_results( $content_type, $taxonomy, $term_id ), 200 ); } diff --git a/src/dashboard/user-interface/scores/readability-scores-route.php b/src/dashboard/user-interface/scores/readability-scores-route.php index 680d03b265e..7fb174500d8 100644 --- a/src/dashboard/user-interface/scores/readability-scores-route.php +++ b/src/dashboard/user-interface/scores/readability-scores-route.php @@ -2,7 +2,7 @@ // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. namespace Yoast\WP\SEO\Dashboard\User_Interface\Scores; -use Yoast\WP\SEO\Dashboard\Application\Scores\Readability_Scores\Readability_Scores_Repository; +use Yoast\WP\SEO\Dashboard\Application\Score_Results\Readability_Score_Results\Readability_Score_Results_Repository; /** * Registers a route to get readability scores. @@ -19,11 +19,11 @@ class Readability_Scores_Route extends Abstract_Scores_Route { /** * Constructs the class. * - * @param Readability_Scores_Repository $readability_scores_repository The readability scores repository. + * @param Readability_Score_Results_Repository $readability_score_results_repository The readability score results repository. */ public function __construct( - Readability_Scores_Repository $readability_scores_repository + Readability_Score_Results_Repository $readability_score_results_repository ) { - $this->scores_repository = $readability_scores_repository; + $this->score_results_repository = $readability_score_results_repository; } } diff --git a/src/dashboard/user-interface/scores/seo-scores-route.php b/src/dashboard/user-interface/scores/seo-scores-route.php index 8fd7c79647d..75d41e0cbac 100644 --- a/src/dashboard/user-interface/scores/seo-scores-route.php +++ b/src/dashboard/user-interface/scores/seo-scores-route.php @@ -2,7 +2,7 @@ // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. namespace Yoast\WP\SEO\Dashboard\User_Interface\Scores; -use Yoast\WP\SEO\Dashboard\Application\Scores\SEO_Scores\SEO_Scores_Repository; +use Yoast\WP\SEO\Dashboard\Application\Score_Results\SEO_Score_Results\SEO_Score_Results_Repository; /** * Registers a route to get SEO scores. @@ -19,11 +19,11 @@ class SEO_Scores_Route extends Abstract_Scores_Route { /** * Constructs the class. * - * @param SEO_Scores_Repository $seo_scores_repository The SEO scores repository. + * @param SEO_Score_Results_Repository $seo_score_results_repository The SEO score results repository. */ public function __construct( - SEO_Scores_Repository $seo_scores_repository + SEO_Score_Results_Repository $seo_score_results_repository ) { - $this->scores_repository = $seo_scores_repository; + $this->score_results_repository = $seo_score_results_repository; } }