mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-16 10:34:26 +00:00
File Editors: Introduce sandboxed live editing of PHP files with rollbacks for both themes and plugins.
* Edits to active plugins which cause PHP fatal errors will no longer auto-deactivate the plugin. Supersedes #39766. * Introduce sandboxed PHP file edits for active themes, preventing accidental whitescreening of a user's site when introducing a fatal error. * After writing a change to a PHP file for an active theme or plugin, perform loopback requests on the file editor admin screens and the homepage to check for fatal errors. If a fatal error is encountered, roll back the edited file and display the error to the user to fix and try again. * Introduce a secure way to scrape PHP fatal errors from a site via `wp_start_scraping_edited_file_errors()` and `wp_finalize_scraping_edited_file_errors()`. * Moves file modifications from `theme-editor.php` and `plugin-editor.php` to common `wp_edit_theme_plugin_file()` function. * Refactor themes and plugin editors to submit file changes via Ajax instead of doing full page refreshes when JS is available. * Use `get` method for theme/plugin dropdowns. * Improve styling of plugin editors, including width of plugin/theme dropdowns. * Improve notices API for theme/plugin editor JS component. * Strip common base directory from plugin file list. See #24048. * Factor out functions to list editable file types in `wp_get_theme_file_editable_extensions()` and `wp_get_plugin_file_editable_extensions()`. * Scroll to line in editor that has linting error when attempting to save. See #41886. * Add checkbox to dismiss lint errors to proceed with saving. See #41887. * Only style the Update File button as disabled instead of actually disabling it for accessibility reasons. * Ensure that value from CodeMirror is used instead of `textarea` when CodeMirror is present. * Add "Are you sure?" check when leaving editor when there are unsaved changes. Supersedes [41560]. See #39766, #24048, #41886. Props westonruter, Clorith, melchoyce, johnbillion, jjj, jdgrimes, azaozz. Fixes #21622, #41887. git-svn-id: https://develop.svn.wordpress.org/trunk@41721 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2217,14 +2217,16 @@ h1.nav-tab-wrapper, /* Back-compat for pre-4.4 */
|
||||
#template > div {
|
||||
margin-right: 190px;
|
||||
}
|
||||
#template .active-plugin-edit-warning {
|
||||
#template .notice {
|
||||
margin-top: 1em;
|
||||
margin-right: 30%;
|
||||
margin-right: calc( 184px + 3% );
|
||||
margin-right: 3%;
|
||||
}
|
||||
#template .active-plugin-edit-warning p {
|
||||
#template .notice p {
|
||||
width: auto;
|
||||
}
|
||||
#template .submit .spinner {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.metabox-holder .stuffbox > h3, /* Back-compat for pre-4.4 */
|
||||
.metabox-holder .postbox > h3, /* Back-compat for pre-4.4 */
|
||||
@@ -3032,10 +3034,14 @@ img {
|
||||
#template textarea,
|
||||
#template .CodeMirror {
|
||||
width: 97%;
|
||||
height: calc( 100vh - 220px );
|
||||
height: calc( 100vh - 280px );
|
||||
}
|
||||
#templateside {
|
||||
margin-top: 31px;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
#template label {
|
||||
#theme-plugin-editor-label {
|
||||
display: inline-block;
|
||||
margin-bottom: 1em;
|
||||
font-weight: 600;
|
||||
@@ -3047,6 +3053,14 @@ img {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.fileedit-sub #theme,
|
||||
.fileedit-sub #plugin {
|
||||
max-width: 40%;
|
||||
}
|
||||
.fileedit-sub .alignright {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#template p {
|
||||
width: 97%;
|
||||
}
|
||||
@@ -3624,7 +3638,7 @@ img {
|
||||
}
|
||||
|
||||
#template > div,
|
||||
#template .active-plugin-edit-warning {
|
||||
#template .notice {
|
||||
float: none;
|
||||
margin: 1em 0;
|
||||
width: auto;
|
||||
|
||||
Reference in New Issue
Block a user