0

Just wanted to ask how can we check which hook is being used for post updates or pages updates, as listing from wp cron event list, there are multiple crons but is there a wayu to recognize post and page update crons and also what are the next run relative and recurrence, I did check the doc but not entirely able to understand them, yes they are showing they are running but a proper understanding would be beneficial

Thank you

enter image description here

6
  • can you be more specific than "post and page update crons"? WordPress cron jobs trigger an action, they don't know what that action does or what's hooked into it, that's up to you, the most information cron on its own can give is the name of the cron job, aka the action/hook it fires. What's the reason you're asking this question? What kind of post/page updates? Which docs did you check?
    – Tom J Nowell
    Commented Apr 2 at 12:49
  • Thanks for the reply tom, basically facing an issue of article updates, a lot of times it is taking 15 to 10 minutes to update so thought of 2 conditions 1 is cron other is CPU , the CPU is fine so thought that the crons might not be triggering at when publishing a post even though they are set every minute, and the lastly was confused like as you can see there are wordfence hooks etc so is there any hook that is of post ? Thank you Commented Apr 2 at 13:34
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Apr 2 at 13:58
  • The thing is we have a customer that is having issues when updating an article it takes around 10 to 15 to show up, check possible solutions, the only thing that I am concerned is the crons that they might not be triggering at the time of publish, apologize the details of the wp-admin I cannot provide Commented Apr 2 at 14:06
  • when you create and publish a post in the editor that has nothing to do with cron, the only time cron is involved in WordPress publishing of posts is when you perform a scheduled publish, aka you set a future publish date. If your customer is not using future publishing, and is directly publishing, or updating an already published post, then that has nothing to do with cron and your theory is incorrect
    – Tom J Nowell
    Commented Apr 2 at 14:47

2 Answers 2

0

which hook is being used for post updates or pages updates

WordPress does not use cron jobs to update posts and pages.

The only exception is scheduled publishing of posts and deletion of trash, e.g. if you want to publish a post and set it to publish next wednesday, or when trashed posts are deleted after 30 days.

there are multiple crons but is there a wayu to recognize post and page update crons and also what are the next run relative and recurrence,

A cron job is a way to fire an action/hook in the future at a regular interval. aka do_action but at a future time.

  • hook is the action that will be triggered when the job happens
  • next_run_gmt is the time that action is meant to run ( stored in the GMT timezone ).
  • next_run_relative is WP CLI telling you how long until that time so you don't have to do the math in your head
  • recurrance is how often this happens, e.g. every day? every month?

The thing is we have a customer that is having issues when updating an article it takes around 10 to 15 to show up, check possible solutions, the only thing that I am concerned is the crons that they might not be triggering at the time of publish, apologize the details of the wp-admin I cannot provide –

The chance that this is related in any way to cron is vanishingly small, remote, highly unlikely. It's far more likely to be a caching problem. Unless you have written code that uses cron to publish/update posts, or have used a page builder that uses cron, then this is not something that should be in your top 10 things to debug, and most likely a waste of time.

It's also highly unlikely to be CPU. When PHP handles a request there is a time limit, if your request takes longer than the time limit then a fatal error occurs and a message is logged to the PHP error log. You would see this in the editor either as an error message or a HTTP 500 error. Most servers are pre-configured with timeouts of 20-60 seconds.

2
  • Thank you again Tom Commented Apr 2 at 14:56
  • if this answers your question consider marking it as the correct answer using the tick button under the voting controls
    – Tom J Nowell
    Commented Apr 2 at 14:58
1

I hope I understand your question. Here is a short explanation of the screenshot you sent:

  • Hook -> refers to the name of the cron that is run
  • Next run GMT and next run relative -> the time of the next run
  • Recurrence -> how often should the cron run (hourly, daily, weekly, etc.)

The command line does not give you much information, but if you install the plugin https://wordpress.org/plugins/wp-crontrol/, you will see what specific functions are run when that cron runs. Sadly, you will have to use a code editor to look up the functions in your code or do some research on Google to find out what they do.

Hopefully, this answer will be helpful.

Best wishes!

1
  • Thanks Dennis for the recommendation will check this out Commented Apr 2 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.