I see that some plugins like Wordfence can write on core folders like wp-includes
or wp-admin
(if write permission is enable). In case everything is permitted, is there a way to interact with the hosting from admin dashboard only? Assuming this is on the site installation folder only.
See also:
• Is there a way to figure out the way to access hosting if I have admin privilege?
• WordPress file manager plugin that can change file permission? in Software Recommendations
1 Answer
You basically have two options:
- Use any of the available File Manager plugins for WordPress. Just Google them, literally that phrase I just used.
- Implement a custom PHP code in your theme or custom plugin which will utilize any of the PHP functions for manipulating the files. For example, check these:
file_get_contents()
– For reading filesfile_put_contents()
– For writing files. This will also create a new file if it doesn’t exist.unlink()
– For deleting fileschmod()
– For changing permissionschown()
– For changing owner
There are also a ton of functions for more advanced file manipulation in PHP. Check this for reference: Filesystem Functions