• honza.skypala

    (@honzaskypala)


    Hi,

    I have moved my blog to new webhosting and encountered that plugin WP Minify is causing troubles. After bit of investigation I have found that it is writing warnings to the beggining of cached CSS and JS files and of course this cause them not to work…

    Warning:  is_file() [function.is-file]: open_basedir restriction in effect. File(/home/www/wp-content/plugins/wp-minify/cache//minify_e03b2626b13f10850a58a589f03a6655) is not within the allowed path(s): (/data/web/virtuals/18342/virtual) in /data/web/virtuals/18342/virtual/www/wp-content/plugins/wp-minify/min/lib/Minify/Cache/File.php on line 71
    Warning:  is_file() [function.is-file]: open_basedir restriction in effect. File(/home/www/wp-content/plugins/wp-minify/cache//minify_e03b2626b13f10850a58a589f03a6655) is not within the allowed path(s): (/data/web/virtuals/18342/virtual) in /data/web/virtuals/18342/virtual/www/wp-content/plugins/wp-minify/min/lib/Minify/Cache/File.php on line 33

    I have changed the is_file() call in both places to not produce warnings and then the plugin works fine. Here is the diff for file /wp-minify/min/lib/Minify/Cache/File.php for the fix:

    33c33
    <         if (is_file($this->_path . '/' . $id)) {
    ---
    >         if (@is_file($this->_path . '/' . $id)) {
    71c71
    <         return (is_file($file) && (filemtime($file) >= $srcMtime));
    ---
    >         return (@is_file($file) && (filemtime($file) >= $srcMtime));

    I understand that the problem is partly caused by security settings on the webhosting provider side, but as this simple fix solved it in the plugin, I suggest that the fix is put into the plugin trunk and used, so it does not cause problems on any webhosting.

    Take care, Honza

  • The topic ‘[Plugin: WP Minify] Suggestion for fix’ is closed to new replies.