Michael Beckwith
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to ConnectHmm.
$clientshould be an instance of https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.11.3/vendor_prefixed/algolia/algoliasearch-client-php/src/SearchClient.php with thelistApiKeys()method being defined at Line 223 to 226We’re definitely getting into the proverbial weeds here.
I’m also suddenly curious if a second application would succeed, but understand if you don’t want to take that route. It could always be deleted afterwards.
Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to ConnectI think I pasted the wrong highlight earlier. Sorry about that.
Line 120-161 is the
assert_valid_credentials()method.May not hurt to try and log the
$clientobject as a whole, to verify if we have aSearchClientobject. That’s going to be from the PHP SDKCurious what’s showing up if you’d change line 130, which is
$client->listApiKeys();to assign to a variable and log the results.Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to ConnectSo the assert_valid_credentials method can be found at https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.11.3/includes/class-algolia-api.php#L195-L244
Would be interesting to:
- verify the 2 parameters are coming in as expected.
- Add a log line in the catch block for
$client->listApiKeys()call - Verify the
$client->getApiKey( (string) $api_key );call is what we’re expecting based on dashboard values. Maybe use a try/catch around that as well. - Check if we get to the
if ( ! empty( $missing_acls ) ) { ... }section where we throw our own exception.
Awesome to hear. I’ve taken notes and filed a ticket to have us harden this specific spot up, so that it doesn’t happen more in the future, for everyone.
Thanks for all the feedback with this.
Did it allow you to successfully re-activate too? or is that still causing errors? Trying to determine urgency of a potential code reworking for the details
Do you have access to the site’s file system, via SFTP or perhaps hosting dashboard? We can answer other questions once the site is back up.
Renaming the plugin’s folder should “hotwire” it to be deactivated long enough to get you back up and in.
Are you getting errors like “headers already sent” or similar? or is it a complete white screen or “your site has experienced an issue” type message?
The line in question is definitely a new one from the latest release, but we hadn’t been experiencing this issue thus far.
In case it helps, what version of PHP are you running on, in case that’s contributing to the issue?
Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to Connect@bdbowles we currently ship with
"algolia/algoliasearch-client-php": "3.4.2"from Composer.A lot of our recent work has been focused on getting this type of issue stabilized and better handled.
I know we have a release going out today that adds in extra checks for current site domain+connecting user and will force disconnect if there’s a mismatch.
An example of when this would come up is if say you’ve cloned down the production install to a staging or local copy. Curious if you can confirm if that type of thing has been done for this site in question.
Also curious if there’s anything in general hosting error logs around the times that manual reconnection had to be done. Hopefully not the case, but possible that new tokens and whatnot don’t save successfully somehow, but the previous refresh token was used already.
Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to ConnectDefinitely both on the same right paths. The try/catch I pointed out earlier is part of the
Algolia_API::assert_valid_credentials()call. Just different spots in the stack trace 😀Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to ConnectDid anything get logged for that?
Regarding “All API Keys” listing, I assume this to be expected, but we have zero control with what shows there. That’s an Algolia.com question.
Out of extra curiosity, have you reached out to Algolia support regarding this? They may be able to help deduce why the app/api pairings aren’t validating, or at least if they SHOULD.
I still believe we’re likely failing at a spot with this:
try {
$acl = $client->getApiKey( $search_api_key );
} catch ( AlgoliaException $e ) {
return false;
}Which is a step that includes their PHP SDK
Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to ConnectHmm.
Part of the validation process occurs in https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.11.3/includes/class-algolia-api.php#L195-L244
4 spots that it maybe returns false.
- Error with fetching the key as a whole, with an AlgoliaException
- “search” scope is NOT set.
- The key has more permissions than we allow (the four you listed, and recently added
browsewith one of our latest releases) - If the key has unlimited TTL (we don’t want unlimited).
Based on the original error message, we’re hittting the first one, for some reason.
Have you done any customization to configurations? Specifically items that would be set in https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.11.3/includes/factories/class-algolia-search-client-factory.php like secured keys?
Forum: Plugins
In reply to: [WP Search with Algolia] Impossible to ConnectWhat are the restrictions shown when visiting https://dashboard.algolia.com/account/api-keys/restricted?applicationId=YOURAPPLICATIONHERE ?
Fill in the actual application ID for that URL. We’re wanting specifically the “Search-only API Key”
Forum: Plugins
In reply to: [WP Search with Algolia] How auto re-index works?Let us know if you have any other questions.
Forum: Plugins
In reply to: [WP Search with Algolia] Scheduled posts not appearing in the indexPrimary being “post” post type?
Don’t really need to move TOO much, since the issue at hand is scheduled posts not self indexing. So primarily we’d want/need the theme/plugin environment more than database. Also to ensure we don’t accidentally push non-production data to the prod Algolia index, change out the prefix value to have it create a temp index in Algolia that you can delete afterwards.