Remove unreachable scaffolding and clean options on uninstall - #142
Merged
Merged
Conversation
Contributor
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
This was referenced Sep 26, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/extraction-helpers #142 +/- ##
================================================================
- Coverage 96.86% 96.40% -0.46%
+ Complexity 855 827 -28
================================================================
Files 39 35 -4
Lines 4308 4233 -75
================================================================
- Hits 4173 4081 -92
- Misses 135 152 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
erseco
force-pushed
the
feature/remove-dead-code
branch
from
September 26, 2026 07:20
68f2c38 to
a4d55d2
Compare
erseco
added this pull request to stack #144
September 26, 2026 07:38
erseco
force-pushed
the
feature/remove-dead-code
branch
from
September 26, 2026 07:43
a4d55d2 to
56c793b
Compare
erseco
force-pushed
the
feature/remove-dead-code
branch
from
September 26, 2026 08:01
56c793b to
2cd6a18
Compare
Delete code that no request can reach or that does nothing: - ExeLearning_Admin_Upload: an admin_post handler for a form that is never rendered, so its nonce is never issued. - ExeLearning_Filters: wrote the literal 'elp file metadata' into every .elpx attachment's metadata (and REST media_details); nothing reads it, and on a REST-created attachment with no metadata it triggered PHP 8.1+'s false to array deprecation. - ExeLearning_Hooks, ExeLearning_Post_Types and ExeLearning::run() / load_dependencies(): empty boilerplate, two of them still hooked on init. - ExeLearning_Elp_List_Table: a list table with hard-coded sample rows that is never instantiated. - REST_API::cleanup_old_extraction() and its private recursive delete, only reached through reflection in tests. uninstall.php now deletes the plugin's five options, on every site of a network. Uploaded packages, their extractions and uploaded styles are user content and stay.
get_sites() returns at most 100 sites unless number is set, so networks with more sites kept the plugin's options on the rest. Ask for all of them.
erseco
force-pushed
the
feature/remove-dead-code
branch
from
September 26, 2026 08:29
2cd6a18 to
f5cd2ff
Compare
erseco
added a commit
that referenced
this pull request
Sep 26, 2026
The standalone editor page called ini_set( 'display_errors', '0' ) twice and error_reporting( 0 ), changing the site's PHP runtime configuration. The output buffer it already starts is enough: send_and_exit() discards anything printed before the document, so the three calls are removed and a test now asserts the settings are left untouched. REST create loaded wp-admin/includes/media.php and image.php without using any function from them; they are dropped. wp-admin/includes/file.php stays in both REST handlers, because wp_handle_upload() is not loaded in REST requests, and is now required immediately before that call. The admin-post upload handler the review also cited was removed in #142.
erseco
added a commit
that referenced
this pull request
Sep 26, 2026
The standalone editor page called ini_set( 'display_errors', '0' ) twice and error_reporting( 0 ), changing the site's PHP runtime configuration. The output buffer it already starts is enough: send_and_exit() discards anything printed before the document, so the three calls are removed and a test now asserts the settings are left untouched. REST create loaded wp-admin/includes/media.php and image.php without using any function from them; they are dropped. wp-admin/includes/file.php stays in both REST handlers, because wp_handle_upload() is not loaded in REST requests, and is now required immediately before that call. The admin-post upload handler the review also cited was removed in #142.
erseco
added a commit
that referenced
this pull request
Sep 26, 2026
…es (#124) The standalone editor page called ini_set( 'display_errors', '0' ) twice and error_reporting( 0 ), changing the site's PHP runtime configuration. The output buffer it already starts is enough: send_and_exit() discards anything printed before the document, so the three calls are removed and a test now asserts the settings are left untouched. REST create loaded wp-admin/includes/media.php and image.php without using any function from them; they are dropped. wp-admin/includes/file.php stays in both REST handlers, because wp_handle_upload() is not loaded in REST requests, and is now required immediately before that call. The admin-post upload handler the review also cited was removed in #142.
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.
Stacked on #141.
Remove unreachable scaffolding
ExeLearning_Admin_Upload: anadmin_post_exelearning_uploadhandler for a form that is never rendered, so its nonce is never issued.ExeLearning_Filters: wrote the literal'elp file metadata'into every.elpxattachment's metadata, which also surfaces in RESTmedia_details. Nothing reads it. On REST-created attachments, which have no metadata, it triggered PHP 8.1+'s false-to-array deprecation.ExeLearning_Hooks,ExeLearning_Post_Types(both still hooked oninit),ExeLearning::run()andload_dependencies().ExeLearning_Elp_List_Table: hard-coded sample rows, never instantiated.REST_API::cleanup_old_extraction()and its private recursive delete, reachable only through reflection in tests.Uninstall
uninstall.phpdeletes the plugin's five options (exelearning_db_version,exelearning_proxy_assets,exelearning_styles_registry,exelearning_styles_block_import,exelearning_disabled_styles), on every site of a network. It passesnumber => 0toget_sites(), becauseWP_Site_Queryotherwise stops at 100 sites. Uploaded packages, their extractions and uploaded styles are user content and are kept.Verification
OK (910 tests), with a newUninstallTest.composer make-translations: only obsolete strings removed, no untranslated msgids.