Opened 2 years ago
Last modified 16 months ago
#56301 assigned feature request
Add File Backup Feature in wp_edit_theme_plugin_file()
Reported by: | sajjad67 | Owned by: | sajjad67 |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Filesystem API | Keywords: | 2nd-opinion |
Focuses: | Cc: |
Description
I thought about the security before creating this ticket, but still let's discuss about the possibility of it for once! The way it works now is if you edit a file using the plugin/theme-editor.php, there's no way of going back! It only checks for any Fatal Error!
Now what i think, would it be good/bad if we add a feature to create a (temp) backup of each file edited, like we do for posts/pages as revisions! There's lots to take into consideration before we discuss about it, i know! But is there anyone else thinking like me this could be a feature!!
Let me know if it's open for any further discussion!
Attachments (2)
Change History (7)
#2
@
2 years ago
- Keywords 2nd-opinion added
- Version 6.0 deleted
Hello, welcome back to Trac and thank you for the proposal!
I think this project should ideally be proposed in a Feature Plugin, so it could get a blogpost on Make/Core to introduce the feature, to help contributors testing it live on a website, to make sure it's relevant and to discuss whether it's something worth adding in Core or if it is plugins territory.
Looking at wp_edit_theme_plugin_file()
I'm thinking we could at least add some hook to help building this Feature Plugin.
#3
@
2 years ago
@audrasjb I am not sure how to propose that in a Feature Plugin... Never done that! But a hook is best option in the function with filename, previous_content, new_content params.
LMK how we can go ahead with that!
#4
@
2 years ago
In the action hook, there's possible to add some more params, such as $plugin, $theme whether it is a plugin or theme being edited! as conditionally it theme being edited $plugin value is set to null, same goes for $theme variable.
@SergeyBiryukov @audrasjb @ipstenu LMK your thoughts!! Thanks!