• Resolved wpmonitoring

    (@wpmonitoring)


    Hi team! We are currently integrating Cleantalk for a couple hundred websites but are facing issues with the automated API key retrieval.

    We have followed the documentation and tried it on 4 websites, but it never works correctly. Even when we visit the Cleantalk page, while having put the code below in the functions.php of the active theme, the administrator email also doesn’t show our email. I’ve pasted the code below for reference. We tested in current active theme and our own plugin which is installed on every site, but neither work:

    add_filter('apbct_is_get_api_key', function ($_is_get_api_key) {
        return true;
    });
    
    add_filter('apbct_get_api_key_email', function ($_admin_email) {
        return '[email protected]';
    });

    Would save a lot of time if we can automatically set these values so we do not have to login to each website. I assume when it fetches the API key it will also configure itself?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support eugenecleantalk

    (@eugenecleantalk)

    Hello @wpmonitoring.

    Pay attention to the notifications on the plugin page after activation. Are there any errors?

    Please note, the code in the active theme to automatically get the Access key only works at the moment of plugin activation.

    Here are the reasons why the plugin may not get the key automatically:

    1. The site is already connected to another CleanTalk account. A notification in the plugin will tell you which one. You need to disconnect the site from that account. This guide will help you.
    2. An Access key was previously issued for the site more than 15 minutes ago. You can disconnect the site from the account so that you can get a key again.
    3. Your license does not allow you to connect another site. You need to upgrade your license.
    4. The “Policy about adding new sites without authorization” option in your account settings is not set to “On” or “Auto”.

    After installing the Access Key, the default settings will be set in the plugin. You can control the settings using templates. These guides will help you:

    Thread Starter wpmonitoring

    (@wpmonitoring)

    Appreciate the quick response!

    I tried all these steps however they did not work, we have unlimited sites and none of the sites are already connected to another account. Also if the license is new (shorter than 15 min ago) the plugin does not get the API keys.

    What worked for me was enabling the “Policy about adding new sites without authorization”. I don’t know if this is a good permanent solution though.

    I tried on about 10 sites, and these symptoms occur on any site.

    Thread Starter wpmonitoring

    (@wpmonitoring)

    Additionally it doesn’t always work even with this enabled. Neither when I paste the code in the theme or our custom plugin.

    Is there a specific action or hook we could tap into instead, or any other automated solution?

    Plugin Support eugenecleantalk

    (@eugenecleantalk)

    There is an alternative option using the API. Here’s the guide: https://cleantalk.org/help/get-api-key.

    The article has not been completed yet. Requests should be sent to api.cleantalk.org.

    Thread Starter wpmonitoring

    (@wpmonitoring)

    Could you provide some more information on this?

    Also we can even inject the API key directly into the Cleantalk WordPress table if that is what is needed. Or maybe use a method from the Cleantalk class directly. Since we develop our plugin in-house we can make any adjustments as needed to make this work.

    Please advise what the best steps are. We are building this for automated deployment; so that Cleantalk gets installed for every new site added, so automating this process would be very helpful.

    Plugin Support eugenecleantalk

    (@eugenecleantalk)

    Also we can even inject the API key directly into the Cleantalk WordPress table if that is what is needed. Or maybe use a method from the Cleantalk class directly.

    I don’t think this is the solution.

    Could you provide some more information on this?

    To get an access key, you need to send a POST request to our server with the parameters specified in the guide.

    If you are having difficulties in getting the key via a hook in an active theme, we can investigate your case. Please contact us via our private Ticket System and add there a link to this topic: https://cleantalk.org/my/support/open.

    Plugin Support katereji

    (@katereji)

    Hello.
    We haven’t heard back from you in a few days, so I’m going to mark this thread as “resolved”.
    If you have any further questions, you can start a new thread or contact us via our private Ticket System: https://cleantalk.org/my/support/open.

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

The topic ‘Automatic API keys not working’ is closed to new replies.