When To Use The Preferred Temporary Directory Option

Shield needs a directory on your webhost disk in order to store some temporary, working data, that shouldn't be stored in the database.

Normally, like most plugins, Shield will try to create a directory within /wp-content/  or /wp-content/uploads/  and it's successful 99.9% of the time.

However, some webhosts can restrict the ability to read and write to disk in these locations. They may also use the open_basedir  directive, which entirely prevents Shield from finding a location it can use,

To assist Shield in these scenarios, the option to specify a temporary directory lets you tell Shield where it should start in its search for a writable directory. If your hosting is using open_basedir  directive, you may need to contact your host to ask them for a location that Shield can use.

The path you provide must be a fully resolvable path (not a relative path) to a directory that exists, and is writable by WordPress.

Within the Dashboard section > click to edit general plugin settings (gear icon) > select Plugin Defaults tab. Here, we've provided your ABSPATH  as a reference - in all likelihood, your temporary directory will be beneath your ABSPATH  .

Access to Temp Dir option

When To Use This Option

Only use this option if you are experiencing PHP warnings that indicate Shield cannot write to certain directory. One such warning might look like:

Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/usr/share/php:/usr/share/pear) in //httpdocs/wp-content/plugins/wp-simple-firewall/src/lib/vendor/fernleafsystems/wordpress-services/src/Core/Fs.php on line 466