• After ticking the delete cache and data on removal the page restrictions remain.

    After adding the following code there appeared what looked like shortcakes above the page header so I had to rollback the database to fix it.

    '

    // global $wp_roles;
    // $roles = $wp_roles->roles;
    // echo '' . print_r( $roles, true ) . '';

    // function um_custom_echo_roles() {
    // global $wp_roles;
    // foreach ( $wp_roles->roles as $roleID => &$role_data ) {
    // unset( $role_data['_um_can_access_wpadmin'] );
    // unset( $role_data['_um_can_not_see_adminbar'] );
    // unset( $role_data['_um_can_edit_everyone'] );
    // unset( $role_data['_um_can_delete_everyone'] );
    // unset( $role_data['_um_can_edit_profile'] );
    // unset( $role_data['_um_can_delete_profile'] );
    // unset( $role_data['_um_default_homepage'] );
    // unset( $role_data['_um_after_login'] );
    // unset( $role_data['_um_after_logout'] );
    // unset( $role_data['_um_can_view_all'] );
    // unset( $role_data['_um_can_make_private_profile'] );
    // unset( $role_data['_um_can_access_private_profile'] );
    // unset( $role_data['_um_status'] );
    // unset( $role_data['_um_auto_approve_act'] );
    // if ( ! empty( $role_meta ) ) {
    // $wp_roles->roles[ $roleID ] = array_merge( $role_data, $role_meta );
    // }
    // }
    // update_option( $wp_roles->role_key, $wp_roles->roles );
    // $um_instructors = get_users( array(
    // 'role__in' => 'um_instructor',
    // ) );
    // if ( ! empty( $um_instructors ) ) {
    // foreach ( $um_instructors as $instructor ) {
    // $instructor->remove_role( 'um_instructor' );
    // }
    // }
    // }
    // add_action( 'init', 'um_custom_echo_roles' );

    Maybe that’s why it’s all commented? I also checked the users and only found one key master but cannot delete as it is me!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support andrewshu

    (@andrewshu)

    Hello @tomcoady

    Sorry, I can’t understand your question. Please describe in more detail.

    Regards.

    Thread Starter tom coady

    (@tomcoady)

    Sorry my. first description was unclear.

    1. Problem with Cache and Data:
    • Even after choosing the option to delete cache and data on removal, the page restrictions did not change.
    1. Issue with New Code:
    • After adding the provided code, strange text appeared above the page header. This issue forced me to restore the database to a previous state to fix it.
    1. Code Explanation:
    • The provided code seems to be commented out, meaning it’s not active. It includes functions to manage user roles in WordPress by removing specific capabilities from certain roles.
    • This code also attempts to update roles and remove a specific role called um_instructor from users.
    1. User Issue:
    • When checking users, I found only one key master user, which I couldn’t delete because it’s my own account.
    • The issues I faced might be due to the commented-out code.

    Feel free to ask for more details or clarification!

    • This reply was modified 8 months, 2 weeks ago by tom coady. Reason: tried to introduce spaces before bullets to fix the number sequences
    Plugin Support andrewshu

    (@andrewshu)

    Hello @tomcoady

    Where did you find this code?

    Regards.

    Thread Starter tom coady

    (@tomcoady)

    Thread Starter tom coady

    (@tomcoady)

    I am writing to follow up on a previous support request regarding two persistent issues I’m facing.

    1. Cache and Data Problem:

    Even after selecting the option to delete cache and data upon removal, the page restrictions did not update as expected. This continues to be a significant issue affecting my site’s performance.

    2. Issue with New Code:

    After implementing the provided code, unusual text appeared above the page header. This problem necessitated a database restoration to a previous state. Additionally, the code appears to be commented out and inactive, despite including functions to manage user roles by removing specific capabilities. It also attempts to update roles and remove the um_instructor role from users.

    User Issue:

    Upon reviewing users, I discovered only one key master user (my own account), which I cannot delete.

    Thread Starter tom coady

    (@tomcoady)

    Hello,

    I’m following up on my previous support request. Despite your assistance, I’m still experiencing issues:

    Cache/Data Problem:

    • Ticked “Remove Data on Uninstall”
    • Uninstalled and reinstalled the plugin
    • Page restrictions still not updating
    • Cache cleared, but problem persists

    Code Implementation Issue:

    • Implemented provided code
    • Result: Unusual text above page header
    • Had to restore database to previous state
    • Code appears commented out and inactive
    • Code includes functions for:
    • Managing user roles
    • Removing specific capabilities
    • Updating roles
    • Removing um_instructor role from users

    User Management:

    • Only one key master user (my account)
    • Unable to delete this account
    • Limits ability to troubleshoot user issues

    Current Status:

    • Site requires login for all page views
    • Effectively locked to outside world

    Questions:

    • How can I resolve the caching issue affecting page restrictions?
    • What’s causing the code to appear inactive, and how can I properly implement it?
    • Is there a way to safely manage user roles without compromising security?
    • Can you suggest a method to allow partial site access while maintaining security?

    I appreciate your continued support in resolving these issues.

    • This reply was modified 7 months, 1 week ago by tom coady.
    Thread Starter tom coady

    (@tomcoady)

    OK I finally resolved by editing the global restriction options page:

    Restriction Method – None

    I’m a bit disappointed it took me so long!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cannot uninstall after ticking remove data on deletion’ is closed to new replies.