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.
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();
}`
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.
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.
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.
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).