wordpress 2.1.3 with php 7.0


I am updating wordpress 2.1.3 to work with php7. I have already been able to install it, after modifying multiple files, but I have a problem now

When I want to enter the control panel give the error “You do not have sufficient permissions to access this page.”, It seems to me that this error is related to “wp_user_roles” in table wp_options since the only error that it marks in the php log is in the capabilities.php file, precisely in the wp_roles function.

The errors are marked in two functions below, it seems a simple error but I could not solve it. everything seems correct, I have already tried several versions

“PHP Warning: Illegal string offset … in … capabilities.php”

in class WP_Roles:

function add_cap( $role, $caps, $grant = true ) {
        if ( ! isset( $this->roles[$role] ) )

        $this->roles[$role]['capabilities'][$caps] = $grant;
        if ( $this->use_db )
            update_option( $this->role_key, $this->roles );

in class WP_Role

function add_cap($caps, $grant = true) {
        global $wp_roles;

        if ( ! isset($wp_roles) )
            $wp_roles = new WP_Roles();

        $this->capabilities[$caps] = $grant;
        $wp_roles->add_cap($this->name, $caps, $grant);

In the table wp_usermeta, in the wp_cababilities seems “a:1:{s:13:”administrator”;b:1;}”, what i think is correct.

But in the table wp_options, in the wp_user_roles seems


I don’t know if it’s correct because not seems multiples options, edit theme, edit user, edit pages, etcétera.

any good idea? thank you

, Texas 3 years 2020-04-07T20:50:51-05:00 0 Answers 89 views 0

Leave an answer