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

Related Posts: Hide settings in block themes #41075

Merged
merged 8 commits into from
Jan 16, 2025

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Jan 15, 2025

Fixes Automattic/wp-calypso#98190
Related to Automattic/wp-calypso#98190

Proposed changes:

This PR hides Related Posts settings in block themes;

  • in wp-admin's Reading Settings on Atomic Classic and Simple Classic
  • in Jetpack Settings on Atomic

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

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

Testing instructions:

Note

This will need to be tested with a Classic theme like Twenty Ten, and a Block theme like Twenty Twenty Four.

Note

To display Related Posts, your site must be:

  • Public
  • Contain at least 500 bytes (about 100 words) per post.
  • You have posts related to another post (for example, using the same tags)

Reading Settings

  • Activate a Classic theme
    • Go to /wp-admin/options-reading.php
    • Observe the settings
      • Screenshot 2025-01-15 at 14 04 03
    • Go to any post
    • Observe the related posts are displayed on the site's frontend
  • Activate a Block theme
    • Go to /wp-admin/options-reading.php
    • Observe the link to the help doc
      • Screenshot 2025-01-15 at 13 55 47
    • Go to Appearance > Editor > Templates > Single Posts
    • Add a Related Posts block at the bottom of the posts
    • Go to any post
    • Observe the related posts are displayed on the site's frontend

Jetpack Settings

  • Activate a Classic theme
    • Go to /wp-admin/admin.php?page=jetpack#traffic
    • Observe the settings
      • Screenshot 2025-01-15 at 15 12 51
    • Go to any post
    • Observe the related posts are displayed on the site's frontend
  • Activate a Block theme
    • Go to /wp-admin/admin.php?page=jetpack#traffic
    • Observe the link to the help doc
      • Screenshot 2025-01-15 at 15 10 09
    • Go to Appearance > Editor > Templates > Single Posts
    • Add a Related Posts block at the bottom of the posts
    • Go to any post
    • Observe the related posts are displayed on the site's frontend

Advanced

  • When the feature is toggled off in Jetpack Settings,
    • Screenshot 2025-01-15 at 15 15 01
    • Screenshot 2025-01-15 at 15 15 15
  • Ensure the settings are not displayed in Reading Settings
  • Ensure you can enable the feature via the Block
    • Screenshot 2025-01-15 at 14 38 39

I referred to #39784 for testing instructions.

Copy link
Contributor

github-actions bot commented Jan 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 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 update/related-posts-block-theme branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack update/related-posts-block-theme
    

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 github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress Admin Page React-powered dashboard under the Jetpack menu labels Jan 15, 2025
Copy link
Contributor

github-actions bot commented Jan 15, 2025

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 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 🤖


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.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!


Jetpack plugin:

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

  • WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for February 4, 2025 (scheduled code freeze on undefined).

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 Jan 15, 2025
@okmttdhr okmttdhr self-assigned this Jan 15, 2025
@okmttdhr okmttdhr requested a review from a team January 15, 2025 06:17
@okmttdhr okmttdhr marked this pull request as ready for review January 15, 2025 06:18
lsl
lsl previously approved these changes Jan 16, 2025
Copy link
Contributor

@lsl lsl left a comment

Choose a reason for hiding this comment

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

Settings options changes LGTM

I could not find the related posts block, do I need to enable something to access that in the post editor?

@lsl lsl added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Jan 16, 2025
@lsl
Copy link
Contributor

lsl commented Jan 16, 2025

Ok, found the related posts block in simple sites (had only tested atomic so far)

This toggle being shown is a little odd because it refers to before/after post:

Screenshot(43)

simple site, 2025 theme

The toggle allows you to disable related posts, should we change the copy or remove the toggle for block themes?

Is there any need to keep the disable option around? (once you add the block and enable related posts I doubt you'd want to break the existing blocks, but maybe that's a good option to have?)

@okmttdhr
Copy link
Member Author

okmttdhr commented Jan 16, 2025

I could not find the related posts block, do I need to enable something to access that in the post editor?

Hmm, there should be nothing particular both on Simple and Atpmic, expect enabling Block themes.

The toggle allows you to disable related posts, should we change the copy or remove the toggle for block themes?
Is there any need to keep the disable option around? (once you add the block and enable related posts I doubt you'd want to break the existing blocks, but maybe that's a good option to have?)

Thank you for pointing this out, @lsl! I confirmed these Show/Hide settings are effective on Block themes as well:
Screenshot 2025-01-16 at 15 50 16

Although it is effective, I believe hiding the options reduces confusion, as the related posts won't be displayed until the block is added, even if the option is enabled. I addressed this in 4b60633

@okmttdhr
Copy link
Member Author

I'll merge this PR, but open to further discussions :)

@okmttdhr okmttdhr merged commit dd375d8 into trunk Jan 16, 2025
60 checks passed
@okmttdhr okmttdhr deleted the update/related-posts-block-theme branch January 16, 2025 08:04
@github-actions github-actions bot added this to the jetpack/14.3 milestone Jan 16, 2025
@github-actions github-actions bot removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Status] In Progress labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Feature] Related Posts [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [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.

Settings: Hide related posts options for block themes
2 participants