If by “run into trouble” you mean that you are getting server or browser timeouts, I’d expect the same trouble with wp_schedule_single_event
, since it is just going to run your function at some other time.
I would consider using wp_schedule_event
to break the work up into chunks– say, process 500 (of your 4000 likes) every half-hour or every hour. I suppose you could do the same with wp_schedule_single_event
by scheduling multiple single events but I am not sure why you would prefer that over wp_schedule_event
.
Neither of those will strictly be “background” processes, though, by which I think you mean something like this.
I should also note that most of the hosts I’ve seen do not allow the kind of mass volume email that you are sending. I’d check the TOS if you haven’t already.
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
- Scheduling a task using class methods
- 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?
- 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
- Change default admin page for specific role(s)
- Check for dependent plugin and if false dont activate plugin
- Show message on wordpress admin dashboard
- Log in from one wordpress website to another wordpress website
- Show a user their recently viewed posts
- How is the data stored in the database?
- How to prevent loading of all plugin’s resources?
- Unit Testing a Plugin functionality with cron
- Is it possible for a plugin to register a page template file?
- Error “Call to a member function switch_to_locale() on null” during insert_with_markers
- multiple functions with same filter
- Generate dynamic page through data from another page
- call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members
- How to Create Custom HTML Tag on Editor in `Text(HTML)` mode
- null callback in add_settings_section
- Is there a Filter that I can use to filter the tags before they are inserted in to the database?
- How can I pass get_the_author_meta(‘user_email’) through the REST API?
- Show error, when selecting image in WordPress media uploader if params mismatch
- How to exit a plugin’s execution mid-stream?
- Redeclaring a plugin function within a class
- enqueue script/style plungin development
- How to Add a Custom Size for Thumbnails for WP – Gallery
- Conditional Generation of Image Sizes using add_image_size
- Plugins and caching
- Display time difference (6 hours ago) in a Soliloquy caption
- Empty Array is Giving Warning for array_merge()
- Pass custom props to
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- GET request return value as error instead of success
- How to update global variables in plugin activation callback?
- How to include a page template and template part into my plugin
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- How to affect front page by plugin
- problem with blank page
- Use custom clean URLs for a plug in
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- Get URL of Post You Are Editing
- Nothing happens on WordPress Update command
- Ajax Contact form plugin [closed]
- How to get the value entered in the input field in wordpres
- Sanitize and Save metabox values
- Help interpreting @wordpress/create-block-tutorial-template usage error
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- WooCommerce adds a newline symbol (\n) between email recipients
- Upload to a specific media folder created by FileBird Lite
- How can I add a custom button to the post editor?
- How to use register_setting()
- What’s wrong in the WordPress Meta Box Generator code?
- add category id to option name when adding an option on edit_category
- esc_url, esc_url_raw or sanitize_url?
- React Plugin Settings Page Localization
- Is it within WordPress guidelines to update another plugin’s database fields from my own plugin? [closed]
- Block Development: hamburger module throwing error in save function
- How can I chanage the user for the composer container in wp-env?
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- Ninja Forms: Front-End Forms, Post ID?
- Allow HTML in product attributes and variation for WooCommerce
- How do I modify the error code array used by “shake_error_codes” filter?
- How do I add multiple custom menu Woo-commerce my account page?