• Resolved bignutz

    (@bignutz)


    Hi there, thanks in advance for any help. I have a error reading:
    Parse error: syntax error, unexpected end of file, expecting ‘)’

    I never updated anything or added any posts/pages recently so suspected issue was with host or MYSQL. Originally it was a white screen only. After contacting host they sent the sollowing response:

    I have switched the php version to 5.5 native and the website throws the below error now :

    Parse error: syntax error, unexpected end of file, expecting ‘)’ in /home/tim1980/public_html/www.laptopscreenman.com.au/wp-includes/post.php on line 1846

    I am unsure what to edit, or why it would error when no changes have been made to my knowledge, hence assuming a hosting issue.

    Can someone please help?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter bignutz

    (@bignutz)

    Here is the last lines of code if this helps, thanks.
    function set_post_type( $post_id = 0, $post_type = ‘post’ ) {
    global $wpdb;

    $post_type = sanitize_post_field(‘post_type’, $post_type, $post_id, ‘db’);
    $return = $wpdb->update( $wpdb->posts, array(‘post_type’ => $post_type), array(‘ID’ => $post_id) );

    clean_post_cache( $post_id );

    return $return;
    }

    /**
    * Retrieve list of latest posts or posts matching criteria.
    *
    * The defaults are as follows:
    *
    * @since 1.2.0
    *
    * @see WP_Query::parse_query()
    *
    * @param array $args {
    * Optional. Arguments to retrieve posts. {@see WP_Query::parse_query()} for more
    * available arguments.
    *
    * @type int $numberposts Total number of posts to retrieve. Is an alias of $posts_per_page
    * in WP_Query. Accepts 1+ and -1 for all. Default 5.
    * @type int $offset The number of posts to offset before retrieval. Default 0.
    * @type int|string $category Category ID or comma-separated list of IDs (this or any children).
    * Is an alias of $cat in WP_Query. Default 0.
    * @type string $orderby Which field to order posts by. Accepts post fields. Default ‘date’.
    * @type array $include An array of post IDs to retrieve, sticky posts will be included.
    * Is an alias of $post__in in WP_Query. Default empty array.
    * @type array $exclude An array of post IDs not to retrieve. Default empty array.
    * @type string $meta_key Custom field key. Default empty.
    * @type mixed $meta_value Custom field value. Default empty string.
    * @type string $post_type Post type. Default ‘post’.
    * @type bool $suppress_filters Whether to suppress filters. Default true.
    * }
    * @return array List of posts.
    */
    function get_posts( $args = null ) {
    $defaults = array(
    ‘numberposts’ => 5, ‘offset’ => 0,
    ‘category’ => 0, ‘orderby’ => ‘date’,
    ‘order’ => ‘DESC’, ‘include’ => array(),
    ‘exclude’ => array(), ‘meta_key’ => ”,
    ‘meta_value’ =>”, ‘post_type’ => ‘post’,
    ‘suppress_filters’

    What version of WordPress are you on?

    Please post the code to a service like Pastbin.. It is easier to read and less messy.

    Thread Starter bignutz

    (@bignutz)

    WordPress 3.9.2
    http://pastebin.com/raw.php?i=WPZ670gD

    Thanks heaps for the fast reply

    Can you post the entire file content? The file you are referencing is and a core file. The error is more than likely coming from an external source such as a plugin or theme but I want to check it real fast.

    Thread Starter bignutz

    (@bignutz)

    Thread Starter bignutz

    (@bignutz)

    I logged in to Cpanel and

    1. Set theme back to default manually 2. Deactivate all of your Plugins manually

    Still same result. Can anyone offer support? Running through forums but cannot find an answer.

    If it’s of any help, show your hosts the message on your login page (cannot connect to database) and see what they think. laptopscreenman.com.au/wp-admin/

    [edit] I imagine you must be attempting to repair things… the database connection error isn’t there anymore..

    Thread Starter bignutz

    (@bignutz)

    Thanks or your help Clayton James.

    I think they (the host) is being lazy and the error comes from their side. I have asked them to restore a full Cpanel back up I did in August.

    Moderator keesiemeijer

    (@keesiemeijer)

    There is a part of the file missing. Can you re-upload a newly downloaded post.php file to /wp-includes and see if that solves the problem.

    Maybe something went wrong with the automatic update to 4.0.1

    Try:
    – re-uploading all files & folders – except the wp-content folder from a fresh download of WordPress. by using FTP or whatever file management application your host provides. You may need to delete the wp-admin and wp-includes folders first on your server. Read the Manual Update first.

    Thread Starter bignutz

    (@bignutz)

    Yeah you got it man. It was an auto update on wordpress and the theme I was using, STRIKING was not ready for it. I rolled back an old back up from 3 months ago.

    I had to disable auto update, so wouldn’t happen again (for anyone else reading and stuck in same boat)
    Disabling WordPress Automatic Updates

    Disabling automatic updates in WordPress is easy. Simply add this line of code in your wp-config.php file:
    1
    define( ‘WP_AUTO_UPDATE_CORE’, false );
    This will disable the WordPress automatic updater, and you will still get notified when there is a new version available, so you can update at your own convenience.

    Here is there (theme writers) message
    23 NOV 2014 – WP 4.0.1 AUTO UPDATE = FIXED!!

    Nov 23 – We have fixed the WordPress butchery of complex shortcodes, and you can view them working correctly at the theme demo site. We will engage in some further testing today as we also updated the mediaelement script and we see some issues with portfolio video which we are attending at this time. We anticipate releasing Striking MultiFlex Ver 1.2 on Monday Nov 24 (likely towards the end of that day based on Eastern Standard Time) assuming we resolve the portfolio matter.

    Thread Starter bignutz

    (@bignutz)

    Thanks to all that helped, great community!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Parse error: syntax error -never changed anything manually’ is closed to new replies.