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
- Cron Job not working
- Redeclaring a plugin function within a class
- What plugin development paradigm differences have occurred between version 3.5 and now?
- How do I change the image from the default mysteryman in the WP Profile page
- Are uploads directories created on a schedule?
- Error: Call to a member function get_error_code() on a non-object
- WordPress: How to rename the main php plugin base file?
- Filter for admin (back end) ‘reply to’ comment
- How to get custom post_author?
- Is there any way to hide page from dashboard (all pages list) OR navbar from plugin function?
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- wp.media Uncaught TypeError: Cannot read properties of undefined (reading ‘state’)
- Showing results from json-string in WordPress search results page
- Pass custom props to
- GET request return value as error instead of success
- How to revive (or take over) a plugin?
- Make visible page only in the trash
- Reading plugin settings in esnext wordpress block
- Plugin frontend page design irrespective of the theme used
- 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?
- add_meta_box does not display meta box in Admin
- How to store in the database directly the translation?
- How to affect front page by plugin
- What is the “best” way to update a theme via a plugin?
- Is there a an option to modify the post content directly on the browser instead of having it reflected on browser by modifying in the database?
- Acessing WP functions in form submission handler
- Custom theme and plugin updating
- What method should I use to store my plugin data (multi level menus with options on each item)
- problem with blank page
- Error on using __FILE__ for add_menu_page() Function
- Getting error of unexpected output during activation
- Use custom clean URLs for a plug in
- Projectmanager Internal Link Code Location
- Select options not reloading after form submit
- How to add something after a function
- Plugin SVN folder structure
- how many rupee or dollar charge to client to make theme [closed]
- Anyway to prevent admin from seeing other admin’s product?
- Bulk post approval and publishing doesn’t work
- How can I get Intellisense working in Visual Studio Code while editing remote PHP plugin code on a WordPress site via FTP?