Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-pings can take a long time #175

Open
boonebgorges opened this issue Apr 24, 2019 · 2 comments
Open

Self-pings can take a long time #175

boonebgorges opened this issue Apr 24, 2019 · 2 comments

Comments

@boonebgorges
Copy link
Owner

I've had a few reports of self-pings taking a long time, specifically the dispatch() calls that can make the pageload appear to hang when posting new content.

After some experimentation (including a local installation where I was experiencing the problem) I discovered that the cURL requests were failing because of DNS lookup issues. If I filtered bpges_async_request_query_url and replaced the domain name with the IP address, the problem went away. Something like this:

add_filter(
  'bpges_async_request_query_url',
  function( $url ) {
    return set_url_scheme( 'http://127.0.0.1/wp-admin/admin-ajax.php' );
  }
);

I'm unsure whether this is safe or wise to do in the plugin itself. I'm opening the ticket to track the issue and possibly gather feedback.

@boonebgorges
Copy link
Owner Author

I've had mixed results with the solution above. Another possibility is that you can reduce the timeout back to the default in wp-background-processing, though then you have to be sure to monitor that the emails are actually going out:

add_filter(
  'bpges_async_request_http_request_args',
  function( $args ) {
    $args['timeout'] = '0.01';
    return $args;
  }
);

@r-a-y
Copy link
Collaborator

r-a-y commented Jun 4, 2019

I ran into an edge case where if the main site is not secure and served over HTTP, the GES query URL might be forced to use HTTPS (by another plugin or code snippet filtering site_url or something like that).

If that is the case, doing something like what Boone mentions in the first post works.

This is what I did:

add_filter( 'bpges_async_request_query_url', function( $retval ) {
	return set_url_scheme( $retval, 'http' );
}, 9999 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants