Conversation
…ve-site_kitcan_read_data-so-that-it-uses-site-kit-as-an-sdk
leonidasmi
left a comment
There was a problem hiding this comment.
CR: 🏗️
I actually didn't finish my CR, but we decided with @thijsoo to pause it for now, so that he adds some more stuff that fix additional parts of our integration which is nice!
|
|
||
| $site_kit_setup_url = \self_admin_url( 'admin.php?page=googlesitekit-splash' ); | ||
|
|
||
| $preload_paths = \apply_filters( 'googlesitekit_apifetch_preload_paths', [] ); |
There was a problem hiding this comment.
Let's move the below in a separate function(s), this is too much cognitive load for a single function.
We can opt into create private properties for the $ga_module and $search_console_module variables, if that was the problem.
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
…ve-site_kitcan_read_data-so-that-it-uses-site-kit-as-an-sdk # Conflicts: # src/dashboard/infrastructure/integrations/site-kit.php # tests/Unit/Dashboard/Infrastructure/Integrations/Site_Kit_To_Array_Test.php
leonidasmi
left a comment
There was a problem hiding this comment.
CR: 🚧
Aside from the points in the code, I have a last reservation:
- On instances where Site Kit is not active/installed (which will be the most usual case), on dashboard page load, we do multiple calls to the Site Kit REST endpoints that will inevitably fail (albeit gracefully).
- We should make our flow likeso that we return early and not perform the REST calls at all.
- Maybe build a default value for all script data that are dependant on Site Kit being active and resort to that when Site Kit is not active
| if ( $module['slug'] === 'analytics-4' ) { | ||
| $this->ga_module['owner'] = $module['owner']; | ||
| $this->ga_module['connected'] = $module['connected']; | ||
| if ( isset( $modules_permissions['googlesitekit_read_shared_module_data::["analytics-4"]'] ) ) { | ||
| $this->ga_module['permissions'] = $is_authenticated || $modules_permissions['googlesitekit_read_shared_module_data::["analytics-4"]']; | ||
| } | ||
| } | ||
| if ( $module['slug'] === 'search-console' ) { | ||
| $this->search_console_module['owner'] = $module['owner']; | ||
| if ( isset( $modules_permissions['googlesitekit_read_shared_module_data::["search-console"]'] ) ) { | ||
| $this->search_console_module['permissions'] = $is_authenticated || $modules_permissions['googlesitekit_read_shared_module_data::["search-console"]']; |
There was a problem hiding this comment.
There's a lot of code duplication here begging for some abstraction, but I'm not sure if it's worth it, what do you think @thijsoo?
Maybe we can bypass the fact that 'connected' is only a thing in GA and go ahead with some?
…ve-site_kitcan_read_data-so-that-it-uses-site-kit-as-an-sdk
Pull Request Test Coverage Report for Build 090a767182f28908a7fe209412e2f713a4c1cabbDetails
💛 - Coveralls |
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
|
Code Review: ✅ As per test instructions, I tried to regression test #22091, but it looks like our new approach doesn't work for SEO managers as is, so half of those test steps fail. The reason is that SEO managers don't have sufficient permissions to do the REST requests so the script data. Let's have a discussion (also with product) to see if we want to give those permissions to SEO managers, or figure out a different solution. The impact of giving those permissions is not negligible, so we'll need to have that discussion. As for the other parts of the test instructions, I didn't test them because I expect our next steps to fix the above will make us have to test the whole PR again anyway. |
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
…ve-site_kitcan_read_data-so-that-it-uses-site-kit-as-an-sdk # Conflicts: # src/dashboard/infrastructure/integrations/site-kit.php # tests/Unit/Dashboard/Infrastructure/Integrations/Site_Kit_To_Array_Test.php
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
bad7474 to
9f8ded5
Compare
9f8ded5 to
6e8c36c
Compare
…ve-site_kitcan_read_data-so-that-it-uses-site-kit-as-an-sdk # Conflicts: # src/dashboard/infrastructure/integrations/site-kit.php # tests/Unit/Dashboard/Infrastructure/Integrations/Site_Kit_To_Array_Test.php
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:
For checking #22157 (multiple admins):
You don't have permissionerrorFor checking #22154 (no fatal errors in that sub-case):
For checking SEO Manager capabilities:
Yoast SEO->GeneralRelevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
wpseoScriptData.dashboard.siteKitConfigurationin the console and it should be the same with this PR and without. Check multiple cases:UI changes
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes https://github.com/Yoast/reserved-tasks/issues/492