Skip to content

Conversation

@sergeymitr
Copy link
Contributor

@sergeymitr sergeymitr commented Oct 15, 2025

Proposed changes:

  • Atomic sites: Display site visibility in wp-admin settings based on the privacy model instead of the blog_public option value.
  • Fix a bug with improper fetching of site title for the JETPACK_MU_WPCOM_SITE_VISIBILITY data.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

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

  1. First, let's reproduce the problem (don't checkout the PR).
  2. Create a WoA dev blog (p9o2xV-1r2-p2), install Jetpack Beta.
  3. Launch the site, then go to /wp-admin/options-reading.php and make it "private". Confirm the checkbox "Private" stays marked after page refresh.
  4. Use CLI to update the option value: wp option update blog_public 1. Refresh the page, confirm the "Site visibility" now has the "Public" active.
  5. Try to load the site in a browser's private window, confirm it says "you need to be logged in", meaning the site actually is private.
  6. Now let's try the fix. Use Jetpack Beta to switch "WordPress.com Site Helper" to this branch.
  7. Refresh the "Reading Settings" page, confirm it now has the "Private" visibility active.
  8. Change the setting to "Public" and save. Then use CLI to change the option: wp option update blog_public -1.
  9. Refresh the "Reading Settings", confirm it shows "Public" nonetheless.
  10. Load the site in a private window, confirm it now loads just fine.

Missing site title

  1. Go to /wp-admin/options-reading.php
  2. Use browser console to check the value of the JS variable: JETPACK_MU_WPCOM_SITE_VISIBILITY.siteTitle. Confirm it contains the site title.

@sergeymitr sergeymitr self-assigned this Oct 15, 2025
@sergeymitr sergeymitr added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] In Progress [Platform] Atomic labels Oct 15, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (WordPress.com Site Helper), and enable the update/woa-actual-site-visibility branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/woa-actual-site-visibility

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@jp-launch-control
Copy link

jp-launch-control bot commented Oct 15, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/replace-site-visibility/replace-site-visibility.php 0/128 (0.00%) 0.00% 2 ❤️‍🩹

Full summary · PHP report

@sergeymitr sergeymitr requested a review from Copilot October 15, 2025 20:48
@sergeymitr sergeymitr added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Oct 15, 2025
@sergeymitr sergeymitr requested a review from a team October 15, 2025 20:49
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

@fgiannar fgiannar left a 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:
Screenshot 2025-10-17 at 13 24 28

@sergeymitr
Copy link
Contributor Author

Thanks @fgiannar, I'll look into that in a separate PR.

@sergeymitr sergeymitr merged commit 6d9e34e into trunk Oct 17, 2025
68 checks passed
@sergeymitr sergeymitr deleted the update/woa-actual-site-visibility branch October 17, 2025 18:31
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[mu wpcom Feature] Replace Site Visibility [Package] Jetpack mu wpcom WordPress.com Features [Platform] Atomic [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants