gocodebox / lifterlms

LifterLMS, a WordPress LMS Solution: Easily create, sell, and protect engaging online courses.
https://lifterlms.com
GNU General Public License v3.0
181 stars 135 forks source link

Dismissed notices re-appear before they are supposed to #2767

Open brianhogg opened 1 month ago

brianhogg commented 1 month ago

Reproduction Steps

  1. On WPEngine (and likely other) hosting, dismiss the NGINX notice. This should remind in 10000 days.
  2. A few days later, login.

Expected Behavior

Notice does not appear.

Actual Behavior

Notice appears.

This issue has be recreated:

brianhogg commented 1 month ago

Because the delay is set as a transient, I believe the transient is being removed. As per the explanation of transients:

"Everyone seems to misunderstand how transient expiration works, so the long and short of it is: transient expiration times are a maximum time. There is no minimum age. Transients might disappear one second after you set them, or 24 hours, but they will never be around after the expiration time."

Instead we can use options that will not just disappear randomly.

brianhogg commented 1 month ago

As a workaround for the media protection notice, this filter can be added:

add_filter( "llms_admin_notice_using_nginx", "__return_false")