-
Notifications
You must be signed in to change notification settings - Fork 812
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
WPcom_Admin_Menu: Add special cases that don't have menus extended #22804
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 🤖 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:
|
Caution: This PR has changes that must be merged to WordPress.com |
The new method used prevents this, as it only checks for |
ef6c86a
to
f80c28f
Compare
2b538b2
to
f932a77
Compare
For the PHP 8.1 WP master unit tests, I'm seeing this failure:
I'm not sure if it's related to these changes? |
@@ -35,6 +35,21 @@ function should_customize_nav( $admin_menu_class ) { | |||
return false; | |||
} | |||
|
|||
// WPCOM-specific exemptions. |
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.
We currently maintain the Nav Unification activation logic for Simple sites in the wpcom
codebase (in the show_unified_nav
function which lives in wp-content/mu-plugins/masterbar.php
), so I guess it makes sense to also add these new checks there?
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 did some testing (the patch is in D75746-code). It looks like it's another way to accomplish the same thing, either this PR or D75746-code is needed, but no extra benefit from both. Maybe D75746-code is better because it keeps the wpcom specific exemptions in wpcom and out of jetpack? I'd be fine w/ closing this PR and going for D75746-code.
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 think keeping wpcom's special case on wpcom in D75746-code makes sense. With WordPress/gutenberg#38810 about to be merged you could even keep it to just the *stuff.php
file checks.
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'd be fine w/ closing this PR and going for D75746-code.
Let's do that then 🙂
…admin/?service-worker url
… for us to check, ignore NonceVerification
f932a77
to
316b66c
Compare
Deployed D75746-code and made a note to remove the ?service-worker exemption after WordPress/gutenberg#38810 is merged |
Even though Gutenberg has removed the service worker, it's still installed in my browser and continues to make requests to |
Changes proposed in this Pull Request:
/wp-admin?service-worker
, do not add any actions toadmin_menu
, as all the page does is return a static js file. All work is wasted.https://github.com/WordPress/gutenberg/blob/b54c2d88fa883e47822ce8088de5592ad4bacbf0/lib/pwa.php#L21-L34
/wp-admin/index-yourstuff.php
and/wp-admin/index-hotstuff.php
: They do not render menus and end up going through JITM code for ultimately no effect.For more background info, see p55Cj4-1xc-p2
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
/wp-admin?service-worker
. Before and after the patch, the data returned should be exactly the same./wp-admin?service-worker
will causeget_top_messages()
injitm-engine.php
to run, however, the data will not be used, as there is nowhere to display the messages./wp-admin?service-worker
will not causeget_top_messages()
injitm-engine.php
to run/wp-admin/index-yourstuff.php
and/wp-admin/index-hotstuff.php
Logging screenshots before/after
Loading /wp-admin/ on my simple site before changes (JITM rendered 5 times)

Loading /wp-admin/ on my simple site after changes (JITM rendered once)
