Skip to content

Move recursive_delete to ExeLearning_Filesystem and say .elpx in docblocks - #146

Merged
erseco merged 1 commit into
mainfrom
feature/filesystem-helper
Sep 26, 2026
Merged

erseco merged 1 commit into
mainfrom
feature/filesystem-helper

Conversation

@erseco

@erseco erseco commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

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.

Comments in line with the code

  • Docblocks in the file service, upload handler, upload block and editor said .elp, although only .elpx packages are accepted.
  • Dropped a boilerplate "optionally unlink the original .elp" note.
  • Fixed a REST docblock that still compared against the removed cleanup_old_extraction().
  • The translatable "eXeLearning v2 source file (.elp)" message is left as is. It describes the legacy format, and changing it would require new translations.

No behavior change.

Verification

  • PHPUnit: OK (911 tests). npm run test:js: 245 passed.
  • PHPCS clean. Translation catalogs unchanged.

…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().
@github-actions

Copy link
Copy Markdown
Contributor

Test in WordPress Playground

Test the plugin with the code from this branch:

Preview in WordPress Playground

ℹ️ The eXeLearning editor is fetched from the shared release and unpacked into the plugin when the playground boots, so the first load may take a few extra seconds. ELP upload, shortcode, Gutenberg block and preview work normally.

@codecov-commenter

codecov-commenter commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.40%. Comparing base (cc94167) to head (b08594a).

Files with missing lines Patch % Lines
includes/class-filesystem.php 91.66% 1 Missing ⚠️
includes/class-styles-service.php 66.66% 1 Missing ⚠️
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           
Flag Coverage Δ
javascript 95.71% <ø> (ø)
php 96.63% <88.88%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
exelearning.php 0.00% <ø> (ø)
includes/class-elp-file-service.php 97.23% <ø> (ø)
includes/class-elp-reprocessor.php 99.36% <100.00%> (ø)
includes/class-elp-upload-block.php 100.00% <ø> (ø)
includes/class-elp-upload-handler.php 100.00% <100.00%> (ø)
includes/class-exelearning-editor.php 93.37% <ø> (ø)
includes/class-exelearning-rest-api.php 99.71% <ø> (ø)
includes/integrations/class-media-library.php 100.00% <ø> (ø)
includes/class-filesystem.php 91.66% <91.66%> (ø)
includes/class-styles-service.php 96.58% <66.66%> (+0.23%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erseco
erseco merged commit 25b98a0 into main Sep 26, 2026
5 checks passed
@erseco
erseco deleted the feature/filesystem-helper branch September 26, 2026 09:03
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.

2 participants