-
Couldn't load subscription status.
- Fork 837
Atomic: Display correct site visibility in wp-admin settings #45510
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
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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! |
Code Coverage SummaryCoverage changed in 1 file.
|
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.
Pull Request Overview
Displays correct site visibility in wp-admin for Atomic sites by reflecting the privacy model instead of relying solely on the blog_public option.
- Build data as an array, conditionally override blogPublic based on Private_Site\site_is_private for launched sites, then JSON-encode for the inline script.
- Add changelog entry documenting the behavior change.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/packages/jetpack-mu-wpcom/src/features/replace-site-visibility/replace-site-visibility.php | Compute and inline JSON config after conditionally overriding blogPublic using the privacy model. |
| projects/packages/jetpack-mu-wpcom/changelog/update-woa-actual-site-visibility | Document the change in site visibility handling for Atomic sites. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...s/packages/jetpack-mu-wpcom/src/features/replace-site-visibility/replace-site-visibility.php
Outdated
Show resolved
Hide resolved
...s/packages/jetpack-mu-wpcom/src/features/replace-site-visibility/replace-site-visibility.php
Outdated
Show resolved
Hide resolved
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.
LGTM 👍
Many thanks for working on this, Sergey! I followed the test instructions and it tests well though I did find it confusing that the site is Public after wp option update blog_public -1.
That said, possibly out of context for this PR, but I noticed that even though the site is now "public" the sitePreviewLink returns a 401:

|
Thanks @fgiannar, I'll look into that in a separate PR. |
Proposed changes:
blog_publicoption value.JETPACK_MU_WPCOM_SITE_VISIBILITYdata.Other information:
Jetpack product discussion
https://linear.app/a8c/issue/CONNECT-47
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Site visibility discrepancy
/wp-admin/options-reading.phpand make it "private". Confirm the checkbox "Private" stays marked after page refresh.wp option update blog_public 1. Refresh the page, confirm the "Site visibility" now has the "Public" active.wp option update blog_public -1.Missing site title
/wp-admin/options-reading.phpJETPACK_MU_WPCOM_SITE_VISIBILITY.siteTitle. Confirm it contains the site title.