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

edd_test_ajax_works performance bottleneck #2873

Closed
bobbingwide opened this issue Dec 14, 2014 · 5 comments
Closed

edd_test_ajax_works performance bottleneck #2873

bobbingwide opened this issue Dec 14, 2014 · 5 comments
Labels
Milestone

Comments

@bobbingwide
Copy link
Contributor

Since re-enabling EDD on my local machine it's been grinding to a halt.

I keep on getting "Your site appears to be blocking the WordPress ajax interface. This may causes issues with your store."

BTW. There's a typo in the message. It should be "This may cause issues with your store"

Is this if statement really supposed to perform the checks in the order shown?

if( ! edd_test_ajax_works() && ! get_user_meta( get_current_user_id(), '_edd_admin_ajax_inaccessible_dismissed', true ) && current_user_can( 'manage_shop_settings' ) ) {

If I've dismissed the message then why is it still performing the test?

@pippinsplugins
Copy link
Contributor

I've seen a couple of other people with this same problem, but I'm not sure
why it's happening . . . If you comment out the test, does that fix it?

On Sunday, December 14, 2014, Herb Miller notifications@github.com wrote:

Since re-enabling EDD on my local machine it's been grinding to a halt.

I keep on getting "Your site appears to be blocking the WordPress ajax
interface. This may causes issues with your store."

BTW. There's a typo in the message. It should be "This may cause issues
with your store"

Is this if statement really supposed to perform the checks in the order
shown?

if( ! edd_test_ajax_works() && ! get_user_meta( get_current_user_id(), '_edd_admin_ajax_inaccessible_dismissed', true ) && current_user_can( 'manage_shop_settings' ) ) {

If I've dismissed the message then why is it still performing the test?


Reply to this email directly or view it on GitHub
#2873
.

@pippinsplugins
Copy link
Contributor

^^ I'm pretty sure that fixes the issue.

@pippinsplugins
Copy link
Contributor

Looks like ajax checks are still running on every page load.

@bobbingwide
Copy link
Contributor Author

Hi pippin, thanks for replying. I had changed the sequence of the tests.
Wondered if perhaps this could be something that's only run in EDD admin pages.

The reason I was seeing this message may be something to do with my local server not being keen to respond to a new request until the first one has finished. I can't confirm that was the case with EDD but that's what I've been seeing with other logic... a local request initiated by wp_remote_post() is not being served until it's timed out! I've seen mentioned that this may be something to do with PHP sessions but have not found the correct workaround
ie. session_write_close() does not magically fix the problem.

Your fixes look OK. Don't forget the typo :-)

@bobbingwide
Copy link
Contributor Author

hi, just to confirm that I had recently upgraded Kaspersky Internet Security and it was monitoring port 80, so the apache server effectively became single threaded. It wasn't until the timeout occurred that the ajax request was run. nothing to do with session_write_close()

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

No branches or pull requests

2 participants