- command "/opt/wp-cli/wp --path=#{site_directory} plugin deactivate #{new_resource.plugin}"
- user node[:wordpress][:user]
- group node[:wordpress][:group]
- only_if { ::File.exist?("#{site_directory}/wp-config.php") }
+ command "/opt/wp-cli/wp --path='#{site_directory}' plugin deactivate '#{new_resource.plugin}'"
+ user "www-data"
+ group "www-data"
+ only_if "/opt/wp-cli/wp --path='#{site_directory}' plugin is-active '#{new_resource.plugin}'"