Support » Plugin: CloudSearch » Cannot Activate (“You don’t have the permissions to perform this operation.”

  • Resolved max

    (@maximledoux)


    So, this is probably pretty simple but I can’t activate the plugin…

    wp plugin activate cloud-search
    You don't have the permissions to perform this operation.%

    Of course, I checked the permissions and I do have rwx.

    I also tried activating/deactivating other plugins (no problem there — issue is with this plugin only).

    I also tried it from the plugins page in wp-admin. That also failed to activate.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Andrea Landonio

    (@lando1982)

    Hi, it seems a problem with the user you are using..
    if you are in a multisite WordPress I check if you have ‘manage_network_plugins’ capabilities otherwise I check if you have ‘activate_plugins’, ‘update_plugins’, and ‘install_plugins’… can you check? or tell me your user grants?

    max

    (@maximledoux)

    Hi @lando1982 thanks for getting back to me. The thing is, I can install/activate/update all other plugins except yours (including new ones that I downloaded just to test installing/activating). I’m not running multisite.

    My WP user is administrator level, so has all capabilities. I generally use WP-CLI for installing/activating/updating, though. I checked and I do have the most recent version of that (2.4.0).

    FYI this is happening both on my localhost install (running MAMP Pro on my Mac), and on my staging site on at our web host…

    Plugin Author Andrea Landonio

    (@lando1982)

    Hi Max, I’ve never used WP-CLI for activating plugins.. Mmm.. Let me try..
    Just to know, have you tried to activate it via UI? if it works it’s a problem related to the WP-CLI but we have founded the point to fix.. ๐Ÿ™‚

    max

    (@maximledoux)

    Hi, yes, I have tried from wp-admin/plugins.php to activate the plugin.

    I receive :

    Plugin could not be activated because it triggered a fatal error.
    You don't have the permissions to perform this operation.

    No other plugin gives me this error, even ones I’ve never before installed, that I only downloaded in order to test whether I could install & activate them. This is also happening on two different servers (my localhost and my staging site at my web host)

    I also tried logging in to WordPress as a different administrator user and got the same error.

    Plugin Author Andrea Landonio

    (@lando1982)

    Hi Max, so it’s not a WP-CLI related error..
    I’ve never get this error before.. Very strange but it seems that you have something “strange” in your db or settings.. But, what? ๐Ÿ™‚

    Are you able to view your local web server logs? If yes, I can write to you where to add some debug.. It could be an easy way to investigate your problem..

    Let me know..

    max

    (@maximledoux)

    @lando1982 Ah, yes, probably something in the DB. I didn’t think of that before but the staging and localhost sites both have cloned versions of the DB that’s on my live site.

    Yes, I can view all logs. I would really appreciate if you could point me to the right direction. Also I apologize that this is really probably not directly related to your plugin. Thank you for your attention, nevertheless. Very good customer service!

    Plugin Author Andrea Landonio

    (@lando1982)

    Hi Max, can you edit this file:

    /plugins/cloud-search/cloud-search-utils.php

    Changing the function “acs_check_user_capabilities” with this one?

    function acs_check_user_capabilities() {
    error_log(‘CHECK ACS: acs_check_user_capabilities function’);
    if ( is_multisite() ) {
    error_log(‘CHECK ACS: is multisite’);
    if ( ! current_user_can( ‘manage_network_plugins’ ) ) {
    error_log(‘CHECK ACS: manage_network_plugins grant not exists’);
    // Don’t allow if the user can’t manage network plugins
    return false;
    }
    }
    else {
    // Don’t allow if user doesn’t have plugin management privileges
    error_log(‘CHECK ACS: is not multisite’);
    $caps = array( ‘activate_plugins’, ‘update_plugins’, ‘install_plugins’ );
    foreach ( $caps as $cap ) {
    error_log(‘CHECK ACS: ‘ . $cap . ‘ grant checking..’);
    if ( ! current_user_can( $cap ) ) {
    error_log(‘CHECK ACS: ‘ . $cap . ‘ grant not exists’);
    return false;
    }
    }
    }

    return true;
    }

    Then, have a test.. and let me know.. ๐Ÿ˜€

    max

    (@maximledoux)

    Thanks, using your code the logs generate:

    [08-Jan-2020 17:29:09 UTC] CHECK ACS: acs_check_user_capabilities function
    [08-Jan-2020 17:29:09 UTC] CHECK ACS: is not multisite
    [08-Jan-2020 17:29:09 UTC] CHECK ACS: activate_plugins grant checking..
    [08-Jan-2020 17:29:09 UTC] CHECK ACS: activate_plugins grant not exists

    However, I can list all the caps that my user has, and they most certainly include activate_plugins, update_plugins, and install_plugins. (My user is Administrator level with all capabilities.)

    When I check for only the activate_plugins capability then I am able to activate the plugins from wp-admin/plugins.php with my WordPress Administrator user. However, I still cannot activate it using WP-CLI.

    But at least I can use the plugin now by activating it from the plugins dashboard. Might you consider checking for just activate_plugins, though, rather than the others?

    Plugin Author Andrea Landonio

    (@lando1982)

    Hi Max, of course!! I can check only the activate_plugins capability.. it’s enough ๐Ÿ˜‰
    I’m working on an updates at the moment but I’ll include this fix in the new release.. is it ok?

    Bye

    max

    (@maximledoux)

    Thanks. That takes care of that issue. I have another one but I’ll start a different thread.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cannot Activate (“You don’t have the permissions to perform this operation.”’ is closed to new replies.