• Resolved santoshskcp

    (@santoshskcp)


    Hi, I was updating my Plugins. Somewhere I started getting “Briefly Unavailable for Scheduled Maintenance Error”. But it went away after a while.

    Then I tried updating my core WordPress from 5.5.1 to the current one. During the process the site broke down first with- “Briefly Unavailable for Scheduled Maintenance Error” and a few secs later when refreshed it turned to “There has been a critical error on your website.”
    Now it says- Parse error: syntax error, unexpected end of file in /home/q5h1wtbr7q89/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php on line 1624

    Is this because my core WordPress update failed mid-way and thus left the rest-api code only partially updated?

    WIll manually updating WordPress using FTP resolve this for me?

    The code leading to error line 1624 is this –
    if ( rest_is_field_included( ‘modified_gmt’, $fields ) ) {
    /*
    * For drafts, post_modified_gmt may not be set (see post_date_gmt comments
    * above). In this case, shim the value based on the post_modified field
    * with the site’s timezone offset applied.
    */
    if ( ‘0000-00-00 00:00:00’ === $po

    As you can see it seems to be left open midway. And I couldn’t make sense of it. Please suggest. I’m not an expert coder. Your suggestions will be of great benefit.

    Before this my site was working perfectly fine.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator James Huff

    (@macmanx)

    Try downloading WordPress again, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), and delete then replace your copies of everything on the server except the wp-config.php file and the /wp-content/ directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings.

    Some uploaders tend to be unreliable when overwriting files, so don’t forget to delete the original files before replacing them.

    Thread Starter santoshskcp

    (@santoshskcp)

    Thank you. That worked perfectly! The website is back. Saved me a lot of work. Thanks a lot.

    Just to be sure, some tutorials state that- “Upload the individual files from the new wp-content folder to your existing wp-content folder and overwrite existing files.”

    But following your instructions above- I didn’t update the wp-content directory at all.

    That is totally fine and shouldn’t be an issue right?

    Moderator James Huff

    (@macmanx)

    That’s totally fine. wp-content only contains your uploads, plugins, and themes.

    Since that’s all individual to you and your site, there isn’t much to replace from a fresh WordPress download, and replacing those things wouldn’t make much of a difference anyway.

    Thread Starter santoshskcp

    (@santoshskcp)

    Understood. Thanks again. Very much appreciated.

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

The topic ‘Syntax error in class-wp-rest-posts-controller.php after WordPress update’ is closed to new replies.