ConnectThink / WP-SCSS

Wordpress Plugin that compiles sass using scssphp
http://wordpress.org/plugins/wp-scss/
249 stars 76 forks source link

wp_options 165 wpscss_options full path does not update resulting in permissions denied when enviroment copied #220

Closed mikekchristensen closed 2 years ago

mikekchristensen commented 2 years ago

We host at WPEngine and the plugin works fine in the development environment. However, when the environment is copied to staging or production the following error is thrown:

PHP Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::construct(/nas/content/live/dev/wp-content/themes/abc/scss/): failed to open dir: Permission denied in /nas/content/live/stage/wp-content/plugins/wp-scss/class/class-wp-scss.php:199\nStack trace:\n#0 /nas/content/live/stage/wp-content/plugins/wp-scss/class/class-wp-scss.php(199): RecursiveDirectoryIterator->construct('/nas/content/li...')\n#1 /nas/content/live/stage/wp-content/plugins/wp-scss/wp-scss.php(198): Wp_Scss->needs_compiling()\n#2 /nas/content/live/stage/wp-includes/class-wp-hook.php(303): wp_scss_needs_compiling('')\n#3 /nas/content/live/stage/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)\n#4 /nas/content/live/stage/wp-includes/plugin.php(470): WP_Hook->do_action(Array)\n#5 /nas/content/live/stage/wp-settings.php(600): do_action('wp_loaded')\n#6 /nas/content/live/stage/wp-config.php(118): require_once('/nas/content/li...')\n#7 /nas/content/live/stage/wp-load.php in /nas/content/live/stage/wp-content/plugins/wp-scss/class/class-wp-scss.php on line 199

the plugin base location is set to "current theme", however the full path is found in option 165 in wp_options :

a:7:{s:21:"base_compiling_folder";s:55:"/nas/content/live/wp-content/themes/abc";s:8:"scss_dir";s:6:"/scss/";s:7:"css_dir";s:10:"/scss/css/";s:17:"compiling_options";s:10:"compressed";s:17:"sourcemap_options";s:15:"SOURCE_MAP_NONE";s:6:"errors";s:4:"show";s:16:"always_recompile";s:1:"1";}

When the environment is copied, this path then points at a location where the plug cannot write and thus throws the error.

shadoath commented 2 years ago

Take a look at issue #196 and if you can pull down the PR #219 and test it for me.