-
Notifications
You must be signed in to change notification settings - Fork 843
Social: Update post publish review prompt #46398
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
base: trunk
Are you sure you want to change the base?
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
There was a problem hiding this 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 refactors the review prompt functionality in the Jetpack Social plugin to use WordPress core components and the core preferences store instead of custom implementations. The changes remove backend REST endpoints and PHP logic for managing the review prompt, replacing them with client-side preference management.
Key Changes
- Migrated review prompt from custom REST endpoint to WordPress core preferences store
- Converted
useJetpackSocialPreferencesto a genericuseSocialUserPreferenceshook supporting multiple preference types - Updated review prompt UI to use core Notice component instead of custom styled component
- Removed unused PHP code for dismissed notices and review prompt state management
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
projects/plugins/social/src/class-rest-settings-controller.php |
Removed REST endpoint /jetpack/v4/social/review-dismiss that was handling review dismissal |
projects/plugins/social/src/class-jetpack-social.php |
Removed constants, methods, and hooks related to review prompt initial state and dismissal tracking |
projects/packages/publicize/src/class-publicize-setup.php |
Removed registration of dismissed notices options |
projects/packages/publicize/src/jetpack-social-settings/class-dismissed-notices.php |
Deleted entire dismissed notices class and functionality |
projects/packages/publicize/tests/php/jetpack-social-settings/Dismissed_Notices_Test.php |
Removed corresponding test file for deleted dismissed notices class |
projects/js-packages/publicize-components/src/types.ts |
Removed review property from SocialScriptData interface |
projects/js-packages/publicize-components/src/hooks/use-social-user-preferences/index.ts |
New generic hook for managing user preferences with support for both pre-publish confirmation and review prompt dismissal |
projects/js-packages/publicize-components/src/hooks/use-jetpack-social-preferences/index.ts |
Deleted old single-purpose preferences hook |
projects/js-packages/publicize-components/src/components/review-prompt/index.jsx |
Refactored to use core Notice component, removed custom styling and one tracking event |
projects/js-packages/publicize-components/src/components/review-prompt/styles.module.scss |
Removed as styling now handled by core Notice component |
projects/js-packages/publicize-components/src/components/post-publish-review-prompt/index.tsx |
Updated to use new preferences hook and determine review URL based on active plugin |
projects/js-packages/publicize-components/src/components/pre-publish-preview/index.tsx |
Updated to use new generic preferences hook |
projects/js-packages/publicize-components/src/components/unified-modal/social-post-preview/confirmation-config.tsx |
Updated to use new generic preferences hook |
projects/js-packages/publicize-components/src/social-store/actions/social-settings.ts |
New action file for social settings (replacing pricing-page actions) |
projects/js-packages/publicize-components/src/social-store/actions/index.ts |
Updated imports to use new social-settings instead of pricing-page |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| variant: 'primary', | ||
| label: __( 'Leave a Review', 'jetpack-publicize-components' ), | ||
| url: href, | ||
| className: 'is-compact', | ||
| }, |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tracking event for clicking the "Leave a Review" link has been removed. While the dismiss click tracking remains, the click tracking for the primary action (leaving a review) is missing. This makes it harder to measure the effectiveness of this prompt and understand user engagement with the review request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tracking event for clicking the "Leave a Review" link has been removed. While the dismiss click tracking remains, the click tracking for the primary action (leaving a review) is missing. This makes it harder to measure the effectiveness of this prompt and understand user engagement with the review request.
I assume this is because we will see the stats on jp redirect for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Also, the Notice component actions have the limitations right now that we can't use onClick with url
More details in WordPress/gutenberg#74090
projects/js-packages/publicize-components/src/hooks/use-social-user-preferences/index.ts
Show resolved
Hide resolved
projects/js-packages/publicize-components/src/hooks/use-social-user-preferences/index.ts
Show resolved
Hide resolved
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
2 files are newly checked for coverage.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
haqadn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const PostPublishPanels = () => { | ||
| return ( | ||
| <ThemeProvider targetDom={ document.body }> | ||
| { isJetpackSelfHostedSite() && <PostPublishReviewPrompt /> } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't notice it at first, and was wondering why the review prompt isn't appearing on my JN site. I am curious about why we want to hide it for hosted sites. Don't we want to show it in Pressable, Bluehost or even WPCOM sites? I understand we might want to hide it because JP comes prepackaged. I just want to understand the rationale clearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this PR, the review prompt was shown only if the Social standalone plugin was active. In this PR, I changed the logic to allow it for the Jetpack plugin as well, and why not? So, I thought to add a guardrail to ensure it's shown on the self-hosted sites only. Maybe a better solution/fix is to skip it only on WPCOM? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion on this. Not showing where it's prepackaged makes sense. But, also it is a distinct product and the notice is not too intrusive. I'm happy either way.
| { | ||
| variant: 'primary', | ||
| label: __( 'Leave a Review', 'jetpack-publicize-components' ), | ||
| url: href, | ||
| className: 'is-compact', | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tracking event for clicking the "Leave a Review" link has been removed. While the dismiss click tracking remains, the click tracking for the primary action (leaving a review) is missing. This makes it harder to measure the effectiveness of this prompt and understand user engagement with the review request.
I assume this is because we will see the stats on jp redirect for this?
That is because of the issues in Core Notice component which we are now using throughout the codebase. That issue has already been fixed and is already available via the Gutenberg plugin if you install it. That change should be available in the next WP release. Thus, we are not using any custom styles here as it will be automatically be fixed. |
I think we should put a little bit of custom style that matches the final outcome. This way it won't look broken until the new version of WP is out or if someone decides to delay their WP update. |

Closes SOCIAL-249
Our review prompt in the sidebar looks a bit off and doesn't follow the core component styles. I updated the component to use the Core Notice component and took the opportunity to clean up other related things.
Proposed changes:
useJetpackSocialPreferencesto a generic user preferences hook, making it easier to add more preferences.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: