I tried WP Crontrol instead and it turned out that two cron jobs were being created for generate_send_csv
. To fix this, I created the crons within activation hooks and deactivation hooks as follows:
register_activation_hook( __FILE__, 'my_activation' );
add_action( 'generate_send_csv', 'generate_and_send_csv' );
function my_activation() {
wp_schedule_event('1488979800', 'daily', 'generate_send_csv');
}
register_deactivation_hook( __FILE__, 'my_deactivation' );
function my_deactivation() {
wp_clear_scheduled_hook( 'generate_send_csv' );
}
Related Posts:
- How Do I Make WordPress Run an Event Every Day?
- Hourly WP schedule, do I need at least 1 visitor hourly?
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- Will cron job run if page loaded is being served from cache?
- How to schedule a cron job in plugin without waiting for page load request?
- How to Trigger WP CRON at Local Timestamp?
- Plugin with functions inside a class & how to trigger WP CRON
- WP Cron as Fast as WordPress AJAX?
- What is the use of wp_schedule_event hook?
- Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?
- How do I log plugin (cron) actions?
- 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
- Cron firing my function everytime wp-admin is visited
- 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 can I change the frequency of a scheduled event?
- get_posts / WP_Query Memory size of 134217728 bytes exhausted
- WP Cron doesn’t save or in post body
- Scheduled event does not run at midnight
- Is it possible to load plugin from console with core ?
- How ( and mostly at what time ) can i prevent the alternate cron from running?
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- Scheduling a task using class methods
- What is minimum time interval for which a cron be scheduled?
- Use wp_set_post_terms() instead of wp_insert_post()
- Programmatically detect if wp-cron is disabled?
- Loading WordPress Admin Environment
- How to perform a heavy and long process in cron jobs?
- How does task scheduler plugin implements cron that is not dependent on page load request? [closed]
- How wp-cron can run in background if PHP is single threaded?
- WordPress daily cron is executing more frequently than once a day
- Problems with cron
- wp-cron and execution of code in is_admin() included script
- 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 Schedule Cronjobs for start of every month and year
- Switch from wp-cron to a server 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
- WordPress cron job running more than once
- Cron: Update four post at Hour
- Activate Plugin Automatically After Set Time
- How to Run Plugin on Server Without Web Browser
- Better way to run heavy scripts using WordPress database
- 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?
- WordPress Cron function is not working
- Detect each active instance of a widget
- Best place to keep files that are called by cron jobs?
- Adding custom cron_schedule prior to wp_schedule_event
- Can wp_schedule_single_event be used to run background proccess?
- Call do_action() within WordPress cronjob
- wp cron does not run when i am not logged in to wp admin
- What’s the best method for emptying an option created with the Settings API?
- Get frequency of scheduled event
- Update exisiting site to 3.5 release candidate
- How to get shortcode to work inside a foreach loop called within a shortcode?
- How to bundle a plugin with a theme, or vice versa
- WordPress Media mime type filter problem 4.0
- Is there a naming convention for database tables created by a plugin?
- WordPress plugin options and jQuery
- Some strings from a .mo file do not load
- Add a row on clicking each post featured image
- Filtering SelectControl items according the input from another SelectControl in Gutenberg Block (ES5, no JSX)
- Determining URIs for plugin pages
- Filter Categories widget to allow custom sorting?
- Custom Rest Endpoint: Post/Put/Patch not working
- How to allow only two (or more) users access to a plugin
- Admin Subpages without Menu entry
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Add code to template dynamically
- Creating posts with links from a txt file
- Time limit on long cron job?
- Detect if requested page is PWA on server side
- Allow user to add the php code in wp_mail()
- Plugin setting page – update_option problem
- WordPress Plugin Update Process
- Registration form Plugin… Email confirmation
- How to display posts list on my plugin page?
- wp_head is not fired from the hook I have used in my plugin
- Admin Message after Plugin Option Updated
- How react js and other Javascript Technologies works on WordPress plugin?
- Shortcode rendered in preview, but empty in post
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Add custom data-attribute to core Gutenberg block within an template
- Can I log the searches that are returning 404 in the DB?
- Install a MU plugin from within another plugin
- Do Not Back Up? Is there any accepted way to tell backup and clone plugins to skip a certain file? [closed]
- get_the_tags($ID) is empty during publish_post callback
- Why is WordPress wrapping search for users that looks like integers with asterisks and how do I fix it?
- update_option with array_push adding mutiple copies
- How to enable auto update for embedded plugins
- My activator class isn’t running the code inside
- Remove Gutenberg Buttons Block