• Resolved fborella

    (@fborella)


    Hi all,

    I’ve stumbled upon a bug that prevent super-administrator of website (multi o single sites) to not see the Nelio AB Testing plugin menu on the dashboard. It seems to be related to the missing capabilities on the ‘super-admin’ role.

    Ref: /wp-content/plugins/nelio-ab-testing/includes/utils/class-nelio-ab-testing-capability-manager.php:60 – “add_capabilities” only adds capabilities to ‘administrator’ and ‘editor’ roles

    /**

    * Adds custom Nelio A/B Testing’s capabilities from admin admin and editor roles.

    *

    * @since 6.0.1

    */

    public function add_capabilities() {

    $roles = array( 'administrator', 'editor' );

    foreach ( $roles as $role_name ) {

    $role = get_role( $role_name );

    if ( $role ) {

    $caps = $this->get_role_capabilities( $role_name );

    foreach ( $caps as $cap ) {

    $role->add_cap( $cap );

    }//end foreach

    }//end if

    }//end foreach

    }//end add_capabilities()


    I needed to add capabilities with an external plugin.

    Cheers,
    Fabio

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter fborella

    (@fborella)

    I’ve just discovered this support page 🙃: https://neliosoftware.com/testing/help/modify-user-capabilities-using-nelio-ab-testing/

    Maybe also super-administrator should be included in the default roles having those capabilities.

    Plugin Author Antonio Villegas

    (@avillegasn)

    Hi Fabio,

    Thanks so much for your detailed report and for sharing your findings — we really appreciate it! 😊

    You’re absolutely right: in a WordPress Multisite environment, Super Admins don’t have a dedicated role like ‘administrator’ or ‘editor’, so get_role( 'super_admin' ) won’t work, and our add_capabilities() function currently doesn’t target them directly. That’s why the Nelio A/B Testing menu might not appear for Super Admins by default unless they also have one of the supported roles.

    As you discovered, this is something that can be worked around by manually assigning the necessary capabilities — and thank you for pointing out the relevant help page as well!

    We agree this can be confusing, and your suggestion makes a lot of sense. We’ll include Super Admins in the default capabilities assignment in Multisite environments in the next release of Nelio A/B Testing. In the meantime, your workaround is perfectly valid.

    Thanks again for helping us improve the plugin!

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

The topic ‘Missing dashboard menu – missing super-admin capabilities’ is closed to new replies.