Fixed warnings when composer.json is not writable.
Identify and define WP_ROOT_DIR constant.