-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
537 refactor microcaching the api endpoints into using cache decorators #21879
537 refactor microcaching the api endpoints into using cache decorators #21879
Conversation
Pull Request Test Coverage Report for Build 9c7ab956e19bbe25f9d4a0b686fe9c3e9e761ad9Details
💛 - Coveralls |
…tor-microcaching-the-api-endpoints-into-using-cache-decorators # Conflicts: # src/dashboard/infrastructure/score-results/readability-score-results/readability-score-results-collector.php # src/dashboard/infrastructure/score-results/seo-score-results/seo-score-results-collector.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: 🏗️
Some remarks, mostly about making the decorated classes cache-agnostic
|
||
return $results; | ||
} | ||
$results = $this->readability_score_results_collector->get_score_results( $score_groups, $content_type, $term_id, $is_troubleshooting ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like an empty line above, but that's maybe just me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the other cached collector
if ( $is_troubleshooting !== true ) { | ||
\set_transient( $transient_name, WPSEO_Utils::format_json_encode( $current_scores ), \MINUTE_IN_SECONDS ); | ||
} | ||
|
||
$results['scores'] = $current_scores; | ||
$results['cache_used'] = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the collector should be agnostic of anything cache related, so I think it's the cached collectors' responsibility to set $results['cache_used'] = false;
?bool $is_troubleshooting | ||
) { | ||
$content_type_name = $content_type->get_name(); | ||
$transient_name = Readability_Score_Results_Collector::READABILITY_SCORES_TRANSIENT . '_' . $content_type_name . ( ( $term_id === null ) ? '' : '_' . $term_id ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The READABILITY_SCORES_TRANSIENT
constant should be set in this class, instead of the cache-agnostic collector, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR + Acceptance is ✅
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo]
, added test instructions for Shopify and attached theShopify
label to this PR.Documentation
Quality assurance
Innovation
innovation
label.Fixes #