It’s been a while but here’s more elegant alternative to conditionally enable/disable CSS and JS files without touching line of code: https://tomasz-dobrzynski.com/wordpress-gonzales