jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

WPCOM Admin Bar: Conflict between admin bar styles, Photon CDN, and Yoast SEO + Yoast SEO Premium 15.6.2

Open JoshuaGoode opened this issue 5 years ago • 8 comments

We've been getting reports over on WordPress.com on Atomic about the account/me screen is expanding and covering WP-Admin.

  • Example screenshot:
Screen Shot 2021-01-12 at 17 21 46
  • 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.

  1. Yoast SEO or Yoast SEO Premium 15.6.2 installed and activated.
  2. Yoast’s admin bar option is enabled under [your-domain]/wp-admin/admin.php?page=wpseo_dashboard#top#features
  3. Jetpack’s photon-cdn module is active. (The Speed up static file load times option)
  4. 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.css

Whereas 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:

  1. Deactivate the Yoast Admin bar menu under [your-domain]/wp-admin/admin.php?page=wpseo_dashboard#top#features Note that you will need to temporarily deactivate the photon-cdn module to access Yoast's settings. Once the Admin bar is turned off, photon-cdn can be activated again.
  2. Or, deactivate the Jetpack photon-cdn module. One way to do this is to go to [your-domain]/wp-admin/admin.php?page=jetpack#/performance and turn off Speed 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.
  3. Add the following CSS to your site in an attempt to override things.

#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper { min-width: 225px; }

JoshuaGoode avatar Jan 12 '21 23:01 JoshuaGoode

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

jeherve avatar Jan 13 '21 09:01 jeherve

@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?

jeherve avatar Jan 13 '21 10:01 jeherve

Thanks, @jeherve. I'll be able to test shortly.

JoshuaGoode avatar Jan 13 '21 14:01 JoshuaGoode

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.

smithkyle45 avatar Jan 13 '21 20:01 smithkyle45

@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.

JoshuaGoode avatar Jan 13 '21 21:01 JoshuaGoode

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 :(

jeherve avatar Jan 14 '21 07:01 jeherve

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.

jeherve avatar Jan 14 '21 16:01 jeherve

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!

jeherve avatar Jan 14 '21 17:01 jeherve