• 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 to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Old version of WordPress 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 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/ 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

    (@caneve10)

    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

    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

    (@caneve10)

    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.