No Admin-Bar in WP 3.1 (RC2) with "Optimize CSS Code"

Bug #696710 reported by gerobe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autoptimize
Fix Committed
Undecided
David

Bug Description

In the RC2 of WordPress 3.1 the new admin bar does not appear, if you select "Optimize CSS Code" in the Autoptimize plugin.

Related branches

Revision history for this message
gerobe (buettner-gmx) wrote :

I think I found the reason for this. Autoptimize seems to combine all CSS code no matter what media they refer to. There is the line:

<style type="text/css" media="print">#wpadminbar { display:none; }</style>

In the code and Autoptimize puts this in the combined css for the screen display. The result is, that the admin bar is not displayed anymore.

Revision history for this message
gerobe (buettner-gmx) wrote :

The error is still present in the final version of WP 3.1

It would be easy to fix this, but I'm not good in regular expressions. Maybe someone can help:

In /classes/minify-html.php the line 109 is responsible for the vanishing admin bar. This regular expression extracts every style-code no matter for which media it is written.

'/(\\s*)(<script\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'

this line must be modified not to catch scripts with the parameter media="print".

Is someone here who is able to modify this line?

Unfortunately it seems, that this good plugin is not maintained by the author anymore :(

David (amereservant)
Changed in autoptimize:
assignee: nobody → David (amereservant)
David (amereservant)
Changed in autoptimize:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.