• Resolved katrinah

    (@dbo244596822)


    Hello, I uninstalled Coursepress and there are lingering “capabilities” that continue to display on my user profile within WordPress. Can you please let me know how to delete these? I looked in the wp_options table in the database and could not find anything.

    Here are the “capabilities” that I’m seeing after uninstalling CoursePress. (below)

    Thank you so much.

    can_edit_posts, read, upload_files, coursepress_dashboard_cap, coursepress_courses_cap, coursepress_instructors_cap, coursepress_students_cap, coursepress_assessment_cap, coursepress_reports_cap, coursepress_notifications_cap, coursepress_discussions_cap, coursepress_settings_cap, coursepress_create_course_cap, coursepress_update_course_cap, coursepress_update_my_course_cap, coursepress_delete_my_course_cap, coursepress_change_my_course_status_cap, coursepress_create_course_unit_cap, coursepress_update_course_unit_cap, coursepress_update_my_course_unit_cap, coursepress_delete_course_units_cap, coursepress_delete_my_course_units_cap, coursepress_change_course_unit_status_cap, coursepress_change_my_course_unit_status_cap, coursepress_assign_and_assign_instructor_my_course_cap, coursepress_invite_my_students_cap, coursepress_withdraw_my_students_cap, coursepress_add_move_my_students_cap, coursepress_add_move_my_assigned_students_cap, coursepress_add_new_students_cap, coursepress_send_bulk_students_email_cap, coursepress_create_notification_cap, coursepress_create_my_assigned_notification_cap, coursepress_create_my_notification_cap, coursepress_update_my_notification_cap, coursepress_delete_my_notification_cap, coursepress_change_my_notification_status_cap, coursepress_create_discussion_cap, coursepress_create_my_assigned_discussion_cap, coursepress_create_my_discussion_cap, coursepress_update_my_discussion_cap, coursepress_delete_my_discussion_cap, coursepress_course_categories_manage_terms_cap, coursepress_course_categories_edit_terms_cap

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello dbo244596822,

    It will be tricky to remove those capabilities directly from databse because they are kept in wp_usermeta table in serialized format. So it looks for user like that:

    s:25:"coursepress_dashboard_cap";

    whole part with capability name has to be removed – so what starts with s and ends with semicolon.
    It is in meta_key wp_capabilities for each user.

    You can also try using this small code snippet:

    add_action( 'admin_init', 'clean_unwanted_caps' );
    function clean_unwanted_caps(){
    	$delete_caps = array('edit_issues', 'publish_issues', 'edit_other_issues', 'read_private_issues',
    		'delete_issue', 'edit_issue');
    	global $wp_roles;
    	foreach ($delete_caps as $cap) {
    		foreach (array_keys($wp_roles->roles) as $role) {
    			$wp_roles->remove_cap($role, $cap);
    		}
    	}
    }

    Please add the list from your screenshot into the array ( $delete_caps ) and paste in your functions.php file – but make sure you are not adding anything that is not from CoursePress.

    kind regards,
    Kasia

    Thread Starter katrinah

    (@dbo244596822)

    Thank you – the function above does not work so I am manually removing the data via your first-mentioned method. In between each piece of data it says “b:1″. Should I delete that also? Example:
    s:32:”coursepress_update_my_course_cap”;b:1;s:32:”coursepress_delete_my_course_cap”;

    Thank you very much for letting me know if I should also delete “b:1”.

    Thread Starter katrinah

    (@dbo244596822)

    Hi there, I think I fixed it but just want to share in case anyone with a similar problem reads this. Here’s what I did: in the database I manually deleted all “coursepress” codes, following Kasia’s guidance above. Doing this somehow turned me into a “participant”, not an “admin”, so I could no longer access the dashboard. I did a search and found this suggestion (http://stackoverflow.com/questions/13094601/changing-a-wordpress-user-to-an-admin) to update the “participant” code with this code:
    a:1:{s:13:”administrator”;s:1:”1″;}

    Adding this line above restored my admin status and access to the dashboard. I think everything is working okay now. From the WordPress dashboard, the “coursepress” data no longer displays in my user profile “capabilities”.

    Thanks so much again for your help, Kasia!

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

The topic ‘Capabilites will not delete after uninstalling plugin’ is closed to new replies.