Add optional setting to use system temp directory for H5P temporary files#204
Open
Lin87 wants to merge 1 commit intoh5p:masterfrom
Open
Add optional setting to use system temp directory for H5P temporary files#204Lin87 wants to merge 1 commit intoh5p:masterfrom
Lin87 wants to merge 1 commit intoh5p:masterfrom
Conversation
Introduces a new admin setting allowing users to store temporary files in the server's system temp folder instead of the plugin directory. Updates settings UI, option handling, and file path logic to support this feature, improving performance on resource-limited servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
This pull request introduces an optional admin setting that allows H5P to store temporary/working files in the server’s system temporary directory (via PHP's sys_get_temp_dir() function) instead of the H5P plugin directory.
Background
In our environment, WordPress content is stored on AWS Elastic File System (EFS). While EFS works well for persistent content, it performs poorly when handling large numbers of small, frequently changing files—such as those created during H5P uploads and processing.
By using the server's system temp directory for these temporary files, we've observed:
This aligns with common best practices of using local system temp storage for short-lived working files.
What This PR Does
Backward Compatibility & Safety
This pull request is based on the earlier work from PR #130, originally submitted several years ago. That PR was created by my colleague and did not receive any follow-up, so this submission reintroduces the feature with minor updates to align with the current H5P codebase.
Thank you for considering this improvement. I'm happy to adjust the implementation or documentation if needed.