Title: Unable to initialize WordPress
Last modified: August 21, 2016

---

# Unable to initialize WordPress

 *  [kwoodard65](https://wordpress.org/support/users/kwoodard65/)
 * (@kwoodard65)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/)
 * Good Day,
    For no explainable reason, I am now receiving the following error 
   message instead of a login success message:
 * Parse error: syntax error, unexpected T_FUNCTION in D:\Hosting\10834771\html\
   WaVBlog\wp-content\plugins\wp-essentials\system\cleanup.php on line 4
 * I attempted to following to troubleshoot:
    1) Upgrade WordPress 2) Recover last
   known version 3) Downloaded file and viewed within Komodo IDE
 * I can’t logon to my Blog website any longer. What is the problem? I don’t have
   a lot of plugins installed.
 * Cheers,
    KWITS

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

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/#post-4047085)
 * You said that you downloaded the file and viewed it… What was on lines 1 to 4?
   Because that’s where the error says it is, that’s most likely where the error
   will be.
 *  Thread Starter [kwoodard65](https://wordpress.org/support/users/kwoodard65/)
 * (@kwoodard65)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/#post-4047179)
 * Here is the code:
 *  <?php
    // Add Client role if (!function_exists(‘add_role_caps’)) { ;function
   add_role_caps() { $role = get_role(‘client’); if (!$role) $role = add_role(‘client’,’
   Client’);
 *  $role->add_cap(‘read’);
    $role->add_cap(‘create_users’); $role->add_cap(‘delete_others_pages’);
   $role->add_cap(‘delete_others_posts’); $role->add_cap(‘delete_pages’); $role-
   >add_cap(‘delete_posts’); $role->add_cap(‘delete_private_pages’); $role->add_cap(‘
   delete_private_posts’); $role->add_cap(‘delete_published_pages’); $role->add_cap(‘
   delete_published_posts’); $role->add_cap(‘delete_users’); $role->add_cap(‘edit_dashboard’);
   $role->add_cap(‘edit_files’); $role->add_cap(‘edit_others_pages’); $role->add_cap(‘
   edit_others_posts’); $role->add_cap(‘edit_pages’); $role->add_cap(‘edit_posts’);
   $role->add_cap(‘edit_private_pages’); $role->add_cap(‘edit_private_posts’); $
   role->add_cap(‘edit_published_pages’); $role->add_cap(‘edit_published_posts’);
   $role->add_cap(‘edit_theme_options’); $role->add_cap(‘list_users’); $role->add_cap(‘
   manage_categories’); $role->add_cap(‘manage_links’); $role->add_cap(‘manage_options’);
   $role->add_cap(‘moderate_comments’); $role->add_cap(‘promote_users’); $role->
   add_cap(‘publish_pages’); $role->add_cap(‘publish_posts’); $role->add_cap(‘read_private_pages’);
   $role->add_cap(‘read_private_posts’); $role->add_cap(‘read’); $role->add_cap(‘
   remove_users’); $role->add_cap(‘upload_files’); $role->add_cap(‘level_1’); } 
   add_action(‘admin_init’,’add_role_caps’);
 *  class User_Caps {
    function User_Caps(){ add_filter(‘editable_roles’,array(&
   $this,’editable_roles’)); add_filter(‘map_meta_cap’,array(&$this,’map_meta_cap’),
   10,4); } function editable_roles($roles){ if(isset($roles[‘administrator’]) &&!
   current_user_can(‘administrator’)){ unset($roles[‘administrator’]); } return 
   $roles; } function map_meta_cap($caps,$cap,$user_id,$args){ switch($cap){ case‘
   edit_user’: case ‘remove_user’: case ‘promote_user’: if(isset($args[0]) && $args[
   0] == $user_id) break; elseif(!isset($args[0])) $caps[] = ‘do_not_allow’; $other
   = new WP_User(absint($args[0])); if( $other->has_cap(‘administrator’)){ if(!current_user_can(‘
   administrator’)){ $caps[] = ‘do_not_allow’; } } break; case ‘delete_user’: case‘
   delete_users’: if(!isset($args[0])) break; $other = new WP_User(absint($args[
   0])); if( $other->has_cap(‘administrator’)){ if(!current_user_can(‘administrator’)){
   $caps[] = ‘do_not_allow’; } } break; default: break; } return $caps; } } $user_caps
   = new User_Caps(); }`
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/#post-4047187)
 * I only needed line 4… The error is pretty obvious there.
 *     ```
       <?php
       // Add Client role
       if (!function_exists('add_role_caps')) {
       ;function add_role_caps() {
       $role = get_role('client');
       ```
   
 * See on the 4th line there’s a semi-colan in front of `function`? that’s the error.
   That should not be there. Remove that and you’ll have fixed that error.
 *  Thread Starter [kwoodard65](https://wordpress.org/support/users/kwoodard65/)
 * (@kwoodard65)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/#post-4047192)
 * I apologize for the poorly formatted code. I still don’t know how to use the 
   formatting on this page. I removed the semicolon but I still have the same parsing
   error on line 4. Evidently, there is an illegal function call here. I have upgraded
   my WordPress version up to the highest level; evidently this script is never 
   updated or fixed.
 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/#post-4047193)
 * It looks like the error is coming from one plugin no?
 *     ```
       Parse error: syntax error, unexpected T_FUNCTION in D:\Hosting\10834771\html\WaVBlog\wp-content\plugins\wp-essentials\system\cleanup.php on line 4
       ```
   
 * Do you have a plugin called essentials?
    I would deactivate that.
 * Via FTP, just rename that plugin to something like old— and then see if you can
   login again.
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/#post-4047196)
 * As Christine said, the error is coming from a plugin called ‘esentials’ (or something
   similar), not from WordPress itself.
 * If you removed that semi-colan, and re-uploaded the file to the same place there’s
   no reason why it won’t work. That’s the only error on that line and the syntax
   is correct.
 * And for formatting code, there’s a button above the input window here that says‘
   code’. Click that and it will start off the code block, and click it again to
   close the code block. All it does is encase the code in back-ticks (I can’t add
   one here as the parser always interperts them as code).

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

The topic ‘Unable to initialize WordPress’ is closed to new replies.

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)
 * [T_FUNCTION](https://wordpress.org/support/topic-tag/t_function/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/unable-to-initialize-wordpress/#post-4047196)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
