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

Add/segmentation to jetpack products my jetpack #38283

Merged
merged 16 commits into from
Jul 16, 2024

Conversation

CodeyGuyDylan
Copy link
Contributor

@CodeyGuyDylan CodeyGuyDylan commented Jul 10, 2024

Proposed changes:

  1. Split products up on the My Jetpack page between owned and unowned
    Note that this will be different from products that have an "active" versus "inactive" status. A user may be considered as "having" or "owning" a product if any of the following are true:
  • They have a standalone plugin for that product (the product may still need a plan)
  • They have a plan for a product (even if the plugin is missing)
  • They had a product that was working before but is not working anymore now due to a connection error (part of the work that is happening with the user connection delay project: https://github.com/Automattic/jetpack-roadmap/issues/1210)
  1. Sort products in the "owned section" by active -> warning -> inactive since all 3 statuses can exist in an "owned" state

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

P2: p1HpG7-sMW-p2

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  1. Create a JN site with Jetpack Beta installed but no branches selected or plugins installed
  2. Try installing a standalone plugin to start and go to My Jetpack. Make sure to check out this branch in Jetpack beta for that plugin
  3. You will likely see Akismet in your owned products since that mostly goes off API key and whether your user account has a plan. Make sure they match the design comps (g1ZLnS65PzfOL9cmByykvf-fi-4412_2) and that you only see the plugin you installed and Akismet in the "My Products" section (or possibly only VideoPress)
    image
  4. Now install the main Jetpack plugin (again with this branch checked out)
  5. Nothing should change in My Jetpack just yet
    image
  6. Now connect your site to Jetpack (no user connection)
  7. You should see Stats and Creator now in the Owned products section
    image
  8. Now connect your user account, it should look roughly the same
    image
  9. Now add a plan to your site from SA that is not currently "owned" on your site. When you go back to My Jetpack, that product should be shown in the "owned" section now
    image
  10. Install but don't activate a Jetpack plugin that is not currently owned by your site
  11. The owned section should now have the new plugin as "inactive" at the end of the list of plugins
    image
  12. Throughout this process, make sure that the products in the "active" section are in the order of active -> warning (connection or plugin missing) -> inactive
  13. Now disconnect your site
  14. The "owned" section should have the same products as before with one exception
  • If it was "owned" solely because you had a plan. With a disconnected site, My Jetpack won't be able to tell you have a plan and the plugin was not active so it's not tracked in "historically_active_modules"
    image
  1. Try and combination of plugins and active/inactive/connection-issue, whatever you can think of to make sure this section always looks correct.
Copy link
Contributor

github-actions bot commented Jul 10, 2024

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 WordPress.com Simple 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, and enable the add/segmentation-to-jetpack-products-my-jetpack branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack add/segmentation-to-jetpack-products-my-jetpack
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/segmentation-to-jetpack-products-my-jetpack
    

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
Copy link
Contributor

github-actions bot commented Jul 10, 2024

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 Team Review, ...).
  • ✅ 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 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for August 6, 2024 (scheduled code freeze on August 5, 2024).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Starter Plugin plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Migration plugin:

  • Next scheduled release: August 6, 2024.
  • Scheduled code freeze: July 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jul 10, 2024
