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?)
- Which hook should be used to add an action containing a redirect?
- add_action hook for completely new post?
- Add a new tab to WordPress Plugin install Listing
- Changing Plugin Load Order
- Admin settings update updating every time home page is hit?
- WordPress Hook for user register
- Which action for triggering cron “wp”or “init”?
- Global Objects and Public Methods
- Using filters and actions for plugin API?
- How should you hook a session_start() when authoring a plugin?
- Init action hook running late after PayPal’s return url?
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- wp_schedule_event in a class
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How to make a cronjob type plugin
- Ajax +wordpress onClick link redirect to new page and create html content
- How to replace settings in WordPress plugin from a theme
- Redirect returning users to a certain page?
- Restrict certain actions to plugin-specific admin menu pages only
- wp_schedule_single_event is set correctly but sometimes not fired
- Creating posts with links from a txt file
- Set the payment processor callbacks to a plugin
- 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
- How to enhance a self developed plugin by its own plugin architecture
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- How to update global variables in plugin activation callback?
- Woocommerce get_term_by() in transition_post_status hook doesn’t works
- How to Run Plugin on Server Without Web Browser
- Add two button to page and post admin to redirect to : add new & list of (posts – pages) just after saving post or page
- `registration_errors` filter doesn’t seem to be called
- How to grab data after wp user search is complete
- Limit get_next_post to posts from the same author
- Any way, hook to add content right before the “read more” link?
- Is there any way to get post meta from publish_post hook?
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- Add a custom submenu under submenu in a Custom WordPress Plugin
- How do I ensure I can loop through every enqueued script and CSS?
- Hook for validating and rejecting frontend image upload
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Nested Hooks with do_action for performance reasons – safe/necessary?
- Problem in plugin debuging in wordpress
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- OOP development and hooks
- Plugin Development – Call to undefined function comment_exists()
- Plugin with functions inside a class & how to trigger WP CRON
- remove different admin menu for specific users
- Custom recurrence not working / Wp Cron event
- Add_action not calling callback function
- replacing jquery google cdn with a new version dynamically
- Prevent plugin activation and add admin notice
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- add_option_{$option} action hook not being called
- Unable to show a message after plugin activation
- plugin modal/popup integration best practice
- 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
- Can wp_schedule_single_event be used to run background proccess?
- How do I replace title with my plugin?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- Get user logged in status from within a plugin. $current_user not defined
- Call do_action() within WordPress cronjob
- Woocommerce: block user removing cart item
- how to insert content into wp_head after loop_end
- Insert plugin html content to a specific spot in the frontpage
- Apply function on all action hooks?
- 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
- Send Webhook when post-status is publish or trash
- Using “add_image_size” to register custom image sizes inside plugins not working
- get_term_by() returning null on plugin
- 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
- Ninja Forms: Front-End Forms, Post ID?
- Execute callback after REST API request completes + Response is sent
- Custom fields in the billing address section woocommerce
- How to use useSelect to retrieve the currently default fontFamily?
- How to customize password reset message page on success if no error in password reset
- Is there a hook for updated image metadata upon using image editor?
- Can I know what changes happened after using native Image Editor?
- Does a wordpress custom plugin is fired by default on php theme ajax request?
- WordPress Cron Job not importing products
- How to run this plugin every time a post is saved?
- how to execute a function only when i send an order to trash [closed]
- Are woocommerce_thankyou hook and is_order_received_page() redundant? [closed]
- Weekly cron is either missing the schedule or triggered too many times on Fridays