Title: How does WP Precheck for PHP Errors in Code Editors
Last modified: June 18, 2020

---

# How does WP Precheck for PHP Errors in Code Editors

 *  Resolved [ohildner](https://wordpress.org/support/users/ohildner/)
 * (@ohildner)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/how-does-wp-precheck-for-php-errors-in-code-editors/)
 * Hi, I’m trying to write a plugin where it is possible to write PHP-Code (eg. 
   Shortcodes) in the Admin-Area.
    I was wondering how WordPress prechecks the Code
   in the Theme and Plugin Editor and doesn’t save the file if it would create an
   error. I’d like to use that too.
 * I already read through ‘wp-includes/error-protection.php’ and the ‘WP_Error Class’
   but I’m totally not sure if I’m on the right track here.
    -  This topic was modified 5 years, 11 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/how-does-wp-precheck-for-php-errors-in-code-editors/#post-13005417)
 * No, that is not the right code to look at.
    The file editors use CodeMirror to
   show the errors as the file is edited, but during the save process, a loopback
   mechanism is used to load WP with the changes to see if an error is thrown. If
   it is, the original file is put back. The same loopback is used in some of the
   Site Health checks.
 *  Thread Starter [ohildner](https://wordpress.org/support/users/ohildner/)
 * (@ohildner)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/how-does-wp-precheck-for-php-errors-in-code-editors/#post-13015176)
 * Thank you for your answer.
 * Do you know where the code is located?
 * Or do you have an idea how to use this method to check custom files as I described?
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/how-does-wp-precheck-for-php-errors-in-code-editors/#post-13015781)
 * How about [https://developer.wordpress.org/?s=loopback](https://developer.wordpress.org/?s=loopback)
 *  Thread Starter [ohildner](https://wordpress.org/support/users/ohildner/)
 * (@ohildner)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/how-does-wp-precheck-for-php-errors-in-code-editors/#post-13017873)
 * Thank you. I’ll check on that.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How does WP Precheck for PHP Errors in Code Editors’ is closed to new
replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [ohildner](https://wordpress.org/support/users/ohildner/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/how-does-wp-precheck-for-php-errors-in-code-editors/#post-13017873)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
