wp-minify.php Error – Workaround
I am running WordPress 3.5.2 on Windows II8 with WP Minify 1.2.0
I am getting warnings in my PHP file like the following:
[25-Jun-2013 23:35:26 UTC] PHP Warning: filemtime(): stat failed for \\\\[server]\\[path1]\\[path2]\\Wordpress//wp-content/themes/visual/js/html5.js in \\[server]\[path1]\[path2]\Wordpress\wp-content\plugins\wp-minify\wp-minify.php on line 668
The line in question is:
$mtime = filemtime($path);
I was able to fix it by adding:
$base_path = str_replace('//', '/', $base_path); $base_path = str_replace('\\\\', '\\', $base_path);
$base_path = trailingslashit($_SERVER['DOCUMENT_ROOT']); $base_path .= trailingslashit($this->get_base());
I think there’s two issues here. When the root filesystem is a network share the document root variable returns a weird, invalid path because of the slashes. Second problem is when there is no base (function get_base returns nothing) the trailingshashit function adds another slash when it shouldn’t, breaking the path. So the first fix fixes the base path issue, the second fix fixes the server document variable.
Maybe something like this can get rolled into the next version (so I don’t have to re-inject the code :D)
Thanks for an awesome plugin!
- The topic ‘wp-minify.php Error – Workaround’ is closed to new replies.