Title: PHP7: Some CSS options broken
Last modified: August 31, 2016

---

# PHP7: Some CSS options broken

 *  Resolved [Grzegorz.Janoszka](https://wordpress.org/support/users/grzegorzjanoszka/)
 * (@grzegorzjanoszka)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/)
 * I moved my site to PHP7 and noticed weird behavior of one plugin, its data was
   displayed completely off. Troubleshooting I found out that the culprit was autoptimize.
   Its option to move inline CSS to separate files (not sure how it is called in
   English, I have a localized version) breaks up the code.
    Could you please check
   the PHP7 compatibility with this plugin? Thank you in advance!
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108471)
 * running PHP7 myself on one of my dev-env’s and haven’t seen a problem yet, but
   then off course I could be mistaking 😉
 * so;
    * when considering these options, which one are we talking about:
 * >  Optimize CSS Code?
   >  Generate data: URIs for images? Remove Google Fonts? Also
   > aggregate inline CSS? Inline and Defer CSS? Inline all CSS? Exclude CSS from
   > Autoptimize
 * * how does the error present itself, where should I be looking? php-errorlog?
   in the resulting HTLM? what specificall?
    * if specifically related to output
   of one plugin; which one would that be?
 * frank
 *  Thread Starter [Grzegorz.Janoszka](https://wordpress.org/support/users/grzegorzjanoszka/)
 * (@grzegorzjanoszka)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108487)
 * Sorry, it is “Also aggregate inline CSS”. The translation is horrible and misleading,
   it would be nice to have a checkbox to force English in the plugin 🙂
    It works
   very well on PHP 5.6, but when I migrate all the files and DB to a server with
   PHP 7.0, this option seems to move some stuff around.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108493)
 * can you explain “this option seems to move some stuff around” a bit more? is 
   this linked to a specific theme or plugin? do you see anything in your php-errorlog?
 * frnak
 *  Thread Starter [Grzegorz.Janoszka](https://wordpress.org/support/users/grzegorzjanoszka/)
 * (@grzegorzjanoszka)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108495)
 * Well, there have been some other things moved, but after clearing all the caches(
   including the browser one) they were clean. The problem remains with one plugin–
   Aspexi Facebook Like Box.
 * Please check: “old” site: [http://paleosmak.pl/](http://paleosmak.pl/) – the 
   facebook box is on the right. The new site is http:// test .paleosmak.pl/ (I 
   am breaking the URL so the crawlers will not go there) – the facebook box is 
   way down at the bottom left.
 * Both have identical options to Autoptimize. The “old” site has PHP 5.6, the new
   one has PHP 7.0. After disabling the option “Also aggregate inline CSS” the new
   site has a proper facebook box. I initially thought it was the plugin “Aspexi
   Facebook Like Box”, but after doing some tests with the author it looked like
   that plugin was OK and somehow things got messed by that one option of Autoptimize.
 * In about 12 hours the test site will become the main one, so I hope you will 
   be able to see it before I migrate 🙂
 * Thank you so much for your great and awesome plugin and fantastic support!
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108500)
 * css optimization is not working at all it seems; there’s a autoptimize_xyz.css
   file, but it isn’t working (getting “Permanently gone”) and there are a lot of
   css-files still referenced in your HTML. something seems badly broken really.
   is “optimize CSS” on now?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108526)
 * installed twenty fourteen (which is your base theme, correct) and tested on my
   PHP7-machine; all works as expected Grzegorz. only difference; I’m on the to-
   be 2.0.1, so as a last resort maybe try that one on your blog instead of 2.0.0
   by [downloading the zip-file from GitHub](https://github.com/futtta/autoptimize/archive/master.zip)
   and overwrite your /autoptimize/ folder with the contents of that?
 * frank
 *  Thread Starter [Grzegorz.Janoszka](https://wordpress.org/support/users/grzegorzjanoszka/)
 * (@grzegorzjanoszka)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108532)
 * OK, I think I know where the problem might be. I moved the whole site using instructions
   on WP site. I used the option to add to wp-config following lines:
 * define(‘WP_HOME’,’http:// test .paleosmak.pl’);
    define(‘WP_SITEURL’,’http://
   test .paleosmak.pl’); define(‘RELOCATE’,true);
 * (agains spaced added to fool bots). But autoptimize creates links to css files
   on [http://paleosmak.pl](http://paleosmak.pl) – without test.
 * So actually the problem is not with PHP7, but with migration. In the DB I have
   original name of the site, I just temporarily forced it using the variables in
   wp-config.php.
 * I think it is something you could take a look at. The links should go to the 
   current server, not the other one.
 * Once I migrate everything and remove the forced hostnames I will write here what
   the result will be.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108540)
 * hmmm, I think the real problem is that your wp-content-url (which AO uses) still
   points to the non-test URL, not only for AO but for all resources, cfr. e.g. 
   this image
 *     ```
       <img src="http://paleosmak.pl/wp-content/uploads/2014/04/paleo-smak-header.jpg">
       ```
   
 * to fix this you will also need to add something like this to you wp-config;
 *     ```
       define( 'WP_CONTENT_URL', 'http://example/blog/wp-content' );
       ```
   
 * frank
 *  Thread Starter [Grzegorz.Janoszka](https://wordpress.org/support/users/grzegorzjanoszka/)
 * (@grzegorzjanoszka)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108549)
 * Frank, I followed: [https://codex.wordpress.org/Changing_The_Site_URL](https://codex.wordpress.org/Changing_The_Site_URL)
   
   It doesn’t say anything about WP_CONTENT_URL. Do you think the above page is 
   not complete? Not sure what can be done to help other people in the future in
   case of similar issue.
 * And one more thing – I moved the site and everything is fine, even with ‘also
   aggregate inline CSS’, so actually your plugin works perfectly fine with PHP7
   🙂 The problem was caused by missing CSS as the URL’s referred to the ‘old’ site.
 * By the way – what is your view on aggregating inline CSS? Is it worth it if it
   is not too much?
 * Thank you for all your help.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108551)
 * > It doesn’t say anything about WP_CONTENT_URL.
   >  Do you think the above page 
   > is not complete?
 * given that not only the AO-files, but also images still pointed to your non-test
   domain, that at least for your context the above page was not complete indeed.
   but _normally_ wp-content-url is (should be) derived from wp-siteurl if I’m not
   mistaking so …
 * > […] so actually your plugin works perfectly fine with PHP7 […] so actually 
   > your plugin works perfectly fine with PHP7 🙂
 * great news, big relief actually 🙂
 * > what is your view on aggregating inline CSS? Is it worth it if it is not too
   > much?
 * it’s clearly less important then “aggregate inline JS”, as inline JS can be render
   blocking, while inline CSS (as far as I know) not. so it probably is not terribly
   important 🙂
 * frank

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘PHP7: Some CSS options broken’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [PHP7](https://wordpress.org/support/topic-tag/php7/)

 * 10 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/php7-some-css-options-broken/#post-7108551)
 * Status: resolved