If I would apply this filter as you wrote, wouldn’t this affect all WordPress plug-ins?

If that’s the case, this obviously would not be a very good idea, because maybe some plug-ins really need this for security reasons.

But I absolutely don’t see why this public preview link needs to expire as I
1. explicitly enable the link (and I can disable it again at any time) and
2. this is not a public link, but I only send it to few people directly (that should review my post) and I want it to be active till I disable it again or I just publish my post.

Therefore there is no need for automatic expiration – at least there should be an option to disable it.

Anyway, I still think a simple checkbox on a plug-in option page would be much better and easier to use.

Additionally I would suggest to warn the user that this link will expire by default: as I never would have thought that this preview link expires (as it makes no sense in my opinion), I was very surprised when I got a complaint from my reviewer that the link I sent to him one day before did not work anymore…

I have to say I also agree that some expiration choices in the GUI would be highly preferrable. A drop down that defaults to 24hrs but also offers 1week, 1month, 1year and never would be ideal to me. Followed below by a date showing me when the link will or did expire.

It’s the idea that a check box is enabled but my link has actually expired (and there’s no indication of when it expired or whether it’s still valid) that’s a very confusing user experience for me. “Preview Link” is “enabled” but it may not be valid – that’s just counterintuitive for me.

I personally will use the plugin not to expire the previews (so I’ve applied the filter). But it would be nice to be able to decide on a post by post basis.

That being said, I do understand that most will appreciate the security of an expiring link. 24hrs is pretty short though. I don’t feel I can depend on people to respond that quickly. So I made mine non-expiring and I added a column in my tables to show me where I had enabled links so that I could disable them when I was done — now that I think of it, I haven’t tested if that does invalidate the link. I’ll have to check.