My site collapsed on error 500, urgent help!


#1

After upgrading the theme frame, My site collapsed, (omermoav.com), and i got the follwing error

PHP Parse error: syntax error, unexpected ‘if’ (T_IF), expecting ‘)’ in /home4/omermoav/public_html/wp-content/themes/moesia/functions.php on line 406

function moesia_register_required_plugins() {
$plugins = array(
array(
‘name’ => ‘Page Builder by SiteOrigin’,
‘slug’ => ‘siteorigin-panels’,
‘required’ => false,
),

	if ( !function_exists('wpcf_init') ) { // !!!  Line 406 !!!
		$plugins[] = array(
				'name'               => 'aThemes Toolbox - custom posts and fields for the Moesia theme',
				'slug'               => 'athemes-toolbox',
				'required'           => false,
		);
	}
);

$config = array(
	'id'           => 'moesia',                // Unique ID for hashing notices for multiple instances of TGMPA.
	'default_path' => '',                      // Default absolute path to bundled plugins.
	'menu'         => 'tgmpa-install-plugins', // Menu slug.
	'has_notices'  => true,                    // Show admin notices or not.
	'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
	'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
	'is_automatic' => false,                   // Automatically activate plugins after installation or not.
	'message'      => '',                      // Message to output right before the plugins table.
);

tgmpa( $plugins, $config );

}


#2

I just had the same error. The way I got the site back was to go in to cpanel (or via FTP) rename the moesia theme folder to -old then upload previous version. You could also get the site running by naming the theme file -old, you will then have access to your wp-admin panel, at that point you could restore from a recent backup.


#3

Hello there,

I just updated to the latest version (1.48) and the error doesn’t present to me. The below code block doesn’t seem contain any error.

	if ( !function_exists('wpcf_init') ) {
		$plugins = array(
			array(
				'name'      => 'Page Builder by SiteOrigin',
				'slug'      => 'siteorigin-panels',
				'required'  => false,
			),

			array(
				'name'      => 'aThemes Toolbox - custom posts and fields for the Moesia theme',
				'slug'      => 'athemes-toolbox',
				'required'  => false,
			),
		);
	}

You might need to try downloading the theme package from wordpress.org repository: https://wordpress.org/themes/moesia/. Then manually updating it with FTP program.

Regards,
Kharis