Update/connection banner multisite url redirection#43594
Conversation
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
|
Definitely not familiar with the codebase, but I think this started being an issue with #39865, which didn't consider multisites when replacing only I opted for a regex in the same ConnectBanner to avoid other issues, but another option would be to be more defensive down the road here and check for multisites and replace the site_url. I think it's not the best option. |
coder-karen
left a comment
There was a problem hiding this comment.
Nice!!
This works well, thank you.
|
I wondered how the logic change would affect non-multisite sites using WordPress in its own directory. I tested using both methods listed on that page. I didn't run into any complications with method 1 (without URL change). However, I ran into something odd when testing with method 2 (with URL change). When testing without WordPress in its own directory and when using method 1, I got the following prompt when following the "Connect Jetpack" button on the Blogroll block as the non-connected user: However, when testing with WordPress in its own directory using method 2, I got something different: Notice that "Connected as" changes to "Connecting as" and "Return to your site" changes to "Approve". I tested this repeatedly, sometimes creating new connections before starting the tests and sometimes reusing the existing connection. I always got this result despite getting to the prompt using a different user as per the instructions. This means that I can't actually test this fix properly for such sites as somehow the connection flow is not properly identifying that the requesting user is different than the user logged in to wp.com. Given this complication, I can't properly give a review to this PR. |
|
Thanks for reviewing @chrisbliss18
Is this different from what happens in trunk? What happens when you |
|
@darssen The same thing happens in both this branch and in trunk. Sorry for not clarifying before. So, this is a preexisting issue. That being the case, I don't want to hold up this fix, but I do want to make sure that we 1) create a new issue for the problem that I found, and 2) ensure that we retest for this issue once we fix the issue that I identified. |
Since it is a separate issue, I went ahead and merged this one. @chrisbliss18 Would it be possible for you to create the issue with the steps to test on non-multisite sites using WordPress in its own directory for method 2? |
* Debugging commit for testing inside multisite JN * Debugging commit for testing inside multisite JN * Changelog * Remove debugging * Use regex to replace all before wp-admin due to multisites not working as expected * changelog * Remove changelog since change is in jetpack and not in the connection package


Fixes VULCAN-101
Proposed changes:
ConnectBannerThe replace code was introduced in Add/skip pricing page when connecting from editor blocks #39865 but didn't consider multisites.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Same as #39865
And also #43340