boonebgorges / buddypress-docs

GNU General Public License v3.0
106 stars 44 forks source link

Attachments protection check: Cache results for 24 hours. #660

Closed dcavins closed 3 years ago

dcavins commented 5 years ago

Instead of running the attachments protection check every time a site admin visits the WP Admin area, run it no more often than once every 24 hours. If it hasn't been 24 hours, return the value saved in the bp_docs_attachment_protection option.

dcavins commented 5 years ago

Note that this follows the previous pattern of using the cached value if it is not an empty string. Per out conversation, we talked about adding a "force re-check" link to the admin notice or similar so that the end user could skip the cached version. That still needs to be added.

boonebgorges commented 5 years ago

What you've got here so far looks good.

boonebgorges commented 3 years ago

I had to do some manual cherry-picking to merge this into the 2.2.x branch. Could you check that branch out and make sure that I didn't mess it up? :-D

dcavins commented 3 years ago

Thanks, Boone! The commits in the 2.2.x branch look good to me and the code is working in my tests.

Thanks for the quick work!