Title: php file becomes corrupt. Code missing from file. Weird!
Last modified: November 5, 2019

---

# php file becomes corrupt. Code missing from file. Weird!

 *  [caneve10](https://wordpress.org/support/users/caneve10/)
 * (@caneve10)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-file-becomes-corrupt-code-missing-from-file-weird/)
 * Hello, a very weird thing happened with a specific file from my wp installation.
 * I was experiencing backend problem with editing products (woocommerce) and editing
   pages…
 * After enabling debug mode, I found out a syntax error in a file called : meta-
   boxes.php.
 * I went inside that file and indeed found the error. To fix it, I downloaded a
   fresh version of wp and replace the old file with the one freshly downloaded.
   That did fix the problem.
 * HOWEVER, before doing that, I compared the two files, the one on my site and 
   the one freshly downloaded… Turns out roughly 500 lines of code were missing 
   from the file on my server…
 * HOW IS THIS POSSIBLE? How can this happen?
 * My concern is that my site was hacked and frankly this is a very unpleasant thought!
 * Anyone has an insight on this?
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-file-becomes-corrupt-code-missing-from-file-weird%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-file-becomes-corrupt-code-missing-from-file-weird/#post-12099372)
 * Old version of WordPress [https://github.com/WordPress/WordPress/blob/3.9-branch/wp-admin/includes/meta-boxes.php](https://github.com/WordPress/WordPress/blob/3.9-branch/wp-admin/includes/meta-boxes.php)
   with 1086 lines
    Always last WordPress 5.2 [https://github.com/WordPress/WordPress/blob/5.2-branch/wp-admin/includes/meta-boxes.php](https://github.com/WordPress/WordPress/blob/5.2-branch/wp-admin/includes/meta-boxes.php)
   with 1556 lines (the minor versions are automatically added to the branch, currently
   for the branch 5.2 is 5.2.4 while for the branch 3.9 is 3.9.29 at five November
   2019). Surely there is a problem with overwriting the wordpress core files, permission
   issues or use of a loader that occasionally does not overwrite the files. In 
   my research I based myself looking for less than 500 lines of code compared to
   WordPress 5.2 (5.2.4 in this moment) if your file is exactly that 3.9.29 (you
   only had this old file) if you want to deepen it look in the archives [https://wordpress.org/download/releases/](https://wordpress.org/download/releases/)
   for the version before 3.9.29. Install Wordfence which protects you and scans
   files with the latest current wordpress version and reports what went wrong
 *  Thread Starter [caneve10](https://wordpress.org/support/users/caneve10/)
 * (@caneve10)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-file-becomes-corrupt-code-missing-from-file-weird/#post-12099750)
 * Hello, I had an issue on the server side with permission a few days ago? This
   was fixed by my host… The fact that you mention this now, may provide strength
   to that theory.
 * I’ll have a look at wordfence…
 * Thanks
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-file-becomes-corrupt-code-missing-from-file-weird/#post-12099802)
 * It would be nice to compare the code with 500 less lines with the exact correspondence
   of the same or less files to 3.9 (github 3.9.29 and archives all). If you get
   the exact match you are sure the file was not updated. it is a pleasure to be
   useful.
 *  Thread Starter [caneve10](https://wordpress.org/support/users/caneve10/)
 * (@caneve10)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-file-becomes-corrupt-code-missing-from-file-weird/#post-12100281)
 * Unfortunately, I cannot do that as I have overwritten the corrupted file… Well,
   so far so good anyway, my site seems to be stable again…
 * Hopefully never, but next time, I’ll compare 🙂
 * Thanks again

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

The topic ‘php file becomes corrupt. Code missing from file. Weird!’ is closed to
new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [caneve10](https://wordpress.org/support/users/caneve10/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/php-file-becomes-corrupt-code-missing-from-file-weird/#post-12100281)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
