• Hello all,

    I am experiencing the infamous “You do not have sufficient permissions to access this page.” error when trying to access /wp-admin/admin.php?page=thesis-options while logged in as any administrator user.

    I have recently upgraded the core and all plugins, removed some backdoors and a lot of spam from the blog posts, renamed table prefixes and moved to a new server.

    The server is a VPS running Ubuntu with Nginx.

    I have tried the following things to try and get access to this page with no success:

    • forcing db update by changing db_version value
    • checked and rechecked prefixes for table names, options and usermeta
    • changed table prefixes back to original
    • change usermeta capabilities value to both a:1:{s:13:”administrator”;b:1;} and a:1:{s:13:”administrator”;s:1:”1″;}
    • deactivating all plugins
    • set standard wp user roles in options table wp_user_roles
    • use simpler table prefix (just lower case letters and underscores)
    • change auth keys and salts
      forced wp upgrade with this script: https://markjaquith.wordpress.com/2006/03/28/wordpress-error-you-do-not-have-sufficient-permissions-to-access-this-page
    • (the script threw a 500)
    • change theme to Twenty Fifteen
    • redownloaded and overwritten wp-includes and wp-admin

    I added the below code to wp-admin/menu.php:

    if ( !user_can_access_admin_page() ) {
        $a = array(
            'Pages No Access' => $_wp_menu_nopriv,
            'User Info' => $current_user,
            'Roles' => $wp_roles->get_names(),
        );
        $s = sprintf("\n<br /><pre>%s</pre>", print_r($a, true));
        do_action('admin_page_access_denied');
        wp_die( __('You do not have sufficient permissions to access this page.'.$s) );
    }

    Which yielded the following:

    Array
    
    (
    
        [Pages No Access] => 
    
        [User Info] => WP_User Object
    
            (
    
                [data] => stdClass Object
    
                    (
    
                        [ID] => 251
    
                        [user_login] => maxmumford
    
                        [user_pass] => ********
    
                        [user_nicename] => maxmumford
    
                        [user_email] => ********
    
                        [user_url] => http://www.cocept.io
    
                        [user_registered] => 2016-03-29 13:43:32
    
                        [user_activation_key] => ********
    
                        [user_status] => 0
    
                        [display_name] => Max Mumford
    
                    )
    
                [ID] => 251
    
                [caps] => Array
    
                    (
    
                        [administrator] => 1
    
                    )
    
                [cap_key] => wp_capabilities
    
                [roles] => Array
    
                    (
    
                        [0] => administrator
    
                    )
    
                [allcaps] => Array
    
                    (
    
                        [switch_themes] => 1
    
                        [edit_themes] => 1
    
                        [activate_plugins] => 1
    
                        [edit_plugins] => 1
    
                        [edit_users] => 1
    
                        [edit_files] => 1
    
                        [manage_options] => 1
    
                        [moderate_comments] => 1
    
                        [manage_categories] => 1
    
                        [manage_links] => 1
    
                        [upload_files] => 1
    
                        [import] => 1
    
                        [unfiltered_html] => 1
    
                        [edit_posts] => 1
    
                        [edit_others_posts] => 1
    
                        [edit_published_posts] => 1
    
                        [publish_posts] => 1
    
                        [edit_pages] => 1
    
                        [read] => 1
    
                        [level_10] => 1
    
                        [level_9] => 1
    
                        [level_8] => 1
    
                        [level_7] => 1
    
                        [level_6] => 1
    
                        [level_5] => 1
    
                        [level_4] => 1
    
                        [level_3] => 1
    
                        [level_2] => 1
    
                        [level_1] => 1
    
                        [level_0] => 1
    
                        [edit_others_pages] => 1
    
                        [edit_published_pages] => 1
    
                        [publish_pages] => 1
    
                        [delete_pages] => 1
    
                        [delete_others_pages] => 1
    
                        [delete_published_pages] => 1
    
                        [delete_posts] => 1
    
                        [delete_others_posts] => 1
    
                        [delete_published_posts] => 1
    
                        [delete_private_posts] => 1
    
                        [edit_private_posts] => 1
    
                        [read_private_posts] => 1
    
                        [delete_private_pages] => 1
    
                        [edit_private_pages] => 1
    
                        [read_private_pages] => 1
    
                        [delete_users] => 1
    
                        [create_users] => 1
    
                        [unfiltered_upload] => 1
    
                        [edit_dashboard] => 1
    
                        [update_plugins] => 1
    
                        [delete_plugins] => 1
    
                        [install_plugins] => 1
    
                        [update_themes] => 1
    
                        [install_themes] => 1
    
                        [update_core] => 1
    
                        [list_users] => 1
    
                        [remove_users] => 1
    
                        [promote_users] => 1
    
                        [edit_theme_options] => 1
    
                        [delete_themes] => 1
    
                        [export] => 1
    
                        [wysija_newsletters] => 1
    
                        [wysija_subscribers] => 1
    
                        [wysija_subscriwidget] => 1
    
                        [wysija_config] => 1
    
                        [wysija_theme_tab] => 1
    
                        [wysija_style_tab] => 1
    
                        [wysija_stats_dashboard] => 1
    
                        [administrator] => 1
    
                    )
    
                [filter] => 
    
            )
    
        [Roles] => Array
    
            (
    
                [administrator] => Administrator
    
                [editor] => Editor
    
                [author] => Author
    
                [contributor] => Contributor
    
                [subscriber] => Subscriber
    
            )
    
    )

    From which we can see that my user has the appropriate permission and the user roles settings are intact.

    I am pretty stumped… I seem to have exhausted Google and can’t think of anything else. Can somebody help?

The topic ‘Permission denied on admin.php’ is closed to new replies.