• Resolved luistinygod

    (@luistinygod)


    Hello,

    I’m testing this plugin in my Mac laptop, using Local WP. I have the right credentials for Algolia Search and they are working on the server. But, when using the same in my local I consistently get the following errors when trying to store the Application ID and the other API keys:

    – Impossible to connect, please check your Algolia Application Id.
    – We were unable to authenticate you against the Algolia servers with the provided information. Please ensure that you used a valid Application ID and Admin API key.

    How can I connect the plugin to Algolia locally? Is there any workaround?

    Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    As a https://localwp.com/ user myself, including my involvement with continuing development of the plugin, they are compatible.

    Do you have any sort of firewalls and the like configured with your machine? Have you verified the app ID and admin api key?

    Thread Starter luistinygod

    (@luistinygod)

    Thank you for the reply.

    I tested the plugin in several environments with and without local firewall set. It seems the plugin works fine in a Local WP regular setup, when installed manually through the WordPress dashboard.

    But it is not working when the plugin is installed as a composer package. I know this plugin is using the Algolia PHP client as a dependency. Do you think there might be some missing piece when setting up the plugin as a composer package?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I could believe so, if you’re going through requiring say via https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.8.2/composer.json directly.

    We’d recommend making use of https://wpackagist.org if able, which will pull from wordpress.org here which should have all the same parts as if you installed via dashboard.

    A simplified composer.json file example below that shows the parts needed for wpackagist.org and would install our Algolia 2.8.2 version

    {
    "name": "my-namespace/my-site",
    "description": "My plugins",
    "repositories": [{
    "type": "composer",
    "url": "https://wpackagist.org/"
    }],
    "require": {
    "wpackagist-plugin/wp-search-with-algolia": "2.8.2",
    },
    "extra": {
    "installer-paths": {
    "plugins/{$name}/": ["type:wordpress-plugin"],
    "themes/{$name}/": ["type:wordpress-theme"],
    "mu-plugin/{$name}/": ["type:wordpress-muplugin"]
    }
    },
    "config": {
    "allow-plugins": {
    "composer/installers": true
    },
    "sort-packages": true
    }
    }
    Thread Starter luistinygod

    (@luistinygod)

    Hello Michael,

    We are using the package from https://wpackagist.org and we use all that composer.json configuration as well, but it is still not working.

    According to my latest investigations it all comes down to the Algolia Search PHP client, in the class CurlHttpClient specifically around these 3 lines:

            $statusCode = (int) curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);
    $responseBody = curl_multi_getcontent($curlHandle);
    $error = curl_error($curlHandle);

    The response and error are empty and the status code is 0.

    Do you have any idea why this might be happening?

    Thank you for your help!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I sadly do not without being able to access your copy of the code during the process or at least error logs, if anything is getting logged.

    That’s also not a library that WewbDevStudios manages ourselves, as I’m sure you understand

    Thread Starter luistinygod

    (@luistinygod)

    Hey Michael,

    The odd thing is that there is no error in the logs. But this morning I found out that changing these 2 lines in the CurlHttpClient.php file (Algolia PHP client) removes the connection error:

    curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false); // Changed this to false.
    curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, false); // Changed this to false (was 2).

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    hmmm, not sure what to suggest here as i don’t think this is a spot we could do any filtering of.

    That said, I’m having to believe there’s something going on between the local install’s current SSL and verification/communication with Algolia’s servers. Have you managed to succeed on a dev install or even production? We don’t have anything enabled by default or indexed immediately on successful connect, so you could get at least first steps tested.

    Extra info in case curious.

    https://curl.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html
    https://curl.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html

    Thread Starter luistinygod

    (@luistinygod)

    Hey Michael,
    Thank you for the reply.
    We found out that the CA file path set by LocalWP was not correct according to our project setup. By adjusting this, everything works now!

    Case closed.
    Thank you for the support!

    • This reply was modified 1 year, 4 months ago by luistinygod. Reason: closing
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome to hear. Let us know if you need anything else.

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

The topic ‘Does it work with Local WP?’ is closed to new replies.