Move recursive_delete to ExeLearning_Filesystem and say .elpx in docblocks - #146
Merged
Merged
Conversation
…locks Since #141 the upload handler, the reprocessor and most tests deleted extraction folders through ExeLearning_Styles_Service::recursive_delete(), which made shared filesystem cleanup look like a styles concern. Move it, unchanged, to a small ExeLearning_Filesystem class and update every caller; its two tests move to FilesystemTest. Also bring comments in line with the code: file-service, upload-handler, upload-block and editor docblocks said .elp although only .elpx packages are accepted; drop a boilerplate 'optionally unlink the original' note; and fix a REST docblock that still compared against the removed cleanup_old_extraction().
Contributor
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #146 +/- ##
=========================================
Coverage 96.40% 96.40%
Complexity 827 827
=========================================
Files 35 36 +1
Lines 4233 4233
=========================================
Hits 4081 4081
Misses 152 152
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Follow-up to the review of #141 and #143.
Shared filesystem helper
Since #141, the upload handler, the reprocessor and most tests delete extraction folders through
ExeLearning_Styles_Service::recursive_delete(). That made shared filesystem cleanup look like a styles concern.ExeLearning_Filesystemclass (includes/class-filesystem.php). It is loaded right after the core class.includes/and intests/. No alias is kept: none of the open PRs (Opaque-origin published viewer and opt-in opaque editor preview #56, fix: stop changing runtime error settings and trim unused core includes #124, fix: serve embed behavior as an enqueued script instead of inline markup #125, docs: document the external services the bundled editor can reach #126, fix(styles): list built-in styles from theme config.xml files #145) adds new calls to it.StylesServiceTestto a newFilesystemTest.AGENTS.mdlists the class under Bootstrap.Comments in line with the code
.elp, although only.elpxpackages are accepted.cleanup_old_extraction().No behavior change.
Verification
OK (911 tests).npm run test:js: 245 passed.