WordPress cron isn’t scheduled on amazon web services

As a general principal, you shouldn’t do anything that requires an ‘add_action’ after the plugin activation hook. This is because WP loads and runs all plugins and THEN runs the new added one, and then does a re-direct. You have to set a DB option and hook into that. Here is the discussion from the CODEX:
https://codex.wordpress.org/Function_Reference/register_activation_hook

Try doing this outside of the activation hook and see what happens.In other words, PHP runs through the whole WordPress routine on each browser request. When you ‘activate’ a plugin, you actually fire two page requests to the server. This type of activity properly goes in the 2nd page request, which is the re-direct.

Leave a Comment