Bug with wp_head or ob_start()?

Hi
Various people are facing issues with this plugin


We get some HTML (especially <script>, <style>, …) moved outside the <head> at the top before the doctype tag, so the plugin doesn’t work.

The author seems to catch the bug in Sage 9, he’s proposing a solution here


He points that the problem is caused by the action hook wp_head or by the ob_start() in filters.php that has no ob_end_flush(). Correct?

Someone can help?

Sage 9 doesn’t use ob_end_flush(), it uses ob_get_clean() which has essentially the same effect (it clears the buffer) it just returns the buffer content instead of printing it. It looks like this plugin starts a buffer with wp_head and then attempts to end the buffer in wp_footer. Because of the way Sage 9 operates, that might be problematic. I think it should work fine in Sage 10, though.

Thanks @alwaysblank!
We’ll try Sage 10 when it will be stable. In the meanwhile could you suggest me a workaround to solve this issue in Sage 9?

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.