@github-actions github-actions bot added [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. labels Jul 10, 2024
Copy link
Contributor

@robertsreberski robertsreberski left a comment

Choose a reason for hiding this comment

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

The code looks good! Very nice implementation. I just left two remarks below.

The design could use a bit tinkering, at least on my screen:
CleanShot 2024-07-11 at 17 13 29@2x

The spacing is off, and the color of "Discover more" background should be white (not beige as currently). Here is the design for the reference:
CleanShot 2024-07-11 at 17 15 26@2x


return (
<Col tagName="li" sm={ 4 } md={ 4 } lg={ 4 } key={ product }>
<Item admin={ !! userIsAdmin } />
Copy link
Contributor

Choose a reason for hiding this comment

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

Is double-negation necessary here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

userIsAdmin is a string that is either "1" or "0" so I think we should keep it to be safe

Copy link
Contributor

Choose a reason for hiding this comment

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

How about not doing implicit casting here and just check userIsAdmin === '1'? I think typescript would complain about that one if it knew about userIsAdmin type 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

userIsAdmin is a string that is either "1" or "0" so I think we should keep it to be safe

Quick heads up that in JavaScript, only empty strings are falsy, so both strings "0" and "1" are considered valid truthy values.

@CodeyGuyDylan
Copy link
Contributor Author

The design could use a bit tinkering, at least on my screen

I went ahead and made it so the background was white everywhere except the My Products section and that fixed the spacing issues in turn. Just took some markup rework 😄

Copy link
Contributor

@robertsreberski robertsreberski left a comment

Choose a reason for hiding this comment

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

Thanks for working on the changes @CodeyGuyDylan ! It looks great. I'm happy you managed to work around the change of background.

One last thing, it seems like some
is added here, and it impacts the spacing of the sections:
CleanShot 2024-07-12 at 11 47 10@2x

Besides that, it's a 🟢

@ilonagl
Copy link

ilonagl commented Jul 12, 2024

Thank you for this amazing work and the ping, @CodeyGuyDylan! It looks great.

Everything works as expected. Here are my thoughts:

  1. The spacing between the logo and the welcome banner section looks off. I added a design proposal in the following comment.
  2. Q: Could you tell me why the Creator is among the active products?
  3. AI got activated and included in ‘Active products’ once I connected my user account. I guess this is expected behavior because it comes by default with Jetpack. So, Stats appeared as active first because they don't need the user account connection, right?
  4. It would be good to add an explanation that plugin is installed, but not activated. The current 'inactive' state can be a bit confusing. I'll attach designs below.
  • 🚩VideoPress example: users can activate it from the plugin directory and get the free version, but the CTA button from My Jetpack shows only the paid interstial page, so users can’t reach the free version and only the paid one.
    Same with the Social plugin. So, when we tell them that the plugin is installed but not active. They can either pay for a plan via My Jetpack, or head back to the plugin directory and activate the plugin from there. It's a part of this project, but just noting this as a potential UX confusion point.
Tooltip
@ilonagl
Copy link

ilonagl commented Jul 12, 2024

As for the spacing/blending between the header and the content when there are any notifications on top of the active products, can we add a light border at the bottom of the header (Gray 5)? This would create more structure to the page.

E.g.:
User connection

More design examples are here: https://www.figma.com/design/g1ZLnS65PzfOL9cmByykvf/My-Jetpack%3A-Separating-active-and-inactive-products?node-id=4444-302&t=jgzGabaV3KKEDOeH-4

@CodeyGuyDylan
Copy link
Contributor Author

The spacing between the logo and the welcome banner section looks off. I added a design proposal in the following comment.

Will get that line added!

Q: Could you tell me why the Creator is among the active products?

Creator gets activated as soon as you user-connect your account. I am actually unsure how to disable it from settings 🤔 Do you have any idea @robertsreberski?

AI got activated and included in ‘Active products’ once I connected my user account. I guess this is expected behavior because it comes by default with Jetpack. So, Stats appeared as active first because they don't need the user account connection, right?

Yes that is correct, Stats only needs a site connection!

It would be good to add an explanation that plugin is installed, but not activated. The current 'inactive' state can be a bit confusing. I'll attach designs below.

We have a status where if a plugin is installed but not active, you can activate it from My Jetpack. It must not be working for VideoPress and Social 🤔 I will try and debug why that is happening

@CodeyGuyDylan
Copy link
Contributor Author

CodeyGuyDylan commented Jul 12, 2024

We have a status where if a plugin is installed but not active, you can activate it from My Jetpack. It must not be working for VideoPress and Social 🤔 I will try and debug why that is happening

@ilonagl Seems like we show this when the product has a free or paid plan and the plugin is installed but not active. I think the intention here is for the interstitial handle giving the free plan or offering the paid one, so I think all we have to do is get that added for VideoPress and Social 🤔

I'll add a maintenance item for this 😄

@CodeyGuyDylan
Copy link
Contributor Author

CodeyGuyDylan commented Jul 12, 2024

A little bit of extra information on these interstitials, the reason there is no free offering is this:

In the code, only the product interstitial tables support free offerings without a plan. Products like Search, which shows a "Start for free" CTA on the card, go to checkout to "purchase" the free plan. So we'll have to rework that a bit to support the free offering without a plan on product cards as well 😄

Copy link
Contributor

@IanRamosC IanRamosC left a comment

Choose a reason for hiding this comment

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

Functionality tests well. I left a few comments on possible improvements, but they are non-blockers as well

Comment on lines 62 to 70
{ slugs.map( product => {
if ( product === 'stats' && showFullJetpackStatsCard ) {
return null;
}

const Item = items[ product ];
if ( ! Item ) {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: to simplify the render of the cards, we can create a new array filtering out when the product is 'stats' or when there's no items[ product ]. Then, the .map function would be only responsible for returning the array of <Col> with each Item

Comment on lines 246 to 247
'ownedProducts' => Products::get_products_by_ownership()['owned'],
'unownedProducts' => Products::get_products_by_ownership()['unowned'],
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think if pass the type of ownership as an argument so we can retrieve the specific values that we want at any time? Alternatively, if we are only going to call this method here, we can store the return value in a variable and use it afterwards:

$products_by_ownership = Products::get_products_by_ownership();
//...

'ownedProducts'   => $products_by_ownership['owned'],
'unownedProducts' => $products_by_ownership['unowned'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I'll get that changed, thank you!

@robertsreberski
Copy link
Contributor

Creator gets activated as soon as you user-connect your account. I am actually unsure how to disable it from settings 🤔 Do you have any idea @robertsreberski?

@CodeyGuyDylan what do you mean by disabling it from settings? I think we could improve the code by changing the value returned from class-product.php::get_status() function. I think we shouldn't display Creator as active if user doesn't explicitly activate it.

@ilonagl
Copy link

ilonagl commented Jul 15, 2024

Thank you for looking into my comments and the follow-ups, @CodeyGuyDylan!

I agree with @robertsreberski that Creator shouldn't be active by default; I left a related comment, but it's out of the scope of your specific project.

If there is anything else I can help with this work, or if you want me to take a second look once we have the header divider, just let me know!

@CodeyGuyDylan
Copy link
Contributor Author

Thank you for your input @robertsreberski and @ilonagl, we decided today in our meeting not to do anything about the Creator card for now since it will soon be replaced with Newsletter

As far as the interstitials not offering a free version for VideoPress and Social, we have a project on the roadmap to make interstitials more consistent, I think we will probably go ahead and handle this issue during that project 😄

@ilonagl
Copy link

ilonagl commented Jul 16, 2024

Sounds great! Thank you for covering all of this, even though it's outside the project you're working on. 🙌

@elliottprogrammer
Copy link
Contributor

It's interesting that if I run this PR in a local dev environment (via Docker), Boost and CRM are showing in the Discover More section... 🤔?. In my local environment, ALL the plugins are installed; Akismet and Jetpack are activated. But since ALL the plugins are installed (including Boost and CRM), shouldn't ALL the products show under the My Products section?
Any idea why Boost and CRM are in the "Discover More" section?

See Screenshot:
Screen Shot 2024-07-16 at 09 28 46

@IanRamosC IanRamosC self-requested a review July 16, 2024 17:26
Copy link
Contributor

@IanRamosC IanRamosC left a comment

Choose a reason for hiding this comment

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

Latest changes look good and test well.

Just found a small issue that is not related to your PR. But Protect is displaying a "View" button even when the site is not connected and it links to a page that doesn't exist if the plugin isn't present.

image
@CodeyGuyDylan
Copy link
Contributor Author

Latest changes look good and test well.

Just found a small issue that is not related to your PR. But Protect is displaying a "View" button even when the site is not connected and it links to a page that doesn't exist if the plugin isn't present.

image

Ah nice catch, that would probably be something that @elliottprogrammer can look at in one of his Protect PRs 😄

@CodeyGuyDylan CodeyGuyDylan merged commit c657adc into trunk Jul 16, 2024
72 checks passed
@CodeyGuyDylan CodeyGuyDylan deleted the add/segmentation-to-jetpack-products-my-jetpack branch July 16, 2024 17:47
@github-actions github-actions bot removed [Status] Design Input Requested [Status] Needs Design Review Design has been added. Needs a review! [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jul 16, 2024
@elliottprogrammer
Copy link
Contributor

Just found a small issue that is not related to your PR. But Protect is displaying a "View" button even when the site is not connected and it links to a page that doesn't exist if the plugin isn't present.

Yes, @IanRamosC and @CodeyGuyDylan, I was aware of this and It has been fixed in #38332 but is still in the review process. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[JS Package] Components [Package] Jitm [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. RNA
5 participants