I actually found out that the Cron works, just not as I expected. I refreshed the pages and called wp-cron.php
(using wget
) a couple of times, and I kept seeing my cron task schedule with “-X seconds“. Then I stopped for a minute or two, and refreshed the frontend page of the site, and my Cron task got called.
When it was time for the second scheduled execution, one hour later, I repeated the test. Task was due in a couple of seconds, so I waited about 10 seconds an loaded a random page: nothing happened. I waited another half a minute or so, loaded again a random page, and the task got called.
It seems that WordPress has a “relaxed” way of calling Cron jobs, which I don’t fully understand yet. Anyway, my approach was correct, my expectations were not. 🙂
Related Posts:
- Which action for triggering cron “wp”or “init”?
- wp_schedule_event in a class
- WP Cron – Run Cron after evey 15 minutes at a specific time for the next three hours
- Using wp_cron with custom time interval and the register activation hook
- WordPress scheduled task is called but not executed
- Problem creating cron job wordpress
- How Do I Make WordPress Run an Event Every Day?
- How can I change the frequency of a scheduled event?
- Hourly WP schedule, do I need at least 1 visitor hourly?
- WP Cron doesn’t save or in post body
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- WordPress cron running twice
- What is minimum time interval for which a cron be scheduled?
- Will cron job run if page loaded is being served from cache?
- Use wp_set_post_terms() instead of wp_insert_post()
- Programmatically detect if wp-cron is disabled?
- How to schedule a cron job in plugin without waiting for page load request?
- How to perform a heavy and long process in cron jobs?
- WordPress daily cron is executing more frequently than once a day
- wp-cron and execution of code in is_admin() included script
- How to Trigger WP CRON at Local Timestamp?
- WP Cron being triggered but not working as expected
- wp_schedule_event() set daily, but processed every second
- Will I get an error if I try unscheduling a WP Cron scheduled task that wasn’t scheduled?
- Looking for a better way to initiate cron job
- WordPress plugin cron working only if admin is logged in
- How to make a cronjob type plugin
- wp_schedule_single_event is set correctly but sometimes not fired
- How to Run Plugin on Server Without Web Browser
- Plugin with functions inside a class & how to trigger WP CRON
- Custom recurrence not working / Wp Cron event
- How and when would I implement some code which would take data from one part of the Db and put it in another?
- WP Cron as Fast as WordPress AJAX?
- Detect each active instance of a widget
- What is the use of wp_schedule_event hook?
- Can wp_schedule_single_event be used to run background proccess?
- Call do_action() within WordPress cronjob
- Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?
- wp cron does not run when i am not logged in to wp admin
- Add self-closing shortcode button to TinyMCE in WP 4.6
- How to make dynamically-generated content searchable in WordPress?
- Nav Menu meta failing to import
- How do I conditionally enqueue script for CPT single post type with plugin?
- Is it possible to remove next-post / previous-post with out creating a custom template?
- Escaping built-in WP function return strings
- Custom Rewriting to Plugin with Parameters
- Help adding image upload functionality to widget
- Script won’t load via plugin class
- How to override a function call in functions.php?
- Is there a need to do apply_filter(‘widget_title’, $instance[‘title’]) or any other ‘widget_xxx’ filters?
- How can I render shortcode so that its not cached by Caching plugins?
- How to save WP widget instances and options
- Function Get User Object By Username?
- How to run an add_action hook for specific page
- How to use radio buttons in WordPress plugin options using register settings?
- Is it possible to use add_filter from a theme to alter a plugin’s function?
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- Send push when new post is published in a certain category
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Translation per IP location [closed]
- Add a select option of shortcodes like dropdown in tinymce
- wp E-commerce featured product plugin with muliple option?
- Problem with saving checkbox values with WordPress Widget API
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Force download file from plugin (change output http headers)
- Run JavaScript validation script on form submit in plugin
- What’s the hook for filtering every texts of site?
- Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions
- How to add plugin options in wp editor page
- Service Worker Uncaught (in promise) DOMException
- WordPress Plugin Boilerplate: Addition of 3rd party scripts and styles [closed]
- How to format custom fields when editing an attachment?
- Woocommerce – Provide Associated Category Link for Product List Plugin [closed]
- How can I call wp-load.php in my plugin file
- How to create new content type and flushes rewrite rules without visiting the permalinks page?
- Extract Information from post content (using regex?)
- Using jQuery prepend() with file include
- Customise Grouped Product display in Woocommerce with custom column
- Ajax action has 200 status but response of No response data available for this request
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Adding customs fields on each product on the cart
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- Unit Testing action hook
- Integrate separate web app inside wordpress [closed]
- I have a plugin where in I have to change the title of the page dynamically by sending parameter to the_title filter
- PHP includes with AJAX actions
- Custom Post Type and Functions
- How can I map a specific URL pattern to a plugin for processing
- Issue on Getting Images URL of the Post Gallery
- I can install my plugin in localhost but not in my server
- Change the class of wordpress menu
- WordPress.org how to force expire Cached Banner-772×250 from my Plugin page
- What is the Timeline for the Active Version Pie Chart in the Repository?
- How to change url’s in WordPress when changing domain [duplicate]
- Email verification feature in wordpress social login plugin
- Custom Pin it button is not showing over the image instead it shows as block top_left
- Is wordpress plugin development active? [closed]
- Need someone to help you want to manage points for members to code interface functions? thank you
- Run different permission_callback depending on HTTP method of custom REST API endpoint