The WP Cron .. which runs when user hit website .. Thus if there are no website visits, WP Cron never runs.
Now you can use 2 solutions.
Disable WP-Cron and use real cron job and then custom real cron job
use custom interval in wp_schedule_event
add_filter( 'cron_schedules', 'myprefix_add_a_cron_schedule' );
function myprefix_add_a_cron_schedule( $schedules ) {
$schedules['sixsec'] = array(
'interval' => 21600, // Every 6 hours
'display' => __( 'Every 6 hours' ),
);
return $schedules;
}
///////Schedule an action if it's not already scheduled
if ( ! wp_next_scheduled( 'myprefix_curl_cron_action' ) ) {
wp_schedule_event( time(), 'sixsec', 'myprefix_curl_cron_action' );
}
///Hook into that action that'll fire sixhour
add_action( 'myprefix_curl_cron_action', 'import_into_db' );
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
- 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
- function deactivate_plugins does not exist
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- Change the_title() of a page dynamically
- Adding more options to the instance of an image. (Attachment Display Settings)
- Plugin – create a page without it appearing in the side menu
- What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
- Trouble with Transient API when W3TC is activated [closed]
- Using wp_filesystem in Plugins
- Getting wrong relationship value in $args in wp_Query?
- custom XMLRPC method plus authentication of user & WooCommerce order
- How to extend LINK TO functionality in ATTACHMENT DISPLAY SETTINGS
- How do I Make a Theme “plugin-ready”?
- WordPress REST API call generates nonce twice on every call
- WordPress Terminology Options Vs. Settings
- How to modify post content before writing to database?
- Display only certain posts based on visitor’s country?
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- How to trap “Publish” button to check for meta box validation?
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Custom user profile, registration, login page with theme
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- Possible to preset a widget’s contents via a plugin script?
- $wp_filesystem returns NULL. What are the dependencies?
- wp_mail not recognizing cc and bcc headers
- How can I call “preview post” from wp_remote_get with authentication?
- When is it too late to call the action wp_enqueue_scripts?
- Plugin Loading Scripts and Styles on Every Page – Even when not being used
- set_sale_price in WooCommerce [closed]
- Synchronize custom post type tags with WordPress default post type tags
- Adding extra pages to plugin that shouldn’t appear in the sidebar
- What for the tables ending with the meta used in database of wordpress?
- How to create custom field in worpdress default widgets?
- Ensure function has completed before allowing another Ajax call
- jquery document ready function not being called [closed]
- How do I include background images in my stylesheets in a plugin?
- Loading scripts with wp_register_script and wp_enqueue_script
- WordPress is automatically linking plain text email addresses
- Is Using WordPress Supplied WYSIWYG Advisable?
- How do I add a filter to wp_list_categories() to make links nofollow?
- Custom plugin icon not showing up
- I’m designing a plugin to create database indexes. Suggestions?
- need to get user ID after a user logs in
- How to hook into publish post events in wordpress 4.7.5
- What is the best way to embed an JS App in a WordPress Page?
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- $reverse_top_level works the opposite way according to Codex?
- How to serve different thumbnails/images depending on users browser/platform
- Plugin for Android Marketplace downloads?
- Plugin development – How to use a specific wp_options into the real rendered code in the front end?
- Show disclaimer with accept button before redirecting to the payment gateway website
- Why is the temporary upload always 4.1K
- Problem with dinamic add_rewrite_rule()
- How to export post meta with images in wordpress
- Parse form values before sending to options.php
- My WordPress plugin cannot load my JavaScript file
- Password field is empty when using wp_signon();
- How to make a implement queue for scheduling tasks in WordPress?
- Add Minimum Dimensions Text to Featured Image
- Putting a resized image into media library with wp_get_image_editor(
- Show error message after exception handled
- How to use github to update my plugin