Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a possibility to not delete old data #244

Open
2ndkauboy opened this issue Mar 18, 2023 · 3 comments
Open

Adding a possibility to not delete old data #244

2ndkauboy opened this issue Mar 18, 2023 · 3 comments

Comments

@2ndkauboy
Copy link
Member

Currently, there is an option to set the number of days of data to keep. This option value will always be used to delete old data. There is no way to not delete data. The cron doesn't even check if the setting is valid at all.

I'd like to see an option that would enable someone to not have Statify delete data. This could be done by settings the value to something like 0. Or we use a "toggle" to activate/deactivete deletion in general and only then check the numeric value for the actual deletion.

@2ndkauboy
Copy link
Member Author

The UI could be similar to something we have in ASB 3.0:
image

@florianbrinkmann
Copy link
Member

I like the idea and proposed UI implementation

@stklcode
Copy link
Contributor

stklcode commented Mar 18, 2023

The cron doesn't even check if the setting is valid at all.

I'd consider this a minor flaw.

We do sanitize the options during update and only accept numeric values greater than zero:

https://github.com/pluginkollektiv/statify/blob/develop/inc/class-statify-settings.php#L301-L306

But a quick sanity check before executing the deletion statement would definitely make sense.

Or we use a "toggle" to activate/deactivate deletion in general [...]

Think I'd prefer this approach. Just add an "keep infinite" checkbox next to the numeric value for convenience (0, -1 or similar works, too, but not very convenient)

Like this:
statify_data_infinite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants