SOLVED: Wp_remote_post request failed

I have created a hosting account, installed WordPress and Bricks 2.0 beta and get the error message in the admin screen: - ‘wp_remote_post request failed’.

I have checked with the hosting support and Curl is enabled and there is nothing in the web firewall that would cause this error. I rolled back to Bricks 1.12.4 but the error persists. And I tried various PHP versions - this also made no difference.

Has anyone had this experience and if so, did you get it fixed?

1 Like

thats a wp core func interesting

Hi @Nico_S,

can you post a screenshot of the error? Also, can you check if there is anything in the debug.log (if not, check if it’s enabled, then let us know).

Thank you.
Matej

This is the only error I can see (using a debug plugin): -

PHP Fatal error: Uncaught Exception: No route defined for this Routes : update_terminal_settings in /home/xxx/public_html/wp-content/plugins/debug-log-config-tool/app/Router.php:77 #0 /home/xxx/public_html/wp-content/plugins/debug-log-config-tool/app/Classes/AjaxHandler.php(23): DebugLogConfigTool\Router->direct() #1 /home/xxx/public_html/wp-includes/class-wp-hook.php(324): DebugLogConfigTool\Classes\AjaxHandler->handleRequest() #2 /home/xxx/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #3 /home/xxx/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #4 /home/xxx/public_html/wp-admin/admin-ajax.php(192): do_action() #5 {main} thrown in /home/xxx/public_html/wp-content/plugins/debug-log-config-tool/app/Router.php on line 77

Did you check the link there: Known issues – Bricks Academy?

Did you try that?
Matej

Thanks for your help. There’s no CDN and I added that snippet to functions.php but the error message remains.

Did you disable Bot Fight Mode in Cloudflare? FAQ · Cloudflare bot solutions docs

Best regards,
Matej

Cloudflare nor any CDN is being used.

Please refer to this forum thread and see what you get from the Code element.

You should get an ‘OK’ if all good.

This is the output I get: -

image

How about this? Try to check in the frontend to see if both are showing OK too.

<?php
$url = add_query_arg(
	[
		'action' => 'bricks_system_info_wp_remote_post_test',
		'nonce'  => wp_create_nonce( 'bricks-nonce-admin' ) 
	],
	admin_url( 'admin-ajax.php' )
);

$args = [
	'sslverify' => false,
	'body'      => '',
	'timeout'   => 10,
	'cookies'   => $_COOKIE,
];

$response = \Bricks\Helpers::remote_post( $url, $args );
if( is_wp_error( $response ) ) {
	echo '<pre>';
	var_dump( $response->get_error_message() );
	echo '</pre>';
} else {
	// Get the body of the response
  if ( isset( $response['response'] ) ) {
    echo '<pre>';
    var_dump( $response['response'] );
    echo '</pre>';
  } else {
     echo '<pre>';
    var_dump( $response );
    echo '</pre>';
  }
	
}

?>

Yes, I get the same result: -

image

Then you shouldn’t get the failed result on the system information page.

You might need to deactivate plugins + use parent theme only to isolate the issue.

If the same issue still there with only Bricks theme, please send us admin credentials (help@bricksbuilder.io and include this forum thread URL as reference.)

Regards,
Jenn

Thanks.

To be clear, this error occurred immediately after uploading the Bricks theme. There were no plugins or child themes installed and rolling back to previous versions of Bricks (or PHP), makes no difference.

Also seeing this error: -

‘The REST API did not process the context query parameter correctly.’

I’m not sure that it’s related.

Will send admin credentials now.

Thanks for your help.

After a lot of back and forth with support at my hosting company, we found the issue.

There were IPv6 AAAA records at my domain registrar and the site was trying to connect there. As soon as I deleted those records, the error went away.

2 Likes

I don’t know if the solution lies in the AAAA records…
I am now getting exact same error… Strangely:

  • I cloned this from another website - the original works fine
  • This clone with the error is on a subdomain of the original, and it is hosted on same server, hardware, theme, plugins etc.
  • This clone was working fine for a while before decided it will give me this error.
  • No CDNs etc involved
  • No AAAA records involved.
  • Error persists when ALL plugins are deactivated.
  • Noticed the error a week ago (may be relevant).