Algolia search index fail Algolia search index fail wordpress wordpress

Algolia search index fail


The Algolia plugin for WordPress needs to be able to access the admin interface over HTTP or HTTPS.This is the way it creates a loop to deal with the pending tasks.

According to your logs: 'Basic realm="Restricted"', your admin seems protected behind Basic Auth (htpasswd).

To make the queue work in your case, you should provide the plugin with the credentials.

Here is what you need to add to the functions.php file of your active theme.

<?php// In your current active theme functions.php.define( 'MY_USERNAME', 'test' );define( 'MY_PASSWORD', 'test' );function custom_loopback_request_args( array $request_args ) {    $request_args['headers']['Authorization'] = 'Basic ' . base64_encode( MY_USERNAME . ':' . MY_PASSWORD );    return $request_args;}add_filter( 'algolia_loopback_request_args', 'custom_loopback_request_args' );

Note that this will probably change in the upcoming weeks as we are working towards removing that logic.