Files automatically added
Those are Geo IP databases which tie IP addresses to countries. They probably came from some e-commerce plugin, or a cookie-law plugin, or some other country-specific tool.
Those are Geo IP databases which tie IP addresses to countries. They probably came from some e-commerce plugin, or a cookie-law plugin, or some other country-specific tool.
Yes, you can safely delete that file. It’s a template of what a minimal wp-config.php looks like, so as soon as you have a working wp-config, you don’t need it. It will never be restored unless you reinstall WordPress from scratch, e.g. by downloading and unpacking a clean WordPress installation. If for some reason you … Read more
You are trying to check it by URL, which makes no sense to is_file() which expects local path. By the way I’d use file_exists() instead. Try: $fileName1 = TEMPLATEPATH . ‘/txtfolder/file1.txt’;
I have used symbolic links for convenience for awhile on a dev server but they are not 100% reliable as some PHP functions will return the filesystem path of the target instead of the path to the symlink itself. The most notable example (though not really a function) is the magic constant __FILE__. (Also https://bugs.php.net/bug.php?id=46260) … Read more
The get_contents function returns the contents of the file, not a file handle. Using put_contents with $f after that is incorrect. Try $wp_filesystem->put_contents( $htaccess_file, $htaccessnew, FS_CHMOD_FILE ) instead. Also, it’s not necessarily safe to use things like “get_home_path” and such with the WP_Filesystem. The remote path may not match the local path. You’ll need to … Read more
Allowing file types outside of WP’s defaults exposes your site to some security risks, and some hosts don’t allow certain filetypes. If your host allows these filetypes, you can use the following function in a plugin or a child theme: function wpse_file_uploads($mime_types){ // photoshop $mime_types[‘psd’] = ‘image/vnd.adobe.photoshop’; // illustrator $mime_types[‘ai’] = ‘application/postscript’; // indesign $mime_types[‘indd’] … Read more
File system access is tricky thing between different possible server configurations. If you need to implement it reliably in WP you should look into its API for such. See Using the WP_Filesystem.
Relative paths in CSS are relative to the stylesheet file. So if you have this structure: – style.css – images/ — logo.png — background.jpg Then the paths in CSS for the images would be url(images/logo.png) and url(images/background.jpg). This is because the relative paths in CSS are relative to the stylesheet itself, not the main domain … Read more
SELinux was the problem. Its enforcement was, for lack of a better term, overriding the file permissions and keeping WordPress from writing to any of the files. To solve the issue, I did the following: Check if SELinux is enabled: # getenforce If the response is “Enforcing”, then SELinux is enabled and it is probably … Read more
Securing a multi-user permission structure