-
Notifications
You must be signed in to change notification settings - Fork 851
Adds a local handling of the Blaze advise campaign endpoint #46623
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
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! |
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report Coverage check overridden by
Coverage tests to be added later
|
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 adds local handling for the Blaze "advise campaign" endpoint to reduce initial delay when users first connect their site to Jetpack. When posts aren't yet synced via Jetpack Sync, the endpoint reads local database data and provides additional post information to WPCOM, allowing users to promote content sooner.
Changes:
- Add handler for
/templates/advise/campaign/:urnendpoint that provides post data locally when sync is not ready - Add handler for
/advise/campaign/:urnendpoint with similar local fallback logic - Whitelist the root
/dsp/api/v1/advisecontroller for future use
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| projects/packages/blaze/src/class-dashboard-rest-controller.php | Adds new REST route registrations and handler methods for advise campaign endpoints with local fallback when Jetpack Sync is not ready |
| projects/packages/blaze/changelog/add-local-handling-of-blaze-advise-endpoint | Adds changelog entry describing the improvement to post promotion speed |
projects/packages/blaze/src/class-dashboard-rest-controller.php
Outdated
Show resolved
Hide resolved
projects/packages/blaze/src/class-dashboard-rest-controller.php
Outdated
Show resolved
Hide resolved
projects/packages/blaze/src/class-dashboard-rest-controller.php
Outdated
Show resolved
Hide resolved
projects/packages/blaze/src/class-dashboard-rest-controller.php
Outdated
Show resolved
Hide resolved
projects/packages/blaze/src/class-dashboard-rest-controller.php
Outdated
Show resolved
Hide resolved
projects/packages/blaze/src/class-dashboard-rest-controller.php
Outdated
Show resolved
Hide resolved
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
EkaterinaStancheva
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.
The code looks good to me! 👍 I tested it, and it works as described! Thank you!
Just to clarify - Based on the PR description, I see that /dsp/api/v1/advise is being whitelisted for future use. Do we plan to move to /advise/campaign/ and remove /templates/advise/campaign/ in the future?
Yes, that's the idea. When the The main problem was that we didn't create the corresponding Jetpack PR that whitelists the |
Part of ADS-626
Proposed changes:
We are working to reduce the initial delay users experience in Blaze when they first connect their site to Jetpack.
This PR handles the "advise campaign" call in the Blaze flow and provides additional post information to WPCOM, allowing users to promote content sooner.
/templates/advise/campaign/:urnendpoint that provides additional information to WPCOM when the site is still syncing post information./dsp/api/v1/advise, which we are going to start using in the near future.Other information:
This is part of a broader effort to improve the initial delay time for the Blaze Ads plugin. We plan to also change the
/templates/articleendpoint and the/campaignsendpoint (which are the ones we require additional post information for).Jetpack product discussion
N/A
Does this pull request change what data or activity we track or use?
No
Testing instructions:
https://{SITE_HOST}/wp-admin/tools.php?page=advertising#!/advertising/posts/promote/post-{POST_ID}/{SITE_HOST}One example:
https://helpful-tiger-mountain.jurassic.ninja/wp-admin/tools.php?page=advertising#!/advertising/posts/promote/post-5/helpful-tiger-mountain.jurassic.ninja/templates/adviseendpoint, and in the answer, the propsync_ready: falseshould appear.This happens when we execute the local version of the article template that we included in this PR. You won't be able to continue the flow, because we still need to change other endpoints, but this test should be enough to test the change