thanks for your feedback aaanadie.
some questions;
- did you clear the autoptimize cache (all files in wp-content/cache/autoptimize/) before trying 1.6.1 (to avoid seeing the corrupt 1.6.0 output)?
- do you know if the problem was with CSS or JS or both (toggling options in admin-page)?
- do you have a (development or test-)site where I could see the problem?
- what is the URL to your live site (if you don’t want that to be public, you can mail me at futtta-at-gmail-dot-com)?
– Yes, cache cleared (in Autoptimize, Supercache & Cloudflare, several times).
– Tried disable/enable every option & cleared caches.
– Site URL:
1energy1.com
I suspect the problem is with the new version of the getpath-function in wp-content/plugins/autoptimize/classes/autoptimizeBase.php. Could you open that and replace the protected function getpath($url) with this piece of (1.5.1) code?
protected function getpath($url)
{
$path = str_replace(get_settings('home'),'',$url);
if(preg_match('#^(https?|ftp)://#i',$path))
{
//External script (adsense, etc)
return false;
}
$path = str_replace('//','/',ABSPATH.$path);
return $path;
}
If this indeed fixes things, I’ll create 1.6.2 to revert back to the 1.5.1 getpath-function.
Looking forward to your feedback!
Didn’t work. I updated to 1.6.1, then copied/pasted getpath function, then cleared caches, same result.
This is the new “wp-content/plugins/autoptimize/classes/autoptimizeBase.php” (1.6.1):
*******
<?php
abstract class autoptimizeBase
{
protected $content = ”;
public function __construct($content)
{
$this->content = $content;
//Best place to catch errors
}
//Reads the page and collects tags
abstract public function read($justhead);
//Joins and optimizes collected things
abstract public function minify();
//Caches the things
abstract public function cache();
//Returns the content
abstract public function getcontent();
//Converts an URL to a full path
protected function getpath($url)
{
$path = str_replace(get_settings(‘home’),”,$url);
if(preg_match(‘#^(https?|ftp)://#i’,$path))
{
//External script (adsense, etc)
return false;
}
$path = str_replace(‘//’,’/’,ABSPATH.$path);
return $path;
}
// coz I’m a crappy developer and I need easy access to whatever I want to log
protected function ao_logger($logmsg) {
$logfile=WP_CONTENT_DIR.’/ao_log.txt’;
$logmsg.=”\n”;
file_put_contents($logfile,$logmsg,FILE_APPEND);
}
}
Hmm, still looking into this. Another user said JS-optimization still worked, only CSS-optimization was broken. Can you check/ confirm with CSS-optimization disabled and JS-optimization enabled?
additional question: are you on a WordPress multi-site setup aaanadie?
Yes, I have Word Press multisite 3.5.1, but I enabled this plugin only for the main site.
OK. Can you also check with CSS-optimization disabled and JS-optimization enabled? Based on info from another user, that could work.
And what webserver are you running, Apache or something else?
Update: of the 4 people I’ve been mailing with who had issues with the update, at least 2 were not running on an Apache server.
In config/delayed.php however I thoughtlessly used a PHP-function which is only available in Apache (apache_request_headers), so that indeed had to break on e.g. Lighttpd, Ngnix and MS IIS.
If you indeed aren’t on Apache either, I pushed out a new version, 1.6.2, which could (should, but I’m being very careful here) solve your Autoptimizing problems as well!
Disabling CSS-optimization works, but gets low PageSpeed & YSlow than old version.
Server:
Apache version 2.2.23
PHP version 5.2.17
MySQL version 5.5.30-cll
Architecture x86_64
Operating system linux
Perl version 5.8.8
Kernel version 2.6.18-408.8.2
Working Perfect Everything for 1.6.2 !!!
Updated to 1.6.2, then enabled again CSS-optimization, cleared all caches, checked everything several times, no errors found and PageSeed=92, YSlow=98.
Thanks