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

[FIX] Set expiry for site transient #104

Merged
merged 1 commit into from
May 19, 2023
Merged

[FIX] Set expiry for site transient #104

merged 1 commit into from
May 19, 2023

Conversation

jdamner
Copy link

@jdamner jdamner commented May 19, 2023

Change Details

The site transient had no expiry date, which meant that if no file changes were detecetd by scandir($mudir) then the old key would continue to be used.

I have set this to have an expiry of 1 day so that if this does happen eventually new code will be loaded, but with a 1 day expiry the performance impact is minimal.

An example of this happening is that if a file already exists in mu-plugins but doesn't have the appropriate plugin name comment then the file is included in the scandir results, but not loaded by WP because of the missing comment. A later change to add the comment to the file does not prompt the loader to load the file.

Backout Plan

Revert of this commit will restore previous behaviour without impact.

Change Details
------------
The site transient had no expiry date, which meant that if no file changes were detecetd by `scandir($mudir)` then the old key would continue to be used.

I have set this to have an expiry of 1 day so that if this does happen eventually new code will be loaded, but with a 1 day expiry the performance impact is minimal.

An example of this happening is that if a file already exists in `mu-plugins` but doesn't have the appropriate **plugin name** comment then the file is included in the scandir results, but not loaded by WP because of the missing comment. A later change to add the comment to the file does not prompt the loader to load the file.

Backout Plan
-----------
Revert of this commit will restore previous behaviour without impact.
@jdamner jdamner force-pushed the transient-expiration branch from 2dcffc9 to 8f25e01 Compare May 19, 2023 08:41
@Ritchbox
Copy link
Member

This is nice

@jdamner jdamner merged commit e345a7d into master May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants