You do not have sufficient permissions to enter this page

Fixing: You do not have sufficient permissions

This script will update permissions, clear cache and perform login actions:

function txfx_log($text) {
	echo $text . '
';
}

switch ($_GET['step']) :
	case "1":
		require('wp-config.php');
		txfx_log('WordPress loaded...');
		require('wp-admin/upgrade-functions.php');
		txfx_log('Upgrade functions loaded...');
		wp_cache_flush();
		txfx_log('Object cache flushed...');
		make_db_current();
		txfx_log('Database made current...');
		upgrade_160();
		txfx_log('Data upgraded...');
		$wp_rewrite->flush_rules();
		txfx_log('Rewrite rules flushed...');
		wp_cache_flush();
		txfx_log('Object cache flushed...');
		txfx_log('
');
		txfx_log('Hopefully that did it!  DELETE THIS FILE FROM YOUR SERVER NOW!');
		txfx_log('And then, try to access your /wp-admin/');
		break;
	default :
		txfx_log('This script will attempt to upgrade your database.  It is intended for users of WordPress 1.5 or later.');
		txfx_log('You should delete this script from your server after you are done using it!');
		txfx_log('Click here to attempt the upgrade');
		break;
endswitch;

5/5 - (3 votes)

3 thoughts on “You do not have sufficient permissions to enter this page”

    1. Spróbuj zresetować role, np. takim skryptem (kopia bazy przed operacją):

      /*
      * example usage: $results = reset_role_wpse_82378( 'subscriber' );
      * per add_role() (WordPress Codex):
      * $results "Returns a WP_Role object on success, null if that role already exists."
      *
      * possible $role values:
      * 'administrator'
      * 'editor'
      * 'author'
      * 'contributor'
      * 'subscriber'
      */
      function reset_role_wpse_82378( $role ) {
      $default_roles = array(
      'administrator' => 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,
      'add_users' => 1,
      'promote_users' => 1,
      'edit_theme_options' => 1,
      'delete_themes' => 1,
      'export' => 1,
      ),
      'editor' => array(
      'moderate_comments' => 1,
      'manage_categories' => 1,
      'manage_links' => 1,
      'upload_files' => 1,
      'unfiltered_html' => 1,
      'edit_posts' => 1,
      'edit_others_posts' => 1,
      'edit_published_posts' => 1,
      'publish_posts' => 1,
      'edit_pages' => 1,
      'read' => 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,
      ),
      'author' => array(
      'upload_files' => 1,
      'edit_posts' => 1,
      'edit_published_posts' => 1,
      'publish_posts' => 1,
      'read' => 1,
      'level_2' => 1,
      'level_1' => 1,
      'level_0' => 1,
      'delete_posts' => 1,
      'delete_published_posts' => 1,
      ),
      'contributor' => array(
      'edit_posts' => 1,
      'read' => 1,
      'level_1' => 1,
      'level_0' => 1,
      'delete_posts' => 1,
      ),
      'subscriber' => array(
      'read' => 1,
      'level_0' => 1,
      ),
      'display_name' => array(
      'administrator' => 'Administrator',
      'editor' => 'Editor',
      'author' => 'Author',
      'contributor' => 'Contributor',
      'subscriber' => 'Subscriber',
      ),
      );
      $role = strtolower( $role );
      remove_role( $role );
      return add_role( $role, $default_roles['display_name'][$role], $default_roles[$role] );
      } // function reset_role_wpse_82378

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top