fix: stop changing runtime error settings and trim unused core includes - #124
Merged
erseco merged 1 commit intoSep 26, 2026
Merged
Conversation
Contributor
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/pot-file-references #124 +/- ##
=================================================================
+ Coverage 95.71% 96.40% +0.69%
- Complexity 0 827 +827
=================================================================
Files 7 36 +29
Lines 1049 4228 +3179
=================================================================
+ Hits 1004 4076 +3072
- Misses 45 152 +107
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Sep 26, 2026
erseco
force-pushed
the
feature/wporg-review-runtime-config
branch
from
September 26, 2026 10:13
d40db3b to
6d8930e
Compare
erseco
added this pull request to stack #151
September 26, 2026 10:50
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
force-pushed
the
feature/wporg-review-runtime-config
branch
from
September 26, 2026 10:50
6d8930e to
3a77417
Compare
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 #148, which stops code-only changes from rewriting the translation catalogs. This PR therefore touches no files under
languages/.WordPress.org review findings addressed:
Runtime error settings
The standalone editor page called
ini_set( 'display_errors', '0' )twice anderror_reporting( 0 ), which changed the site's PHP configuration for that request. The page already starts an output buffer, andsend_and_exit()discards everything printed before the editor document, so the buffer alone keeps the first byte clean. The three calls and theirphpcs:ignores are removed.EditorPageTestnow asserts thaterror_reporting()anddisplay_errorsare unchanged after the editor boots. Before, the test restored them.Core admin includes
REST_API::create_elp_file()loadedwp-admin/includes/media.phpandimage.phpbut used no function from either. Both are removed.wp-admin/includes/file.phpstays in both REST handlers (/createand/save/{id}), becausewp_handle_upload()is not loaded in REST requests. Eachrequire_oncenow sits immediately before itswp_handle_upload()call.admin/class-admin-upload.php) that the review also cited was removed as dead code in Remove unreachable scaffolding and clean options on uninstall #142.get_current_screen(),submit_button(),add_meta_box()) only run on admin screens where core has already loaded them.Verification
PHPUnit:
OK (911 tests). PHPCS clean. Noerror_reporting,display_errorsorini_setremains in plugin PHP.