Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:24:44+00:00 2026-05-26T18:24:44+00:00

I am doing some sort of cronjob inside a WordPress plugin that does the

  • 0

I am doing some sort of cronjob inside a WordPress plugin that does the following. When the cronjob needs to be fired, it sends a piece of jquery code with the user that happens to visit. As soon as the script is loaded on the frontend, it sends a post back to the server with the actions that need to be performed.

Now the function that fires on the server takes a long time to complete, that’s why I do it this way. In PHP i have ignore_user_abort(true); so it does not matter if the user closes the browser. And I have some build in fallback if for some reason the actions are not fired with the particular user.

This works great all, only problem, for the particular user that visits, the browser keeps waiting for a reply. Is there a way I could break the jQuery post as soon as it is received by the server.

And if someone has another better solution for me to mimic a cronjob please let me know. I do not want to rely on functions as exec(), pcntl_form, wp-cron, as they are often disabled for users.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:24:44+00:00Added an answer on May 26, 2026 at 6:24 pm

    I don’t think the client actually waits for the request to complete (at least it shouldn’t, if you have async on and everything…)

    But anyway, if it’s still a problem, you could send the request, then use xhr.abort(); or such after, say, a second or two.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While doing some JavaScript performance tests I came up with the following piece of
Doing some jquery animation. I have certain divs set up with an attribute of
While doing some refactoring I've found that I'm quite often using a pair or
I am doing some sort of lab test record collection but there is a
I am doing some sort of science with a combination of Python, bash scripts
I'm doing some programming practice right now by trying to sort a 2D array
I'm looking for some help converting this from prototype to jQuery. I'm doing some
Basically, I'm doing some sort of image processing using a screen-sized rectangle made of
I am currently doing some work for a company that runs a legacy web
I am doing some sort of drawing software in WPF, and I have certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.