custom-post-type-ui icon indicating copy to clipboard operation
custom-post-type-ui copied to clipboard

Backup/Undo/Recovery options.

Open tw2113 opened this issue 9 years ago • 2 comments

Combining many thoughts into one ticket that we can flesh out into individual tickets later if needed.

Eliminates #425, #508, #506.

"Backup/Recovery" tab in Tools section.

In this tab, we will present all the relevant settings, outlined below.

  • Checkbox whether to backup at all. (Need to decide on default).
  • Type of backup:
    • Database
    • File
  • Location for file backup. (Default wp-content/uploads).
  • Delete db options/backups on uninstall (Default unchecked).

Indicate backups would be "run" on every save.

File backup.

Utilize idea located at http://docs.pluginize.com/article/84-save-cptui-settings-data-to-file

If backups enabled, run fetch/file_put on both before and after hooks. This provides a before save version, and after save version. Saves in saved location.

Provide indication of "before" or "after" in file name used.

Separate out between post types and taxonomies

Database backup.

Utilize idea located at http://docs.pluginize.com/article/84-save-cptui-settings-data-to-file except save to new options.

If backups enabled, save to new options on both before/after hooks. This provides a before save version and after save version. Name option key appropriately based on "before" or "after".

Separate out between post types and taxonomies

Undo functionality.

If backups enabled, offer "restore previous settings" option on associated Import/Export pages. Indicate that it'd restore version of all post type/taxonomy options from before last save.

Popup confirmation

Once confirmed, fetch from "before" version of saved location(db or file), import as appropriate.

Delete upon uninstall

Add to uinstall process from WP core. Check for our confirmation to delete. If yes, delete ALL related OPTIONS. Still leave content.

tw2113 avatar Aug 21 '16 01:08 tw2113

Alternative ideas from discussion:

Hidden post type for saving backup version and versioning of settings backups.

Opens possibility to navigate back many versions of settings for post types or taxonomy settings

Potential file saving caveats

Janky/wonky file permissions that cause headache for support team.

Add test to see if we can write to location, admin notice if not.

tw2113 avatar Aug 22 '16 15:08 tw2113

There is potential that this one could be considered handled with our planned local JSON data in #891, however it may not cover EVERYTHING.

Going to leave this open for the moment, and re-evaluate what remains after that.

tw2113 avatar Sep 23 '22 15:09 tw2113