reminder wp_schedule_event

It’s because your code is explicitly written to ignore whether or not the event is in the past or the future. See here: $diff = strtotime($my_meta) – strtotime($datetime2); If the event date is in the future, $diff will be a positive number, but if it’s in the past, it will be a negative number. Then … Read more

WP_cron keeps going back to the past

For future reference if someone else has the same problem. Found out that the high availability of the database cluster was causing this. For some weird reason another server was sending old data back to the mysql server on which this wordpress site is connected at the moment. The strange thing is that it was … Read more

WP-Cron called by separate server

Might be your production server still uses the site url of the dev server? Check your production database for dev url’s. In any case, use the WP_SITEURL and WP_HOME defines

Activate Plugin Automatically After Set Time

Add this to the functions.php file of your active (child) theme- add_action( ‘init’, ‘wpse_393267_activate_plugin’ ); function wpse_393267_activate_plugin() { if( !function_exists( ‘is_plugin_active’ ) ) { include_once ABSPATH . ‘/wp-admin/includes/plugin.php’; } $plugin_to_activate=”jetpack/jetpack.php”; // plugin-dir/plugin-file.php $date_to_activate=”2021-08-13″; // YYYY-MM-DD if( is_plugin_active( $plugin_to_activate ) ) return; if( time() >= strtotime( $date_to_activate ) ) { activate_plugin( $plugin_to_activate ); } } Change … Read more