Skip to content

Conversation

obenland
Copy link
Member

Improves the experience for sites that picked Blog Only mode in the profile_mode step.

Proposed changes:

  • Adds step-completion option update to blog-profile tab.
  • Adds a case for Blog Only sites to link the Profile setup button to the Blog Profile.
  • Fixes a bug where the Blog Setup button was never made primary when it was the next button in the list.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to Settings > Activitypub to see the Welcome page. Re-enable it if needed.
  • Click "Choose Mode", select "Blog profile only", and Save Changes.
  • Go back to Welcome and click "Edit Profile"
  • Make sure you end up on the Blog Profile tab.
  • Go back to Welcome and make sure the step is complete.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

The welcome page now links to the correct profile when Blog Only mode was selected in the profile mode step.

@obenland obenland requested review from pfefferle and Copilot June 12, 2025 15:17
@obenland obenland self-assigned this Jun 12, 2025
Copilot

This comment was marked as outdated.

@obenland obenland requested a review from Copilot June 12, 2025 15:21
Copy link

@Copilot 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

This PR updates the welcome onboarding flow to properly handle Blog Only mode by marking the profile step complete and linking the “Edit profile” button to the blog-profile tab.

  • Changed the primary button logic to target the correct next step (profile_setup).
  • Added a link and visited-flag update for Blog Only sites in the profile setup step.
  • Included a changelog entry for the new behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
includes/wp-admin/class-welcome-fields.php Adjusted button primary logic and added Blog Only mode link
includes/wp-admin/class-blog-settings-fields.php Marked the profile step complete when visiting the blog-profile tab
.github/changelog/1807-from-description Added changelog entry
Comments suppressed due to low confidence (3)

includes/wp-admin/class-welcome-fields.php:358

  • [nitpick] The link label still reads “Edit profile” for blog-only sites—consider updating the text to “Edit blog profile” to make the target more explicit for users.
<?php elseif ( ACTIVITYPUB_BLOG_MODE === \get_option( 'activitypub_actor_mode' ) ) : ?>

includes/wp-admin/class-blog-settings-fields.php:31

  • It would be good to add or update tests covering the blog-profile tab visit so that this update_option path is verified in the test suite.
\update_option( 'activitypub_checklist_profile_setup_visited', '1' );

includes/wp-admin/class-blog-settings-fields.php:30

  • To avoid accidentally marking the profile step complete on unrelated admin pages, consider also checking that the current page is the ActivityPub settings page (e.g., verifying $_GET['page'] === 'activitypub').
if ( isset( $_GET['tab'] ) && 'blog-profile' === \sanitize_key( $_GET['tab'] ) && ACTIVITYPUB_BLOG_MODE === \get_option( 'activitypub_actor_mode' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended

Copy link
Member

@pfefferle pfefferle left a comment

Choose a reason for hiding this comment

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

that might be a rare case, because the actor mode is the default and you see the welcome screen normally only when installing the plugin.

@obenland obenland merged commit fb7045c into trunk Jun 16, 2025
11 checks passed
@obenland obenland deleted the update/welcome-profile branch June 16, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants