Skip to content
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

My Sites: Fix Jetpack sites' listing on the "My Home" (/home) page #57952

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

ivan-ottinger
Copy link
Contributor

Sites displayed on the "My Home" page (/home) are filtered based on the following rule:

// Supported on Simple and Atomic Sites
if ( /^\/home/.test( path ) ) {
return ! site.is_vip && ! ( site.jetpack && ! site.options.is_automated_transfer );
}

It looks like the rule was originally added to filter out VIP sites only, but it is filtering out all Jetpack-connected sites as well (issue reported in #57295).

To add more specificity, the condition ! site.is_vip && ! ( site.jetpack && ! site.options.is_automated_transfer ) returns false for every Jetpack-connected site. This results in each Jetpack-connected site to be left out from the sites array that is then rendered in the Site Selector component:

if ( this.props.filter ) {
sites = sites.filter( this.props.filter );
}

Changes proposed in this Pull Request

  • Remove part of the condition (! ( site.jetpack && ! site.options.is_automated_transfer )) to make sure only VIP sites are filtered out.

Hey @gwwar and @kwight 👋🏼 I am tagging you here in case there's something I might have missed in relation to VIP sites (as the filter was originally added in #39090). I don't think the change would have any effect on VIP sites, just wanted to double-check with you.

Screenshots

Before:
Markup on 2021-11-11 at 11:16:07

After:
Markup on 2021-11-11 at 11:17:41

Testing instructions

It shouldn't be possible to reproduce #57295.

In steps:

  1. Create a WPORG site. You can use https://jurassic.ninja/
  2. Connect it to your WordPress.com account.
  3. The Jetpack-connected site should show up in the list under "My Sites" https://wordpress.com/home - in the same way as it is showing up on other similar pages, e.g. https://wordpress.com/media and https://wordpress.com/settings/general

Related to #57295

Sites displayed on the "My Home" page (`/home`) are filtered based on certain rules.

This commit removes filter condition that prevents Jetpack-connected sites from loading.
@github-actions
Copy link

@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~34 bytes removed 📉 [gzipped])

name                      parsed_size           gzip_size
woocommerce-installation        -47 B  (-0.0%)      -11 B  (-0.0%)
woocommerce                     -47 B  (-0.0%)      -11 B  (-0.0%)
themes                          -47 B  (-0.0%)      -11 B  (-0.0%)
theme                           -47 B  (-0.0%)      -11 B  (-0.0%)
stats                           -47 B  (-0.0%)      -11 B  (-0.0%)
sites                           -47 B  (-0.0%)      -11 B  (-0.0%)
site-purchases                  -47 B  (-0.0%)      -12 B  (-0.0%)
settings-writing                -47 B  (-0.0%)      -11 B  (-0.0%)
settings-security               -47 B  (-0.0%)      -11 B  (-0.0%)
settings-performance            -47 B  (-0.0%)      -11 B  (-0.0%)
settings-jetpack                -47 B  (-0.0%)      -11 B  (-0.0%)
settings-discussion             -47 B  (-0.0%)      -11 B  (-0.0%)
settings                        -47 B  (-0.0%)      -11 B  (-0.0%)
scan                            -47 B  (-0.0%)      -11 B  (-0.0%)
purchases                       -47 B  (-0.0%)      -12 B  (-0.0%)
preview                         -47 B  (-0.0%)      -11 B  (-0.0%)
posts-custom                    -47 B  (-0.0%)      -11 B  (-0.0%)
posts                           -47 B  (-0.0%)      -11 B  (-0.0%)
plugins                         -47 B  (-0.0%)      -11 B  (-0.0%)
plans                           -47 B  (-0.0%)      -11 B  (-0.0%)
people                          -47 B  (-0.0%)      -11 B  (-0.0%)
pages                           -47 B  (-0.0%)      -11 B  (-0.0%)
migrate                         -47 B  (-0.0%)      -11 B  (-0.0%)
media                           -47 B  (-0.0%)      -11 B  (-0.0%)
marketplace                     -47 B  (-0.0%)      -11 B  (-0.0%)
marketing                       -47 B  (-0.0%)      -11 B  (-0.0%)
jetpack-search                  -47 B  (-0.0%)      -11 B  (-0.0%)
jetpack-connect                 -47 B  (-0.0%)      -11 B  (-0.0%)
jetpack-cloud-settings          -47 B  (-0.0%)      -11 B  (-0.0%)
jetpack-cloud-pricing           -47 B  (-0.0%)      -11 B  (-0.0%)
jetpack-cloud                   -47 B  (-0.0%)      -11 B  (-0.0%)
import                          -47 B  (-0.0%)      -11 B  (-0.0%)
hosting                         -47 B  (-0.0%)      -11 B  (-0.0%)
home                            -47 B  (-0.0%)      -11 B  (-0.0%)
gutenberg-editor                -47 B  (-0.0%)      -11 B  (-0.0%)
google-my-business              -47 B  (-0.0%)      -11 B  (-0.0%)
export                          -47 B  (-0.0%)      -11 B  (-0.0%)
email                           -47 B  (-0.0%)      -11 B  (-0.0%)
earn                            -47 B  (-0.0%)      -11 B  (-0.0%)
domains                         -47 B  (-0.0%)      -12 B  (-0.0%)
customize                       -47 B  (-0.0%)      -11 B  (-0.0%)
concierge                       -47 B  (-0.0%)      -11 B  (-0.0%)
comments                        -47 B  (-0.0%)      -11 B  (-0.0%)
checkout                        -47 B  (-0.0%)      -12 B  (-0.0%)
backup                          -47 B  (-0.0%)      -11 B  (-0.0%)
activity                        -47 B  (-0.0%)      -11 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 11, 2021
Copy link
Contributor

@arcangelini arcangelini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for me, I am glad you tagged someone familiar with VIP. I would want to make sure this doesn't adversely affect any VIP sites? 🤷‍♂️

@simison
Copy link
Member

simison commented Nov 22, 2021

How does this affect https://cloud.jetpack.com/ ? (It also runs on Calypso)

@ivan-ottinger
Copy link
Contributor Author

How does this affect https://cloud.jetpack.com/ ? (It also runs on Calypso)

Thanks for your comment Mikael. The code change shouldn't affect https://cloud.jetpack.com/ as /home is not available there: https://cloud.jetpack.com/home and the site filter touched in this PR only applies to that one specific /home path.

Copy link
Member

@alshakero alshakero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested. LGTM.

@ivan-ottinger
Copy link
Contributor Author

Thank you so much for your feedback folks! 🙇🏼 I will deploy the change tomorrow morning since I am at the end of the day for today.

@ivan-ottinger ivan-ottinger merged commit a837da9 into trunk Nov 23, 2021
@ivan-ottinger ivan-ottinger deleted the fix/jetpack-site-listing branch November 23, 2021 08:27
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 23, 2021
@ivan-ottinger
Copy link
Contributor Author

Successfully merged and deployed to production.

nelsonec87 pushed a commit that referenced this pull request Dec 9, 2021
Sites displayed on the "My Home" page (`/home`) are filtered based on certain rules.

This PR removes filter condition that prevents Jetpack-connected sites from loading on the `/home` page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jetpack linked sites are not showing up in some views on Calypso dashboard
5 participants