Repository navigation
Stats: do not update the WPCOM blog details - #21441
Conversation
There was a problem hiding this comment.
Here are some suggested test cases for this PR.
Stats
- Visit home page, make sure that page view is recorded in stats
- Visit home page in AMP view
- Visit post page in non-AMP and AMP view
If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration file.
|
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 🤖 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 (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
The Stats module shouldn't update the wpcom blog details. Tthe blog details are kept up to date by Sync and Identity Crisis. * Deprecate the stats_update_blog() function. * Remove the stats_update_blog() call from stats_upgrade_options().
e2c25bc to
ab4b32e
Compare
leogermani
left a comment
There was a problem hiding this comment.
I've verified that all the options that we updated via jetpack.updateBlog are handled by Sync.
From the options list, I saw that host, path, stats_api and stats_version were not handled by Sync, but these were also not handled by the XMLRPC endpoint, as we can see in Jetpack_XMLRPC_Server::sanitize_blog_option.
All options of my site looked fine even without this call (I watched my sandbox to see no calls coming in)
I also made sure to delete stats_options locally and saw it getting synced to WPCOM
* master: (27 commits) Admin Page: Update upgrade buttons Tracks events (#21483) Debug Helper IDC Simulator: Add the ability to spoof the home url (#21516) Map block: Add `address` block attribute (#21412) Update wordpress monorepo (#21522) Stats Page: Add VideoPress nudge (#21513) Improve Jetpack products illustrations file size (#21514) Update dependency mediawiki/mediawiki-codesniffer to v38 (#21523) Update dependency yoast/phpunit-polyfills to v1.0.2 (#21524) Widgets: add Strava to Social Icons Widget and Social Menu (#21518) Boost: Add active modules to speed score request (#21471) Markdown: Better accessibility for Footnotes (#21495) Jetpack Plugin: Add VideoPress upgrade page (#21497) Admin Menu: moves Add new (plugin) menu item to the top for Atomic sites (#21506) General: Check the return value of get_comment() (#21080) Instagram Widget: link to user connection if user is not connected (#21512) Search: Create a new search package, rename Search plugin (#21502) Identity Crisis: Remove the unused jetpack_idc_option transient (#21492) Stats: do not update the wpcom blog details (#21441) Admin: do not display upgrade messages when on offline mode (#21444) jetpack: Catch calls to `exit()` and `die()` in PHPUnit (#21043) ...
Changes proposed in this Pull Request:
Currently, it's possible for the Stats module to change the WPCOM side
siteurlvalue when the site is in an identity crisis, which is not the expected behavior. Only the Identity Crisis process should update the WPCOM sidesiteurlandhomeoption values. Also, the data that is sent by the Stats module is handled by the Sync process, so it shouldn't be necessary for the Stats module to send it.stats_update_blog()function.stats_update_blog()call fromstats_upgrade_options().An alternate approach to this solve the identity crisis problem would be to just remove the
siteurloption from the data that's sent in thejetpack.updateBlogrequest. However, it seems redundant to send any of this data since Sync handles it.Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Suggested code review:
Confirm that the
jetpack.updateBlogrequest sends data that is handled by Sync. The values that are sent by the call tojetpack.updateBlogare found in thestats_get_blogfunction. The default options that are sent by Sync are found in theDefaults::default_options_whitelistproperty. Thesiteurloption is synced via thesite_urlcallable here.Manual test:
jetpack.updateBlogare correct. (blogname,siteurl,stats_api,stats_options, etc.)