I was having the same issue recently, until I followed an example from the WordPress Codex which suggests using action hooks to run the function.
I think if you add the following…
add_action( 'recalculate_all_scores_hook', 'recalculate_all_scores' );
…and amend the wp_schedule_event function to use the action hook name rather than the function directly…
wp_schedule_event( time(), 'fiveminutes', 'recalculate_all_scores_hook' );
…you might be in business.
Good luck!
Related Posts:
- How and when would I implement some code which would take data from one part of the Db and put it in another?
- What is the use of wp_schedule_event hook?
- Difference Between Filter and Action Hooks?
- How many times will this code run? (or, how rich is grandma?)
- Admin settings update updating every time home page is hit?
- Which action for triggering cron “wp”or “init”?
- Global Objects and Public Methods
- Using filters and actions for plugin API?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- Does WP fire delete_post when trashed posts are automatically deleted?
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- How to add a link to WordPress Plugin install Listing
- Hourly WP schedule, do I need at least 1 visitor hourly?
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- Call activation hook multiple times
- Two-step login process – Is it possible?
- How can I hook into existing WordPress Bulk actions?
- Hook for post permalink update
- Get returned variable from a function to add_shortcode function
- 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
- Earliest WP Hook to Safely and Reliably Redirect
- Define a function outside a class and call the function using action or filter hook
- Create a plugin to change the action to which a function is hooked
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- Synchronize Custom post type tags to WordPress default posts tags
- comment_email hook doesn’t seem to work for comment editor field
- unable to stop loop when using wp_insert_post with publish_post hook
- Hook into theme-switching later than `setup_theme`
- Is it possible to delay execution of shortcode output callback?
- Scheduling a task using class methods
- WordPress Ajax callback function from plugin – OOP
- Why my database table not created on activation?
- What is minimum time interval for which a cron be scheduled?
- Will cron job run if page loaded is being served from cache?
- Act on user meta updated, but only once
- Where and how does WordPress store and use its plugin and hook information?
- Is there any way to allow a plugin to write over a previous version?
- Use wp_set_post_terms() instead of wp_insert_post()
- WordPress after content Hook & external template part
- best practice for query string values – get_query_var always empty for my value supplied in query string
- get_current_screen() return null
- Programmatically detect if wp-cron is disabled?
- Modifying meta tags after doing ajax call in plugin
- how to add custom functionality after woocommerce place order button
- How to schedule a cron job in plugin without waiting for page load request?
- Where to add hooks in a class
- How to use output buffering in WordPress hooked functions?
- Conditional hook based on the core function that is calling it
- Adding option to Gallery shortcode
- How to perform a heavy and long process in cron jobs?
- I have 2 plugins using the same wp_login action hook and one is not working
- Add a new confirmation page before saving
- How dynamic action login_form_{action} is working
- What happens when two or more plugins use the same hook?
- How to get all queries’s results after they have executed?
- wp_schedule_event() set daily, but processed every second
- flush rewrite rules after plugin update?
- Add child pages to submenu automatically
- After plugin activation hook
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- How can I create a custom plugin that allows anonymous users to signup without registering?
- hook filter after the_content on a specific page
- Associate multiple email addresses with the same user account, so they can log in with either
- Run command “composer install” when activating wordpress plugin
- Custom filter not working
- Configure WordPress to Generate Scheme-less Relative URLs
- WordPress plugin cron working only if admin is logged in
- Ajax +wordpress onClick link redirect to new page and create html content
- How to replace settings in WordPress plugin from a theme
- Creating posts with links from a txt file
- Action / Hook when a new plugin is added
- apply_filters() and call_user_func() to define and call a function outside a class
- Getting Post ID at “stylesheet” and “template” hooks
- Is there any way to get post meta from publish_post hook?
- Problem in plugin debuging in wordpress
- OOP development and hooks
- Plugin Development – Call to undefined function comment_exists()
- Add_action not calling callback function
- Prevent plugin activation and add admin notice
- Function not working on any file other than the main plugin file
- Does WordPress have something like timer hook?
- Multi hook deploiement
- WP Cron as Fast as WordPress AJAX?
- Can I use a hook other than ‘init’ to handle form submissions?
- Template file structure , wordpress hook for altering the template
- woocommerce single product page hook not working
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- Detect each active instance of a widget
- How do I replace title with my plugin?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- Call do_action() within WordPress cronjob
- Woocommerce: block user removing cart item
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?
- Send retrieve password notification email with custom HTML email template
- wp_head is not fired from the hook I have used in my plugin
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- wp cron does not run when i am not logged in to wp admin