You can try using wp cron functions, programing a feed import every 10 minutes or so, until you have nothing left in queue.
Example code:
<?php
register_activation_hook( __FILE__, 'wp1903_schedule_cron' );
function wp1903_schedule_cron() {
$counter = 0;
$feeds = array(
'http://example.com/feed1',
'http://example.com/feed2',
'http://example.com/feed3',
'http://example.com/feed4'
);
foreach ($feeds as $feed) {
$counter++;
// schedule every 10 mins
$time = time() + (600 * $counter);
wp_schedule_single_event( $time, 'wp1903_process_feed', $feed );
}
}
add_action('wp1903_process_feed', 'wp1903_import_feed');
function wp1903_import_feed($feed_url="") {
// do the import
}
It is essential only to run the scheduler on a activation hook, or else at every page load the crons will be rescheduled.
Related Posts:
- Function to return true if current page has child pages
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- How to preserve PHP modifications while upgrading WordPress?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Change comments form title on a page by page basis
- Setting up the child theme so as to enable right-to-left WordPress?
- delete an array element when its date expires
- How to add default images into theme customizer image control?
- Overriding a theme redux file in child theme
- PHP can I add line numbers to file_get_contents()
- Setting custom canonical urls
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Converting HTML Template to WordPress Theme
- How to check if a meta value has already been assigned to any user?
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to pick the default selected value in wordpress dropdown?
- Modify custom field input data before creating a new post
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Need help enqueueing webfonts
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Create page template via functions.php?
- How to create a field in customize and show that in header.php?
- List post by title length
- How do i wrap woocomerce attribute in list?
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Is there a hack for using is_page() within the function.php file?
- Customize field names in backend profile edit page through function.php [duplicate]
- WP insert post Redirect after function has executed
- WP-Bakery – Add custom colors to buttons with template colors
- Trying to update Woocommerce meta values
- update_user_meta as multiple value but with same meta key
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Delete post meta by serialized meta value
- Remove node from multisites?
- Automatically refresh page if widget is added to page?
- Where can I find the declaration of `$_wp_theme_features`?
- How do I routinely extract the thumbnail of the most recent post?
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Check if values exists DB
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How to add button to top of theme customizer?
- How can I clear the theme mod settings?
- Display a list of users with avatar filterable with alphabets
- Select area and checkbox data is not saving?
- WP Custom tables query
- Add multiple HTML attributes to an Elementor button
- Woocomerce custom add to cart button edit functionality [closed]
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- How to capture number input from wordpress form into acf field in woocommerce
- Restricting page by user role
- Shortcode content filter?
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- How do I display a user’s previous orders as a select box option on a product?
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- Hide wordpress field if data is empty in post!
- allow subscribers to see private posts without plug in
- Replace word in “the_content” only for index.php
- How do you add customer capability after Woocommerce purchase?
- How to get specific image in media library with php
- Function set default image when image not present
- Custom location for attached images
- Change the site tagline (or similar) based on current page
- WooCommerce – Reset quantity input field when variation changes
- Query all posts of a custom taxonomy term
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- get current product name in functions.php
- Get first URL from post content
- Handling Body class based on Template
- Trigger popup in a php if/else statement
- Setting a cookie upon specific URL visit
- Only show search results with if current date is between two dates?
- Get_avatar filter?
- Can’t get page content in WordPress
- database interactions using OOP
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- Customizer: Output default value in Customizer CSS
- Way to querry data (tags) from a wordpress database?
- How to add just one specific page to widget without plugin?
- Remove one value in dismissed_wp_pointers?
- get post based on category chosen in drop down – The ajax method
- Adding Default Settings to Theme My Login plugin
- create a select input with menus created on a custom options page
- Image as Sales Badge
- Taxonomy linked to pages
- how to make separate field in wordpress user_data_
- Function not working at one place
- jQuery not defined
- Displaying the Month and Year that a page was Created?
- Changing custom logo link
- Add a class to the anchor tag on HTML5 gallery
- Conditional Header in wordpress
- Remove meta description on certain pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Use menu link or onClick to set a variable
- Swapping wp_dropdown_categories function with wp_category_checklist
- functions.php is being included twice, creating PHP fatal errors