-
Notifications
You must be signed in to change notification settings - Fork 816
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
Jetpack: clean up registration_nonce #42552
Conversation
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryCoverage changed in 1 file.
|
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.
Tested well for me, though I had a question around one testing step.
/wp-admin/admin.php?page=jetpack&jetpack-partner-coupon=my-coupon-code
redirects to /wp-admin/admin.php?page=jetpack
and shows 'Setup and redeem Jetpack Backup'. I presume that was what I was supposed to click?
I can't then go back to that URL afterwards, as it just redirects to /wp-admin/admin.php?page=jetpack&showCouponRedemption=1#/dashboard
.
Also, for some reason, it looks as though this PR introduces a new PHP error: PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>woocommerce</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
. I changed between trunk and the PR a few times just to double check it wasn't also happening on trunk. It happens specifically after going through the connection process just before being redirected back to the site. I added a stack trace, the first part of which shows:
Stack trace:
#0 /var/www/html/wp-includes/l10n.php(1412): _load_textdomain_just_in_time()
#1 /var/www/html/wp-includes/l10n.php(195): get_translations_for_domain()
#2 /var/www/html/wp-includes/l10n.php(307): translate()
#3 /usr/local/src/jetpack-monorepo/projects/packages/assets/src/class-assets.php(664): __()
#4 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\Jetpack\Assets::filter_gettext()
#5 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#6 /var/www/html/wp-includes/l10n.php(220): apply_filters()
#7 /var/www/html/wp-includes/l10n.php(307): translate()
#8 /usr/local/src/jetpack-monorepo/projects/packages/connection/src/class-tokens.php(381): __()
#9 /usr/local/src/jetpack-monorepo/projects/packages/connection/src/class-manager.php(488): Automattic\Jetpack\Connection\Tokens->get_access_token()
#10 /usr/local/src/jetpack-monorepo/projects/packages/connection/src/class-manager.php(401): Automattic\Jetpack\Connection\Manager->internal_verify_xml_rpc_signature()
#11 /usr/local/src/jetpack-monorepo/projects/packages/connection/src/class-manager.php(130): Automattic\Jetpack\Connection\Manager->verify_xml_rpc_signature()
#12 /usr/local/src/jetpack-monorepo/projects/packages/config/src/class-config.php(266): Automattic\Jetpack\Connection\Manager::configure()
#13 /usr/local/src/jetpack-monorepo/projects/packages/config/src/class-config.php(217): Automattic\Jetpack\Config->enable_connection()
#14 /usr/local/src/jetpack-monorepo/projects/packages/config/src/class-config.php(107): Automattic\Jetpack\Config->ensure_feature()
#15 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\Jetpack\Config->on_plugins_loaded()
Do you see the warning as well in testing locally as well?
Edit to add - I've realized the reason I see the warning is because I'm testing with WordPress 6.8 in my local dev environment, so you may need to add the WordPress Beta Tester plugin and upgrade to the latest beta as well, assuming your test site uses English as it's site language?. Or change the site language to something like Deutsch, and reinstall the current version, that may also work.
Hi @coder-karen, thanks for taking a look!
As far as I can tell, it's supposed to happen for connected sites.
I tried to reproduce it on 6.8-beta3-60060 with no luck, the error log is clean. |
I tried again on my local development site, same results, also still see the PHP error. To confirm, I made sure I rebuilt Jetpack and Connection locally after checking out the PR, this time rebuilding all dependencies associated with Jetpack just in case. So then I tried just now on a Jurassic Ninja site, everything worked as I'd expect, based on the testing instructions. Except for step 5 under 'Coupons' - after going through the connection flow and landing back on the site I land on the dashboard and see a notice 'Your connection with WordPress.com seems to be broken. If you're experiencing issues, please try reconnecting.', maybe that's unrelated? I also don't see the PHP error on a Jurassic Ninja site. So, the issues seem to either be related to local development environment, or just mine. For what it's worth, it's just one PHP notice each connection, so it will not be filling up logs. If it isn't replicable, then it would seem fairly safe to wait and see if we can replicate later I think? |
It does seem unrelated. Since we edit UI for the most part, it seems unlikely to trigger connection issues.
I agree, let's keep an eye on that. This too doesn't seem related to the PR though, since we are only removing stuff and don't edit any initialization flows. |
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.
Ok, thanks for clarifying! In that case, giving this a ✅
Part of #42076
Proposed changes:
registration_nonce
remnants from the Jetpack plugin.Other information:
Jetpack product discussion
PT: pf5801-1dm-p2
Justification: pf5801-1q1-p2#comment-787
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Connection
plugins/jetpack
andpackages/connection
.Coupons
NONCE_NON_
+ random letters./wp-admin/admin.php?page=jetpack&jetpack-partner-coupon=the-coupon-code
WooCommerce
/wp-admin/admin.php?page=jetpack#/woo-setup