WPCOM Admin Bar: Conflict between admin bar styles, Photon CDN, and Yoast SEO + Yoast SEO Premium 15.6.2
We've been getting reports over on WordPress.com on Atomic about the account/me screen is expanding and covering WP-Admin.
- Example screenshot:
- A8C internal discussion: p9F6qB-6mP-p2
- It's not easy to reproduce outside of the sites we've confirmed it on.
- We started getting reports after 9.3 + Yoast 15.6 updates released today.
Steps to reproduce the issue
Reproducing this issue is very difficult outside of sites that are experiencing it.
Please see the internal discussion at p9F6qB-6mP-p2 for example sites.
It seems to occur under the following conditions.
- Yoast SEO or Yoast SEO Premium 15.6.2 installed and activated.
- Yoast’s admin bar option is enabled under [your-domain]/wp-admin/admin.php?page=wpseo_dashboard#top#features
- Jetpack’s
photon-cdnmodule is active. (The Speed up static file load times option) - The site loads two admin bar related CSS files in a specific order. Thanks to @tbradsha for identifying that key point.
@tbradsha's note on CSS file order:
It seems to be an stylesheet load order issue. On a broken site, admin bar CSS is loaded in this order:
https://s1.wp.com/wp-content/mu-plugins/admin-bar/wpcom-admin-bar.css?ver=9.3 ... https://c0.wp.com/c/5.6/wp-includes/css/admin-bar.min.cssWhereas on a working site, it's loaded in this order:
https://c0.wp.com/c/5.6/wp-includes/css/admin-bar.min.css ... https://s1.wp.com/wp-content/mu-plugins/admin-bar/wpcom-admin-bar.css?ver=9.3
On sites where things are broken, https://s1.wp.com/wp-content/mu-plugins/admin-bar/wpcom-admin-bar.css?ver=9.3 loads first and applies the following:
#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper {
min-width: 225px;
}
However, that gets overridden due to specificity when https://c0.wp.com/c/5.6/wp-includes/css/admin-bar.css loads in with the following:
#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper {
min-width: 100%;
}
Workarounds
Three workaround options, until a fix is identified, appear to be:
- Deactivate the Yoast Admin bar menu under
[your-domain]/wp-admin/admin.php?page=wpseo_dashboard#top#featuresNote that you will need to temporarily deactivate thephoton-cdnmodule to access Yoast's settings. Once the Admin bar is turned off,photon-cdncan be activated again. - Or, deactivate the Jetpack
photon-cdnmodule. One way to do this is to go to[your-domain]/wp-admin/admin.php?page=jetpack#/performanceand turn offSpeed up static file load times. Note that you may see an increase in the time it takes to load core WordPress, WooCommerce, Jetpack, and WordPress.com assets with this off. - Add the following CSS to your site in an attempt to override things.
#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper { min-width: 225px; }
I cannot seem to reproduce at the moment; I assume this is the key element that's eluding me so far:
The site loads two admin bar related CSS files in a specific order.
I can't seem to be able to find things that changed in Yoast SEO or in Jetpack that would cause this issue to start appearing.
I would be tempted to increase the specificity of our CSS to solve the problem, but that wouldn't really help us understand exactly what is happening.
D55255-code
@JoshuaGoode I've deployed the change above to try to mitigate the issue, although I still cannot reproduce. Could you let me know if that helps?
Thanks, @jeherve. I'll be able to test shortly.
I came across this same issue in chat today 24641671-hc
The issue was only present while Yoast SEO Premium (ver 15.5) was activated on the site.
We used the first workaround listed to deactivate the Yoast Admin bar menu.
@jeherve How long might that change take to apply across photon?
When I visit instances like https://s1.wp.com/wp-content/mu-plugins/admin-bar/wpcom-admin-bar.css?ver=9.3 , it's still loading the following without the quick fix !important added via D55255-code
#wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper {
min-width: 225px;
}
Our current list of sites on our internal notes at p9F6qB-6mP-p2 are still impacted by this at the time of this message.
How long might that change take to apply
I'm afraid the file is cached in the browser, so as long as we don't release a new version of Jetpack, folks with a cached version of the file in their browser would either have to flush their cache or wait until the version bump :(
We'll release a new version of Jetpack later today; that should help bust the cache for that file by changing its URL, and it should help solve the issue.
I've just released 9.3.1. It should be available on Atomic soon, and hopefully solve that issue. Let me know how that goes!