WP Cron: Save third party data as user meta
An alternative way to do what I wanted : Save the time when the action has been ran and check the difference with actual time : function my_save_statistiques( $user_id ) { $user_id = get_current_user_id(); $current_time = time(); if (empty($current_time)) { update_usermeta( $user_id, ‘last_analytics’, $current_time ); } $last_analytics = get_user_meta( $user_id, ‘last_analytics’, true ); $diff = … Read more