CSS/JS Minify Path Error with Non-Standard wp-content directory HAS PATCH
-
I had an error in the admin come up – much like this thread, but not the same issue.
Recently an error occurred while creating the CSS / JS minify cache: File "/var/www/vhosts/example.com/html/wp/wp-content/mu-plugins/interest-survey/lib/js/script.js" doesn't exist." doesn't exist.That message is accurate, but not correct. The file doesn’t exist at the path, but the compiled path used is incorrect.
Our webroot is set up like this:
{webroot}/wp == WordPress directory
{webroot}/wp-content == Custom wp-content directoryThe issue arrises that the Minify code is looking for the WordPress site directory in the wp-content path, but without a trailing slash on the site directory. Meaning that it’s getting a false-positive with the directory structure above because the wp-content directory begins with “/wp”.
The patch, found here, uses
trailingslashit()to make sure it’s looking for the site directory, and not just a match by happenstance with theWP_CONTENT_DIR.It’s working well for us now.
The topic ‘CSS/JS Minify Path Error with Non-Standard wp-content directory HAS PATCH’ is closed to new replies.