statify icon indicating copy to clipboard operation
statify copied to clipboard

Adding a possibility to not delete old data

Open 2ndkauboy opened this issue 2 years ago • 3 comments

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 avatar Mar 18 '23 14:03 2ndkauboy

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

2ndkauboy avatar Mar 18 '23 14:03 2ndkauboy

I like the idea and proposed UI implementation

florianbrinkmann avatar Mar 18 '23 14:03 florianbrinkmann

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

stklcode avatar Mar 18 '23 15:03 stklcode